QuantumRepeater-Lab: quantum repeater lab - entanglement swapping, DEJMPS purification, chains. Sim!
205
Quantum Repeater Chain Lab β by Darion Kellar
Educational quantum repeater lab in ONE pure-Python file: direct transmission tabled honestly (fidelity 0.518552 still alive at 1,000 km, but success probability 1e-20 β an expected wait of 5e17 s, about 1.58e10 years), entanglement swapping with the exact Werner formula F' = F1*F2 + (1-F1)(1-F2)/3 verified against a from-scratch 4-qubit density-matrix Bell-measurement simulation (all four outcomes at p = 1/4, fidelities matching to <1e-9), the DEJMPS purification recurrence likewise verified against a bilateral-CNOT simulation and priced per round (F = 0.75 climbs to 0.923061 in five rounds while the cumulative cost climbs 2.77 -> 101.09 pairs per output), a nested repeater chain over 8 x 125 km segments with purification at every level and memory decay exp(-t/T2) during every wait (final F = 0.858245 in 0.2991 s at 1,119 elementary pairs per delivered pair, against a swap-only chain at F = 0.471701 β below the separable line), full rate bookkeeping for direct vs repeater, and a from-scratch kNN link classifier whose labels come from the lab's own policy.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: every parameter is a LABELLED teaching value β no photon, fibre, memory, or detector exists here, no rate is a network specification, and Werner-state algebra is exact arithmetic on the model, never a hardware promise. Every quantum-internet / QKD-service / hardware / deployment / vendor use is a permanent HOLD gate (14 total).
math, hashlib, json, sys) β zero dependencies, zero network, deterministic (double-run byte-identical)w per pair β the channel multiplies it by exp(βΞ³L), swapping multiplies two w's, memory waiting multiplies it by exp(βt/T2), and purification applies the DEJMPS recurrence to F = (3w + 1)/4 β every rule asserted against its analytic value in CHECKSspan/c, purification retries dividing time and multiplying pair cost by 2/p)
python:3.12-slim Docker image
python:3.12-slim), GitHub Actions CI + Docker Publish (delivered in the paste pack)credkellar/quantumrepeater-lab:latestpytest (26 tests) + the built-in CHECKS suite (59 checks) in main.pydocker pull credkellar/quantumrepeater-lab:latest
docker run --rm credkellar/quantumrepeater-lab:latest
docker pull credkellar/quantumrepeater-lab:latest