Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions research/clifford-chart-contraction/INPUT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"initial":2310346608841204225,"circuit":[]}
59 changes: 59 additions & 0 deletions research/clifford-chart-contraction/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# A compact observation at the width-13 identity decoder

## Producer and observation

Fix four qubits per register, thirteen registers, and the identity-coefficient row of apoursh's #7800 at **fdc90699f4a64139ed6d84cdbf9a606ff0ccd32e**. The 104-bit computational address is the 52-bit row followed by the 52-bit column. Our producer is Ali Romman's #5704 signature constructor at width 104. Its chart has independent 104-bit columns of a linear map $D$, an offset $o$, a quadratic phase $q$ modulo four with even mixed terms, and an absolute scalar $c=(a+ib)/2^e$. It gives $Y[o+Dx]=c i^{q(x)}$ for each binary $x$ and zero elsewhere. A sum of producer charts costs a separate contraction per chart. The input contains no decomposition into the decoded Clifford columns. Global circuit phases are retained. Additions inside vector or mask arguments below are over the binary field.

Split a raw address linearly as $(S,V)$. The low twelve nibbles of $S$ are the XORs of adjacent nibbles for the six row pairs and then the six column pairs. The high nibble is the XOR of the singleton row and column. $V$ comprises the second nibble in each pair, then the row singleton. This is invertible because a pair can be reconstructed from its XOR and second nibble, and the column singleton equals the row singleton plus their XOR. The published row has 22 shift keys $s$ with zero high nibble. Its value at address $(s,v)$ is

$$2^{-12}\sum_{(w,n)\text{ at }s} n(-1)^{w\cdot v}.$$

