A minimal 2-qubit quantum computer simulator written in Rust.
It supports gate operations, entanglement, measurement, and several foundational quantum algorithms through an interactive CLI.
- 2-qubit complex state simulation
- Gate operations: X, Z, H, CNOT
- Measurement with probabilistic collapse
- Interactive CLI with algorithm selection
- Included algorithms:
- Bell State
- Deutsch’s Algorithm (constant and balanced)
- Superdense Coding
- Parity Check
- Grover’s Algorithm (2-qubit version)
cargo run
Use arrow keys to select an algorithm from the menu.
main.rs
– CLI entry pointstate.rs
– quantum state and measurement logicgates.rs
– quantum gates and oraclesalgorithms.rs
– algorithm implementations
num-complex
– complex number supportrand
– probabilistic measurementinquire
– interactive CLI prompt
MIT License