Can we generate quantum random numbers through Qiskit? I want to try the random number generator without using optics or noise.
Hadamard Gates together with Quantum Bloom Filters and a Verifiable Random Functions can prove to be a simple but elegant implementation of Quantum Algorithmic Randomness.
This technique can be seen as a way to reduce the dimensionality of high-dimensional data; high-dimensional input items can be reduced to low-dimensional versions while preserving relative distances between items. While we reduce the dimensionality from a high dimensional data the elements of order are replaced by entropies of randomness.
We can generate Quantum Random Numbers in IBM QIS Kit by implementing a Hadamard Gate. The Hadamard gate is the simplest method for generating a random bit in a qubit. It generates a quantum state which is a superposition of a 0 and a 1, with equal probability. If you then attempt to measure that qubit the quantum state collapses into either a 0 or a 1 with equal probability, generating a single random bit.
Execute n Hadamard (H) gates, either on the same or distinct qubits, measure the qubit state after executing each H gate, and you have n-bits of random number. Please find a sample code from IBM QIS Kit for executing a Hadamard gate through a register with a specific backend.
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit from qiskit import execute from qiskit import IBMQ from qiskit.tools.jupyter import * from qiskit.providers.ibmq import least_busy IBMQ.load_accounts() IBMQ.backends() backend = least_busy(IBMQ.backends(simulator=False)) %%qiskit_job_status q = QuantumRegister(2) c = ClassicalRegister(2) qc = QuantumCircuit(q, c) qc.h(q) qc.cx(q, q) qc.measure(q, c) job_exp = execute(qc, backend=backend, shots=1024, max_credits=3)