Educational measurement-based quantum computing lab in ONE pure-Python file: the cluster state is built first (|+>^n plus one CZ per graph edge โ chains to 6 qubits, 2x3 and 3x3 patches) and every stabilizer K_a = X_a prod Z_neighbours is applied to the built state, returning deviation exactly 0.00e+00 at every site while a product state fails the same test. From there the only operations are single-qubit measurements, and the lab proves the model by enumeration, not sampling: every measurement branch of every pattern is run, each outcome probability is asserted 1/2 (worst deviation 6.11e-16), and the corrected output is graded against direct gate application on a 14-state input grid. The one-way wire gives H in 1 step and the identity in 2 and 4 steps (corrected deviation at most 5.55e-16); two J-steps give exact Rz and Rx rotations; three give H.Rz.Rx.Rz and four give the exact Euler form Rz.Rx.Rz. Feed-forward angles follow phi = -(-1)^x * alpha + pi * z from a Pauli frame that is tracked as a matrix and asserted to stay a Pauli at every step, and every branch's frame is fitted to an affine function of the outcome bits over GF(2). The two-qubit result is stated exactly as it computes: the 2x3 patch with all-X measurements implements (H x H) CZ (H x H) โ a CZ in the Hadamard frame, locally equivalent to CZ, maximally entangling (concurrence of U|00> = 1.0), NOT a bare CZ โ and (H x H).U.(H x H) = CZ to 8.88e-16, so the patch plus Hadamard patterns is exactly CZ.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: an exact statevector simulation of small patterns (at most 9 qubits) โ no real quantum hardware was touched, no quantum advantage is claimed, and no pattern here is a fault-tolerance or compiler product. Every hardware / cloud-service / blind-computing / cryptographic / advantage use is a permanent HOLD gate (14 total).
โ ๐งฐ Tech Stack Badges & Full Architecture Tech Stack
๐ Python 3.12, pure standard library (cmath, math, hashlib, json, sys) โ zero dependencies, zero network, deterministic (double-run byte-identical)
โ๏ธ Statevector core from scratch: flat complex amplitude lists (qubit q = bit q), single-qubit gates, CZ, XY-plane measurement with basis rotation back to computational form โ no library quantum code anywhere
๐งฉ Cluster builder: |+>^n plus one CZ per graph edge (chains to 6 qubits, 2ร3 and 3ร3 patches), with the stabilizer receipt K_a = X_a โ Z_neighbours applied to the built state operator-by-operator
๐ Pattern engine: J-gate steps J(ฮฑ) = HยทRz(ฮฑ), feed-forward angle rule ฯ = โ(โ1)^xยทฮฑ + ฯยทz, and a Pauli frame tracked as a matrix (Pโฒ = X^sยทJ(โฯ)ยทPยทJ(ฮฑ)โปยน) and asserted to stay inside the Pauli group at every step
๐ Branch enumeration: all 2^m outcome branches run deterministically โ the seeded splitmix64 PRNG (seed 20261119) only picks probe input states, it never samples a branch
๐ง TinyML kNN pattern classifier (from scratch, stdlib, distance-weighted): resource-state / wire / single-step-gate / rotation-gate / entangling-gate from (measurements, outputs, cross edges, nonzero angles), 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 cluster state and a measurement-pattern engine. Quantum-hardware control, cloud quantum services, and blind-computing services are permanent HOLD gates, not features. No fake badges here.
โ โ๏ธ Platform Support & Hardware Architecture
๐ฅ๏ธ 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 photonic processors, cluster-state sources, and detectors are permanent HOLD gates (see the gate table below)
๐ซ No low-level code โ honestly. No C, no C++, no GPU, no compiled extensions: this is one interpreted Python file on purpose, so every amplitude can be read, checked, and diffed. Performance here means honest algorithms โ exhaustive branch enumeration instead of Monte Carlo, exact Pauli-frame matrix tracking instead of post-hoc fitting, and an affine GF(2) fit that either holds on all 16 patch branches or fails the build.
๐ซ 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.
Cluster states, receipted โ chains (2โ6 qubits) and 2ร3 / 3ร3 patches; every stabilizer K_a applied to the built state returns deviation exactly 0.00e+00, single-qubit marginals are maximally mixed (purity 0.5), and a product state fails the same stabilizer test at deviation > 0.5.
Randomness, priced โ every XY-plane measurement in every pattern is 50/50 to within 6.11e-16; branches are enumerated (2^m of them), never sampled; the seeded splitmix64 PRNG (seed 20261119) only picks probe input states.
The one-way wire โ 1 step = H, 2 steps = identity, 4 steps = identity, on every branch ร 14 inputs, corrected deviation at most 5.55e-16.
Gate patterns โ Rz(theta) for theta in {0.7, -1.3, pi/3} and Rx(theta) for theta in {0.7, -2.0} from two J-steps; H.Rz.Rx.Rz from three; the exact Euler Rz.Rx.Rz from four โ all graded against independently built matrix products.
Feed-forward with a referee โ angles follow phi = -(-1)^x * alpha + pi * z; the Pauli frame is tracked as a matrix (P' = X^s . J(-phi) . P . J(alpha)^-1) and asserted to stay in the Pauli group at every step, so a wrong angle rule would fail the build, not just the answer.
The patch, honestly named โ (H x H) CZ (H x H): 16 branches ร 10 input pairs correct to 6.66e-16; distance from bare CZ is itself a check (> 0.5); the H-sandwich recovers CZ to 8.88e-16; concurrence of U|00> = 1.0 (maximally entangling), of U|++> = 0.0.
Frames as data โ wire, Euler, and patch frame tables all fit affine functions of the outcome bits over GF(2); worked example: Euler branch 1010 on |+i> is off by 0.1486 uncorrected and by 3.33e-16 after the predicted Z correction.
Adversarial frame extraction โ Pauli-eigenstate inputs admit spurious frames, so patch frames are found by intersecting candidate sets over generic seeded probes until exactly one Pauli survives per branch.
TinyML kNN classifier โ resource-state / wire / single-step-gate / rotation-gate / entangling-gate from (measurements, outputs, cross edges, nonzero angles); agreement with the lab's policy asserted on every scenario and all 120 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).