HUB
Sign inSign up
quantummeasurement-lab logo

credkellar/quantummeasurement-lab

By credkellar

β€’Updated 17 days ago

QuantumMeasurement-Lab: quantum measurement lab - trine POVM, Neumark, weak values, tradeoff. Sim!!!

Image
Machine learning & AI
Developer tools
Data science
1

130

credkellar/quantummeasurement-lab repository overview

⁠QuantumMeasurement-Lab πŸ“βš›οΈ

Quantum Measurement Lab β€” POVMs, Weak Measurement & Weak Values β€” by Darion Kellar

Educational quantum measurement lab in ONE pure-Python file: the trine POVM built explicitly (elements positive, summing to I) and refereed against projective measurement on the same discrimination task β€” POVM success 0.666667 against the best projective strategy found by an exhaustive 1,440-angle scan, 0.622008 (textbook aligned strategy: 0.583333) β€” a Neumark dilation constructed in code (isometry completed to an explicit 4x4 unitary; statistics match the POVM to 1.11e-16 and the fourth outcome never fires), a Gaussian pointer on a 1,201-point grid whose information-disturbance tradeoff is integrated from the actual pointer states (g = 0.5 keeps fidelity 0.941248 for 0.108515 bits; g = 3 pays down to 0.505554 for 0.985181 bits), an exact anomalous weak value of 21 for sigma_z printed beside its 0.002262 post-selection probability and reproduced by the post-selected pointer simulation as g -> 0 (shift/g: 16.4728 at g = 0.05, 20.7715 at g = 0.01), a five-row back-action ledger from none to strong, and a from-scratch kNN measurement classifier whose labels come from the lab's own policy.

Pure Python standard library. Zero dependencies. Zero network. Honest scope: the pointer is a Gaussian wavefunction on a labelled grid and the qubit is 2x2 matrices β€” no detector clicked, no sensor exists here, and every number is a statement about the model at the stated inputs. A weak value is a conditional average of a defined procedure, never a measured eigenvalue and never free amplification; its post-selection probability is printed wherever it appears. Every detector / sensing / hardware / calibration / surveillance 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 Trine POVM Weak Value

  • 🐍 Python 3.12, pure standard library (math, hashlib, json, sys) β€” zero dependencies, zero network, deterministic (double-run byte-identical)
  • πŸ“ Measurement core: a from-scratch complex linear-algebra kit (2Γ—2 and 4Γ—4 matrices as plain lists) β€” the trine POVM built explicitly and asserted positive + summing to I, a Neumark isometry completed to an explicit 4Γ—4 unitary by Gram–Schmidt, and a Gaussian pointer discretised on a 1,201-point grid (Οƒ = 1, step 0.02) whose overlaps, readout probabilities, and partial traces are integrated numerically β€” every headline number asserted against its analytic value in CHECKS
  • πŸ” Discrimination, honestly refereed: the POVM strategy is exact, and the "best projective" number comes from an exhaustive deterministic scan (1,440 basis angles Γ— all guess assignments), not from a textbook quote
  • 🧠 TinyML kNN measurement classifier (from scratch, stdlib): projective-like / weak-informative / too-weak-to-read / demolished from coupling + pointer width + readout separation, 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 a POVM, a pointer wavefunction, and a ledger. Cryptographic measurement attacks are 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 detectors, pointers, and readout electronics 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 probability can be read, checked, and diffed. Performance here means honest algorithms β€” closed-form weak values graded against grid-integrated pointer simulations, an exhaustive projective scan instead of a quoted bound β€” 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/quantummeasurement-lab:latest
  • πŸ§ͺ Tests: pytest (30 tests) + the built-in CHECKS suite (55 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/quantummeasurement-lab:latest
docker run --rm credkellar/quantummeasurement-lab:latest

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

Run a specific command instead:

docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py checks    # CHECKS 55/55
docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py povm      # trine POVM + discrimination report (JSON)
docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py neumark   # Neumark dilation receipt (JSON)
docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py weak      # pointer tradeoff table (JSON)
docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py weakvalue # weak values + pointer-sim convergence (JSON)
docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py ledger    # back-action ledger (JSON)
docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py classify  # kNN verdicts: projective-like / weak-informative / too-weak / demolished
docker run --rm credkellar/quantummeasurement-lab:latest python3 main.py holds     # 14 HOLD gates

β πŸ”¬ What's inside

  • Trine POVM, explicit β€” three states at 120 degrees, elements (2/3)|psi_k><psi_k| with eigenvalues 2/3 and 0, summing to I; |0> reads [0.666667, 0.166667, 0.166667], |+> reads [0.333333, 0.622008, 0.044658].
  • Discrimination, refereed β€” POVM success 0.666667 (error 0.333333); best projective 0.622008 by exhaustive scan over basis angle and guess assignments; aligned textbook strategy 0.583333 (7/12). Three states want three outcomes.
  • Neumark receipt β€” the isometry W is completed to an explicit 4x4 unitary (unitarity error 3.33e-16); projective readout on qubit + ancilla reproduces the POVM statistics to 1.11e-16, and the fourth outcome's probability is exactly 0 on every test state.
  • The tradeoff table β€” overlap / fidelity / readout success / information at g = 0, 0.25, 0.5, 1, 1.5, 2, 3, all integrated from discretised pointer states; grid overlap matches exp(-g^2/2 sigma^2) to <1e-6, readout success matches the normal CDF to <0.005.
  • Disturbance as bookkeeping β€” the unread disturbed state's off-diagonal is the pointer overlap itself (0.303265 at g = 1), so fidelity kept = (1 + overlap)/2 is a verified identity, not an assumption.
  • Weak values, exact and priced β€” post-select |0>: A_w = 1 (the eigenvalue); |+>: 0; |->: undefined at probability 0; tilted delta = 0.1 off |->: A_w = 21 at P(post) = 0.002262. The anomaly never appears without its price.
  • The sim grades the formula β€” post-selected pointer shift/g converges 16.4728 (g = 0.05, already too strong) -> 20.1150 (0.02) -> 20.7715 (0.01) -> 21 exact; sim post-selection probability 0.002287 at g = 0.01 against the exact 0.002262.
  • Back-action ledger β€” same input, five rows: none (0 bits, fidelity 1.000000), weak g = 0.5 / 1 / 2 (0.108515 / 0.368898 / 0.843365 bits; 0.941248 / 0.803265 / 0.567668), strong (1 bit, 0.500000). Monotone both ways.
  • TinyML kNN classifier β€” projective-like / weak-informative / too-weak-to-read / demolished from (coupling g, pointer width, readout separation); a wide pointer keeps g = 2 weak-informative while a narrow one makes g = 1 demolished.
  • 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: 30 passed
  • Built-in checks: CHECKS 55/55
  • 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/quantummeasurement-lab:latest
Tag summary
Recent tags
Content type
Image
Digest
sha256:f4cefdcd3…
Size
41.6 MB
Last updated
17 days ago
docker pull credkellar/quantummeasurement-lab:latest