QED Precision Quantities Lab — g-2, Running α, Klein–Nishina, Lamb Shift & Thresholds — by Darion Kellar
Educational quantum-electrodynamics lab in ONE pure-Python file: the classic precision quantities of QED evaluated from labelled input constants, each graded against something independent. The electron g-2 series is summed over the five published mass-independent coefficients — terms +1.161410e-03, -1.772305e-06, +1.480420e-08, -5.566799e-11, +4.555582e-13 — landing at 0.001159652176814 against the labelled experimental 0.00115965218073, a residual of -3.916e-12 (-0.003377 ppm) printed beside the itemised list of pieces not in the coefficients (mass-dependent QED, hadronic ~1.7e-12, weak ~3e-14, alpha's own input uncertainty). The leptonic running of alpha is receipted per lepton (electron 0.017435 + muon 0.009178 + tau 0.004808 = Delta alpha_lep 0.031421), taking alpha^-1 to 132.7302 at the Z pole on leptonic running alone; the hadronic piece is NOT computed and enters only as the labelled input 0.02766 behind the full on-shell 128.9398, with the MS-bar 127.95 flagged as a labelled convention value. The Klein-Nishina total cross section is computed two ways — a 2,880-slice Simpson integral and the closed form, asserted to agree below 1e-8 — falling from sigma/sigma_T = 0.998005 at x = 0.001 through 0.430728 at x = 1 to 0.122760 at x = 10. Bethe's nonrelativistic Lamb estimate gives 1047.4230 MHz against the labelled measured 1057.84 MHz, its 0.9847% gap printed as the known shortfall. Pair thresholds are exact bookkeeping: 2 m_e c^2 = 1.021997900 MeV, Breit-Wheeler E1*E2 >= 0.261119927 MeV^2. A from-scratch distance-weighted kNN classifier labels regimes from the lab's own policy.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: every constant and published coefficient is a LABELLED input and every experimental value a labelled reference — nothing here is a measurement, and a computed residual is arithmetic, not a discovery. Every piece the lab does not compute is printed as a labelled missing piece with its size. Every precision-measurement / new-physics / metrology / vendor / hardware use is a permanent HOLD gate (14 total).
🧰 Tech Stack Badges & Full Architecture Tech Stack
🐍 Python 3.12, pure standard library (math, cmath, hashlib, json, sys) — zero dependencies, zero network, deterministic (double-run byte-identical)
✨ g−2 core: the five published mass-independent coefficients (labelled inputs) evaluated as C_n·(α/π)ⁿ with partial sums, term ratios, and the residual against the labelled experimental value — every step asserted in CHECKS
🏃 Running-α core: one-loop leptonic vacuum polarisation Δα_lep = (α/3π)·Σ_l [ln(Q²/m_l²) − 5/3] with a stated threshold guard (a lepton counts only above Q > 2m_l), per-lepton receipts, and the hadronic piece printed as a labelled missing input — never computed, never hidden
🎯 Compton core: the exact shift Δλ = λ_C(1 − cos θ) plus the Klein–Nishina total cross section computed twice — Simpson integration (2,880 slices) of the differential formula and the closed form — with agreement asserted, so the integral is graded, not trusted
🐑 Lamb core: Bethe's nonrelativistic formula with the labelled Bethe logarithm ln K₀(2S) = 2.8117695, its ~1% shortfall against the labelled measured value printed as the known gap, not as agreement
🧠 TinyML kNN regime classifier (from scratch, stdlib, distance-weighted): precision-agreement / running-coupling-regime / classical-limit / threshold-blocked from residual ppm + Δα % + σ/σ_T + E/E_threshold, 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)
🚫 Not applicable — honestly. No blockchain, no Web3, no tokens: the "infrastructure" in this lab is one offline file holding a power series, a logarithm sum, and an angular integral. Precision-measurement and metrology claims are permanent HOLD gates, not features. No fake badges here.
🚫 No low-level code — honestly. No C, no C++, no GPU, no compiled extensions: this is one interpreted Python file on purpose, so every term can be read, checked, and diffed. Performance here means honest algorithms — a 2,880-slice Simpson integration refereed by a closed form, bisection-free threshold bookkeeping that is exact by construction — all deterministic and byte-identical between runs.
🚫 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.
g-2 with the ladder showing — five published terms evaluated from the labelled alpha, partial sums printed per order, Schwinger's alpha/(2pi) = 0.001161409732886 matched to machine precision, every term ratio under 1% and asserted.
The residual, explained — total 0.001159652176814 vs labelled experiment 0.00115965218073: -0.003377 ppm, printed with the four named pieces that are NOT in the mass-independent coefficients.
Running alpha, receipted — Delta alpha_lep(M_Z^2) = 0.031421 split as e 0.017435 + mu 0.009178 + tau 0.004808; alpha^-1 ladder 134.1373 / 133.1127 / 132.7302 / 132.2302 / 131.2056 at Q = 10 / 50 / 91.1876 / 200 / 1000 GeV, monotone and asserted.
The hadronic gap, labelled — not computed anywhere in the file; the labelled input 0.02766 produces exactly one printed line (full on-shell alpha^-1(M_Z) = 128.9398), and 127.95 is flagged as the MS-bar convention value.
Compton landmarks — lambda_C = 2.4263102387 pm from h/(m_e c); shift 0 / 2.426310 / 4.852620 pm at 0 / 90 / 180 degrees, each asserted against lambda_C itself.
Klein-Nishina, two ways — Simpson integral (2,880 slices) vs closed form agree below 1e-8 relative at x = 0.01, 1, 10; sigma_T = 0.66524587 barn; sigma/sigma_T falls 0.998005 -> 0.980507 -> 0.841338 -> 0.430728 -> 0.122760.
Bethe's Lamb estimate — ln K0(2S) = 2.8117695 (labelled) gives K0 = 226.3897 eV and 1047.4230 MHz; the 0.9847% gap to the labelled 1057.84 MHz is printed as the known nonrelativistic shortfall, missing pieces named.
Threshold bookkeeping — m_e c^2 = 0.510998950 MeV computed from kg, pair threshold 1.021997900 MeV asserted to the digit; Breit-Wheeler product 0.261119927 MeV^2 with the symmetric point E1 = E2 = 0.510999 MeV and blocked pairs flagged.
TinyML kNN classifier — precision-agreement / running-coupling-regime / classical-limit / threshold-blocked from (residual ppm, Delta alpha %, sigma/sigma_T, E/E_threshold); agreement with the lab's policy asserted on every scenario and all 500 training-grid rows.
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).