DIY: Physical Random Number Generators

One of the benefits of Quantum Computing is their ability to generate truly random numbers.

Since classical computers are deterministic machines, governed by algorithms, they are inherently predictable. Therefor any number generated by a classical computer, even if it seems complex is actually based on a set of conditions or algorithm, which therefor makes it a “pseudo random number”, rather than truly random.

To generate truly random numbers you need to rely on a physical processor or phenomena that are unpredictable, examples of this include radioactive decay, electronic noise or even atmospheric noise.

Since QC is essentially based on a physical process and the probabilistic nature of quantum mechanics, its qubits can exist in a superposition state, this means they can represent a combination of 0 and 1 simultaneously, this state/property can be harnessed by QRNG (Quantum random number generators) to produce truly random numbers.

As a fun project, I decided to build a small physical QRNG using an Arduino, laser diode, beam splitter and two photo resistors. The basic premise is that you pulse the laser, it sends a wave/particle (both!) through the beam splitter, 50% of the time it should hit one of the two photo resistors, providing you with a random string of “1”s or “0”s.

While a very simple, basic and small example, it is a fun experiment. Check out OpenQbit.com if you would like to build your own. To make this a little easier, I laser cut a template/outline for the beam splitter for holding each of the components.

Enjoy Randomness? Check out these blog, sites, references: http://www.reallyreallyrandom.com

Non Quantum RNG generator using zener noise: http://www.reallyreallyrandom.com/zener/breadboard/

Nice video explaining the seed variables used and middle squares: https://www.khanacademy.org/computing/computer-science/cryptography/crypt/v/random-vs-pseudorandom-number-generators

Generating Random Numbers with QisKit & IBM Quantum Hardware

4096 – Bit Random Byte String

``` from qiskit import IBMQ from qiskit_rng import Generator provider = IBMQ.load_account() generator = Generator(backend=provider.backends.ibmq_lima) output = generator.sample(num_raw_bits=4096).block_until_ready() print("Mermin correlator value is {}".format(output.mermin_correlator)) print("Raw bits are {}".format(output.raw_bits[:4096])) int[] data; int width = 512; int height = 512; void setup() { size(512, 512); // Load text file as a String String[] stuff = loadStrings("123.csv"); // Convert string into an array of integers using ',' as a delimiter data = int(split(stuff[0], ',')); //printArray(data); } void draw() { background(255); //stroke(0); // Draw points int k = 0; for (int i = 0; i < width; i ++ ) { for (int j = 0; j < height; j ++ ) { if (data[k] == 1) { stroke(1); point(i, j); } k++; } } } ```

DIY: Ion Trap Quantum Computer

An ion is a atom with one of the outer electrons removed (normally removed by pointing a laser beam at it) – forming positively charged ion.
Ion trapping is done in a vacuum chamber to isolate the ions from the external environment as much as possible. (And avoid other atoms in the air from bumping and

  • Atoms
    • Consist of 3 components, a proton and neutron (called the nucleus) in the center and electrons which orbit this nucleus
    • 117 different types
    • Are elements the same as atoms
    • Every element is unique and has an atomic number
      • That number tells you the number of protons in every atom of the element. The atomic number is also called the proton number.
      • read more

  • Quantum Algorithms – Notes

    Traveling sales person problem

    Solve problems which are NP hard – and they can’t be solved in polynomial time.

    P versus NP problem: full polynomial versus nondeterministic polynomial problem

    A P problem is one that can be solved in “polynomial time,” which means that an algorithm exists for its solution such that the number of steps in the algorithm is bounded by a polynomial function of n, where n corresponds to the length of the input for the problem. Thus, P problems are said to be easy, or tractable. A problem is called NP if its solution can be guessed and verified in polynomial time, and nondeterministic means that no particular rule is followed to make the guess. read more

    Bookmark: Quantum Links