This repository contains the implementation and analysis of a quantum random number generator using IBM's quantum computers.
We developed a simple quantum random number generator using Hadamard gates applied to 100 qubits initialized in the |0⟩ state. The project includes the following components:
- QRNG implementation
- Data analysis using Principal Component Analysis (PCA) and Fast Fourier Transform (FFT)
- Entropy calculation and randomness tests
- Error analysis and mitigation strategies
The core of our QRNG consists of:
- Initialization of 100 qubits in the |0⟩ state
- Application of Hadamard gates to all qubits
- Measurement of all qubits
- Recording of measurement results in classical registers
We performed extensive analysis on the generated data:
- Attempted classification using neural networks (results were inconclusive)
- Applied PCA to identify major sources of error and bias
- Used FFT for frequency analysis
- Calculated fidelity using density matrices
We employed several tests to evaluate the randomness of our QRNG:
- Shannon entropy calculation
- Compressibility test
- P-value analysis
- Hashing algorithm for post-processing
We investigated various sources of error in our QRNG:
- Identified qubits prone to noise through multiple runs
- Analyzed decoherence times (T1 and T2), SX Error, and Readout time error
- Compared results across different IBM quantum devices
Based on our findings, we propose the following improvements:
- Implement bias mitigation techniques based on PCA results
- Develop adaptive algorithms to avoid noisy qubits
- Explore more advanced post-processing techniques to increase entropy
- Qiskit
- NumPy
- SciPy
- Matplotlib
- Pandas
- Sampada Wagle
- Yubraj Bhandari
- Pritesh Thakur
We would like to thank SCQuantum for hosting the hackathon, Dorahacks for the challenge and IBM for providing access to their quantum computers through the IBM Quantum Experience platform.