A small, reproducible playground for quantum error correction (QEC) decoding formulated as a binary quadratic optimization (QUBO) problem and solved with:
- QAOA (via
qiskit-algorithms+ primitives) - an exact baseline (NumPy minimum eigensolver)
This repo starts with the distance-(n) repetition code under bit-flip noise and measures logical error rate (LER) via Monte-Carlo simulation.
If you’ve done QAOA / annealing for classical decoding (e.g., MIMO or channel decoding), QEC decoding feels very similar:
- measured syndrome ↔ observed channel output
- unknown error pattern ↔ unknown transmitted bits
- infer the most likely binary vector via optimization
pip install -e .
vanilla-qec-run --n 5 --shots 200 --maxiter 40 --reps 1This prints one JSON-like line per physical error probability p, e.g.
{'n': 5, 'p': 0.05, 'shots': 200, 'qaoa_LER': 0.01, 'exact_LER': 0.01, 'avg_qaoa_time_s': 0.62}
- Physical error rate:
p(bit flip probability per physical qubit) - Logical error rate (LER): fraction of trials where the decoded logical bit is wrong after correction
src/vanilla_qec/repetition.py: repetition code model + syndromesrc/vanilla_qec/qubo.py: QUBO construction for decodingsrc/vanilla_qec/solvers.py: QAOA + exact solverssrc/vanilla_qec/experiments.py: Monte Carlo experiment runnersrc/vanilla_qec/cli.py: command line entry point
- This uses modern Qiskit primitives (
StatevectorSampler) for local simulation. - QAOA is usually slower than classical decoding for small codes; the point is the method and benchmarking framework.
MIT