QuantumEntanglement-Lab: entanglement measures lab - concurrence, negativity, CHSH, monogamy. Sim!!!
188
Entanglement Measures Lab β by Darion Kellar
Educational entanglement-measures lab in ONE pure-Python file: Wootters concurrence and entanglement of formation, negativity from the partial transpose, von Neumann entropy, mutual information, and the Horodecki CHSH maximum, all computed from scratch (cyclic Jacobi eigensolver, no library diagonalisation) over an 11-state zoo measured by one code path β the four Bell states pin every measure to its ceiling (C = 1.000000, EoF = 1.000000, N = 0.500000, MI = 2.000000, CHSH = 2.828427) while the classically correlated mixture prints the discipline's key warning in numbers (MI = 1.000000 with C = 0.000000: correlation is not entanglement). The pure family verifies the exact law CHSH_max = 2*sqrt(1 + C^2) across 13 sweep points (worst error 5.6e-09), the Werner family is swept against its closed forms with both thresholds located by bisection on the computed measures (separable up to w = 0.333333 = 1/3, CHSH violated only past w = 0.707107 = 1/sqrt(2), with an entangled-but-local band between), CKW monogamy is computed for GHZ (every pair C = 0, C(A|BC) = 1) and W (every pair C = 2/3, CKW saturated at 8/9 = 4/9 + 4/9), and a from-scratch distance-weighted kNN classifier labels states from the lab's own policy.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: every state is a LABELLED teaching state β no photon was entangled, no device was benchmarked, and a measure is a number about a state on paper, never a hardware specification, a network design, or a security proof. Every hardware / quantum-network / QKD / certification / vendor / advantage use is a permanent HOLD gate (14 total).
math, hashlib, json, sys) β zero dependencies, zero network, deterministic (double-run byte-identical)[[Re, βIm], [Im, Re]] for every Hermitian spectrum (eigenvalues arrive in exact pairs; one complex eigenvector per pair is recovered by greedy independence selection, including inside degenerate subspaces) β reconstruction of a Bell state from its eigendecomposition is asserted in CHECKS before any measure is trustedsqrt(Ο)Β·ΟΜΒ·sqrt(Ο), entanglement of formation from the binary-entropy closed form, negativity from the partial-transpose spectrum, von Neumann entropy, mutual information, the correlation tensor T[i][j] = Tr(Ο ΟiβΟj), and the Horodecki maximum 2β(m1 + m2) β every headline number asserted against its analytic value in CHECKScos ΞΈ|00β© + sin ΞΈ|11β© and the Werner family measured point by point, with the separability threshold (w = 1/3) and the CHSH threshold (w = 1/β2) located by bisection on the computed measures, not quoted
python:3.12-slim Docker image
python:3.12-slim), GitHub Actions CI + Docker Publish (delivered in the paste pack)credkellar/quantumentanglement-lab:latestpytest (28 tests) + the built-in CHECKS suite (97 checks) in main.pydocker pull credkellar/quantumentanglement-lab:latest
docker run --rm credkellar/quantumentanglement-lab:latest
The default command runs the full demo plus the built-in self-checks (CHECKS 97/97).
Run a specific command instead:
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py checks # CHECKS 97/97
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py zoo # 11-state zoo, full measure cards (JSON)
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py pure # pure sweep + CHSH law per point (JSON)
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py werner # Werner sweep + both thresholds (JSON)
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py chsh # CHSH = 2*sqrt(1 + C^2) report (JSON)
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py monogamy # GHZ vs W + CKW balance (JSON)
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py classify # kNN verdicts: separable / local / nonlocal / maximal
docker run --rm credkellar/quantumentanglement-lab:latest python3 main.py holds # 14 HOLD gates
python:3.12-slimScience Β· Developer tools Β· Machine learning & AI
credkellar/quantumentanglement-lab:latestdocker pull credkellar/quantumentanglement-lab:latest