Skip to content

Sonai124/vanilla-QEC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vanilla-QEC

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.

Why this exists

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

Quickstart

pip install -e .
vanilla-qec-run --n 5 --shots 200 --maxiter 40 --reps 1

This 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}

What is measured

  • 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

Project structure

  • src/vanilla_qec/repetition.py: repetition code model + syndrome
  • src/vanilla_qec/qubo.py: QUBO construction for decoding
  • src/vanilla_qec/solvers.py: QAOA + exact solvers
  • src/vanilla_qec/experiments.py: Monte Carlo experiment runner
  • src/vanilla_qec/cli.py: command line entry point

Notes

  • 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.

License

MIT

About

QAOA-based quantum error correction benchmarking

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages