diff --git a/research/clifford-width17/PROOF.md b/research/clifford-width17/PROOF.md new file mode 100644 index 0000000000..e1c2443948 --- /dev/null +++ b/research/clifford-width17/PROOF.md @@ -0,0 +1,233 @@ +# Dyadic interpolation of four-qubit Clifford tensors at width 17 + +Let `R = Z[i,1/2]`. Choose one Gaussian-dyadic unitary representative +`U_a` of each four-qubit Clifford coset modulo scalar powers of `i`. +Write `c_a = vec(U_a)/4` and let `A_f` have columns `c_a^(tensor f)`. +The convention `vec(U_a^(tensor f))/4^f` differs only by a coordinate +permutation. There are `N = 12,128,668,876,800` columns. + +**Theorem.** At every integer width `f >= 17`, the recipe below gives a +matrix `B_f` over `R` such that `B_f A_f = I_N`. Each row of this +specified inverse has squared Euclidean norm `73,190,789,644,335,724`. +Using the reported spectral bounds of #7772, a finite dyadic iteration +gives another exact inverse with operator norm below `3.021`. +The proof also gives the exact complex independence threshold 17 for the +larger alphabet of *all* eight-qubit projective stabilizer states. +The four-qubit Clifford alphabet is a proper subset. Its least dyadic +width remains open between 13 and 17 inclusive, using the reported +complex threshold of [#7766](https://github.com/CrocSwap/integer-mult-bounds/pull/7766). + +## 1. Recenter the target over the coefficient ring + +Use computational labels `s,r in F_2^4` for the row and column of a +matrix. For a fixed target apply `U_a^* ⊗ I`, then the Bell-basis change + +```text +D |s,r> = (1/4) sum_z (-1)^(r·z) |s+r,z>. +``` + +This is a reversible binary relabeling followed by four Hadamards on the +second register. Their combined coefficient is exactly `1/4`. Thus +`T_a = D(U_a^* ⊗ I)` is unitary, Clifford and Gaussian-dyadic. +It sends `c_a` to `e_0`, since the character sum of `(-1)^(r·z)` over +the sixteen values of `r` vanishes for every nonzero `z`. Each `c_b` +comes from the four Bell pairs `vec(I)/4` by a Clifford on the first +register. Hence `v = T_a c_b` is an eight-qubit stabilizer vector. Its +ray equals that of `e_0` precisely when `U_b` is proportional to `U_a`. +A scalar of modulus one in `R` is a power of `i`: if +`h²+j²=2^(2l)` with `l>0`, reduction modulo four forces both +`h,j` even, and descent gives the four units. Thus the chosen cosets +agree exactly in this case. With `a=b` the recentering gives `e_0` +with coefficient exactly one. + +## 2. The phases on a stabilizer support + +An eight-qubit stabilizer vector has support an affine subspace of +`V=F_2^8`. If it contains zero, its support is a linear subspace `A` +and the coefficients restricted to any independent directions +`b_1,...,b_k in A` have the form + +```text +v_(sum_j t_j b_j) / v_0 = i^q(t), +q(t) = sum_j h_j t_j + 2 sum_(j= 17` set + +```text +P_f(v) = v_0^(f-16) sum_(K<=V) mu_dim(K) M_K(v). +``` + +If `v_0=0`, the positive exponent kills every term. Otherwise the +preceding sum gives `P_f(v) = v_0^f 1[A={0}]`. In particular, +`P_f(T_a c_b) = 1[a=b]`. + +Use one **ordered** tensor coordinate for each term, consisting of +`f-16` zero labels followed by the listed sixteen labels. Put coefficient +`mu_dim(K)` on that coordinate and zero elsewhere, obtaining a row +`b`. Different `K` produce different words because their labels span +different subspaces. No symmetrization or factorial division occurs. +The row `b T_a^(tensor f)` evaluates the interpolant on the observation +coordinates of the normalized map. This applies the ordered-word lift +in recentered coordinates before the unitary change of basis. +Stacking the rows yields `B_f` +over `R`. + +The number of subspaces in dimensions 0 through 8 is +`(1,255,10795,97155,200787,97155,10795,255,1)`. The disjoint tensor +coordinates and the unitarity of the recentering give + +```text +||b T_a^(tensor f)||_2² = sum_(k=0)^8 [8 choose k]_2 2^(k(k-1)) + = 73,190,789,644,335,724. +``` + +In particular, for Euclidean noise `e` on the normalized observations, +each recovered coefficient has error at most `||b||_2 ||e||_2`, and +`||B_f e||_2 <= sqrt(N) ||b||_2 ||e||_2`. + +## 4. Exact dyadic stabilization + +Fix `A=A_f` and start with `D_0=B_f`. The following corollary uses +the all-width spectral enclosure of Ali Romman's [#7772, pinned +proof](https://github.com/aliromman/integer-mult-bounds/blob/1398fbdca3536389d8ac3c8b3aaa408f03e8f6c2/research/clifford-threshold-conditioning/PROOF.md); +the interpolation theorem itself is independent of those spectra. +For `G=A* A` its two bounds are `l=470624175/2^32` and +`u=7841980575/2^30`. Apply the classical Landweber (Richardson +normal-equation) iteration with dyadic step: + +```text +H = I - G/4, +D_(j+1) = H D_j + A*/4. +``` + +Every entry remains in `R`. If `D_j A = I`, then `D_(j+1) A = H+G/4=I`, +so each iterate is already an exact left inverse. The complex canonical +inverse `A^+ = G^(-1) A*` is a fixed point. Consequently +`D_j-A^+ = H^j (D_0-A^+)`. Since `1/16 < l <= u < 15/2`, +`||H||_2 < 63/64`. Section 3 and `||A^+||_2 <= 1/sqrt(l)` give +`||D_0-A^+||_2 <= sqrt(N) ||b||_2 + 1/sqrt(l) < 2^50`. +As `(64/63)^64 >= 1 + 64/63 > 2`, the choice `j=8192` yields +`||D_j-A^+||_2 < 2^-78`. For the numerical margin, +`302095² × 470624175 - 100000² × 2^32 = 142959244679375 > 0`. +Thus `||D_j||_2 < 302095/100000 + 2^-78 < 3.021`. This bound applies +to arbitrary Euclidean perturbations of the normalized observations. +The huge Gram multiplication and its precision, storage, movement and +restoration costs have no complete caller invoice here. + +## 5. Sharpness for all eight-qubit stabilizer rays + +Clifford transitivity sends any target stabilizer ray to that of +`e_0`. For example, reverse a stabilizer preparation circuit; when a +dyadic gate lift is desired, a single Hadamard can be rephased as +`(1+i)/2 * [[1,1],[1,-1]]`. The same polynomial then separates each target +from all other stabilizer rays; rescale its nonzero target value to one. +Thus their tensor columns are independent for `f >= 17`. + +Suppose a degree-16 homogeneous polynomial separated `e_0` from every +other stabilizer ray with target value one. Any smaller-degree separator +could be padded by a power of `v_0` to meet this premise. Average the +polynomial over all diagonal Clifford phases `i^q(x)` of Section 2 +on the full space `V`. These fix `e_0` and permute stabilizer rays, +so the average is still a separator. The phase generators allow every +linear coefficient modulo four and every cross sign independently. +For a degree-16 monomial with binary coordinate labels `x_1,...,x_16`, +the average survives only if each coordinate row of its `8 × 16` +label matrix has weight divisible by four and each pair overlaps evenly. +These rows and the length-16 all-ones row therefore span a self-orthogonal +binary space of dimension at most eight. The affine dimension of the +sixteen labels is the rank of this augmented matrix minus one. It is +at most seven. + +For every nonempty affine subspace `A`, its indicator vector is +proportional to a stabilizer state: prepare a uniform superposition on +independent coordinates, extend its basis by an invertible binary map, +and translate. Evaluating a surviving monomial on this indicator gives +`1[F contained in A]` where `F` is the affine span of its labels. +Thus the averaged polynomial would express `1[A={0}]` as a combination +of these incidence functions with `dim F <= 7`. On the finite poset of +nonempty affine subspaces the full incidence matrix is unit triangular +in any inclusion-respecting order. Its expansion is unique. The +coefficient on `F` in the desired expansion is zero if `0` lies outside +`F` and `mu_dim(F)` otherwise, by the sum in Section 3. In particular +the coefficient on `V` is `2^28`, a contradiction. This proves the +stated threshold for the enlarged alphabet. The diagonal phases in this +argument can move a Clifford Choi ray outside the recentered Choi set. +Consequently this lower bound supplies no obstruction at widths 13–16 +for the four-qubit problem. + +## Attribution + +The zero-quadratic-phase tuple method and its relation to doubly even +codes were developed in the project by Ali Romman and Nick Petalas. +The proof above uses their witness-code idea for an interpolation +problem, together with classical Möbius inversion and the stabilizer +normal form. [Nine-axis proof #5635](https://github.com/CrocSwap/integer-mult-bounds/pull/5635) +and [zero-phase witness lengths #5902](https://github.com/CrocSwap/integer-mult-bounds/pull/5902). + +Ali Romman supplied the four-qubit canonical odd-denominator obstruction, +building on the Clifford work of alephnan and the character projections +of Nick Petalas. The earlier dyadic inverse of apoursh provided the +width-256 handoff. Those results retain their respective attribution. +[Canonical decoder #7792](https://github.com/CrocSwap/integer-mult-bounds/pull/7792) +and [prior interpolant #7797](https://github.com/CrocSwap/integer-mult-bounds/pull/7797). +Gross, Nezami and Walter describe the complex span projector for stabilizer +tensor powers in [Theorem 5.6](https://arxiv.org/abs/1712.08628). +Chang, Caro, Larocca and West use the quadratic-phase characters in their +[Eqs. 7–9](https://arxiv.org/html/2609.10974v1), and Nebe, Rains and +Sloane relate Clifford invariants to [self-dual code weight +enumerators](https://arxiv.org/abs/math/0001038). +We make no literature-priority claim for the complex threshold. +Prepared by **apoursh** with substantial OpenAI Codex and separate agent +assistance. Apache-2.0. diff --git a/research/clifford-width17/README.md b/research/clifford-width17/README.md new file mode 100644 index 0000000000..94266e3a5e --- /dev/null +++ b/research/clifford-width17/README.md @@ -0,0 +1,34 @@ +# Gaussian-dyadic four-qubit Clifford recovery at width 17 + +For the normalized tensor columns of the full four-qubit projective Clifford alphabet, every integer width **f ≥ 17** admits an exact left inverse over **Z[i,1/2]**. The previous sufficient width was 256. The reported complex threshold is 13, leaving four widths, 13 through 16, where Gaussian-dyadic recovery remains open. For the larger alphabet of all eight-qubit stabilizer rays, the complex independence threshold is exactly 17. [Previous dyadic inverse #7797](https://github.com/CrocSwap/integer-mult-bounds/pull/7797) · [Complex threshold #7766](https://github.com/CrocSwap/integer-mult-bounds/pull/7766) + +The normalized observation is a linear combination of columns `(vec(U)/4)^(tensor f)`, with one fixed representative per scalar coset. For each target, a change to Bell coordinates sends that column's single-copy state to the origin basis vector. A length-16 binary code cancels the quadratic phases on each linear subspace of the support. Möbius inversion isolates the target. The seventeenth coordinate kills supports missing the origin. Dropping it gives a false positive even on a four-qubit Clifford, as the checker demonstrates with one rephased Hadamard and three copies of HS. [Construction and lower bound](PROOF.md) + +The resulting ordered tensor row has 417,199 nonzero entries before the change of basis and squared Euclidean norm 73,190,789,644,335,724. Starting from this exact inverse, dyadic Richardson iterations preserve exact recovery. Using the uniform spectral bounds of Ali Romman's #7772, 8,192 steps give a second exact inverse within **2⁻⁷⁸** of the canonical decoder in operator norm. Its noise amplification is **below 3.021** on arbitrary normalized observations. This estimate uses #7772's spectral theorem. The width-17 construction and the larger-alphabet lower bound are self-contained. [Stability proof](PROOF.md#4-exact-dyadic-stabilization) · [Pinned spectral result](https://github.com/aliromman/integer-mult-bounds/blob/1398fbdca3536389d8ac3c8b3aaa408f03e8f6c2/research/clifford-threshold-conditioning/RESULT.json) + +These are algebraic results. The Gram matrix has more than 12 trillion columns. No complete physical evaluation, storage, precision or routing cost is known for this decoder, and no change to the selected multiplication exponent κ is claimed. + +## Reproduce + +Run from the repository root with CPython 3.12 and the standard library. + +```sh +python3.12 -B scripts/research_package.py --package research/clifford-width17 +``` + +- `verify.py` checks seven literal four-qubit Clifford matrices, their 49 ordered recenterings, and all 417,199 subspaces on a full-support example. It reconstructs the squared row norm and checks five faulty variants. +- `independent_check.py` builds the 24-element embedded one-qubit projective alphabet and tests 9,216 normalized identities including all four scalar phases at widths 17–20. It expands 1,094 tensor coefficients for two target rows and checks 48 literal contractions. It rejects three mutations and imports neither other checker. +- `check_stability.py` authenticates the retained #7772 numerical receipt, checks its 81 spectral rows and proves the numerical margins by exact arithmetic. A small normalized matrix checks the iteration and its error recurrence through nine successive exact inverses. + +Each checker runs normally and under optimized Python. The proofs cover the full alphabets. The replays use finite fixtures and never materialize the full Clifford tensor map or the 8,192-step dense decoder. The spectral identification, all-width propagation and the complex threshold from #7766 are attributed inputs. The only external research data consumed by the checks are bundled in `references/conditioning-result.json`. [Replay manifest](VERIFY.json) · [Sources and credit](SOURCES.json) + +## Research context and credit + +Prepared by **apoursh** with substantial OpenAI Codex and separate agent assistance under Apache-2.0. Ali Romman's canonical obstruction motivated the alternative decoder question. His work and Nick Petalas's work on code-based phase witnesses are predecessors to the present construction. Their Clifford and character-table sources retain the credit to alephnan and other contributors. The proof cites the classical stabilizer normal form and related work on Clifford invariants and tensor powers. [Canonical obstruction #7792](https://github.com/CrocSwap/integer-mult-bounds/pull/7792) · [Phase witnesses #5635](https://github.com/CrocSwap/integer-mult-bounds/pull/5635) · [Doubly-even codes #5902](https://github.com/CrocSwap/integer-mult-bounds/pull/5902) + +This follows the intermediate-width handoff from #7797 on upstream `e54523517d0f03e58352e647c403a5af3e525a57`. The historical revision-8 audit card concerns a selected multiplier assumption. This follow-up addresses the algebraic feasibility of the proposed decoder and leaves those assumptions open. [Public claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19752782) · [Task and overlap record](TASK.json) + +## Open next questions + +1. Does the Clifford subset admit a Gaussian-dyadic left inverse at width 16, or even at 13? Start by restricting the incidence equations to the maximally entangled Choi rays. The diagonal phase averaging used for the larger-alphabet lower bound requires a family closed under those phases. +2. Is stable exact recovery affordable at one named caller? Price a single Gram application, including coefficient precision, movement, scratch space and restoration, before extrapolating to the full iteration. diff --git a/research/clifford-width17/SOURCES.json b/research/clifford-width17/SOURCES.json new file mode 100644 index 0000000000..544699e97c --- /dev/null +++ b/research/clifford-width17/SOURCES.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + } + ], + "context_only": [ + { + "pr": 7797, + "head": "9d3237a6308228145f1c26dc349f18d5c857bb41", + "credit": "apoursh", + "use": "Previous dyadic sufficient width and intermediate-width question." + }, + { + "pr": 7792, + "head": "9321c67e29c3c41a188154bc5c2add7d7802b694", + "credit": "Ali Romman", + "use": "Canonical odd-division result and alternative decoder question." + }, + { + "pr": 7788, + "head": "9a8ce06644700ffa576d99316450bcb52835d6dc", + "credit": "Ali Romman", + "use": "Normalization and complex spectral context." + }, + { + "pr": 5635, + "head": "bd04d907995da4480d07099bafa4d44396caec0b", + "credit": "Ali Romman", + "use": "Related phase-neutral native monomial tests." + }, + { + "pr": 5902, + "head": "dedb8bd4a53ecf7b36975941a872173ed8f2a1ba", + "credit": "Nick Petalas", + "use": "Related doubly-even code constructions for zero-phase witnesses." + }, + { + "pr": 7766, + "head": "d7c2dd1868c70f0addce2c0a4d3220149452f14b", + "credit": "Ali Romman", + "use": "Reported full four-qubit complex threshold 13." + } + ], + "retained_spectrum": { + "credit": "Ali Romman, retaining Nick Petalas and alephnan's predecessor work", + "pr": 7772, + "head": "1398fbdca3536389d8ac3c8b3aaa408f03e8f6c2", + "url": "https://github.com/aliromman/integer-mult-bounds/blob/1398fbdca3536389d8ac3c8b3aaa408f03e8f6c2/research/clifford-threshold-conditioning/RESULT.json", + "local_path": "references/conditioning-result.json", + "original_git_blob": "039f22ba0bfec63c02fb3a97959766b8ec3a1bfa", + "sha256": "d032d5e63820f4ffe246d21adcd8d272f04dfd635a6fc519c4a81a366ca41d49", + "use": "Unmodified numerical receipt for the stability corollary. Spectral identification and its propagation in width are inputs from PR7772." + } +} diff --git a/research/clifford-width17/TASK.json b/research/clifford-width17/TASK.json new file mode 100644 index 0000000000..e24aa0ff07 --- /dev/null +++ b/research/clifford-width17/TASK.json @@ -0,0 +1,93 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "task_id": "uniform-transfer-audit", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_key": "58d0403e3078b2c5ae8a", + "priority_revision": 8, + "scope_status": "changed", + "actual_scope": "Answer the intermediate-width handoff from PR7797 for a Gaussian-dyadic left inverse of the four-qubit Clifford tensor map.", + "scope_change_reason": "The selected multiplier has a different caller. This question concerns the algebraic coefficient ring and noise amplification for a proposed decoder alphabet.", + "bottleneck_link": "Separates exact dyadic recovery from the canonical odd-denominator obstruction and bounds one decoder's row norm. Its complete physical cost is unknown.", + "stop_rule": "Give one sufficient width and a self-contained proof, check the actual normalization independently, and state which lower widths remain open.", + "family_decision": "Narrow to exact interpolation and its norm. The all-stabilizer lower bound describes the limit of this route. No selected caller or physical construction is proposed.", + "outcome": "completed", + "evidence": "PROOF.md and three registered checkers including an offline reproduction of the width-independent noise constant from PR7772's numerical input.", + "author": "apoursh", + "ai_assistance": "Substantial OpenAI Codex assistance in the proof, implementation and separate computational checks.", + "open_questions": [ + { + "question": "Does the four-qubit Clifford tensor map split over the Gaussian dyadics at any width from 13 through 16?", + "why_it_matters": "The lifted stabilizer lower bound applies to a larger alphabet.", + "first_step": "At width 16, restrict the incidence equations to maximally entangled Choi rays before taking any phase average.", + "blocked_by": "A lower bound for all stabilizers need not survive restriction to the Clifford orbit." + }, + { + "question": "Can a dyadic decoder with noise amplification below 3.021 be realized at a specified caller's budget?", + "why_it_matters": "The stable algebraic formula involves repeated dense Gram operations.", + "first_step": "Price one Gram application at the actual precision, including temporary storage, movement and cleanup, before budgeting thousands of iterations.", + "blocked_by": "The symbolic decoder supplies neither a physical schedule nor a complete signed invoice." + } + ], + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19752782", + "overlap": "Checked the live handoff board, #7797, #7792 and all-state searches for width, Clifford, stabilizer, Möbius and doubly-even code. The local sparse and cached overlap corpus is incomplete. The older phase-witness results #5635 and #5902 address a different alphabet/target.", + "orientation": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY at the pinned base; the older revision-8 allocation card is retained verbatim." +} diff --git a/research/clifford-width17/VERIFY.json b/research/clifford-width17/VERIFY.json new file mode 100644 index 0000000000..469309c555 --- /dev/null +++ b/research/clifford-width17/VERIFY.json @@ -0,0 +1,84 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Binary phase cancellation, subspace counts, affine supports and rejection controls" + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Binary phase cancellation, subspace counts, affine supports and rejection controls under optimized Python" + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/independent_check.py" + ], + "timeout_seconds": 180, + "checks": "Independent embedded Clifford interpolation and tensor-coordinate checks" + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/independent_check.py" + ], + "timeout_seconds": 180, + "checks": "Independent embedded Clifford interpolation and tensor-coordinate checks under optimized Python" + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/check_stability.py" + ], + "timeout_seconds": 60, + "checks": "Pinned spectral endpoints, exact contraction margin and small dyadic iteration" + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/check_stability.py" + ], + "timeout_seconds": 60, + "checks": "Pinned spectral endpoints, exact contraction margin and small dyadic iteration" + } + ] +} diff --git a/research/clifford-width17/check_stability.py b/research/clifford-width17/check_stability.py new file mode 100644 index 0000000000..7199cea7d0 --- /dev/null +++ b/research/clifford-width17/check_stability.py @@ -0,0 +1,78 @@ +"""Check the inherited spectrum receipt and the dyadic stability corollary. + +apoursh with substantial OpenAI Codex assistance. Apache-2.0. +""" +from fractions import Fraction as Q +import hashlib +import json +from pathlib import Path + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def check_constants(): + path = Path(__file__).parent / "references" / "conditioning-result.json" + raw = path.read_bytes() + digest = "d032d5e63820f4ffe246d21adcd8d272f04dfd635a6fc519c4a81a366ca41d49" + require(hashlib.sha256(raw).hexdigest() == digest, "changed PR7772 result") + receipt = json.loads(raw) + levels = [Q(*row["eigenvalue"]) for row in receipt["rows"]] + low, high = min(levels), max(levels) + require(len(levels) == 81 and receipt["width"] == 13, "wrong spectral scope") + require((low, high) == (Q(*receipt["minimum"]), Q(*receipt["maximum"])), + "endpoints disagree with the retained rows") + dimension = sum(row["regular_dimension"] for row in receipt["rows"]) + require(dimension == receipt["projective_order"] == 12128668876800, "wrong dimension") + contraction = max(abs(1 - low / 4), abs(1 - high / 4)) + require(contraction < Q(63, 64) and Q(63, 64)**64 < Q(1, 2), "slow contraction") + row_norm_squared = 73190789644335724 + require(dimension * row_norm_squared < (2**50 - 4)**2 and low > Q(1, 16), + "initial error bound") + canonical_bound = Q(302095, 100000) + require(canonical_bound**2 * low > 1, "canonical norm margin") + gap = Q(2**50, 2**(8192 // 64)) + require(gap == Q(1, 2**78) and canonical_bound + gap < Q(3021, 1000), + "final norm margin") + + +def matmul(left, right): + return [[sum(x*y for x, y in zip(row, col, strict=True)) for col in zip(*right)] + for row in left] + + +def combine(left, right, multiplier): + return [[x + multiplier*y for x, y in zip(a, b, strict=True)] + for a, b in zip(left, right, strict=True)] + + +def check_iteration(): + # Two unit columns with overlap 1/2. Their pseudoinverse requires thirds. + half = Q(1, 2) + a = [[1, half], [0, half], [0, half], [0, half]] + adjoint = list(zip(*a)) + identity = [[1, 0], [0, 1]] + gram = matmul(adjoint, a) + h = combine(identity, gram, -Q(1, 4)) + gram_inverse = [[Q(4, 3), -Q(2, 3)], [-Q(2, 3), Q(4, 3)]] + canonical = matmul(gram_inverse, adjoint) + current = [[1, -1, 0, 0], [0, 2, 0, 0]] + error = combine(current, canonical, -1) + for _ in range(9): + require(matmul(current, a) == identity, "an iterate lost exact recovery") + require(combine(current, canonical, -1) == error, "wrong error recurrence") + require(all(v.denominator.bit_count() == 1 for row in current for v in row), + "non-dyadic iterate") + current = combine(matmul(h, current), adjoint, Q(1, 4)) + error = matmul(h, error) + require(any(v for row in error for v in row), "fixture started at its fixed point") + faulty = combine(matmul(h, current), adjoint, -Q(1, 4)) + require(matmul(faulty, a) != identity, "wrong-sign control escaped") + + +if __name__ == "__main__": + check_constants() + check_iteration() + print("PASS_DYADIC_STABILITY spectral_rows=81 toy_left_inverses=9 norm_upper=3.021") diff --git a/research/clifford-width17/independent_check.py b/research/clifford-width17/independent_check.py new file mode 100644 index 0000000000..7beb47ad01 --- /dev/null +++ b/research/clifford-width17/independent_check.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python3 +"""An independent exact interpolation check on an embedded Clifford alphabet. + +Coordinates and row weights are Gaussian integers with explicit common powers +of 8. No primary checker, predecessor code or numerical algebra is imported. +Prepared by apoursh with substantial OpenAI Codex assistance. Apache-2.0. +""" + +from collections import Counter, deque + + +ZERO = (0, 0) +ONE = (1, 0) +UNITS = (ONE, (0, 1), (-1, 0), (0, -1)) + + +def check(condition, message): + if not condition: + raise ValueError(message) + + +def add(z, w): + return z[0] + w[0], z[1] + w[1] + + +def mul(z, w): + return z[0] * w[0] - z[1] * w[1], z[0] * w[1] + z[1] * w[0] + + +def conj(z): + return z[0], -z[1] + + +def scale(z, k): + return z[0] * k, z[1] * k + + +def power(z, n): + value = ONE + while n: + if n & 1: + value = mul(value, z) + z = mul(z, z) + n //= 2 + return value + + +def multiply(a, b): + """Multiply literal 2-by-2 Gaussian integer matrices in row-major order.""" + return tuple(add(mul(a[2*r], b[c]), mul(a[2*r+1], b[c+2])) + for r in range(2) for c in range(2)) + + +def phase(a, unit): + return tuple(mul(unit, entry) for entry in a) + + +def enumerate_alphabet(): + """Close on H'=(1+i)H/sqrt(2) and the phase gate, storing 2U.""" + identity = ((2, 0), ZERO, ZERO, (2, 0)) + gates = (((1, 1), (1, 1), (1, 1), (-1, -1)), + ((2, 0), ZERO, ZERO, (0, 2))) + seen = {identity} + pending = deque([identity]) + while pending: + current = pending.popleft() + for gate in gates: + expanded = multiply(current, gate) + check(all(k % 2 == 0 for z in expanded for k in z), + "matrix failed its common denominator") + child = tuple((a // 2, b // 2) for a, b in expanded) + if child not in seen: + seen.add(child) + pending.append(child) + representatives = sorted({min(phase(a, u) for u in UNITS) for a in seen}) + check(len(seen) == 96 and len(representatives) == 24, + "incomplete one-qubit Clifford alphabet") + return representatives + + +def coordinate_rows(target): + # /2 on the normalized V tensor I_8 column. The four + # nonzero row weights below act on V/4 at fixed spectator index 0. + # V/4 has numerator 2V and denominator 8. For embedded inputs this is + # equivalent to averaging all eight equal spectator blocks. + identity = (ONE, ZERO, ZERO, ONE) + x = (ZERO, ONE, ONE, ZERO) + z = (ONE, ZERO, ZERO, (-1, 0)) + return [tuple(map(conj, multiply(target, w))) + for w in (identity, x, z, multiply(x, z))] + + +def inner(row, column): + result = ZERO + for a, b in zip(row, column): + result = add(result, mul(a, b)) + return result + + +def inversion_terms(): + # Actual subspaces of F_2^2. All other F_2^8 subspaces contain a + # probe outside this active plane and hence contribute zero. Restrict + # the first E8 block to two coordinate functions of RM(1,3). + bases = [(), (1,), (2,), (3,), (1, 2)] + terms = [] + for basis in bases: + columns = [] + for position in range(16): + label = 0 + if position < 8: + for bit, point in enumerate(basis): + if position & (1 << bit): + label ^= point + columns.append(label) + # In the F_2^2 subspace lattice the top coefficient is +2: + # 1 (bottom) - 3 (lines) + 2 (plane) = 0. + terms.append(((1, -1, 2)[len(basis)], tuple(columns))) + check(Counter(terms[-1][1]) == {0: 10, 1: 2, 2: 2, 3: 2}, + "bad restriction of the doubly-even length-16 probe") + return terms + + +def evaluate(points, terms): + total = ZERO + for weight, columns in terms: + value = ONE + for j in columns: + value = mul(value, points[j]) + total = add(total, scale(value, weight)) + return mul(points[0], total) + + +def multiply_linear(poly, row): + result = {} + for word, a in poly.items(): + for i, b in enumerate(row): + if b == ZERO: + continue + next_word = list(word) + next_word[i] += 1 + key = tuple(next_word) + result[key] = add(result.get(key, ZERO), mul(a, b)) + return {key: z for key, z in result.items() if z != ZERO} + + +def literal_tensor_row(rows, terms): + """Lift each monomial to one grouped, ordered tensor coordinate.""" + result = {} + for weight, columns in terms: + poly = {(0, 0, 0, 0): (weight, 0)} + for index in (0,) + columns: + poly = multiply_linear(poly, rows[index]) + for address, value in poly.items(): + check(sum(address) == 17, "inhomogeneous tensor coordinate") + result[address] = add(result.get(address, ZERO), value) + return {address: z for address, z in result.items() if z != ZERO} + + +def literal_column_entry(column, address): + value = ONE + for entry, count in zip(column, address): + value = mul(value, power(entry, count)) + return value + + +def main(): + representatives = enumerate_alphabet() + # Each target may have an arbitrary independent choice of scalar lift. + targets = [phase(a, UNITS[i % 4]) for i, a in enumerate(representatives)] + terms = inversion_terms() + faults = {"top-term dropped": terms[:-1], + "sign of lines reversed": [(abs(w), p) for w, p in terms], + "bad code column": [*terms[:-1], (2, (1,) + terms[-1][1][1:])]} + rejected = set() + literal_cases = 0 + literal_coefficients = 0 + checked_widths = (17, 18, 19, 20) + expanded_shapes = set() + for a, target in enumerate(targets): + rows = coordinate_rows(target) + # Include one sparse and one flat source matrix in tensor-row + # expansion. All source matrices are checked by direct evaluation. + literal = None + nonzero = sum(z != ZERO for z in target) + if nonzero not in expanded_shapes: + expanded_shapes.add(nonzero) + literal = literal_tensor_row(rows, terms) + literal_coefficients += len(literal) + for b, other in enumerate(targets): + points = [inner(row, other) for row in rows] + canonical = evaluate(points, terms) + for bug, mutated in faults.items(): + if bug not in rejected and evaluate(points, mutated) != canonical: + rejected.add(bug) + if literal is not None: + entry = ZERO + for address, value in literal.items(): + entry = add(entry, mul(value, literal_column_entry(other, address))) + check(entry == canonical, "literal tensor contraction mismatch") + literal_cases += 1 + for unit in UNITS: + actual = [mul(unit, p) for p in points] + base = evaluate(actual, terms) + for width in checked_widths: + recovered = mul(base, power(actual[0], width - 17)) + expected = scale(power(unit, width), 8**width) if a == b else ZERO + check(recovered == expected, "incorrect normalized left-inverse entry") + check(rejected == set(faults), "a faulty construction survived the calibration") + check(expanded_shapes == {2, 4} and literal_cases == 48 and literal_coefficients > 0, + "missing sparse or flat literal tensor coverage") + print("PASS_INDEPENDENT_CLIFFORD_MOBIUS", + f"cosets={len(targets)} gauge_pairs={len(targets)**2*len(UNITS)}", + f"normalized_width_checks={len(targets)**2*len(UNITS)*len(checked_widths)}", + f"literal_entries={literal_cases} literal_coefficients={literal_coefficients}", + f"mutants_rejected={len(rejected)}") + + +if __name__ == "__main__": + main() diff --git a/research/clifford-width17/references/conditioning-result.json b/research/clifford-width17/references/conditioning-result.json new file mode 100644 index 0000000000..039f22ba0b --- /dev/null +++ b/research/clifford-width17/references/conditioning-result.json @@ -0,0 +1,1519 @@ +{ + "source_files": 18, + "projective_order": 12128668876800, + "width": 13, + "rows": [ + { + "row": 1, + "quotient_degree": 1, + "multiplicity": 651, + "clifford_degree": 16, + "regular_dimension": 256, + "eigenvalue": [ + 470624175, + 4294967296 + ] + }, + { + "row": 2, + "quotient_degree": 35, + "multiplicity": 1518660, + "clifford_degree": 560, + "regular_dimension": 313600, + "eigenvalue": [ + 7841980575, + 1073741824 + ] + }, + { + "row": 3, + "quotient_degree": 51, + "multiplicity": 1611753, + "clifford_degree": 816, + "regular_dimension": 665856, + "eigenvalue": [ + 22846598775, + 4294967296 + ] + }, + { + "row": 4, + "quotient_degree": 85, + "multiplicity": 3148145, + "clifford_degree": 1360, + "regular_dimension": 1849600, + "eigenvalue": [ + 26774973225, + 4294967296 + ] + }, + { + "row": 5, + "quotient_degree": 119, + "multiplicity": 118482, + "clifford_degree": 1904, + "regular_dimension": 3625216, + "eigenvalue": [ + 359889075, + 2147483648 + ] + }, + { + "row": 6, + "quotient_degree": 135, + "multiplicity": 211575, + "clifford_degree": 2160, + "regular_dimension": 4665600, + "eigenvalue": [ + 1132984125, + 4294967296 + ] + }, + { + "row": 7, + "quotient_degree": 238, + "multiplicity": 5425992, + "clifford_degree": 3808, + "regular_dimension": 14500864, + "eigenvalue": [ + 4120362675, + 1073741824 + ] + }, + { + "row": 8, + "quotient_degree": 510, + "multiplicity": 620620, + "clifford_degree": 8160, + "regular_dimension": 66585600, + "eigenvalue": [ + 439864425, + 2147483648 + ] + }, + { + "row": 9, + "quotient_degree": 595, + "multiplicity": 620620, + "clifford_degree": 9520, + "regular_dimension": 90630400, + "eigenvalue": [ + 188513325, + 1073741824 + ] + }, + { + "row": 10, + "quotient_degree": 595, + "multiplicity": 2637635, + "clifford_degree": 9520, + "regular_dimension": 90630400, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 11, + "quotient_degree": 918, + "multiplicity": 9570847, + "clifford_degree": 14688, + "regular_dimension": 215737344, + "eigenvalue": [ + 15074084025, + 8589934592 + ] + }, + { + "row": 12, + "quotient_degree": 1190, + "multiplicity": 4765475, + "clifford_degree": 19040, + "regular_dimension": 362521600, + "eigenvalue": [ + 5790052125, + 8589934592 + ] + }, + { + "row": 13, + "quotient_degree": 1275, + "multiplicity": 4765475, + "clifford_degree": 20400, + "regular_dimension": 416160000, + "eigenvalue": [ + 2702024325, + 4294967296 + ] + }, + { + "row": 14, + "quotient_degree": 1512, + "multiplicity": 28353468, + "clifford_degree": 24192, + "regular_dimension": 585252864, + "eigenvalue": [ + 27113003775, + 8589934592 + ] + }, + { + "row": 15, + "quotient_degree": 1785, + "multiplicity": 22608300, + "clifford_degree": 28560, + "regular_dimension": 815673600, + "eigenvalue": [ + 2289090375, + 1073741824 + ] + }, + { + "row": 16, + "quotient_degree": 1785, + "multiplicity": 3878875, + "clifford_degree": 28560, + "regular_dimension": 815673600, + "eigenvalue": [ + 1570944375, + 4294967296 + ] + }, + { + "row": 17, + "quotient_degree": 2295, + "multiplicity": 38434110, + "clifford_degree": 36720, + "regular_dimension": 1348358400, + "eigenvalue": [ + 6053372325, + 2147483648 + ] + }, + { + "row": 18, + "quotient_degree": 2856, + "multiplicity": 4592588, + "clifford_degree": 45696, + "regular_dimension": 2088124416, + "eigenvalue": [ + 2324997675, + 8589934592 + ] + }, + { + "row": 19, + "quotient_degree": 2856, + "multiplicity": 36173280, + "clifford_degree": 45696, + "regular_dimension": 2088124416, + "eigenvalue": [ + 2289090375, + 1073741824 + ] + }, + { + "row": 20, + "quotient_degree": 2975, + "multiplicity": 28260375, + "clifford_degree": 47600, + "regular_dimension": 2265760000, + "eigenvalue": [ + 6867271125, + 4294967296 + ] + }, + { + "row": 21, + "quotient_degree": 2975, + "multiplicity": 42578965, + "clifford_degree": 47600, + "regular_dimension": 2265760000, + "eigenvalue": [ + 10346688495, + 4294967296 + ] + }, + { + "row": 22, + "quotient_degree": 3213, + "multiplicity": 6330324, + "clifford_degree": 51408, + "regular_dimension": 2642782464, + "eigenvalue": [ + 356080725, + 1073741824 + ] + }, + { + "row": 23, + "quotient_degree": 3213, + "multiplicity": 49512177, + "clifford_degree": 51408, + "regular_dimension": 2642782464, + "eigenvalue": [ + 11140239825, + 4294967296 + ] + }, + { + "row": 24, + "quotient_degree": 3400, + "multiplicity": 7757750, + "clifford_degree": 54400, + "regular_dimension": 2959360000, + "eigenvalue": [ + 6597966375, + 17179869184 + ] + }, + { + "row": 25, + "quotient_degree": 3570, + "multiplicity": 15825810, + "clifford_degree": 57120, + "regular_dimension": 3262694400, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 26, + "quotient_degree": 3570, + "multiplicity": 7757750, + "clifford_degree": 57120, + "regular_dimension": 3262694400, + "eigenvalue": [ + 1570944375, + 4294967296 + ] + }, + { + "row": 27, + "quotient_degree": 3570, + "multiplicity": 45216600, + "clifford_degree": 57120, + "regular_dimension": 3262694400, + "eigenvalue": [ + 2289090375, + 1073741824 + ] + }, + { + "row": 28, + "quotient_degree": 3808, + "multiplicity": 42503604, + "clifford_degree": 60928, + "regular_dimension": 3712221184, + "eigenvalue": [ + 64552348575, + 34359738368 + ] + }, + { + "row": 29, + "quotient_degree": 4200, + "multiplicity": 12412400, + "clifford_degree": 67200, + "regular_dimension": 4515840000, + "eigenvalue": [ + 1068242175, + 2147483648 + ] + }, + { + "row": 30, + "quotient_degree": 4760, + "multiplicity": 10550540, + "clifford_degree": 76160, + "regular_dimension": 5800345600, + "eigenvalue": [ + 3204726525, + 8589934592 + ] + }, + { + "row": 31, + "quotient_degree": 5712, + "multiplicity": 29089346, + "clifford_degree": 91392, + "regular_dimension": 8352497664, + "eigenvalue": [ + 29452962825, + 34359738368 + ] + }, + { + "row": 32, + "quotient_degree": 5950, + "multiplicity": 56520750, + "clifford_degree": 95200, + "regular_dimension": 9063040000, + "eigenvalue": [ + 6867271125, + 4294967296 + ] + }, + { + "row": 33, + "quotient_degree": 5950, + "multiplicity": 39564525, + "clifford_degree": 95200, + "regular_dimension": 9063040000, + "eigenvalue": [ + 9614179575, + 8589934592 + ] + }, + { + "row": 34, + "quotient_degree": 7140, + "multiplicity": 51622285, + "clifford_degree": 114240, + "regular_dimension": 13050777600, + "eigenvalue": [ + 20907025425, + 17179869184 + ] + }, + { + "row": 35, + "quotient_degree": 8160, + "multiplicity": 67824900, + "clifford_degree": 130560, + "regular_dimension": 17045913600, + "eigenvalue": [ + 48070897875, + 34359738368 + ] + }, + { + "row": 36, + "quotient_degree": 8925, + "multiplicity": 26376350, + "clifford_degree": 142800, + "regular_dimension": 20391840000, + "eigenvalue": [ + 1068242175, + 2147483648 + ] + }, + { + "row": 37, + "quotient_degree": 8925, + "multiplicity": 62172825, + "clifford_degree": 142800, + "regular_dimension": 20391840000, + "eigenvalue": [ + 5035998825, + 4294967296 + ] + }, + { + "row": 38, + "quotient_degree": 8960, + "multiplicity": 106392000, + "clifford_degree": 143360, + "regular_dimension": 20552089600, + "eigenvalue": [ + 34336355625, + 17179869184 + ] + }, + { + "row": 39, + "quotient_degree": 9639, + "multiplicity": 42729687, + "clifford_degree": 154224, + "regular_dimension": 23785042176, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 40, + "quotient_degree": 10200, + "multiplicity": 113041500, + "clifford_degree": 163200, + "regular_dimension": 26634240000, + "eigenvalue": [ + 16023632625, + 8589934592 + ] + }, + { + "row": 41, + "quotient_degree": 11900, + "multiplicity": 52752700, + "clifford_degree": 190400, + "regular_dimension": 36252160000, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 42, + "quotient_degree": 11900, + "multiplicity": 79129050, + "clifford_degree": 190400, + "regular_dimension": 36252160000, + "eigenvalue": [ + 9614179575, + 8589934592 + ] + }, + { + "row": 43, + "quotient_degree": 13056, + "multiplicity": 33761728, + "clifford_degree": 208896, + "regular_dimension": 43637538816, + "eigenvalue": [ + 7477695225, + 17179869184 + ] + }, + { + "row": 44, + "quotient_degree": 13600, + "multiplicity": 82897100, + "clifford_degree": 217600, + "regular_dimension": 47349760000, + "eigenvalue": [ + 35251991775, + 34359738368 + ] + }, + { + "row": 45, + "quotient_degree": 14280, + "multiplicity": 63303240, + "clifford_degree": 228480, + "regular_dimension": 52203110400, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 46, + "quotient_degree": 14280, + "multiplicity": 137910630, + "clifford_degree": 228480, + "regular_dimension": 52203110400, + "eigenvalue": [ + 27926902575, + 17179869184 + ] + }, + { + "row": 47, + "quotient_degree": 14688, + "multiplicity": 48532484, + "clifford_degree": 235008, + "regular_dimension": 55228760064, + "eigenvalue": [ + 19109665575, + 34359738368 + ] + }, + { + "row": 48, + "quotient_degree": 16065, + "multiplicity": 55390335, + "clifford_degree": 257040, + "regular_dimension": 66069561600, + "eigenvalue": [ + 2492565075, + 4294967296 + ] + }, + { + "row": 49, + "quotient_degree": 16065, + "multiplicity": 65940875, + "clifford_degree": 257040, + "regular_dimension": 66069561600, + "eigenvalue": [ + 2967339375, + 4294967296 + ] + }, + { + "row": 50, + "quotient_degree": 16065, + "multiplicity": 87041955, + "clifford_degree": 257040, + "regular_dimension": 66069561600, + "eigenvalue": [ + 3916887975, + 4294967296 + ] + }, + { + "row": 51, + "quotient_degree": 16065, + "multiplicity": 169562250, + "clifford_degree": 257040, + "regular_dimension": 66069561600, + "eigenvalue": [ + 3815150625, + 2147483648 + ] + }, + { + "row": 52, + "quotient_degree": 16065, + "multiplicity": 118693575, + "clifford_degree": 257040, + "regular_dimension": 66069561600, + "eigenvalue": [ + 5341210875, + 4294967296 + ] + }, + { + "row": 53, + "quotient_degree": 17850, + "multiplicity": 52752700, + "clifford_degree": 285600, + "regular_dimension": 81567360000, + "eigenvalue": [ + 1068242175, + 2147483648 + ] + }, + { + "row": 54, + "quotient_degree": 17850, + "multiplicity": 124345650, + "clifford_degree": 285600, + "regular_dimension": 81567360000, + "eigenvalue": [ + 5035998825, + 4294967296 + ] + }, + { + "row": 55, + "quotient_degree": 18360, + "multiplicity": 93447640, + "clifford_degree": 293760, + "regular_dimension": 86294937600, + "eigenvalue": [ + 3679500825, + 4294967296 + ] + }, + { + "row": 56, + "quotient_degree": 19040, + "multiplicity": 73853780, + "clifford_degree": 304640, + "regular_dimension": 92805529600, + "eigenvalue": [ + 22433085675, + 34359738368 + ] + }, + { + "row": 57, + "quotient_degree": 23800, + "multiplicity": 195938600, + "clifford_degree": 380800, + "regular_dimension": 145008640000, + "eigenvalue": [ + 5951634975, + 4294967296 + ] + }, + { + "row": 58, + "quotient_degree": 23800, + "multiplicity": 226083000, + "clifford_degree": 380800, + "regular_dimension": 145008640000, + "eigenvalue": [ + 6867271125, + 4294967296 + ] + }, + { + "row": 59, + "quotient_degree": 26775, + "multiplicity": 254343375, + "clifford_degree": 428400, + "regular_dimension": 183526560000, + "eigenvalue": [ + 6867271125, + 4294967296 + ] + }, + { + "row": 60, + "quotient_degree": 26775, + "multiplicity": 118693575, + "clifford_degree": 428400, + "regular_dimension": 183526560000, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 61, + "quotient_degree": 28560, + "multiplicity": 158258100, + "clifford_degree": 456960, + "regular_dimension": 208812441600, + "eigenvalue": [ + 16023632625, + 17179869184 + ] + }, + { + "row": 62, + "quotient_degree": 28917, + "multiplicity": 250273881, + "clifford_degree": 462672, + "regular_dimension": 214065379584, + "eigenvalue": [ + 6256847025, + 4294967296 + ] + }, + { + "row": 63, + "quotient_degree": 30464, + "multiplicity": 231508992, + "clifford_degree": 487424, + "regular_dimension": 237582155776, + "eigenvalue": [ + 1373454225, + 1073741824 + ] + }, + { + "row": 64, + "quotient_degree": 32130, + "multiplicity": 131881750, + "clifford_degree": 514080, + "regular_dimension": 264278246400, + "eigenvalue": [ + 2967339375, + 4294967296 + ] + }, + { + "row": 65, + "quotient_degree": 32130, + "multiplicity": 166171005, + "clifford_degree": 514080, + "regular_dimension": 264278246400, + "eigenvalue": [ + 7477695225, + 8589934592 + ] + }, + { + "row": 66, + "quotient_degree": 32130, + "multiplicity": 237387150, + "clifford_degree": 514080, + "regular_dimension": 264278246400, + "eigenvalue": [ + 5341210875, + 4294967296 + ] + }, + { + "row": 67, + "quotient_degree": 34425, + "multiplicity": 118693575, + "clifford_degree": 550800, + "regular_dimension": 303380640000, + "eigenvalue": [ + 2492565075, + 4294967296 + ] + }, + { + "row": 68, + "quotient_degree": 34425, + "multiplicity": 254343375, + "clifford_degree": 550800, + "regular_dimension": 303380640000, + "eigenvalue": [ + 5341210875, + 4294967296 + ] + }, + { + "row": 69, + "quotient_degree": 34560, + "multiplicity": 158878720, + "clifford_degree": 552960, + "regular_dimension": 305764761600, + "eigenvalue": [ + 830855025, + 1073741824 + ] + }, + { + "row": 70, + "quotient_degree": 38080, + "multiplicity": 168808640, + "clifford_degree": 609280, + "regular_dimension": 371222118400, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 71, + "quotient_degree": 38556, + "multiplicity": 170918748, + "clifford_degree": 616896, + "regular_dimension": 380560674816, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 72, + "quotient_degree": 42525, + "multiplicity": 314188875, + "clifford_degree": 680400, + "regular_dimension": 462944160000, + "eigenvalue": [ + 5341210875, + 4294967296 + ] + }, + { + "row": 73, + "quotient_degree": 42525, + "multiplicity": 314188875, + "clifford_degree": 680400, + "regular_dimension": 462944160000, + "eigenvalue": [ + 5341210875, + 4294967296 + ] + }, + { + "row": 74, + "quotient_degree": 43520, + "multiplicity": 265270720, + "clifford_degree": 696320, + "regular_dimension": 484861542400, + "eigenvalue": [ + 35251991775, + 34359738368 + ] + }, + { + "row": 75, + "quotient_degree": 47600, + "multiplicity": 316516200, + "clifford_degree": 761600, + "regular_dimension": 580034560000, + "eigenvalue": [ + 9614179575, + 8589934592 + ] + }, + { + "row": 76, + "quotient_degree": 48195, + "multiplicity": 213648435, + "clifford_degree": 771120, + "regular_dimension": 594626054400, + "eigenvalue": [ + 3204726525, + 4294967296 + ] + }, + { + "row": 77, + "quotient_degree": 51408, + "multiplicity": 322846524, + "clifford_degree": 822528, + "regular_dimension": 676552310784, + "eigenvalue": [ + 18160116975, + 17179869184 + ] + }, + { + "row": 78, + "quotient_degree": 53550, + "multiplicity": 356080725, + "clifford_degree": 856800, + "regular_dimension": 734106240000, + "eigenvalue": [ + 9614179575, + 8589934592 + ] + }, + { + "row": 79, + "quotient_degree": 57120, + "multiplicity": 316516200, + "clifford_degree": 913920, + "regular_dimension": 835249766400, + "eigenvalue": [ + 16023632625, + 17179869184 + ] + }, + { + "row": 80, + "quotient_degree": 65536, + "multiplicity": 381308928, + "clifford_degree": 1048576, + "regular_dimension": 1099511627776, + "eigenvalue": [ + 67299257025, + 68719476736 + ] + }, + { + "row": 81, + "quotient_degree": 68850, + "multiplicity": 356080725, + "clifford_degree": 1101600, + "regular_dimension": 1213522560000, + "eigenvalue": [ + 7477695225, + 8589934592 + ] + } + ], + "distinct_levels": [ + { + "eigenvalue": [ + 470624175, + 4294967296 + ], + "rows": [ + 1 + ], + "eigenspace_dimension": 256 + }, + { + "eigenvalue": [ + 359889075, + 2147483648 + ], + "rows": [ + 5 + ], + "eigenspace_dimension": 3625216 + }, + { + "eigenvalue": [ + 188513325, + 1073741824 + ], + "rows": [ + 9 + ], + "eigenspace_dimension": 90630400 + }, + { + "eigenvalue": [ + 439864425, + 2147483648 + ], + "rows": [ + 8 + ], + "eigenspace_dimension": 66585600 + }, + { + "eigenvalue": [ + 1132984125, + 4294967296 + ], + "rows": [ + 6 + ], + "eigenspace_dimension": 4665600 + }, + { + "eigenvalue": [ + 2324997675, + 8589934592 + ], + "rows": [ + 18 + ], + "eigenspace_dimension": 2088124416 + }, + { + "eigenvalue": [ + 356080725, + 1073741824 + ], + "rows": [ + 22 + ], + "eigenspace_dimension": 2642782464 + }, + { + "eigenvalue": [ + 1570944375, + 4294967296 + ], + "rows": [ + 16, + 26 + ], + "eigenspace_dimension": 4078368000 + }, + { + "eigenvalue": [ + 3204726525, + 8589934592 + ], + "rows": [ + 30 + ], + "eigenspace_dimension": 5800345600 + }, + { + "eigenvalue": [ + 6597966375, + 17179869184 + ], + "rows": [ + 24 + ], + "eigenspace_dimension": 2959360000 + }, + { + "eigenvalue": [ + 7477695225, + 17179869184 + ], + "rows": [ + 43 + ], + "eigenspace_dimension": 43637538816 + }, + { + "eigenvalue": [ + 1068242175, + 2147483648 + ], + "rows": [ + 29, + 36, + 53 + ], + "eigenspace_dimension": 106475040000 + }, + { + "eigenvalue": [ + 19109665575, + 34359738368 + ], + "rows": [ + 47 + ], + "eigenspace_dimension": 55228760064 + }, + { + "eigenvalue": [ + 2492565075, + 4294967296 + ], + "rows": [ + 48, + 67 + ], + "eigenspace_dimension": 369450201600 + }, + { + "eigenvalue": [ + 2702024325, + 4294967296 + ], + "rows": [ + 13 + ], + "eigenspace_dimension": 416160000 + }, + { + "eigenvalue": [ + 22433085675, + 34359738368 + ], + "rows": [ + 56 + ], + "eigenspace_dimension": 92805529600 + }, + { + "eigenvalue": [ + 5790052125, + 8589934592 + ], + "rows": [ + 12 + ], + "eigenspace_dimension": 362521600 + }, + { + "eigenvalue": [ + 2967339375, + 4294967296 + ], + "rows": [ + 49, + 64 + ], + "eigenspace_dimension": 330347808000 + }, + { + "eigenvalue": [ + 3204726525, + 4294967296 + ], + "rows": [ + 10, + 25, + 39, + 41, + 45, + 60, + 70, + 71, + 76 + ], + "eigenspace_dimension": 1645529044992 + }, + { + "eigenvalue": [ + 830855025, + 1073741824 + ], + "rows": [ + 69 + ], + "eigenspace_dimension": 305764761600 + }, + { + "eigenvalue": [ + 3679500825, + 4294967296 + ], + "rows": [ + 55 + ], + "eigenspace_dimension": 86294937600 + }, + { + "eigenvalue": [ + 29452962825, + 34359738368 + ], + "rows": [ + 31 + ], + "eigenspace_dimension": 8352497664 + }, + { + "eigenvalue": [ + 7477695225, + 8589934592 + ], + "rows": [ + 65, + 81 + ], + "eigenspace_dimension": 1477800806400 + }, + { + "eigenvalue": [ + 3916887975, + 4294967296 + ], + "rows": [ + 50 + ], + "eigenspace_dimension": 66069561600 + }, + { + "eigenvalue": [ + 16023632625, + 17179869184 + ], + "rows": [ + 61, + 79 + ], + "eigenspace_dimension": 1044062208000 + }, + { + "eigenvalue": [ + 67299257025, + 68719476736 + ], + "rows": [ + 80 + ], + "eigenspace_dimension": 1099511627776 + }, + { + "eigenvalue": [ + 35251991775, + 34359738368 + ], + "rows": [ + 44, + 74 + ], + "eigenspace_dimension": 532211302400 + }, + { + "eigenvalue": [ + 18160116975, + 17179869184 + ], + "rows": [ + 77 + ], + "eigenspace_dimension": 676552310784 + }, + { + "eigenvalue": [ + 9614179575, + 8589934592 + ], + "rows": [ + 33, + 42, + 75, + 78 + ], + "eigenspace_dimension": 1359456000000 + }, + { + "eigenvalue": [ + 5035998825, + 4294967296 + ], + "rows": [ + 37, + 54 + ], + "eigenspace_dimension": 101959200000 + }, + { + "eigenvalue": [ + 20907025425, + 17179869184 + ], + "rows": [ + 34 + ], + "eigenspace_dimension": 13050777600 + }, + { + "eigenvalue": [ + 5341210875, + 4294967296 + ], + "rows": [ + 52, + 66, + 68, + 72, + 73 + ], + "eigenspace_dimension": 1559616768000 + }, + { + "eigenvalue": [ + 1373454225, + 1073741824 + ], + "rows": [ + 63 + ], + "eigenspace_dimension": 237582155776 + }, + { + "eigenvalue": [ + 5951634975, + 4294967296 + ], + "rows": [ + 57 + ], + "eigenspace_dimension": 145008640000 + }, + { + "eigenvalue": [ + 48070897875, + 34359738368 + ], + "rows": [ + 35 + ], + "eigenspace_dimension": 17045913600 + }, + { + "eigenvalue": [ + 6256847025, + 4294967296 + ], + "rows": [ + 62 + ], + "eigenspace_dimension": 214065379584 + }, + { + "eigenvalue": [ + 6867271125, + 4294967296 + ], + "rows": [ + 20, + 32, + 58, + 59 + ], + "eigenspace_dimension": 339864000000 + }, + { + "eigenvalue": [ + 27926902575, + 17179869184 + ], + "rows": [ + 46 + ], + "eigenspace_dimension": 52203110400 + }, + { + "eigenvalue": [ + 15074084025, + 8589934592 + ], + "rows": [ + 11 + ], + "eigenspace_dimension": 215737344 + }, + { + "eigenvalue": [ + 3815150625, + 2147483648 + ], + "rows": [ + 51 + ], + "eigenspace_dimension": 66069561600 + }, + { + "eigenvalue": [ + 16023632625, + 8589934592 + ], + "rows": [ + 40 + ], + "eigenspace_dimension": 26634240000 + }, + { + "eigenvalue": [ + 64552348575, + 34359738368 + ], + "rows": [ + 28 + ], + "eigenspace_dimension": 3712221184 + }, + { + "eigenvalue": [ + 34336355625, + 17179869184 + ], + "rows": [ + 38 + ], + "eigenspace_dimension": 20552089600 + }, + { + "eigenvalue": [ + 2289090375, + 1073741824 + ], + "rows": [ + 15, + 19, + 27 + ], + "eigenspace_dimension": 6166492416 + }, + { + "eigenvalue": [ + 10346688495, + 4294967296 + ], + "rows": [ + 21 + ], + "eigenspace_dimension": 2265760000 + }, + { + "eigenvalue": [ + 11140239825, + 4294967296 + ], + "rows": [ + 23 + ], + "eigenspace_dimension": 2642782464 + }, + { + "eigenvalue": [ + 6053372325, + 2147483648 + ], + "rows": [ + 17 + ], + "eigenspace_dimension": 1348358400 + }, + { + "eigenvalue": [ + 27113003775, + 8589934592 + ], + "rows": [ + 14 + ], + "eigenspace_dimension": 585252864 + }, + { + "eigenvalue": [ + 4120362675, + 1073741824 + ], + "rows": [ + 7 + ], + "eigenspace_dimension": 14500864 + }, + { + "eigenvalue": [ + 22846598775, + 4294967296 + ], + "rows": [ + 3 + ], + "eigenspace_dimension": 665856 + }, + { + "eigenvalue": [ + 26774973225, + 4294967296 + ], + "rows": [ + 4 + ], + "eigenspace_dimension": 1849600 + }, + { + "eigenvalue": [ + 7841980575, + 1073741824 + ], + "rows": [ + 2 + ], + "eigenspace_dimension": 313600 + } + ], + "minimum": [ + 470624175, + 4294967296 + ], + "maximum": [ + 7841980575, + 1073741824 + ], + "minimum_dimension": 256, + "maximum_dimension": 313600, + "gram_condition": [ + 101244, + 1519 + ], + "inverse_squared_norm": [ + 4294967296, + 470624175 + ], + "second_moment": [ + 930080652310818734947227759375, + 72057594037927936 + ], + "one_qubit_calibration": { + "projective_elements": 24, + "closure_products": 576, + "quotient_character_counts": [ + [ + -64, + 12 + ], + [ + 1, + 8 + ], + [ + 4096, + 4 + ] + ], + "multiplicities": [ + 651, + 715, + 1365 + ], + "eigenvalues": [ + [ + 1953, + 2048 + ], + [ + 2145, + 2048 + ], + [ + 4095, + 4096 + ] + ], + "eigenspace_dimensions": [ + 4, + 4, + 16 + ], + "gram_second_moment": [ + 25184259, + 1048576 + ], + "literal_cubic_annihilator": true, + "normalization_controls": 3 + } +} diff --git a/research/clifford-width17/verify.py b/research/clifford-width17/verify.py new file mode 100644 index 0000000000..49ac3ef043 --- /dev/null +++ b/research/clifford-width17/verify.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python3 +"""Exact finite checks of the width-17 four-qubit Clifford interpolant.""" + +from collections import Counter +from itertools import combinations, product + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def mobius(rank): + return (-1) ** rank * (1 << (rank * (rank - 1) // 2)) + + +def subspaces(bits): + """Enumerate unique reduced-row-echelon bases, with low-bit pivots.""" + for rank in range(bits + 1): + for pivots in combinations(range(bits), rank): + choices = [] + for pivot in pivots: + row_options = [1 << pivot] + for column in range(pivot + 1, bits): + if column not in pivots: + row_options += [row | (1 << column) for row in row_options] + choices.append(row_options) + yield from product(*choices) + + +def span(basis): + values = [0] + for row in basis: + values += [value ^ row for value in values] + return values + + +def affine_cube(x, y, z, offset): + return (offset, offset ^ x, offset ^ y, offset ^ x ^ y, + offset ^ z, offset ^ z ^ x, offset ^ z ^ y, offset ^ z ^ x ^ y) + + +def code_columns(basis): + # Each block evaluates u1, u2, u3, 1 at all eight binary triples. + rows = basis + (0,) * (8 - len(basis)) + return affine_cube(*rows[:4]) + affine_cube(*rows[4:]) + + +def row_masks(columns, dim): + return tuple(sum(((point >> j) & 1) << t for t, point in enumerate(columns)) + for j in range(dim)) + + +def verify_code(): + checked_pairs = 0 + for dim in range(9): + units = tuple(1 << j for j in range(dim)) + columns = code_columns(units) + masks = row_masks(columns, dim) + words = span(masks) + require(len(set(words)) == 1 << dim, "rank-deficient shortened generator") + require(all(w.bit_count() % 4 == 0 for w in words), "quarter phase survives") + for a, b in combinations(masks, 2): + require((a & b).bit_count() % 2 == 0, "quadratic phase survives") + checked_pairs += 1 + if dim < 8: + require(0 in columns, "shortened generator lacks its zero column") + return checked_pairs + + +# Gaussian integer pairs. Each test operator carries a common positive denominator. +ONE = (1, 0) +I = (0, 1) +ZERO = (0, 0) + + +def times(a, b): + return a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0] + + +def conjugate(a): + return a[0], -a[1] + + +def kron(a, b): + return [[times(x, y) for x in row_a for y in row_b] + for row_a in a for row_b in b] + + +def tensor(factors): + result = [[ONE]] + for matrix in factors: + result = kron(result, matrix) + return result + + +def relative_matrix(a, b): + """Literal matrix product a* b for Gaussian integer numerator matrices.""" + output = [] + for ca in zip(*a): + row = [] + for cb in zip(*b): + values = [times(conjugate(x), y) for x, y in zip(ca, cb)] + row.append(tuple(map(sum, zip(*values)))) + output.append(row) + return output + + +def bell(matrix): + # Entry at (shift a, Fourier index b) of the unprepared normalized Choi state. + # Suppress the common positive denominator 16 times the matrix denominator. + result = [] + for b in range(16): + for a in range(16): + real = imag = 0 + for x in range(16): + sign = (-1) ** ((b & x).bit_count() % 2) + u, v = matrix[x ^ a][x] + real += sign * u + imag += sign * v + result.append((real, imag)) + return result + + +def phase_profile(vector): + """Return support and phase relative to its first nonzero amplitude.""" + first = next(z for z in vector if z != ZERO) + rotations = [first] + for _ in range(3): + rotations.append(times(rotations[-1], I)) + lookup = {phase: k for k, phase in enumerate(rotations)} + require(all(z == ZERO or z in lookup for z in vector), "unequal moduli/phase cosets") + return [None if z == ZERO else lookup[z] for z in vector] + + +def basis_of_linear_support(support): + require(0 in support, "linear support misses origin") + reached = {0} + basis = [] + for x in sorted(support): + if x not in reached: + basis.append(x) + reached |= {y ^ x for y in reached} + require(reached == support, "support through zero is not a flat") + return tuple(basis) + + +def literal_detector(phase, check_full): + # Skip K outside the support: their 16 evaluation points span K, so at + # least one amplitude vanishes. Evaluate every surviving ordered monomial. + if phase[0] is None: + return (0, 0) + support = {j for j, exponent in enumerate(phase) if exponent is not None} + basis = basis_of_linear_support(support) + images = span(basis) + by_phase = [0] * 4 + for sub in subspaces(len(basis)): + actual = tuple(images[combination] for combination in sub) + columns = code_columns(actual) + exponent = sum(phase[x] for x in columns) % 4 + require(exponent == 0, "nonzero phase on a supported code tuple") + by_phase[exponent] += mobius(len(sub)) + if check_full is not None: + check_full[len(sub)] += 1 + return by_phase[0] - by_phase[2], by_phase[1] - by_phase[3] + + +def actual_matrices(): + identity = [[ONE, ZERO], [ZERO, ONE]] + x = [[ZERO, ONE], [ONE, ZERO]] + s = [[ONE, ZERO], [ZERO, I]] + # h = (1+i) H/sqrt(2), represented by its numerator over 2: + # h = (1+i)[[1,1],[1,-1]]/2. Its global phase is immaterial. + h = [[(1, 1), (1, 1)], [(1, 1), (-1, -1)]] + hs = [[(1, 1), (-1, 1)], [(1, 1), (1, -1)]] + cnot = [[ONE if row == (col ^ ((col >> 1) & 1)) else ZERO + for col in range(16)] for row in range(16)] + return [ + ("identity", tensor([identity] * 4), 1), + ("Pauli X", tensor([identity] * 3 + [x]), 1), + ("phase", tensor([identity] * 3 + [s]), 1), + ("CNOT", cnot, 1), + ("four Hadamards", tensor([h] * 4), 16), + ("four HS gates", tensor([hs] * 4), 16), + ("Hadamard and three HS gates", tensor([h, hs, hs, hs]), 16), + ] + + +def verify_matrices(): + fixtures = actual_matrices() + full_counts = Counter() + support_sizes = [] + comparisons = 0 + for i, (source, a, da) in enumerate(fixtures): + for j, (target, b, db) in enumerate(fixtures): + vector = bell(relative_matrix(a, b)) + # Norm one including the suppressed common denominator. + require(sum(u*u + v*v for u, v in vector) == (16 * da * db) ** 2, + f"normalization failed: {source}, {target}") + phases = phase_profile(vector) + support = {position for position, phase in enumerate(phases) if phase is not None} + origin = min(support) + basis_of_linear_support({x ^ origin for x in support}) + if i == 0: + support_sizes.append(len(support)) + if i == j: + require(vector[0] == (16 * da * db, 0) and support == {0}, + "target maps to e0") + counts = full_counts if (i, j) == (0, 5) else None + result = literal_detector(phases, counts) + require(result == (int(i == j), 0), f"decoder failed: {source}, {target}") + comparisons += 1 + require(support_sizes == [1, 1, 2, 4, 16, 256, 128], "literal support sizes") + require(sum(full_counts.values()) == 417199, "eight-axis subspace count") + norm_squared = sum(count * mobius(k) ** 2 for k, count in full_counts.items()) + require(norm_squared == 73190789644335724, "ordered row squared norm") + return comparisons, full_counts, norm_squared + + +def controls(): + # A shifted hyperplane containing all points of the full 16-word generator. + # Shorter prefixes all include zero, which is outside this flat. + plane = {x for x in range(256) if (x & 136).bit_count() % 2} + _, matrix, _ = actual_matrices()[-1] + phase = phase_profile(bell(matrix)) + require({x for x in range(256) if phase[x] is not None} == plane, + "literal H tensor (HS)^3 does not give the anchor hyperplane") + full_points = code_columns(tuple(1 << j for j in range(8))) + require(all(phase[x] is not None for x in full_points), + "full code tuple misses a nonzero literal amplitude") + # Work relative to the first nonzero amplitude raised to the 16th power. + # Ranks 0..7 contribute zero because their tuple has a zero coordinate. + root = (ONE, I, (-1, 0), (0, -1))[sum(phase[x] for x in full_points) % 4] + unanchored = times((mobius(8), 0), root) + require(sum(t*t for t in unanchored) == 1 << 56 + and literal_detector(phase, None) == ZERO, "missing-anchor variant escaped") + # One lost generator coordinate already leaks a linear quarter phase. + full = code_columns(tuple(1 << j for j in range(8))) + bad = list(full) + bad[0] = 0 + require(sum((x >> 3) & 1 for x in bad) % 4 != 0, "bad weight escaped") + # Two weight-four rows can share a single entry unless orthogonality is checked. + pair = (0b00001111, 0b01110001) + require(all(x.bit_count() == 4 for x in pair) + and (2 * (pair[0] & pair[1]).bit_count()) % 4 == 2, "bad overlap escaped") + # Evaluate the unsigned variant on the flat indicator for {0,1}. + line = {0, 1} + unsigned = sum(abs(mobius(len(sub))) for sub in subspaces(1) + if all(x in line for x in code_columns(sub))) + line_profile = [0 if x in line else None for x in range(256)] + require(unsigned == 2 and literal_detector(line_profile, None) == ZERO, + "unsigned Möbius variant escaped") + # A rank-deficient generator fails the span implication used to discard flats. + require(len(set(span(row_masks((0,) * 16, 1)))) != 2, "zero-row variant escaped") + return 5 + + +def main(): + checked_pairs = verify_code() + comparisons, counts, norm_squared = verify_matrices() + rejected = controls() + print(f"PASS_CLIFFORD_WIDTH17 code_pair_checks={checked_pairs}" + f" literal_matrices=7 relative_matrices=49 decoder_checks={comparisons}" + f" flats_by_dimension={','.join(str(counts[k]) for k in range(9))}" + f" full_support_tuples={sum(counts.values())} row_norm_squared={norm_squared}" + f" rejecting_controls={rejected}") + + +if __name__ == "__main__": + main()