HUB
Sign inSign up
quantumrepeater-lab logo

credkellar/quantumrepeater-lab

By credkellar

β€’Updated 13 days ago

QuantumRepeater-Lab: quantum repeater lab - entanglement swapping, DEJMPS purification, chains. Sim!

Image
Machine learning & AI
Developer tools
Data science
1

205

credkellar/quantumrepeater-lab repository overview

⁠QuantumRepeater-Lab πŸ”—βš›οΈ

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

⁠🧰 Tech Stack Badges & Full Architecture Tech Stack

β πŸ’» Core Programming Languages & Core Systems

Python Stdlib Only Network Deterministic License Swapping Purification

  • 🐍 Python 3.12, pure standard library (math, hashlib, json, sys) β€” zero dependencies, zero network, deterministic (double-run byte-identical)
  • βš›οΈ Werner-state algebra core: one parameter 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 CHECKS
  • πŸ”¬ Density-matrix simulation from scratch: 16Γ—16 complex matrices as plain lists, Bell-basis projectors, partial traces, Pauli corrections, bilateral CNOT β€” the swapping formula and the purification recurrence are both reproduced from the matrices to <1e-9 before either is trusted
  • πŸ—ΊοΈ Chain bookkeeping: expected-value recursion over a nesting tree (3/2 waiting factor for two links, memory decay during the wait, heralding time span/c, purification retries dividing time and multiplying pair cost by 2/p)
  • 🧠 TinyML kNN link classifier (from scratch, stdlib): direct-ok / swap-only / purify-then-swap / hopeless from segment fidelity + segment count + memory margin, labels from the lab's own policy, which itself runs the chain model
  • πŸͺ‘ Council seats: Gemini Argon 4 DECIDER (names-only, tighten-only) + Muse advisor (never overrides HOLD) + Google Flow plan-only (rendered = False, live = 0)
⁠⛓️ Web3 & Infrastructure
  • 🚫 Not applicable β€” honestly. No blockchain, no Web3, no tokens: the "infrastructure" in this lab is a labelled model of fibre segments, repeater stations, and memories inside one offline file. Quantum-network deployment is a permanent HOLD gate, not a feature. No fake badges here.
β βš™οΈ Platform Support & Hardware Architecture

Linux macOS Windows

  • πŸ–₯️ Pure Python β€” runs anywhere Python 3.12+ runs (Linux, macOS, Windows), plus the python:3.12-slim Docker image
  • πŸ”’ No hardware is controlled, ever: real repeaters, sources, memories, and detectors are permanent HOLD gates (see the gate table below)
⁠⚑ Low-Level Infrastructure & Performance
  • 🚫 No low-level code β€” honestly. No C, no C++, no GPU, no compiled extensions: this is one interpreted Python file on purpose, so every fidelity can be read, checked, and diffed. Performance here means honest bookkeeping β€” closed-form Werner algebra for the chain, and a 16Γ—16 density-matrix simulation used only where a formula needs a witness, all deterministic and byte-identical between runs.
β πŸ› οΈ DevOps & Build Tools

Docker GitHub Actions pytest Git

  • 🐳 Docker (python:3.12-slim), GitHub Actions CI + Docker Publish (delivered in the paste pack)
  • 🎯 Target image: credkellar/quantumrepeater-lab:latest
  • πŸ§ͺ Tests: pytest (26 tests) + the built-in CHECKS suite (59 checks) in main.py
⁠☁️ Cloud Providers
  • 🚫 None β€” honestly. No cloud provider is used or needed: the lab runs fully offline on your own machine or in a local Docker container. Docker Hub appears only as the registry the publish workflow pushes the image to.

⁠🐳 Quick start

docker pull credkellar/quantumrepeater-lab:latest
docker run --rm credkellar/quantumrepeater-lab:latest
Tag summary
Recent tags
Content type
Image
Digest
sha256:5de52dd92…
Size
41.3 MB
Last updated
13 days ago
docker pull credkellar/quantumrepeater-lab:latest