This project implements and simulates the surface code, one of the leading quantum error-correcting codes, using two frameworks:
- Qiskit for circuit-based simulations
- Stim for fast stabilizer circuit sampling
It explores how stabilizer measurements detect Pauli errors (X, Y, Z) and how noise affects logical qubits.
Qiskit/
├── Modular_Simple_Circuit.ipynb # Modular Surface Code using Qiskit
├── Simple Model Circuit 4 qubits.ipynb # Example with 4-qubit entangled state
├── SurfaceCode.py # Qiskit-based surface code implementation
STIM/
├── Modular_Simple_Circuit_STIM.ipynb # Modular Surface Code using Stim
├── SurfaceCodeSTIM.py # Stim-based surface code simulator
README.md # Project documentation
- Surface code construction for arbitrary distance (d).
- Stabilizer measurement circuits (X and Z stabilizers) on a planar 2D lattice.
- Noise models: Pauli depolarizing noise ((X, Y, Z) errors with probability (p)).
- Visualization tools:
- Single-shot stabilizer measurement timelines.
- Histograms of multi-shot syndrome distributions.
- X stabilizers detect Z and Y errors.
- Z stabilizers detect X and Y errors.
- Y errors flip both stabilizer types.
A minimal-weight perfect matching (MWPM) decoder can then be applied to infer the most likely error configuration.
The surface code encodes logical qubits in a 2D grid of physical qubits with local stabilizer checks. A distance-(d) code can detect and correct up to (\left\lfloor \frac{d-1}{2} \right\rfloor) errors.
- Implement a decoder (e.g., Edmonds’ Minimum-Weight Perfect Matching).
- Explore logical error rates as a function of noise probability (p).
- Extend to rotated surface codes or other topological codes.