HUB
Sign inSign up
quantumzeno-lab logo

credkellar/quantumzeno-lab

By credkellar

•Updated 17 days ago

QuantumZeno-Lab: Zeno lab - watched qubit, quadratic law, anti-Zeno peak, subspace guard. Sim!!!!!!!

Image
Machine learning & AI
Developer tools
Data science
1

132

credkellar/quantumzeno-lab repository overview

⁠QuantumZeno-Lab ⏱️⚛️

Quantum Zeno & Anti-Zeno Effect Lab — Watched Qubits, Quadratic Laws & Reservoir Rate Curves — by Darion Kellar

Educational quantum Zeno and anti-Zeno lab in ONE pure-Python file: a resonantly driven qubit under ideal projective measurements whose survival at the full-flip time climbs 0 -> 0.25 -> 0.605429 -> 0.780546 -> 0.951842 -> 0.975627 -> 0.997536 as the measurement count runs N = 1, 2, 5, 10, 50, 100, 1000 (closed form graded against a step-by-step projection simulation), the quadratic short-time law with tau_Z = 2.000000 from DeltaH = 0.500000 computed off the labelled model Hamiltonian's matrix (breakdown at t = 0.758779, quadratic/exponential crossover at t = 0.588355), the decay rate into a Lorentzian reservoir integrated on a stated grid - ratio 0.0776 at tau = 0.05, crossing 1 at tau* = 0.9317, peaking at 1.2103 near tau = 1.91 (anti-Zeno), then relaxing toward the free rate 0.153846 - a three-level leakage toy where 100 projective checks cut the leaked population from 0.654508 to 0.008843 (74.0x suppression, per-interval leak verified quadratic in g*tau), and a from-scratch distance-weighted kNN regime classifier whose labels come from the lab's own policy.

Pure Python standard library. Zero dependencies. Zero network. Honest scope: every measurement is IDEAL and projective - no detector inefficiency, dark count, or readout error is modelled - and every parameter is a LABELLED teaching number. A computed suppression factor is a statement about the model at the stated inputs: no qubit was protected, no decay was controlled, and no error correction was deployed. Every protection / deployment / device / vendor / decay-control 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 Zeno Survival Anti-Zeno Peak

  • 🐍 Python 3.12, pure standard library (math, cmath, hashlib, json, sys) — zero dependencies, zero network, deterministic (double-run byte-identical)
  • ⏱️ Zeno core from scratch: the exact watched-survival law [cos²(Ωt/2N)]^N graded against an independent step-by-step evolve-project-renormalise simulation, ΔH read off the model Hamiltonian's matrix entries (⟨H²⟩ − ⟨H⟩²), the reservoir rate integrated numerically on a stated trapezoid grid (ω ∈ [0, 70], step 0.025), and both crossings (quadratic/exponential, Zeno/anti-Zeno) located by bisection on the computed curves — every headline number asserted against its analytic value in CHECKS
  • 🧠 TinyML kNN regime classifier (from scratch, stdlib, distance-weighted): zeno-frozen / free-evolution / anti-zeno-accelerated / exponential-decay from survival + rate ratio + measurement count, 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 Rabi drive, a Lorentzian reservoir, and a leakage toy. Real error-correction 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 qubits, detectors, and measurement 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 — a 2,801-point reservoir grid reused across every rate evaluation, RK4 propagators that referee the closed forms, and 200-step bisections for the crossings — 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/quantumzeno-lab:latest
  • 🧪 Tests: pytest (28 tests) + the built-in CHECKS suite (52 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/quantumzeno-lab:latest
docker run --rm credkellar/quantumzeno-lab:latest

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

Run a specific command instead:

docker run --rm credkellar/quantumzeno-lab:latest python3 main.py checks    # CHECKS 52/52
docker run --rm credkellar/quantumzeno-lab:latest python3 main.py watched   # watched-qubit survival table at t = pi (JSON)
docker run --rm credkellar/quantumzeno-lab:latest python3 main.py regimes   # DeltaH, tau_Z, crossover, regime samples (JSON)
docker run --rm credkellar/quantumzeno-lab:latest python3 main.py antizeno  # reservoir rate curve, peak, crossing (JSON)
docker run --rm credkellar/quantumzeno-lab:latest python3 main.py subspace  # guarded leakage table (JSON)
docker run --rm credkellar/quantumzeno-lab:latest python3 main.py sweeps    # all three sweeps in one report (JSON)
docker run --rm credkellar/quantumzeno-lab:latest python3 main.py classify  # kNN verdicts: zeno-frozen / free-evolution / anti-zeno / exponential
docker run --rm credkellar/quantumzeno-lab:latest python3 main.py holds     # 14 HOLD gates

⁠🔬 What's inside

  • Watched pot, two implementations - [cos^2(Omega t/2N)]^N in closed form and an evolve-project-renormalise simulation agree to 1e-12 at every rung of the N ladder; at t = pi the unwatched qubit flips completely (P = 0) while N = 1000 keeps 0.997536.
  • The deficit law, derived then verified - 1 - P_N ~ (Omega t)^2/(4N) from the ln cos^2 expansion; at N = 1000 the estimate 2.467401e-03 sits within 0.12% of the exact deficit 2.464361e-03, and the relative error is asserted to shrink monotonically from N = 10 to N = 1000.
  • DeltaH from the matrix - H = (0.7/2) sigma_z + (1.0/2) sigma_x (labelled) gives DeltaH = 0.500000 from <H^2> - ^2 over its own entries, tau_Z = 2.000000; the exact survival under H is RK4-integrated as an independent referee.
  • Regimes, refereed - at t = 0.2 the exact survival 0.990050 hugs the quadratic 0.990000 and ignores the exponential 0.969699; the quadratic law breaks (>1% error) at t = 0.758779 and the asymptotes cross at t = 0.588355, both bisected on the computed curves; at t = tau_Z the quadratic reads 0 while the exact curve is still 0.407832.
  • The reservoir, integrated honestly - Lorentzian J(w), centre 9.0, width 1.0, transition on the slope at 10.5; free rate Gamma(inf) = 2 pi J(omega_a) = 0.153846 analytic; Gamma(tau) integrated on the stated trapezoid grid (w in [0, 70], step 0.025) with the tail-truncation caveat printed in the docstring.
  • Anti-Zeno, in the open - ratio 0.0776 at tau = 0.05 (deep suppression), rising through 1 at tau* = 0.9317, peaking at 1.2103 near tau = 1.91, falling back through 1.0755 at tau = 5 to 1.0192 at tau = 20: moderate watching accelerates decay by 21% here, and the lab shows the whole curve.
  • Subspace guard duty - g = 0.3 leakage coupling, total time pi: unguarded leak 0.654508; guarded leaks 0.369734 / 0.163656 / 0.085116 / 0.043457 / 0.017609 / 0.008843 at 2 / 5 / 10 / 20 / 50 / 100 checks - 74.0x suppression, closed form graded against an RK4 projection simulation.
  • TinyML kNN classifier - zeno-frozen / free-evolution / anti-zeno-accelerated / exponential-decay from (survival, rate ratio, measurement count); agreement with the lab's policy asserted on every scenario and all 891 training-grid points.
  • 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 52/52
  • 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/quantumzeno-lab:latest
Tag summary
Recent tags
Content type
Image
Digest
sha256:3b866b688…
Size
41.5 MB
Last updated
17 days ago
docker pull credkellar/quantumzeno-lab:latest