A fun and interactive visual simulation of a quantum computer built using Python and Pygame. This project lets you play around with qubits, apply quantum gates, and see how quantum states change in real-time.
- Qubits: Visualize qubits as circles that can be in superposition or classical states.
- Quantum Gates:
- Hadamard (H) Gate: Puts qubits into superposition.
- Pauli-X (X) Gate: Flips the qubit state (|0⟩ to |1⟩ and vice versa).
- Measurement: Collapse qubits to either |0⟩ or |1⟩ randomly, based on their probabilities.
- Reset: Reset qubits back to their initial state (|0⟩).
- Probabilities: See the probabilities of |0⟩ and |1⟩ states when qubits are in superposition.
-
Clone the repo:
git clone https://github.com/deniscraciungabriel/qbitsSimulation.git cd qbitsSimulation
-
Install dependencies: Make sure you have Python installed, then run:
pip install pygame numpy
-
Run the simulator:
python main.py
- Apply Gates:
- Click on a gate button (H, X, or Measure).
- Click on a qubit to apply the gate or measure it.
- Reset Qubits:
- Click the "Reset" button to set all qubits back to |0⟩.
- See Probabilities:
- When qubits are in superposition, their probabilities are shown below them.