HUB
Sign inSign up
quantumteleportation-lab logo

credkellar/quantumteleportation-lab

By credkellar

โ€ขUpdated 17 days ago

QuantumTeleportation-Lab: teleportation lab - Bell pairs, Pauli corrections, no-cloning proof. Sim!!

Image
Machine learning & AI
Developer tools
Data science
1

161

credkellar/quantumteleportation-lab repository overview

โ QuantumTeleportation-Lab โš›๏ธ๐Ÿ“ก

Quantum Teleportation Protocol Lab โ€” by Darion Kellar

Educational quantum teleportation lab in ONE pure-Python file: the full protocol run on a from-scratch 3-qubit statevector simulator โ€” the headline input |psi> = 0.6|0> + 0.8|1> teleports with all four Bell-measurement outcomes at p = 0.2500 each and fidelity 1.000000000000 after Pauli corrections, across an 8-state input grid whose worst fidelity is also 1.000000000000. The no-cloning receipt is computed from the density matrix: after the measurement the sender's original qubit is I/2 (max deviation 1.11e-16, overlap with the input exactly 0.5000), and Bob's qubit is I/2 until the 2 classical bits arrive. Superdense coding runs on the same pair (all four 2-bit messages decode at probability 1.0000). With labelled Kraus noise on the shared pair, the delivered fidelity matches its closed forms โ€” depolarizing F = 1 - 2p/3 (1.000 down to 0.333) and dephasing F = (1 - q) + q(|a|^2 - |b|^2)^2 (down to 0.0784 for the headline state) โ€” and a bisection on the simulation locates where each channel stops beating the classical 2/3 bound: depolarizing at p = 0.500000, dephasing at q = 0.361690. The resource ledger prices the classical alternative with F(N) = (N + 1)/(N + 2): 98 copies for 0.99, no finite N for 1. A distance-weighted kNN classifier labels links from the lab's own policy.

