Quantum Repeater with Encoding (QRE)

May 22, 2026 · View on GitHub

Simulation code for the paper Quantum Repeater with Encoding, built on a forked SeQUeNCe.

The simulator generates logical Bell pairs across a linear chain of quantum routers using a CSS code (default Steane [[7,1,3]]) and one of four classical post-processing modes: none, cec, qec, qec+cec.

Requirements

  • Python 3.10+
  • The forked SeQUeNCe checked out as a sibling directory:
    parent/
    ├── QEC/         # this repo
    └── SeQUeNCe/    # https://github.com/SagarPatange/SeQUeNCe
    
  • stim, numpy, matplotlib

Running a single simulation

python main.py \
    --config_file config/standard_configs/line_6_2G.json \
    --css_code "[[7,1,3]]" \
    --correction_mode cec \
    --run_duration_ms 1e5

Output is written under log/<run_name>/.

Repository layout

PathPurpose
main.pyCLI entry point for one simulation run
RequestLogicalPairApp.pyApp controller driving logical-pair generation
QREProtocol.pyQRE protocol (frame updates, classical messaging)
TeleportedCNOT.pyTeleported-CNOT protocol used by QRE
css_codes.pyCSS code definitions (Steane [[7,1,3]], etc.)
router_net_topo_2G.pyNetwork topology with 2nd-generation routers
runner_*.pyParameter sweep drivers (distance, links, thresholds, …)
process_log.pyPost-processing of log/ output
config/standard_configs/Canonical line-topology configs (line_N_2G.json)
threshold_plots.ipynb, final_graphs.ipynbFinal plots

Sweep runners

  • runner.py, runner_final.py — main fidelity sweeps
  • runner_distance_and_link.py — sweeps over inter-node distance and chain length
  • runner_z.py — Z-basis experiment

Configuration

Topology JSONs live under config/standard_configs/ (line_N_2G.json for N nodes). config/config_generator_*.py regenerate these from templates.