HUB
Sign inSign up
quantumentanglement-lab logo

credkellar/quantumentanglement-lab

By credkellar

β€’Updated 17 days ago

QuantumEntanglement-Lab: entanglement measures lab - concurrence, negativity, CHSH, monogamy. Sim!!!

Image
Machine learning & AI
Developer tools
Data science
1

188

credkellar/quantumentanglement-lab repository overview

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

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

⁠🧰 Tech Stack Badges & Full Architecture Tech Stack

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

Python Stdlib Only Network Deterministic License Concurrence CHSH

  • 🐍 Python 3.12, pure standard library (math, hashlib, json, sys) β€” zero dependencies, zero network, deterministic (double-run byte-identical)
  • πŸ”’ Linear-algebra core from scratch: complex density matrices as plain lists, a cyclic Jacobi eigensolver on the real embedding [[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 trusted
  • βš›οΈ Measures core: Wootters concurrence via sqrt(ρ)·ρ̃·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 CHECKS
  • πŸ—ΊοΈ Sweeps + thresholds: the pure family cos ΞΈ|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
  • 🧠 TinyML kNN state classifier (from scratch, stdlib, distance-weighted): separable / entangled-local / nonlocal / maximally-entangled from (concurrence, negativity, CHSH), 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 a labelled evaluation of density matrices 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 sources, detectors, repeaters, and quantum processors 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 eigenvalue can be read, checked, and diffed. Performance here means honest algorithms β€” a cyclic Jacobi solver, exact partial traces by index bookkeeping, and bisection threshold searches β€” 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/quantumentanglement-lab:latest
  • πŸ§ͺ Tests: pytest (28 tests) + the built-in CHECKS suite (97 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/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

β πŸ”¬ What's inside

  • Bell states, maximal on every measure β€” C = 1.000000, EoF = 1.000000, N = 0.500000, reduced entropy 1.000000, MI = 2.000000, CHSH = 2.828427 (2*sqrt(2), the Tsirelson bound) for all four Bell states.
  • Correlation is not entanglement, in print β€” the classically correlated mixture (|00><00| + |11><11|)/2: C = 0.000000, N = 0.000000, CHSH = 2.000000, but MI = 1.000000. Perfectly correlated, not entangled at all.
  • The CHSH law, verified β€” CHSH_max = 2*sqrt(1 + C^2) holds at all 13 pure-family sweep points; worst error 5.6e-09 between the spin-flip concurrence route and the correlation-tensor route.
  • Pure family closed forms β€” concurrence = |sin 2*theta|, negativity = C/2, EoF = reduced-state entropy at every swept theta; at theta = pi/6: C = 0.866025, EoF = 0.811278, CHSH = 2.645751.
  • Werner thresholds, located not quoted β€” bisection on the computed measures finds separability at w = 0.333333 (exact 1/3) and CHSH violation at w = 0.707107 (exact 1/sqrt(2)); the band between is entangled but local (w = 0.50: C = 0.250000, CHSH = 1.414214).
  • Monogamy, both ways β€” GHZ: pairwise C = 0.000000 everywhere, C(A|BC) = 1.000000, CKW slack 1.000000. W: pairwise C = 2/3 everywhere, C^2(A|BC) = 8/9, slack 0.000000 β€” the inequality saturates.
  • Eigensolver with its papers in order β€” sigma_y spectrum exactly +/-1, Bell spectrum (1, 0, 0, 0), reconstruction from eigendecomposition < 1e-9, trace = 1 asserted for every zoo state before measures are trusted.
  • TinyML kNN classifier β€” separable / entangled-local / nonlocal / maximally-entangled from (concurrence, negativity, CHSH); labels generated by the lab's own verdict policy, agreement with the policy asserted on every zoo state.
  • 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: 28 passed
  • Built-in checks: CHECKS 97/97
  • 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/quantumentanglement-lab:latest
Tag summary
Recent tags
Content type
Image
Digest
sha256:41c19a41d…
Size
41.6 MB
Last updated
17 days ago
docker pull credkellar/quantumentanglement-lab:latest