Cheap Static Math vs. Real Circuit-Level Noise
Physical qubits fail constantly from gate errors, stray heat, and noisy measurements. A quantum error-correcting (QEC) code protects a smaller number of reliable logical qubits by spreading them across many noisy physical data qubits, watched over by helper ancilla qubits that repeatedly check parity without reading the quantum state itself.
Modern search loops — including AI- and RL-guided discovery — can propose thousands of candidate quantum LDPC codes in hours. Properly testing even one candidate at the circuit level (simulating tens of thousands of noisy runs in Stim and decoding every syndrome with BP+OSD) takes minutes to hours. Measuring just 242 small codes in M0 took 76.3 CPU core-hours.
To cope, search loops screen candidates first with a back-of-the-envelope formula: Φ = k · d² / n. The catch is that Φ is blind to hardware reality — it rewards packing more logical qubits k while ignoring how heavy, deep, and noisy the error-checking circuit becomes.
n ≤ 72).true d ≤ d_upper; never called exact, INV-5).k while ignoring check weight and gate depth.Φ stay completely blind as check weight w doubles the noisy two-qubit CX gates per round.k · d_upper² / nn · w noisy 2-qubit gates2w + 2 pinned scheduleTanner Graphs, Short Cycles & Syndrome-Extraction Depth
Every CSS quantum LDPC code is defined by two sparse binary parity-check matrices over GF(2): H_X (detects Z phase flips) and H_Z (detects X bit flips). Drawn as a network, each matrix forms a Tanner graph connecting data qubits to parity checks.
Computing the 28 features in m0_features.parquet takes milliseconds per code, yet captures the physical mechanisms that Φ misses:
- Check weight (
check_weight_mean): Directly sets how many sequential two-qubit CX gates each check executes per round — controlling both gate-error count and idle qubit decoherence time. - Short loops (
cycle4_count,cycle6_count,girth): Four-step cycles in the Tanner graph bounce Belief Propagation messages back to themselves, causing iterative decoders to stall and fall back to slow OSD elimination. - Graph expansion & schedule cost (
lambda2,cx_total,circuit_ticks): Captures global connectivity alongside exact gate counts under the pinned X-then-Z monomial-matching schedule.
q0–q7) to toggle bit-flip faults, switch between light and heavy check layouts, highlight a 4-cycle loop, or hit Animate 1 Round to watch CX layers execute across ticks.Why the Best Codes Cost 40× More to Verify
Every M0 label was measured under one exact, hashed protocol (protocol_hash 6230a7a8…): uniform depolarizing noise at p = 0.002, Z-basis memory for r = d_upper rounds, sampled in Stim 1.16.0 and decoded with ldpc 2.4.1 BP+OSD (min-sum, 30 iterations, scaling 0.625, OSD-CS order 10).
To keep statistical error bars tight without wasting CPU hours on weak codes, each code runs in 256-shot batches until it records at least 100 logical failures, stopping at a cap of 40,960 shots. If a code hits 40,960 shots with fewer than 100 failures, INV-3 refuses to report a thin point estimate: the row is marked censored (true_ler = null), excluded from regression training, and ranked conservatively by its 95% Wilson upper bound (true_ler_ub).
This creates a stark cost asymmetry: across all 242 codes, the median code finished in just 1,024 shots — whereas the 10 best codes required 24,320 to 40,960 shots each. Good screening prevents burning those 40,000-shot budgets on bad candidates.
INV-4) converge inside its 95% Wilson band.Watch the Top 10 Codes Glide Across Screening Scores
M0 exhaustively enumerated every admissible BB code with n ≤ 72 and d_upper ≥ 3 across 11 templates (244 codes; two mixed_3_5 codes with l = 2 had cancelling monomials x³ = x and were excluded under D-036, leaving 242 measured rows).
Below are 40 real M0 codes taken verbatim from evidence/m0-verdict/2026-10-03-1131f10/m0_results.json — including all 10 true top-10 codes (★). Switch the horizontal axis and watch every dot animate to its new rank: under Φ = kd²/n, all 10 winners pile up on the far left; switch to −Check Weight and watch them glide straight toward the bottom-right ideal corner.
m0_results.json record below.Official M0 Scoreboard (All 242 Codes, Leave-One-Program-Out)
Exact numbers from spec/evals.md §7 and m0_results.txt (95% paired bootstrap over codes, 1,000 resamples, seed 20261001; label-noise ceiling over 1,000 Beta draws, seed 20261002).
| Metric (242 codes, leave-one-program-out) | LightGBM Model | Φ (from d_upper) | Model − Φ |
|---|---|---|---|
| Recall@30-of-top-10 (pre-registered headline) | 0.200 [0.000, 0.600] | 0.000 [0.000, 0.000] | 0.200 [0.000, 0.600] |
| Recall@30-of-top-10 (censored code excluded) | 0.100 | 0.000 | — |
| Spearman rank correlation (global ordering) | 0.871 [0.838, 0.894] | 0.242 [0.118, 0.354] | +0.629 [0.521, 0.750] |
| Spearman (censored code excluded) | 0.870 | 0.243 | — |
| Label-noise ceiling (Recall@30-of-top-10) | 1.000 [1.000, 1.000] | — | — |
One Held-Out Fold Decided All Ten Winners
Why did LightGBM score an impressive 0.871 Spearman across all 242 codes, yet catch only 2 of the top 10? The answer is structural — not measurement noise (the label-noise ceiling is a perfect 1.000).
Because random row splits leak near-duplicate siblings from the same polynomial recipe (INV-2), M0 evaluates strictly leave-one-program-out across the 11 construction programs. As it turned out, all 10 of the lowest-error codes came from one single template, bb_v1_pair_2_2 (weight 4, k = 2). When pair_2_2 is held out, LightGBM trains exclusively on heavier templates (w ≥ 5) and must extrapolate cold to every single top-10 winner in one fold.
Meanwhile, Φ scored exactly 0.000 because every top-10 code has k = 2 and Φ ≤ 1.64 — buried behind at least 70 higher-k, higher-Φ codes with worse error rates.
pair_2_2 alone holds 10/10 winners — and compare each template's sub-threshold scaling ρ(d_upper, true_ler) below.Six Automated Invariants & the Path to M1
Scientific ML benchmarks rarely fail loudly; they fail silently through data leakage, mixed simulation settings, or rounded-up claims. Every core rule in CONTRACT.md is enforced automatically by pytest (427 default tests passing):
Separated Measurements
true_* labels and pred_* model outputs never share a file or column. A prediction is never presented as a real error rate.
Grouped Splits Only
Random train_test_split on code rows is blocked by source-grep tests. Splits group by construction_program_id (and by family from M2).
Bounds, Not Thin Guesses
Fewer than 100 failures triggers censored = True and true_ler = null; excluded from fits and ranked by true_ler_ub.
One LER Formula
1 − (1 − P_L)^(1/(r·k)) lives exclusively inside protocol.py, guarded by a self-tested source-grep check.
Bounds Never Called Exact
Randomized search produces d_upper (d ≤ d_upper). d_exact stays null unless provably exact; proxy is phi_from_d_upper.
No Mixed Protocols
Every row carries a SHA-256 protocol_hash. Metric and training functions raise ValueError if two protocols are ever combined.
Roadmap (Plans, Not Results — M1 Has Not Started)
| Milestone | Planned Scope | How It Resolves M0 Findings |
|---|---|---|
| M1 · Dataset v0.1 (Next) | Generalized Bicycle (GB) & Hypergraph Product (HGP) codes · 3 qubit budgets · 3 values of p · ~2,000 rows · Zenodo DOI |
Eliminates the single-template top-10 bottleneck; filters colliding monomials before pinning; measures decode cost per new regime. |
| M2 · Benchmark & Baselines | Frozen cross-family splits · scoring CLI · research preprint | Establishes held-out code family as the headline metric and measures model refit variance explicitly. |
| M3 · GNN Surrogate | Tanner-graph GNN evaluated head-to-head against LightGBM and Φ | Tests whether message passing directly on the bipartite parity-check graph beats tabular features out-of-family. |
| M4 · Package & Outreach | Pip-installable score(code) API · worked search-loop example |
Drops circuit-aware screening straight into automated QEC code-discovery pipelines. |