Skip to content

Random bit (number) generator for IBM Quantum API

License

Notifications You must be signed in to change notification settings

rialbat/IBMqRNG

Repository files navigation


DOI License GitHub issues Status Python

IBMqRNG is a random bit (number) generator for IBM Quantum API written with PySide6.

Requirements


Tested on Python 3.9, 3.10

Package Version
Qiskit
Matplotlib
PySide6 version

Manual installation


  1. Create a virtual environment in the current directory:
python3 -m venv venv
  1. Activate the virtual environment:
# On Mac/Linux:
source venv/bin/activate
# On Windows:
call venv\scripts\activate.bat
  1. Install requirements:
pip install -r requirements.txt
  1. Run program:
python main.py

Guide to using


  1. Use your IBMQ key.

  1. Choose one of the cloud or local backends.

  1. Specify the number of shots (20 000 max), qbits, and threads (max 5 for free IBM account).
  2. If you want to see the results in the table, check the box "Show results in the table" (Don't use this for a large number of values).

  1. Use "File -> Save bit sequence" to save the result.
  2. In the statistics menu, you can calculate frequencies, plot a distribution graph, as well as a bitmap.

  1. If you need to form a numerical sequence of bits, use the "Generate numbers" button.

❗Warning

At the moment, statistics can be built only once, then there will be overlays

  1. Use "Clear result" button to free up memory.

TODO


  1. Add the ability to overwrite statistical tests' results.
  2. Clear the code.

Why are the values obtained randomly?


Quantum Random-Number Generators (QRNG), unlike PseudoRandom Number Generators (PRNG), generate truly random numbers. There are several reasons for this. Firstly, quantum generators are hardware generators. All generation and measurement processes take place in digital-analogue space, as opposed to PRNG, which operates, as a rule, on the same processor architecture in the form of a machine language algorithm. Secondly, any generator with good statistical and cryptographic properties only works with entropy. Moreover, the difference lies in the fact that the entropy of the PRNG is, as a rule, the reading of external physical (natural) noises, for example, temperature, vibration, and the photoelectric effect, which can be restored according to the existing laws of physics with an understanding of the initial conditions, and the entropy of the QRNG is chaotic quantum processes that are almost impossible to measure.

:octocat:References


  1. PySide6 - https://wiki.qt.io/Qt_for_Python
  2. IBMQ - https://quantum-computing.ibm.com/
  3. Matplotlib - https://matplotlib.org/
  4. Qiskit - https://qiskit.org/

📄 License


MIT License

Copyright (c) 2022 rialbat

About

Random bit (number) generator for IBM Quantum API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages