Skip to content

This is a very simple example of using the Qiskit platform to produce random numbers. The bits are specified by the user, and then the code goes into quantum code to determine the random number. It is very simple code, but I thought it was interesting in thinking of random number generation from the quantum perspective.

Notifications You must be signed in to change notification settings

alexandrepdumont/Quantum-Random-Number-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Quantum Random Number Generator

The code is exceedingly simple. The user provides the number of bits, after which the quantum program is run. 1 qubit (doesn't matter if at 1 or 0), is hadamard shifted, which puts the qubit in a state of superposition. The qubit is then measured, and the probability of observing a 1 or 0 are equivalent and the returned number is thus truly generated at random (though I'm not sure how random the qasm simulator is). This is repeated for the number of bits specified by the user, and then the bit array is converted into a numeric value.

This code was developed using the qiskit platform (https://qiskit.org), which makes coding very simple in Python.

About

This is a very simple example of using the Qiskit platform to produce random numbers. The bits are specified by the user, and then the code goes into quantum code to determine the random number. It is very simple code, but I thought it was interesting in thinking of random number generation from the quantum perspective.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages