A quantum computer simulator in pure C, using state vectors of double-precision complex numbers.
Pure-Quanta is a quantum computer simulator written in pure C. Rather than using a library or framework, the simulator represents quantum state directly as a vector of 2n double-precision complex numbers and applies gate operations as linear transformations over that vector. This makes the quantum mechanics fully explicit in the code.
The project was motivated by wanting to understand quantum computing fundamentals from first principles — not just calling qiskit.execute(), but actually implementing the matrix operations that underpin every quantum gate.
An n-qubit system is represented as a state vector of 2n complex amplitudes. The system initialises in the |0…0〉 state. Gate operations are applied by transforming the state vector according to the gate's unitary matrix. All arithmetic is double-precision complex number arithmetic in C.
|0〉 → (|0〉 + |1〉) / √2|0〉 ↔ |1〉|1〉|1〉make
./pure-quanta 4 # simulate a 4-qubit system