The frozen compiler returns 4,265 terms with total absolute numerator 12,800. Other shifts have weight zero. This is a linear evaluation of $Y$ without conjugating $c$. [#7800 raw cost and weight formula](https://github.com/apoursh/integer-mult-bounds/blob/fdc90699f4a64139ed6d84cdbf9a606ff0ccd32e/research/clifford-sparse-row/COST.md)

## All shifts share the same phase spectrum

Eliminate $SD$ once. Write $K$ for a matrix of independent kernel columns and $d$ for its column count. For a consistent shift take any witness $t$ with $SDt=s+So$. The producer parameters over that shift are precisely $t+Ku$. Inconsistent shifts contribute zero. The map $VDK$ is injective because $(S,V)$ is invertible and $DK$ is injective. Thus $d\le52$, even for a producer of full rank 104.

Let $B$ be the binary symmetric polar matrix defined by

$$q(x+y)=q(x)+q(y)-q(0)+2x^TBy\pmod4.$$

Its diagonal gives the linear coefficients modulo two, and its off-diagonal entries are half the mixed coefficients. Set $p(u)=q(Ku)-q(0)$, $v_t=V(o+Dt)$, and $F(m)=\sum_u i^{p(u)}(-1)^{m\cdot u}$. Then term $(w,n)$ contributes exactly

$$\frac{cn}{4096}\,i^{q(t)}(-1)^{w\cdot v_t} F\big(K^TBt+(VDK)^Tw\big).$$

This identifies one quadratic polynomial $p$ shared by all 4,265 frequencies across all 22 address buckets.

Let $H$ be the polar matrix of $p$. For $z\in\ker H$, $p(z)$ is even by applying the polar identity to $x=y=z$. Moreover $p(z)/2$ is linear on the radical. Choose $m_0$ satisfying $m_0\cdot z=p(z)/2$ on a basis of the radical. The solutions form exactly $m_0+\operatorname{im}H$, since $H$ is symmetric. A shift by $z$ in the sum for $F(m)$ proves it vanishes outside this affine space. For $m=m_0+Hv$, shift the summation variable by $v$ to obtain

$$F(m)=i^{-p(v)}(-1)^{m_0\cdot v} F(m_0).$$

This is independent of the preimage $v$. In fact $|F(m_0)|^2=2^{d+\dim\ker H}$. In the square, pair indices $u$ and $u+z$. Summing over $u$ kills all $z$ outside the radical and the anchor cancels the remaining phases. Only $F(m_0)$ requires the credited #5727 Gauss-sum routine. Its input is $p(u)+2m_0\cdot u$. All other nonzero values are Gaussian-unit rotations of its output. An empty shift intersection skips the Gauss sum entirely.

A single **weighted Walsh cell** with independent mask rows $M$, signature $b$, and numerator $n$ is covered by the same algorithm. Replace its bucket terms by $(M^Tw,n(-1)^{b\cdot w})$ for all $w$ on the signature bits and multiply the denominator by $2^{\operatorname{rank} M}$. This is the binary character formula for the indicator $Mv=b$.

## General cost in the declared input model

The public command reads its JSON circuit file once and reports the exact byte count $L$. It builds the signature through the unchanged #5704 gate implementation, whose circuit-dependent work and gate restrictions carry over. The contraction begins at that returned chart. An observation already supplied as a chart needs its offset, scalar, independent columns and phase terms read once into working memory. Converting an arbitrary dense array to a chart is a separate problem. The unchanged #7800 program generates the 4,265 fixed terms once. A packed representation can store each frequency in 52 bits and each signed weight in nine (the absolute maximum is 128), plus 22 keys and bucket lengths. Python containers have additional object overhead.

Let $r\le104$ be the chart rank. Use words wide enough for a 104-bit binary mask. One pivot elimination of $SD$, one for $H$, and one linear system for $m_0$ suffice apart from the internals of the single scalar Gauss routine. A per-shift witness gives $v_t$, $q(t)$ and the twist $K^TBt$. Each term then takes at most $d$ parity products to project its frequency, $d$ pivot steps, and one phase evaluation on at most $1+d+\binom d2$ monomials, plus constant overhead. With the retained substitution-based implementation, a conservative total word-operation bound after row compilation and chart production is

$$O\big(r^2(d+1)^2+(d+1)^5+22(r+1)^2+4265(d+1)^2\big).$$

For the middle term the retained scalar routine eliminates at most $d$ variables. A generic substitution visits at most quadratically many old terms and expands each into at most quadratically many new ones. Peak dynamic working storage beyond the fixed compiled source tables is $O((r+1)^2+(d+1)^2+4265)$ mask/coefficient words, plus the Gaussian integers. The algorithm avoids enumeration of the $2^d$ coordinates. The unit-rotation accumulator has components at most 12,800 in absolute value. Each component of the Gauss result has absolute value at most $2^d$. Before reducing the final denominator $2^{e+12}$, each output numerator has absolute value at most $2^{d+1}12800(|a|+|b|)$, including multiplication by the producer scalar. The procedure reads the chart without mutation and can release the transient arrays on return.

## A priced active cell on a phase-mask tape

For each of the six adjacent register pairs, call the free second row and column nibbles $r_j,s_j$. On all $2^{104}$ raw addresses $A$ supply the normalized amplitude

$$Y_h[A]=2^{-52}(-1)^{\sum_{j=1}^6r_j\cdot s_j+h\cdot A},\qquad h\in\mathbb F_2^{104}.$$

These are actual #5704 outputs. Apply the positive translation root on each coordinate, then a diagonal phase cancelling the independent root phases and introducing the shown quadratic pairs and linear sign. The accumulated root scalar is $(1+i)^{104}/2^{104}=2^{-52}$. At $h=0$ exchanging a coupled second register with its uncoupled neighbor changes an amplitude. Every tensor power in the decoded alphabet is permutation-invariant, so this observation is outside their entire linear span.

Choose the source bucket with shifts $(0,0,0,0,0,4)$ on both sides, and signature 2 in its three masks (compiled values in *cell_tape.py*). The weight of this cell is $128/4096=1/32$. For each of the eight indicator frequencies $w$, the effective free-variable frequency is the XOR of $M^Tw$ and the restriction of $h$ to the free coordinates. Write its first 24 bits as $\alpha$, the next 24 as $\beta$, and its singleton as $\gamma$. Each pair contributes $16(-1)^{\alpha_j\cdot\beta_j}$ by Fourier orthogonality on one nibble. The singleton contributes 16 if $\gamma=0$ and zero otherwise. Including the $1/8$ from the indicator leaves the fixed denominator $2^{32}$. The numerator is a signed sum of at most eight units.

On a read-only binary tape supply the 104 bits of $h$ directly, in the order consumed. For each pair and bit, an adjacent quartet $(a,b,c,d)$ holds the two row and two column phase bits. The final eight symbols give the two phase bits of each singleton bit. On the corresponding free coordinates $h$ adds $a+b,c+d$, and on the shift it adds $a x'_j+c x_j$. Expanding $(\alpha+a+b)(\beta+c+d)$ in one coordinate changes $\alpha\beta$ by $(a+b)(c+d)+(a+b)\beta+(c+d)\alpha$. For each quartet this plus the shift phase is an eight-bit flip mask on the eight signs. The fixed table has 24 rows of 16 one-byte masks. Four singleton XORs select one of 16 one-byte eligibility masks. A one-byte initial phase mask includes the eight indicator and constant Fourier signs. The entire fixed lookup payload is **401 bytes** (384+16+1).

One evaluation reads exactly **104 binary symbols**, moves its input head **104 positions forward and 104 back**, writes zero input symbols, and emits an integer in $[-8,8]$ with implicit denominator $2^{32}$. With a fixed controller the mutable data include an eight-bit sign register, up to four quartet/singleton bits and a temporary incoming/partial bit. The final eligibility byte and five-bit signed output can reuse that space. Reserving these registers separately takes 26 bits (8+4+1+8+5). The fixed arithmetic uses 24 table lookups and byte XORs, one eligibility lookup, and a byte intersection, two population counts, a shift and a subtraction for the output. This is a read-only input track plus fixed local controller and ROM model. The loop counters in the executable simulate a fixed finite schedule. Clearing the local registers after copying the output restores the scratch. The 208 count prices input-head motion with no external scratch head. The producer supplies the phase bits in the stated order. The test encoder starts from a mask in a random-access word. A differently ordered caller tape entails an extra conversion. Reversible gate or selected-multiplier costs remain open.

At $h=0$ the cell gives $2^{-31}$. For the complete row on this input the same six-pair factorization and singleton selection, applied to all 4,265 raw frequencies, independently give $2^{-29}$. The chart algorithm handles this example with $d=52$, one Gauss evaluation and 603 supported frequencies. All 22 shifts are reached. The verifier also checks 137 phase masks against the general single-cell algorithm with exact head restoration.
36 changes: 36 additions & 0 deletions research/clifford-chart-contraction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# One Gauss sum for a compact width-13 Clifford observation

Given a compact 104-bit observation from Ali Romman's absolute-phase Clifford circuit simulator, this package evaluates the complete identity-coefficient row of #7800 with **at most one quadratic Gauss sum**, on at most 52 binary variables. The row's 4,265 signed terms share 22 affine address sets. All have the same linear directions. Their Fourier coefficients therefore reduce to rotations of one value, including for observations outside the Clifford-mixture span. [Proof and cost model](PROOF.md)

| Exact test | Result |
|---|---:|
| Full row on a normalized, explicitly off-image observation with support $2^{104}$ | $2^{-29}$ |
| Single active cell on that observation | $2^{-31}$ |
| Same cell on a family specified by 104 binary phase-mask symbols | 104 reads, 208 head moves, input head restored |
| Fixed lookup data for this tape consumer | 401 bytes |

The off-image example has unequal amplitudes on two inputs related by a register swap, which every vector in the Clifford-column span preserves. A separate product of six four-bit Fourier sums checks the full result. The tape count applies to one identified cell with the phase bits supplied in the declared layout. For general circuit-produced observations the package instead accounts for the chart arithmetic, precision and working storage. A selected-multiplier input supplying such a chart remains an open obligation. There is no change to κ.

## Replay and use

Run from the repository root with CPython 3.12 and its standard library.

~~~sh
python3.12 -B scripts/research_package.py --package research/clifford-chart-contraction
python3.12 -I -B research/clifford-chart-contraction/verify.py
python3.12 -I -B research/clifford-chart-contraction/verify.py --tape
python3.12 -I -B research/clifford-chart-contraction/contract.py research/clifford-chart-contraction/INPUT.json
~~~

The last example returns exactly **−1/32** for the first nonzero probe in #7800. The JSON takes a #5704 gate array in `circuit` and an optional nonnegative 104-bit computational address in `initial`. It produces the chart, evaluates the row, and reports the exact real/imaginary rational parts, input byte count, and producer/consumer counters. In Python, `contract(state)` accepts an engine signature directly. `one_cell` evaluates one explicitly weighted Walsh cell. Proof-relevant source bytes are authenticated at startup. [Frozen source index](RETAINED.json)

The verifier compares all 4,233 frequency values for all admissible phases with zero constant through dimension three against literal enumeration. It exercises 22 source-produced small-support circuits (one in each shift), four normalized 13-fold Clifford columns including global phase, the full-support off-image fixture, and 137 phase masks on the priced cell. The checks are finite evidence supplementing the general proof.

## Sources and credit

apoursh prepared this package with substantial OpenAI Codex and separate agent assistance, under Apache-2.0. apoursh's #7800 supplies the signed decoder row and its access problem, building on #7799 and the Clifford/Bell, spectral and Pauli lineage of Ali Romman, Nick Petalas and alephnan. Ali Romman's #5727 supplies the exact Gauss routine and affine solver, and #5704 supplies the compact circuit producer. Quadratic stabilizer simulation and Fourier transforms of quadratic phases are classical. The frozen source retains the original attribution and Apache license. [Signed decoder row](https://github.com/CrocSwap/integer-mult-bounds/pull/7800) · [Exact contractions](https://github.com/CrocSwap/integer-mult-bounds/pull/5727) · [Circuit signature](https://github.com/CrocSwap/integer-mult-bounds/pull/5704) · [Original notices](source/engine/source/PR5704-NOTICE.md) · [Public claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19754144)

## Open next questions

1. Does a named multiplication supplier naturally expose this phase mask or a bounded sum of these charts? Bind one producer's actual output bytes and address order, quantify chart count and acquisition, and price restoring its working state.
2. Can several target coefficients share a single elimination on a concrete producer? First derive the target's shift equations and absolute phases, then compare their kernel and polar form with the identity target's. Other coefficient rows need their own source binding.
74 changes: 74 additions & 0 deletions research/clifford-chart-contraction/RETAINED.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[
{
"local": "source/engine/INPUTS.json",
"repository": "CrocSwap/integer-mult-bounds",
"commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"path": "research/clifford-exact-contractions/INPUTS.json",
"sha256": "c62bd55fd36c136ba2ec34f6d91ed481497932fadc7134d0b7e5c10009fd588c",
"git_blob": "f9d4fd920651b002370ffb5084dbef2abaa5ed44"
},
{
"local": "source/engine/contractions.py",
"repository": "CrocSwap/integer-mult-bounds",
"commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"path": "research/clifford-exact-contractions/contractions.py",
"sha256": "a2fc065d6f293ddcffe5b6eec7fff0fdf57c8e3d4c6be355bd92e87d3f1865ef",
"git_blob": "76c807deceea0b1a6b64b50735253959b07c144d"
},
{
"local": "source/engine/source/LICENSE",
"repository": "CrocSwap/integer-mult-bounds",
"commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"path": "research/clifford-exact-contractions/source/LICENSE",
"sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64"
},
{
"local": "source/engine/source/PR5698-NOTICE.md",
"repository": "CrocSwap/integer-mult-bounds",
"commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"path": "research/clifford-exact-contractions/source/PR5698-NOTICE.md",
"sha256": "1f55b3e4bb80a60611b1fca0622da5a99fe7877446f03d0edd1dc8f3a5abadd2",
"git_blob": "56712e3195faf8c83319100065183b8b2488809d"
},
{
"local": "source/engine/source/PR5704-NOTICE.md",
"repository": "CrocSwap/integer-mult-bounds",
"commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"path": "research/clifford-exact-contractions/source/PR5704-NOTICE.md",
"sha256": "a77adc71861e3b9c73c703c5db5b671f61a1101d85d14cca08547e21d6d8dce4",
"git_blob": "b96b400e5ca04b3a9003a8b2c70a2461972d39d7"
},
{
"local": "source/engine/source/PR5704-quadratic.py",
"repository": "CrocSwap/integer-mult-bounds",
"commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"path": "research/clifford-exact-contractions/source/PR5704-quadratic.py",
"sha256": "d406584aed1479b75c387bc964b9e797b2f4f75e5f8c6bbea00df07f7d590a91",
"git_blob": "ce3c86ec07fd5767741e02ff0c88b93ba9164fb4"
},
{
"local": "source/row/bell_reads.py",
"repository": "apoursh/integer-mult-bounds",
"commit": "fdc90699f4a64139ed6d84cdbf9a606ff0ccd32e",
"path": "research/clifford-sparse-row/bell_reads.py",
"sha256": "44942462cd7778d23042bf827fb313d0e7acf99aa5b9793e411503e83d3421b7",
"git_blob": "32b2ed2a94dc77d04709fedb420bf0ffd6d74f73"
},
{
"local": "source/row/compile_row.py",
"repository": "apoursh/integer-mult-bounds",
"commit": "fdc90699f4a64139ed6d84cdbf9a606ff0ccd32e",
"path": "research/clifford-sparse-row/compile_row.py",
"sha256": "4e6420f6dcccfd76d64a3b14d94dbdd4803bfd780c921a225d8f29b5d9f0565b",
"git_blob": "daf35d6a26993ed00cfc25a9e16c9136fba2a275"
},
{
"local": "source/row/raw_row.py",
"repository": "apoursh/integer-mult-bounds",
"commit": "fdc90699f4a64139ed6d84cdbf9a606ff0ccd32e",
"path": "research/clifford-sparse-row/raw_row.py",
"sha256": "40fb7b900409d1908e01683830f44670417338412753ba77a37ea203f94aafa7",
"git_blob": "1787feb76acf78e3fd314bf3e0ecbe6cb2432316"
}
]
48 changes: 48 additions & 0 deletions research/clifford-chart-contraction/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"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"
}
],
"cited_research": [
{
"pr": 5704,
"author": "aliromman",
"head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2",
"title": "Make complete Clifford replay 5.17x faster with exact quadratic states",
"url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5704"
},
{
"pr": 5727,
"author": "aliromman",
"head": "8b74ecd0eea26d95b400e56435d35fbd261dc49b",
"title": "Add exact phase-sensitive Clifford contractions and attained finite-span errors",
"url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5727"
},
{
"pr": 7799,
"author": "apoursh",
"head": "7f08a74037788311cc6b7da27297b25f1b188e45",
"title": "Prove the sharp Gaussian-dyadic four-qubit Clifford tensor width is 13 (no κ)",
"url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7799"
},
{
"pr": 7800,
"author": "apoursh",
"head": "fdc90699f4a64139ed6d84cdbf9a606ff0ccd32e",
"title": "Compile the width-13 Clifford decoder into 4,265 Bell reads and certify its dense input cost (no κ)",
"url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7800"
}
]
}
Loading
Loading