This Python project demonstrates the difference between quantum and classical coin flipping using Qiskit, a quantum computing library. It provides a fascinating comparison between quantum probabilistic behavior and classical random number generation.
- Quantum coin flip simulation using Qiskit
- Classical coin flip simulation using Python's random module
- Comparative visualization of results
- Probability analysis of coin flip outcomes
- Python 3.7+
- Qiskit
- Qiskit-aer
- Matplotlib
- Clone the repository:
git clone https://github.com/aditya19200/quantum-coin-flip.git
- Install required dependencies:
pip install qiskit qiskit-aer matplotlib
The script does two things:
- Performs a quantum coin flip using a Hadamard gate to create a superposition
- Performs a classical coin flip using Python's random number generator
It then compares and visualizes the results, showing the probabilistic nature of quantum systems.
python quantum_coin_flip.py
The Hadamard gate used in this simulation puts a qubit into an equal superposition of |0⟩ and |1⟩ states, analogous to a coin spinning in the air before landing.
The script generates two types of plots:
- Histogram of quantum coin flip results
- Histogram of classical coin flip results
- Comparative bar graph of both methods
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
- Your Name - aditya19200
- Project Link: https://github.com/aditya19200/quantum-coin-flip
#screenshots

