A modular quantum computing simulator built with Rust.
The project aims to simulate quantum circuits from scratch to understand the underlying linear algebra and quantum logic.
- State Representation: Dirac (Bra-ket) notation output for any number of qubits.
- Math Engine: Generic implementation of the Kronecker (tensor) product supporting vectors and matrices.
- Gate Library: Single-qubit (X, H, I) and multi-qubit (CNOT) gates.
- Statistical Engine: High-performance measurement simulation (shots) to verify superposition.
To run the latest research experiments:
cargo runTo run the verification test suite:
cargo testTo run performance benchmarks:
cargo benchsrc/main.rs: Entry point for the quantum simulator.src/lib.rs: Quantum simulator library.src/constants.rs: Quantum gates and basis states definitions.src/ops.rs: Mathematical operations.src/formatting.rs: Visualization tools for quantum states.src/measurement.rs: Simulation of the wave function collapse.src/experiments: Modular research sessions (Single qubit, Entanglement).tests/: Integration tests.
- The benchmark results show exponential growth in execution time as the number of qubits increases, with ~16× slowdown for every additional 2 qubits. Performance remains stable across runs, confirming correctness. However, the dense matrix-vector approach does not scale and becomes impractical beyond ~16 qubits due to computational and memory constraints.
- Universal Tensor Product (Generics)
- Single qubit gates (X, H, Identity)
- Multi-qubit state vectors
- Controlled-NOT (CNOT) logic
- Quantum Entanglement (Bell State)
- Multi-qubit measurement decoding and statistical analysis
- Complex number support
- Implement full Pauli and phase gates set: Z, S, T and Y.
- Quantum Circuit API: Implement a higher-level abstraction to build circuits without manual matrix multiplication.
- Standard Algorithms: Implement Deutsch-Jozsa and Grover's search as verification experiments.