Pure Python standard library. Zero dependencies. Zero network. Honest scope: nothing was teleported anywhere โ€” Alice and Bob are registers in one process, the "channel" is a Kraus map on a matrix, and no photon, fibre, or network exists here. Every real-communication / quantum-internet / faster-than-light / hardware 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 Teleportation Dense Coding

  • ๐Ÿ Python 3.12, pure standard library (math, hashlib, json, sys) โ€” zero dependencies, zero network, deterministic (double-run byte-identical)
  • โš›๏ธ Statevector core from scratch: H / X / Y / Z gates and CNOT applied by index arithmetic on 8 complex amplitudes โ€” the Bell pair, the Bell-basis rotation (CNOT + H), all four measurement outcomes, and the Pauli corrections are computed, never quoted
  • ๐Ÿ”ฌ Density-matrix noise core from scratch: 8ร—8 density matrices, Kronecker products, partial traces, and Kraus channels written operator by operator (depolarizing: โˆš(1โˆ’p)ยทI + โˆš(p/3)ยท{X, Y, Z}; dephasing: โˆš(1โˆ’q)ยทI + โˆš(q)ยทZ) โ€” every simulated fidelity is graded against its closed form in CHECKS
  • ๐Ÿ“’ Resource ledger: the quantum cost (1 ebit + 2 classical bits + 1 copy โ†’ fidelity exactly 1) printed against the optimal classical estimation fidelity F(N) = (N + 1)/(N + 2) โ€” the 2/3 bound is its N = 1 case, and 0.99 costs N = 98 copies
  • ๐Ÿง  TinyML kNN link classifier (from scratch, stdlib, distance-weighted): perfect-protocol / beats-classical / classical-tie / broken from channel + noise strength + delivered fidelity, labels from the lab's own policy
  • ๐Ÿช‘ 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 one offline file holding three simulated qubits. Quantum-internet 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 photonic links, ion traps, superconducting qubits, and network nodes 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 amplitude can be read, checked, and diffed. Performance here means honest algorithms โ€” an 8-amplitude statevector, exact 8ร—8 density-matrix algebra, and a 60-step bisection that locates the classical-bound crossing to 1e-6 โ€” 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/quantumteleportation-lab:latest
  • ๐Ÿงช Tests: pytest (38 tests) + the built-in CHECKS suite (45 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/quantumteleportation-lab:latest
docker run --rm credkellar/quantumteleportation-lab:latest

The default command runs the full demo plus the built-in self-checks (CHECKS 45/45).

Run a specific command instead:

docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py checks   # CHECKS 45/45
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py teleport # ideal protocol report (JSON)
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py grid     # 8-state input grid report (JSON)
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py clone    # no-cloning receipt (JSON)
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py dense    # superdense coding report (JSON)
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py noise    # noise tables + 2/3 crossings (JSON)
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py ledger   # resource ledger (JSON)
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py classify # kNN link verdicts
docker run --rm credkellar/quantumteleportation-lab:latest python3 main.py holds    # 14 HOLD gates

โ ๐Ÿ”ฌ What's inside

  • The protocol, computed โ€” Bell pair + CNOT/H Bell measurement on a from-scratch statevector: four outcomes at p = 0.2500 each, Bob's corrected fidelity 1.000000000000 for every outcome and for all 8 grid input states.
  • No-cloning receipt โ€” the sender's post-measurement qubit traced out of the density matrix: I/2 to 1.11e-16, overlap with the input exactly 0.5000, for two different inputs โ€” the original is destroyed, not copied.
  • No-signalling receipt โ€” Bob's qubit before the classical bits arrive is also I/2 (deviation 1.11e-16): nothing usable moves faster than the classical channel.
  • Superdense coding โ€” the same pair carries 2 classical bits per qubit sent: all four messages decode at probability 1.0000, encoded states verified orthonormal.
  • Depolarizing table, graded โ€” simulated fidelity 1.000 / 0.9333 / 0.8667 / 0.8000 / 0.7333 / 0.6667 / 0.6000 / 0.5333 / 0.4667 / 0.4000 / 0.3333 for p = 0 โ†’ 1, matching F = 1 - 2p/3 to <1e-9; fully depolarized pair (p = 0.75) gives exactly 0.5000.
  • Dephasing table, input dependence shown โ€” F = (1 - q) + q(|a|^2 - |b|^2)^2: headline state falls to 0.0784 at q = 1, an equatorial input falls as exactly 1 - q, pole states are untouched.
  • The 2/3 crossings โ€” bisected from the simulation: depolarizing stops beating the classical bound at p = 0.500000, dephasing at q = 0.361690; both match the analytic values.
  • Resource ledger โ€” quantum: 1 ebit + 2 classical bits + 1 copy โ†’ fidelity 1. Classical estimation F(N) = (N + 1)/(N + 2): N = 1 is the 2/3 bound, 0.99 needs 98 copies, 1 is unreachable at any finite N.
  • TinyML kNN classifier โ€” perfect-protocol / beats-classical / classical-tie / broken from (channel, noise, delivered fidelity); scenario fidelities computed by the density-matrix simulator, labels from the lab's own policy.
  • Advisory seats โ€” Gemini Argon 4 DECIDER (names-only, tighten-only, sha256 trace), Muse advisor (can never override HOLD), Google Flow plan-only (rendered = False, live = 0).

โ โœ… Verified

  • pytest: 38 passed
  • Built-in checks: CHECKS 45/45
  • Deterministic: double-run byte-identical
  • Base image: python:3.12-slim

โ ๐Ÿท๏ธ Categories

Science ยท Developer tools ยท Machine learning & AI

  • License: MIT ยฉ 2026 Darion Kellar
  • Image: credkellar/quantumteleportation-lab:latest
Tag summary
Recent tags
Content type
Image
Digest
sha256:016c54ecdโ€ฆ
Size
41.5 MB
Last updated
17 days ago
docker pull credkellar/quantumteleportation-lab:latest