From 75d29038e8ed28b0ec54617c8d598c5789d86be7 Mon Sep 17 00:00:00 2001 From: apoursh <8867770+apoursh@users.noreply.github.com> Date: Thu, 19 Nov 2026 14:47:26 -0500 Subject: [PATCH] Decode two variable sites in the width-13 Clifford dictionary --- .../ADDRESS-CENSUS.md | 49 + .../CROSS-CHECK.md | 12 + .../DENOMINATOR.md | 25 + .../DOUBLE-READOUT.md | 38 + research/clifford-two-site-canonical/PROOF.md | 39 + .../clifford-two-site-canonical/README.md | 31 + .../SOURCE-PINS.json | 114 ++ .../clifford-two-site-canonical/SOURCES.json | 69 + .../clifford-two-site-canonical/TASK.json | 99 ++ .../TWO-SITE-SPECTRUM.md | 67 + .../clifford-two-site-canonical/VERIFY.json | 100 ++ .../address_census.py | 97 ++ .../check_address_census.py | 134 ++ .../check_cross.py | 58 + .../check_double.py | 164 ++ .../check_flag_weights.py | 67 + .../check_full_readout.py | 52 + .../check_two_site_spectrum.py | 163 ++ .../denominators.py | 81 + .../double_readout.py | 81 + .../clifford-two-site-canonical/example.json | 10 + .../flag_weights.py | 224 +++ .../predecessor/pointed.py | 161 ++ .../predecessor/predecessor/adjoint.py | 190 +++ .../predecessor/predecessor/canonical.py | 128 ++ .../predecessor/source/CLASS-ALGEBRA.json | 165 ++ .../predecessor/source/engine/INPUTS.json | 72 + .../predecessor/source/engine/contractions.py | 236 +++ .../predecessor/source/engine/source/LICENSE | 201 +++ .../source/engine/source/PR5698-NOTICE.md | 9 + .../source/engine/source/PR5704-NOTICE.md | 33 + .../source/engine/source/PR5704-quadratic.py | 283 +++ .../predecessor/source/row/bell_reads.py | 128 ++ .../predecessor/source/row/compile_row.py | 247 +++ .../predecessor/source/width13-spectrum.json | 1519 +++++++++++++++++ .../predecessor/predecessor/spherical.py | 66 + .../two_site_spectrum.py | 142 ++ 37 files changed, 5354 insertions(+) create mode 100644 research/clifford-two-site-canonical/ADDRESS-CENSUS.md create mode 100644 research/clifford-two-site-canonical/CROSS-CHECK.md create mode 100644 research/clifford-two-site-canonical/DENOMINATOR.md create mode 100644 research/clifford-two-site-canonical/DOUBLE-READOUT.md create mode 100644 research/clifford-two-site-canonical/PROOF.md create mode 100644 research/clifford-two-site-canonical/README.md create mode 100644 research/clifford-two-site-canonical/SOURCE-PINS.json create mode 100644 research/clifford-two-site-canonical/SOURCES.json create mode 100644 research/clifford-two-site-canonical/TASK.json create mode 100644 research/clifford-two-site-canonical/TWO-SITE-SPECTRUM.md create mode 100644 research/clifford-two-site-canonical/VERIFY.json create mode 100644 research/clifford-two-site-canonical/address_census.py create mode 100644 research/clifford-two-site-canonical/check_address_census.py create mode 100644 research/clifford-two-site-canonical/check_cross.py create mode 100644 research/clifford-two-site-canonical/check_double.py create mode 100644 research/clifford-two-site-canonical/check_flag_weights.py create mode 100644 research/clifford-two-site-canonical/check_full_readout.py create mode 100644 research/clifford-two-site-canonical/check_two_site_spectrum.py create mode 100644 research/clifford-two-site-canonical/denominators.py create mode 100644 research/clifford-two-site-canonical/double_readout.py create mode 100644 research/clifford-two-site-canonical/example.json create mode 100644 research/clifford-two-site-canonical/flag_weights.py create mode 100644 research/clifford-two-site-canonical/predecessor/pointed.py create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/adjoint.py create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/canonical.py create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/CLASS-ALGEBRA.json create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/engine/INPUTS.json create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/engine/contractions.py create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/LICENSE create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5698-NOTICE.md create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-NOTICE.md create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-quadratic.py create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/row/bell_reads.py create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/row/compile_row.py create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/source/width13-spectrum.json create mode 100644 research/clifford-two-site-canonical/predecessor/predecessor/spherical.py create mode 100644 research/clifford-two-site-canonical/two_site_spectrum.py diff --git a/research/clifford-two-site-canonical/ADDRESS-CENSUS.md b/research/clifford-two-site-canonical/ADDRESS-CENSUS.md new file mode 100644 index 0000000000..f221e346c4 --- /dev/null +++ b/research/clifford-two-site-canonical/ADDRESS-CENSUS.md @@ -0,0 +1,49 @@ +# Exact support distribution over two freely varying coordinates + +Fix a repeated matrix unit in common input and output stabilizer bases. Among the 65,536 ordered pairs of matrix units on the two remaining sites, there are seven possible numbers of nonzero coefficients of the Hilbert adjoint. Every pair appears once, including both choices equal to the repeated coordinate. + +| Nonzero Clifford labels | Ordered pairs | +|---:|---:| +| 5,929,571,450,880 | 420 | +| 5,978,984,546,304 | 1,350 | +| 6,028,397,641,728 | 18,900 | +| 6,078,693,113,856 | 44,100 | +| 6,670,767,882,240 | 90 | +| 6,781,947,346,944 | 675 | +| 8,338,459,852,800 | 1 | + +At width 13 with **all** sites free, there are exactly 30 support sizes among the $2^{104}$ coordinates. With the first address fixed, the number attaining the minimum of 5,411,658,792,960 is 74,959,609,988,606,102,773,113,260,160 out of $2^{96}$ (94.6123%). The maximum is attained only when every site agrees. With zero through six free sites beyond one common address, there are respectively 1, 3, 7, 13, 22, 27 and 30 sizes. The full histogram stabilizes in its set of sizes by six free sites; the multiplicities continue to change. The census concerns the raw adjoint $A^*$. + +## Counting quotient isomorphisms + +Work in computational bases by conjugating by the two fixed Clifford basis changes. Write $X,Y$ for the row and column spaces $\mathbb F_2^n$. Subtract the repeated or first coordinate from all sites, and let $D\le X\oplus Y$ be the span of the resulting displacement vectors. Put $a=\dim\mathrm{pr}_X D$, $b=\dim\mathrm{pr}_YD$, and $c=a+b-\dim D$. The pure row and pure column subspaces of $D$ have dimensions $a-c,b-c$. Their two projection quotients are identified by $D$ and have common dimension $c$. + +At Hadamard rank $h$, the displacement support of a Clifford lift is a linear relation $R$ given by two $h$-planes $U\le X$, $V\le Y$ and an isomorphism $X/U\to Y/V$. This follows from the column-support derivation in [the coordinate census of #7821](https://github.com/apoursh/integer-mult-bounds/blob/eead545a4ba6c50010fcac0919a9fdc6b14bd673/research/clifford-compact-adjoint-fibres/COORDINATES.md). Every column is one coset of $U$, and the surjection from columns to $X/U$ has kernel $V$. Each such relation occurs for +$$ +m_h=2^{h(h+1)/2}|P_Z| / \prod_{i=0}^{n-h-1}(2^n-2^i) +$$ +symplectic fibres, where $|P_Z|=2^{n(n+1)/2}|\mathrm{GL}(n,2)|$. The coefficient is nonzero when $D\subseteq R$ and the Pauli translate includes the first address, giving $2^{n+h}$ nonzeros per occupied fibre. The absolute square of each coefficient is $2^{-w(n+h)}$ at width $w$. + +For $D\subseteq R$, its pure subspaces must lie in $U,V$. The intersections $U\cap\mathrm{pr}_XD$ and $V\cap\mathrm{pr}_YD$ must induce the **same** subspace of the common quotient. Otherwise a vector equivalent to zero on one side maps to a nonzero class on the other. If this induced subspace has dimension $e$, there are $\genfrac{[}{]}{0pt}{}{c}{e}_2$ choices. Set $k=c-e$. The intersections now have prescribed dimensions $a-k,b-k$. The number of $h$-planes having one prescribed intersection of dimension $s$ with an $a$-plane is +$$ +L(a,s)=\genfrac{[}{]}{0pt}{}{n-a}{h-s}_2\,2^{(a-s)(h-s)}. +$$ +Indeed choose the projection of the $h$-plane to the ambient quotient of the $a$-plane, then its graph into the $a$-plane modulo the fixed intersection. Infeasible dimensions have count zero. Finally the isomorphism on the two $(n-h)$-dimensional quotients must extend a fixed isomorphism between $k$-planes. There are $2^{k(n-h-k)}|\mathrm{GL}(n-h-k,2)|$ extensions. Choose the isomorphism on the complementary quotient and an arbitrary component in the target $k$-plane. Thus the exact number of relations is +$$ +\sum_{e=0}^c \genfrac{[}{]}{0pt}{}{c}{e}_2 L(a,a-k) L(b,b-k) + 2^{k(n-h-k)}|\mathrm{GL}(n-h-k,2)|,\qquad k=c-e, +$$ +omitting $k>n-h$. Multiplying by $m_h$ gives occupied fibres. The formula is symmetric in $a,b$ and uses only three ranks. It yields both the support size and the squared adjoint norm by shell summation. + +## Counting address lists + +With $t$ varying sites and a fixed base address, the number of ordered lists of displacement type $(a,b,c)$ is +$$ +\genfrac{[}{]}{0pt}{}{n}{a}_2\genfrac{[}{]}{0pt}{}{n}{b}_2\genfrac{[}{]}{0pt}{}{a}{c}_2\genfrac{[}{]}{0pt}{}{b}{c}_2 |\mathrm{GL}(c,2)| +\prod_{i=0}^{a+b-c-1}(2^t-2^i). +$$ +The first factors choose the projected subspaces, their pure kernels and the isomorphism between the $c$-dimensional quotients. These data recover $D$ uniquely as a relation. The final product counts surjections $\mathbb F_2^t\to D$, since they are exactly the ordered $t$-tuples spanning $D$. A varying base contributes an extra factor $2^{2n}$. The formulas have no dependency on the other sites' order or on a chosen coordinate gauge. + +The [calculator](address_census.py) produces the table and complete histograms. The [independent checker](check_address_census.py) constructs every quotient plane and surjection directly for $n\le4$. In four qubits this visits all 65,536 distinct support relations and checks all 55 ordered displacement types, a different enumeration from summing subspace intersection counts. It also counts all two-site address pairs, checks normalization, and independently verifies that the sum of squared adjoint norms over all addresses equals the number of unit dictionary columns for widths 1, 2, 6 and 13. The calculation extends apoursh's support criterion, individual-address counts and extrema in #7821. + +The same closed formula also checks every support multiplicity in the [two-site normal operator](TWO-SITE-SPECTRUM.md), including its off-diagonal entries. Form $D$ from the two directly matched addresses, the two crossed addresses, or their union. The three shell counts reproduce the independently enumerated direct, crossed and simultaneous support counts on every row and column type. diff --git a/research/clifford-two-site-canonical/CROSS-CHECK.md b/research/clifford-two-site-canonical/CROSS-CHECK.md new file mode 100644 index 0000000000..159b41f749 --- /dev/null +++ b/research/clifford-two-site-canonical/CROSS-CHECK.md @@ -0,0 +1,12 @@ +# Independent check across the two kinds of nonzero mark + +At $X=L$ take a nonzero interior mark $u\in L$ and an exterior mark $w\notin L$. There are two parabolic orbits of such ordered pairs, classified by the symplectic pairing $s=\langle w,u\rangle$. In coordinates $L=Z$, the external $X$ part of $w$ is a nonzero functional on $L$. A change of basis fixing $u$ is transitive on the functionals of each specified value at $u$. Symmetric shears add an arbitrary $Z$ component to the vector with a given nonzero $X$ part (prescribe the corresponding column of a symmetric matrix). For each interior $u$ the numbers of allowed exterior $w$ are $n_0=112,n_1=128$. + +Write $k_C$ for the central inverse value on conjugacy class $C$, computed directly from the full character table by the formula in #7823. Set $f_j=4^{-13}(-1/32)^j$. For each class representative $g$, sum over the 2,295 Lagrangians and form the weighted displacement count +$$ + T_s(g)=\sum_L f_{d(L,gL)}\, + \#\{w\in (g^{-1}L)\setminus L:\langle w,gw\rangle=s\}. +$$ +Indeed in the raw right hand side after shifting $(L,w)$ by $g$, the only surviving interior mark is $u=gw$. For fixed $s$ the inverse result is constant on all $2295\cdot15\cdot n_s$ triples $(L,u,w)$ by transitivity. Its value is therefore $\sum_C |C| k_C T_s(g_C)/(2295\cdot 15\cdot n_s)$. Reversing the two marks gives the same value: substitute $g^{-1}$ for $g$, using $k(g)=k(g^{-1})$ and $d(L,gL)=d(L,g^{-1}L)$. The checker compares all members of each fused rational class packet before applying its multiplicity. + +This calculation makes no use of the marked orbit traversal, separating operator, or polynomial interpolation. Its exact answers are $224457234251/202337455041975052800000$ for the perpendicular pair and $-235362773012219/27517893885708607180800000$ for the paired case. Both agree with both orientations in the decoder. [Class-sum checker](check_cross.py) diff --git a/research/clifford-two-site-canonical/DENOMINATOR.md b/research/clifford-two-site-canonical/DENOMINATOR.md new file mode 100644 index 0000000000..d83a2f4ad1 --- /dev/null +++ b/research/clifford-two-site-canonical/DENOMINATOR.md @@ -0,0 +1,25 @@ +# Exact common odd denominator + +The least positive odd integer clearing every canonical two-site coefficient into $\mathbf Z[i,1/2]$ for all Gaussian-dyadic joint inputs is +$$D=21{,}556{,}663{,}020{,}569{,}210{,}160{,}884{,}269{,}703{,}315{,}625.$$ +It has 115 bits. The analogous one-site divisor from #7823 has 73 bits. This statement prices the fixed coordinate interface. Circuit costs depend on the producer, precision and schedule. + +**Reduction to five full Walsh sweeps.** For each distance $j$, use the symplectic map exchanging $Z_s$ and $X_s$ on the first $j$ qubits and fixing the others. Every relative $S'$ at this distance has the form $A S B^{-1}$ for this representative $S$ and $A,B$ preserving $Z$. Indeed pairs of Lagrangians of the same distance lie in a single symplectic orbit, by extending a common intersection basis to adapted symplectic bases. Because the scalar Gram is central, its transformed flag weight is invariant under simultaneously moving the two marked flags. Therefore the weight at $S'$ in the coefficient formula equals the weight at $S$ with the output mark transformed by $A^{-1}$ and the input mark by $B^{-1}$. A linear symplectic map preserving $Z$ acts on a fixed coset $(z,x)$ by an invertible linear change of $x$ and, within the coset, an affine change of $z$. Such changes permute Walsh frequencies and introduce only signs. Thus the set of absolute scalar multipliers is identical throughout each shell, also when the physical bases of the repeated site are rotated. + +Write $x=r\oplus i$, $y=c\oplus k$, $\alpha=r\oplus m$ and $\beta=c\oplus n$. The four independent four-bit strings parametrize all $65,536$ Walsh values per shell, including the extraction factor $1/16$. The remaining factor is a conjugated matrix entry. When nonzero this is a Gaussian-dyadic unit: its squared modulus is $2^{-j}$, so its inverse is also Gaussian-dyadic. At least one Pauli translate has a nonzero entry at any requested matrix address since translations of any nonempty column support reach all rows in the left stabilizer basis. All four strings are realizable taking $r=c=0$. These observations prove that the lcm of the odd denominators of the Walsh values is exactly the desired joint divisor. Linear superposition with Gaussian-dyadic coefficients preserves the bound. + +| Distance $j$ | Distinct absolute multipliers | Zero multipliers out of 65,536 | Distinct odd divisors | Shell lcm | +|---:|---:|---:|---:|:---| +| 0 | 10 | 64,140 | 10 | $D/3$ | +| 1 | 25 | 62,720 | 22 | $D$ | +| 2 | 42 | 57,216 | 35 | $D$ | +| 3 | 44 | 38,912 | 36 | $D$ | +| 4 | 27 | 0 | 24 | $D$ | + +No individual matrix-unit entry realizes all the prime powers of $D$. A pair already forces it. For $B=E_{00}$, take $p=0$ in both queries. At the identity, the defects $E_{11},E_{11}$ have canonical odd denominator $562788258996425089753125$. At the one-qubit exchange representative, $E_{22},E_{44}$ have canonical odd denominator $6293916210385170849893217431625$. Their lcm is $D$. The verifier recovers these divisors from actual complex output coordinates. [Complete sweep and witnesses](denominators.py) + +A single query attains the complete divisor if the joint observation is allowed to be a superposition. With $B=E_{00}$, choose the four-qubit exchange representative ($j=4$), $p=0$, and +$$ + J=E_{00}\otimes E_{11}+E_{11}\otimes E_{22}+2E_{11}\otimes E_{42}. +$$ +Its canonical coefficient is exactly $35434033216309953801405149/(2^{16}D)$ in lowest terms. Thus one real output of an integer input can require the entire 115-bit odd divisor. diff --git a/research/clifford-two-site-canonical/DOUBLE-READOUT.md b/research/clifford-two-site-canonical/DOUBLE-READOUT.md new file mode 100644 index 0000000000..83143c01f9 --- /dev/null +++ b/research/clifford-two-site-canonical/DOUBLE-READOUT.md @@ -0,0 +1,38 @@ +# Canonical readout with two arbitrary sites + +Use the Gaussian-dyadic four-qubit Clifford lifts and the width-13 dictionary of #7816 and #7823. In fixed left and right stabilizer bases let the repeated site be the matrix unit $B=E_{rc}$. At the other two sites take an arbitrary joint tensor $J$ with entries $J_{ikmn}$ in the basis $E_{ik}\otimes E_{mn}$. This includes entangled two-site inputs. The observation is $(\mathrm{vec}\,B)^{\otimes 11}\otimes J$. All thirteen factors of a dictionary column are identical, so the choice of the two site positions is immaterial. + +Write $V$ for the specified lifted Pauli translate expressed in those two bases, $Z$ for the computational Lagrangian and $S$ for the relative binary action. Thus $V=U_L^*W_pU_TU_R$ and $S=L^{-1}TR$. Write $j=4-\dim(Z\cap SZ)$ and $\tau=V_{rc}$. The width-13 adjoint entry for a basis pair $E_{ik}\otimes E_{mn}$ is $4^{-13}\overline\tau^{11}\overline{V_{ik}}\overline{V_{mn}}$. A nonzero $\tau$ has squared modulus $2^{-j}$ and $\overline\tau^{12}=(-1/64)^j$ by the Gaussian-dyadic phase identity of #7821. Consequently, including $\tau=0$, +$$ + 4^{-13}\overline\tau^{11}=h_j\tau, + \qquad h_j=4^{-13}(-1/32)^j. +$$ + +## One Pauli conjugation + +Let $P_{(z,x)}=i^{|x\cap z|}X_xZ_z$ be a trace-orthogonal Hermitian Pauli basis, with $z$ stored in the low four bits. Expand $|c\rangle\langle k|=16^{-1}\sum_v\langle k|P_v|c\rangle P_v$. Then +$$ + \tau\overline{V_{ik}}=\langle r|V|c\rangle\langle k|V^*|i\rangle + =\frac1{16}\sum_{u,v}\langle r|P_u|i\rangle\langle k|P_v|c\rangle\, + \mathbf1_{\{u=Sv\}}\epsilon_v(V), +$$ +where $VP_vV^*=\epsilon_v(V)P_{Sv}$. The signs depend on the Pauli translate. When $u=Sv$, multiplication $V\mapsto P_u VP_v$ acts on this particular basis vector by that sign. + +For a fixed $S$, synthesize the adjoint coefficients by $M(S)=\sum_p d(S,p)V$. The trace basis identity is $\sum_p\overline{V_{mn}}V=16E_{mn}$. Multiplication of each coefficient by $\epsilon_v(V)$ therefore replaces $16E_{mn}$ by $16P_uE_{mn}P_v$. With $t_{uv}=\langle r|P_u|i\rangle\langle k|P_v|c\rangle$ this gives +$$ + M_{A^*y}(S)=\sum_{u,v}t_{uv}\,h_j\mathbf1_{\{u=Sv\}}P_u E_{mn}P_v. +$$ +The Gram of #7816 acts on each scalar entry of $M$ by the central $F(g)=16^{-12}(-64)^{\dim\operatorname{Fix}(g)}$ on $\mathrm{Sp}(8,2)$. Constant left and right basis changes preserve this action, as does replacing $T$ by its relative coordinate $S$ since $F$ is central. Each scalar input $S\mapsto h_j\mathbf1_{\{u=Sv\}}$ is the pullback of $(X,w)\mapsto h_{d(Z,X)}\mathbf1_{\{u=w\}}$ along $S\mapsto (SZ,Sv)$. Its inverse $K(Z,u;X,w)$ is computed on that permutation module. This uses one arbitrary marked vector, including vectors outside either Lagrangian. A single incident-flag table covers the smaller one-site problem in #7823. + +## Coefficient formula + +Extraction of a coefficient of $M$ is $\mathrm{Tr}(V^*M)/16$. For a nonzero $t_{uv}$ we must have $u=(z,r\oplus i)$ and $v=(t,c\oplus k)$. Multiplying $t_{uv}$ with $P_uE_{mn}P_v$ cancels both Hermitian phase choices and leaves the single matrix unit $E_{r\oplus i\oplus m,c\oplus k\oplus n}$ with sign $(-1)^{z\cdot(r\oplus m)+t\cdot(c\oplus n)}$. Indeed the two factors of $i^{|x\cap z|}$ on the left multiply to $(-1)^{x\cdot z}$, and the signs from the two input indices there are $(-1)^{z\cdot(i\oplus m)}$. On the right the signs from the two input indices are $(-1)^{t\cdot(c\oplus n\oplus c\oplus k)}$, which combines with $(-1)^{t\cdot(c\oplus k)}$ to give $(-1)^{t\cdot(c\oplus n)}$. Thus the basis-pair answer is +$$ + \frac{\overline{V_{r\oplus i\oplus m,c\oplus k\oplus n}}}{16} + \sum_{z,t\in\mathbf F_2^4} + (-1)^{z\cdot(r\oplus m)+t\cdot(c\oplus n)} + K\bigl(Z,(z,r\oplus i);SZ,S(t,c\oplus k)\bigr). +$$ +Multiply each answer by $J_{ikmn}$ and sum. The implementation uses one length-256 Walsh transform for each occupied pair of displacements $(r\oplus i,c\oplus k)$ and combines all terms reading the same output unit. There are at most 256 such transforms and 256 output units. All requested Pauli translates of a given target reuse the same transformed weights. The implementation starts with explicit rational real and imaginary input entries and the supplied symplectic labels and bases. A physical producer and tape cost for general two-site inputs remain open. + +Independent controls compare the untransformed formula with direct degree-13 entries across all five Lagrangian distances, including rotated bases. To exercise the normal equation without using the full-group inverse implementation, a second test takes the six embedded one-qubit symplectic elements and all 256 four-qubit Pauli translates. The principal scalar Gram on those six elements is inverted directly. Every one of the 1,536 resulting entries satisfies the actual Choi normal equation, whose factors are computed independently from $[\operatorname{Tr}(V^*V')/16]^{13}$. Full-group controls interchange genuinely distinct singleton matrix units and reduce either chosen singleton to the repeated site, recovering the independently computed #7823 weights. diff --git a/research/clifford-two-site-canonical/PROOF.md b/research/clifford-two-site-canonical/PROOF.md new file mode 100644 index 0000000000..5e5fcf78e7 --- /dev/null +++ b/research/clifford-two-site-canonical/PROOF.md @@ -0,0 +1,39 @@ +# A marked-Lagrangian inverse for two variable sites + +Let $A$ have columns $(\operatorname{vec}(W_pU_S)/4)^{\otimes13}$ for the four-qubit Pauli translates and $S\in G=\operatorname{Sp}(8,2)$, in the fixed Gaussian-dyadic lifts of #7816 and #7821. Fix a repeated stabilizer matrix unit $B$. For an arbitrary two-site tensor $J$, the observation is $y=(\operatorname{vec} B)^{\otimes11}\otimes J$. The following construction returns every queried entry of $A^\dagger y$ exactly. The two-site amplitude calculation, including its normalization and Pauli signs, is derived in [the readout proof](DOUBLE-READOUT.md). The rank of this linear map is 32,896. The proof of that assertion and of the raw adjoint's singular spectrum uses diagonal Clifford characters and support counts. [Rank and singular spectrum](TWO-SITE-SPECTRUM.md) + +## Scalar inverse + +Use the left and right stabilizer bases to express the target by its relative symplectic action. Write $Z$ for the computational Lagrangian. For each $u,v\in\mathbb F_2^8$ the scalar input is +$$ + S\longmapsto h_{d(Z,SZ)}[u=Sv],\qquad + d(L,X)=4-\dim(L\cap X),\qquad h_j=4^{-13}(-1/32)^j. +$$ +It pulls back from the permutation action on $(X,w)=(SZ,Sv)$. Scalar Gram convolution by $F(g)=16^{-12}(-64)^{\dim\operatorname{Fix}(g)}$ intertwines this pullback. The inverse acts on the same permutation space because its eigenvalues on the full group are positive (#7816). This gives a single finite problem even for marks outside $Z$ or $SZ$. + +There are 2,295 Lagrangians. At each there is one zero mark, 15 nonzero internal marks and 240 external marks. Each of the three sets is transitive under $G$. In coordinates $(z,x)$ with $Z=\{(z,0)\}$, the stabilizer of $Z$ consists of changes of basis and symmetric shears $(z,x)\mapsto(z+Bx,x)$. These generate arbitrary changes of nonzero internal marks. For a given nonzero $x$ the symmetric shears realize every value of $Bx$, establishing transitivity on external marks. We may thus take $u$ to be $0$, $Z_1$, or $X_1$. Starting with the transvections of $\mathrm{GL}(4,2)$ and the elementary symmetric shears, retain the generators fixing the chosen $u$. For $Z_1$ the basis changes fix the first basis column; for $X_1$ they fix the first covector and the shear's first column vanishes. The retained generators generate those subgroups by row reduction on the remaining three coordinates and the permitted additions involving the first. Traversing the resulting permutation actions gives 28, 77, and 249 orbits of $(X,w)$ respectively. Even a refinement by a subgroup fixing $u$ is valid, since the right hand side is invariant and the Gram is central. The code stores one value per orbit. The traversal labels 587,520 states for each of three roots, and never enumerates the 47,377,612,800 group elements. + +## Computing the central operator from two conjugacy classes + +Let $T$ be the sum of the 255 symplectic transvections $t_a(x)=x+\langle a,x\rangle a$. Let $U$ sum one involution per totally isotropic two-plane with independent generators $a,b$. Its action is +$$ + t_a t_b t_{a+b}(x)=x+\langle b,x\rangle a+\langle a,x\rangle b. +$$ +The map is independent of the plane basis over $\mathbb F_2$. The image of $g-I$ recovers the plane and $\langle x,(g-I)x\rangle=0$ for all $x$. Witt extension makes this one class, of size $255\cdot126/6=5355$. The class-table representatives have the corresponding rank and pairing. Summing each action on an orbit representative gives sparse integer matrices for $T,U$ on invariant functions. Each row counts the destinations under all elements of that class. + +For each class representative $g$, enumerate the invariant Lagrangians $L$. The contributions to the three permutation characters are respectively $1$, $|L\cap\operatorname{Fix}(g)|-1$ and $|\operatorname{Fix}(g)|-|L\cap\operatorname{Fix}(g)|$. Check that these counts agree within each fused packet of the pinned character table from #7816/#7823. For a row $r$ of that table (the sum of an ordinary Galois packet), take the usual character inner product with each permutation character and divide by $\langle r,r\rangle$ to get the common multiplicity. The reconstructed dimensions are 2,295, 34,425 and 550,800. Their union contains 31 character packets. Each has the central scalars +$$ + t=255r(T)/r(1),\quad u'=5355r(U)/r(1),\qquad + f=\frac{\sum_C |C|r(C)(-64)^{\dim\operatorname{Fix}(C)}}{16^{12}r(1)}. +$$ +Here $r(T),r(U)$ denote values on class representatives. Direct character arithmetic gives distinct pairs $(t,u')$ and positive $f$ for these packets. The computed $t,u'$ are integers. Since $|t|\le255$, the values $z=t+511u'$ distinguish all 31 pairs. Interpolate the 31 values $(z,1/f)$ over the rationals. Applying the resulting polynomial of degree at most 30 in $T+511U$ to the orbital input gives exactly $F^{-1}$ on it. Newton evaluation clears denominators before multiplying the sparse matrices. Mapping the left mark to its representative and reading the orbit label then gives each weight for the Walsh sum. The forward polynomial $z\mapsto f$ reproduces the right hand side in every one of the 354 orbit equations. [Implementation](flag_weights.py) · [Normal equations and diagonal probes](check_flag_weights.py) + +## Finite arithmetic + +The five parabolic double cosets reduce the common odd denominator to 327,680 Walsh multipliers. The resulting sharp divisor has 115 bits. Two matrix-unit queries force its lower bound, and one three-term integer input attains the full divisor in a single coefficient. [Shell sweep and witnesses](DENOMINATOR.md) + +## Independent controls and scope + +Direct reciprocal-class averages give the inverse values on the three aligned flags and four more values crossing the interior and exterior modules. These controls use all class representatives and bypass the interpolating polynomial. On a restricted dictionary of six symplectic actions with all 256 Pauli translates, literal degree-thirteen Choi overlaps verify all 1,536 normal equations. Full-group specializations recover both orderings of the one-site answer in #7823. The coordinate-support distribution gives a second way to check the shell sizes used in the rank analysis. [Cross-flag probes](CROSS-CHECK.md) · [Address census](ADDRESS-CENSUS.md) + +The formula consumes an explicitly supplied two-site tensor and supplied bases. The singular values in the [spectrum calculation](TWO-SITE-SPECTRUM.md) belong to the restricted raw adjoint; its kernel is shared by the canonical decoder. This package establishes an algebraic readout. Physical generation, routing and finite-precision accounting at a multiplication caller remain open. diff --git a/research/clifford-two-site-canonical/README.md b/research/clifford-two-site-canonical/README.md new file mode 100644 index 0000000000..df475e9589 --- /dev/null +++ b/research/clifford-two-site-canonical/README.md @@ -0,0 +1,31 @@ +# Exact canonical Clifford readout with two variable sites + +At width thirteen, fix eleven copies of a four-qubit stabilizer matrix unit and supply any joint tensor on the other two sites. This package returns the exact Moore–Penrose coefficient at any requested Clifford label, including for entangled inputs. It answers the two-singleton question in [PR #7823](https://github.com/CrocSwap/integer-mult-bounds/pull/7823). + +- The decoder uses 354 orbital weights, shared across all queries. A given symplectic target uses at most 256 Walsh transforms of length 256 for the supplied tensor, then reuses their results across Pauli translates. [Proof](PROOF.md) · [Readout formula](DOUBLE-READOUT.md) +- Exactly 32,896 of the 65,536 input directions are detectable. The kernel consists of the antisymmetric tensors under site exchange. The raw adjoint has thirteen distinct positive squared singular values on the symmetric sector and squared condition number $2{,}100{,}225/2$. [Rank proof and complete spectrum](TWO-SITE-SPECTRUM.md) +- The least common odd denominator for Gaussian-dyadic joint inputs has 115 bits. A single query on a three-term integer input attains it. [Arithmetic proof and witnesses](DENOMINATOR.md) +- The 65,536 ordered pairs of computational matrix units with a fixed repeated unit attain seven different raw adjoint support sizes. The counting formula depends only on three binary ranks. [Support distribution](ADDRESS-CENSUS.md) + +## Reproduce + +Run the registered checks from the repository root with CPython 3.12. + +```sh +python3.12 -B scripts/research_package.py --package research/clifford-two-site-canonical +``` + +The included example uses $E_{00}^{\otimes11}\otimes E_{10}\otimes E_{01}$. At the identity its raw adjoint entry is zero and its canonical coefficient is $q=3639905331779/47774121329355220800000$. The other two requested labels give $-q$ and zero. Each item of `joint` contains four four-bit matrix indices and a pair of rational real and imaginary components. Each query contains the binary symplectic action (the images of the eight basis vectors) and an eight-bit Pauli label. Optional `left_basis` and `right_basis` supply the stabilizer bases in the same format. + +```sh +python3.12 -B research/clifford-two-site-canonical/double_readout.py research/clifford-two-site-canonical/example.json +``` + +## Open next questions + +1. What are the principal angles of the complete two-site subspace with the full dictionary span? Contract the raw and canonical readouts inside the one- and two-dimensional symmetry blocks. The raw normal spectrum already supplies the block indexing; an exact shell average of the cross terms is still needed. +2. What does a tape pay to emit these canonical coefficients from a structured two-site input? Begin with a sparse tensor and compare shared Walsh evaluation and single-coordinate evaluation at the same requested precision. Input production, storage and routing must enter the invoice. + +## Attribution and scope + +This work builds on the four-qubit Clifford class and character calculations of alephnan, Nick Petalas and Ali Romman, the exact affine-quadratic evaluator by Ali Romman, and the #7816 scalar Gram, #7821 stabilizer phases and #7823 pointed-flag readout by apoursh. The executable predecessor files retain their original bytes, notices and license. The coefficient formula, marked-flag interpolation and two-site calculations here were prepared by apoursh with substantial OpenAI Codex assistance under Apache-2.0. The selected conditional multiplication exponent is $0.00363005817$. [Pinned sources](SOURCE-PINS.json) · [Research claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19757639) diff --git a/research/clifford-two-site-canonical/SOURCE-PINS.json b/research/clifford-two-site-canonical/SOURCE-PINS.json new file mode 100644 index 0000000000..05defe4515 --- /dev/null +++ b/research/clifford-two-site-canonical/SOURCE-PINS.json @@ -0,0 +1,114 @@ +[ + { + "local": "predecessor/pointed.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/pointed.py", + "git_blob": "8280ca60f7782994108ba0915d6b61b268665365", + "sha256": "102333a1fdd73f7ca7f5f6f51af7735bedde47c335782514e7cd1c92918644bb" + }, + { + "local": "predecessor/predecessor/adjoint.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/adjoint.py", + "git_blob": "f1de960eedd161290a77fb2cfb92e3743b9e6f60", + "sha256": "b2ba0a27c5794e0fbf9532d7256dea9b014c95d65d1c1b6f8a8267b0e8faa035" + }, + { + "local": "predecessor/predecessor/canonical.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/canonical.py", + "git_blob": "4168b9aecb6a8c31bbfd3272e014b886ef0add4b", + "sha256": "b22de1c9d6057f3f8f202630fd971bc99d539089f9d82595e7d18c01c0410d66" + }, + { + "local": "predecessor/predecessor/source/CLASS-ALGEBRA.json", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/CLASS-ALGEBRA.json", + "git_blob": "cbee453d502ebcfa5dc1c286185f3e7755fda19d", + "sha256": "6c057511a066c8c0fe2c26ed69183a329e59e80308d1e6c0de7ed11f0d650537" + }, + { + "local": "predecessor/predecessor/source/engine/INPUTS.json", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/engine/INPUTS.json", + "git_blob": "f9d4fd920651b002370ffb5084dbef2abaa5ed44", + "sha256": "c62bd55fd36c136ba2ec34f6d91ed481497932fadc7134d0b7e5c10009fd588c" + }, + { + "local": "predecessor/predecessor/source/engine/contractions.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/engine/contractions.py", + "git_blob": "76c807deceea0b1a6b64b50735253959b07c144d", + "sha256": "a2fc065d6f293ddcffe5b6eec7fff0fdf57c8e3d4c6be355bd92e87d3f1865ef" + }, + { + "local": "predecessor/predecessor/source/engine/source/LICENSE", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/engine/source/LICENSE", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "local": "predecessor/predecessor/source/engine/source/PR5698-NOTICE.md", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/engine/source/PR5698-NOTICE.md", + "git_blob": "56712e3195faf8c83319100065183b8b2488809d", + "sha256": "1f55b3e4bb80a60611b1fca0622da5a99fe7877446f03d0edd1dc8f3a5abadd2" + }, + { + "local": "predecessor/predecessor/source/engine/source/PR5704-NOTICE.md", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/engine/source/PR5704-NOTICE.md", + "git_blob": "b96b400e5ca04b3a9003a8b2c70a2461972d39d7", + "sha256": "a77adc71861e3b9c73c703c5db5b671f61a1101d85d14cca08547e21d6d8dce4" + }, + { + "local": "predecessor/predecessor/source/engine/source/PR5704-quadratic.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/engine/source/PR5704-quadratic.py", + "git_blob": "ce3c86ec07fd5767741e02ff0c88b93ba9164fb4", + "sha256": "d406584aed1479b75c387bc964b9e797b2f4f75e5f8c6bbea00df07f7d590a91" + }, + { + "local": "predecessor/predecessor/source/row/bell_reads.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/row/bell_reads.py", + "git_blob": "32b2ed2a94dc77d04709fedb420bf0ffd6d74f73", + "sha256": "44942462cd7778d23042bf827fb313d0e7acf99aa5b9793e411503e83d3421b7" + }, + { + "local": "predecessor/predecessor/source/row/compile_row.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/row/compile_row.py", + "git_blob": "daf35d6a26993ed00cfc25a9e16c9136fba2a275", + "sha256": "4e6420f6dcccfd76d64a3b14d94dbdd4803bfd780c921a225d8f29b5d9f0565b" + }, + { + "local": "predecessor/predecessor/source/width13-spectrum.json", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/source/width13-spectrum.json", + "git_blob": "039f22ba0bfec63c02fb3a97959766b8ec3a1bfa", + "sha256": "d032d5e63820f4ffe246d21adcd8d272f04dfd635a6fc519c4a81a366ca41d49" + }, + { + "local": "predecessor/predecessor/spherical.py", + "repository": "apoursh/integer-mult-bounds", + "commit": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "path": "research/clifford-mixed-site-canonical/predecessor/spherical.py", + "git_blob": "7cfa882a15306478f9893d69a7244319f37cfc84", + "sha256": "6bb8ab4653b4d445b5a1da81b0d6563b7632d4a09950dae3266a24d18148e093" + } +] diff --git a/research/clifford-two-site-canonical/SOURCES.json b/research/clifford-two-site-canonical/SOURCES.json new file mode 100644 index 0000000000..ed26bfba03 --- /dev/null +++ b/research/clifford-two-site-canonical/SOURCES.json @@ -0,0 +1,69 @@ +{ + "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": 7821, + "head": "eead545a4ba6c50010fcac0919a9fdc6b14bd673", + "author": "apoursh", + "title": "Compute compact Clifford adjoints and canonical readouts on repeated stabilizer sites", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7821" + }, + { + "pr": 7823, + "head": "52ad2a3802ff7fe84a74694b5def51b337d2e056", + "author": "apoursh", + "title": "Compute exact canonical Clifford readouts for mixed width-13 observations", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7823" + }, + { + "pr": 7816, + "head": "7e7e62c62fcccd11f5c8e22677b4523863a48f4b", + "author": "apoursh", + "title": "Apply the width-13 Clifford Gram and its inverse to requested fibres", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7816" + }, + { + "pr": 7772, + "head": "1398fbdca3536389d8ac3c8b3aaa408f03e8f6c2", + "author": "aliromman", + "title": "Determine sharp four-qubit Clifford threshold conditioning", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7772" + }, + { + "pr": 5704, + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "author": "aliromman", + "title": "Make complete Clifford replay 5.17x faster with exact quadratic states", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5704" + }, + { + "pr": 5698, + "head": "024e43cdd1b942059c87446a76235c3f0b681c34", + "author": "aliromman", + "title": "Certify the actual restricted C coframe optimum and 201-call reduction", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5698" + }, + { + "pr": 5727, + "head": "8b74ecd0eea26d95b400e56435d35fbd261dc49b", + "author": "aliromman", + "title": "Add exact phase-sensitive Clifford contractions and attained finite-span errors", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5727" + } + ] +} diff --git a/research/clifford-two-site-canonical/TASK.json b/research/clifford-two-site-canonical/TASK.json new file mode 100644 index 0000000000..4f71a5e2c1 --- /dev/null +++ b/research/clifford-two-site-canonical/TASK.json @@ -0,0 +1,99 @@ +{ + "schema_version": 1, + "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" + } + ] + }, + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "selection_nonce": "f4331c408b79e2a1b91ccc3a359011ab", + "scope_key": "58d0403e3078b2c5ae8a", + "scope_status": "changed", + "actual_scope": "Resolve #7823’s open question for width thirteen with eleven repeated stabilizer sites and two independently varying or jointly entangled sites. Determine a canonical coefficient, observable rank, and exact coefficient arithmetic.", + "scope_change_reason": "The handoff in #1166 and open next question in #7823 identify a concrete coefficient producer beyond the one-site interface. This supplies an exact finite interface for the Clifford route. The historical task card asks for a source-bound transfer audit at a different caller.", + "bottleneck_link": "A coefficient produced from the specified tensor gives a concrete input contract whose arithmetic and physical transport can be priced. It preserves the current selected multiplication bound.", + "stop_rule": "Solve and check the exact marked Gram systems, check independent literal and one-site limits, and determine the accessible feature dimension before making a decoder claim.", + "outcome": "completed", + "evidence": "PROOF.md and linked mathematical supplements, the working CLI example, and registered CPython 3.12 checks.", + "author": "apoursh", + "ai_assistance": "Substantial OpenAI Codex assistance in derivation, implementation, verification and review.", + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19757639", + "overlap": "Read #1163, recent #1166 handoffs, active discussions including #7111, all-state PR search and the recent creation queue. Reviewed related #7816, #7821 and #7823. The cached repository helper had stale remote coverage and a sparse local inventory; live checks supplemented it.", + "upstream_refresh": { + "date_utc": "2026-11-19", + "canonical_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "priority_revision": 8, + "orientation": "Selected bindings checked on the refreshed commit. The revision-8 catalogue refers to #5599, while #7000 is the selected record.", + "before_submission": "Fetched upstream again and rechecked recent PRs, #1166 and exact predecessor heads." + }, + "open_questions": [ + { + "question": "What are the principal angles for all two-site inputs?", + "why_it_matters": "They quantify the exact projection losses of the canonical decoder.", + "first_step": "Average the product of the raw and canonical coefficients in each one- or two-dimensional diagonal-character block.", + "blocked_by": "An exact average of the mixed shell contributions." + }, + { + "question": "Can a tape produce these two-site coefficients at a competitive full cost?", + "why_it_matters": "A paid finite-precision producer is needed for a multiplication caller.", + "first_step": "Price sparse tensor loading and Walsh evaluation at one precision and compare contracted versus individual requested coefficients.", + "blocked_by": "A specified physical input, output, precision and transport contract." + } + ] +} diff --git a/research/clifford-two-site-canonical/TWO-SITE-SPECTRUM.md b/research/clifford-two-site-canonical/TWO-SITE-SPECTRUM.md new file mode 100644 index 0000000000..ec6e5fbb4f --- /dev/null +++ b/research/clifford-two-site-canonical/TWO-SITE-SPECTRUM.md @@ -0,0 +1,67 @@ +# Two variable sites: exact rank, kernel and raw singular spectrum + +Fix normalized stabilizer lines and write their rank-one matrix as $B=\lvert a\rangle\langle b\rvert$. Leave the last two matrix registers fully variable, including entangled two-site tensors. Let $R$ denote the restriction of the width-13 adjoint to $(\mathrm{vec}\,B)^{\otimes 11}\otimes T$. Independent Clifford basis changes reduce $B$ to the computational matrix unit at $(0,0)$. They permute the dictionary columns up to phase and act unitarily on the variable registers. For a projective Clifford matrix $V$, the corresponding row of $R$ thus contains the monomials +$$ + 4^{-13}\overline{V_{00}^{11} V_{ik}V_{hl}} . +$$ +The normalization is the dictionary's $\mathrm{vec}(V)/4$. Projective choices multiply an entire row by a common phase and disappear from the normal operator. + +**Rank and kernel.** The kernel of $R$ is exactly the antisymmetric sector of the variable sites, of dimension $256\cdot255/2=32640$. Its orthogonal complement has dimension $256\cdot257/2=32896$. The restricted canonical decoder and the orthogonal projection onto the dictionary span have the same kernel, since all three vanish exactly for observations orthogonal to the dictionary. For a linear factorization through a complex feature vector recovering every queried coefficient on arbitrary two-site tensors, 32,896 coordinates are both necessary and sufficient. Sufficiency here is a dimension statement. Store the symmetric part. The sharp norm bounds below apply to the raw adjoint. + +Here is a rank proof using a small subensemble. Take flat Clifford matrices with entries proportional to +$$ + i^{q(i)+q'(k)}(-1)^{i^tMk}, +$$ +where $M\in\mathrm{GL}(4,2)$, and $q,q'$ range independently over computational diagonal Clifford phases. These phases include the single-bit $S$ generators and pairwise $CZ$ generators. On an unordered index pair $\{i,h\}$, the four $S$ characters give the coordinate sums $i_t+h_t\in\{0,1,2\}$. At positions of sum 1 the bits of the two indices are complementary. For any two such positions, the $CZ$ character says whether their 1s belong to the same index. Thus these characters recover the unordered pair, also when there are zero or one differing positions. Orthogonality of the left and right characters separates the unordered row and column multisets. Each sector has one symmetric monomial unless both pairs are distinct, when the direct and crossed matchings give two. In the latter case the ratio of their flat phases is $(-1)^{(i+h)^t M(k+l)}$. Both signs occur for $M$ invertible, since the orbit of the nonzero $k+l$ is all nonzero vectors. Thus the two columns are independent. Antisymmetric tensors vanish by commutativity of scalar products. + +## The complete normal operator + +Take the orthonormal symmetric monomial basis. An unequal pair of matrix units contributes the sum of its two orderings divided by $\sqrt2$. A repeated matrix unit contributes itself. Character separation as above applies to the entire group because left and right diagonal Clifford multiplications preserve its uniform measure and fix $V_{00}$. The normal operator splits into blocks of size at most two. The four linear-change orbits of unordered row pairs and of column pairs have representatives and multiplicities + +| Type | Pair | Count | +|---|---|---:| +| $00$ | $(0,0)$ | 1 | +| $xx$ | $(1,1)$ | 15 | +| $0x$ | $(0,1)$ | 15 | +| $xy$ | $(1,2)$ | 105 | + +A block occurs with multiplicity equal to the product of the row and column counts. For a two-dimensional block, use the direct and crossed matchings of the displayed representatives in that order. Entries below are multiplied by $2^{70}$. Triples denote the two diagonal entries and then the off-diagonal entry. Transposing the type pair has the same block entries. + +| Output pair | Input pair | Scaled block | +|---|---|---:| +| 00 | 00 | 87,222,165,730,875 | +| 00 | xx | 42,568,162,875 | +| 00 | 0x | 85,136,325,750 | +| 00 | xy | 83,059,830 | +| xx | xx | 5,854,541,334,075 | +| xx | 0x | 5,753,277,558 | +| xx | xy | 11,423,495,286 | +| 0x | 0x | (11,709,082,668,150; 5,753,277,558; −5,675,755,050) | +| 0x | xy | (11,423,495,286; 11,423,495,286; −5,537,322) | +| xy | xy | (846,565,563,510; 846,565,563,510; −815,568,426) | + +There are 13 distinct positive squared singular values. The $0x,0x$ block gives two distinct irrational conjugates, each with multiplicity 225. The sharp largest and smallest positive squared singular values are $87222165730875/2^{70}$ and $83059830/2^{70}$, of multiplicity 1 and 210. Their ratio is $2100225/2$. Within the entire flat shell alone the scaled squared singular values are 315, 630, 588 and 672 with multiplicities 256, 3,840, 14,400 and 14,400, respectively. + +## Counting the blocks + +We give the count on $n$ qubits, $q=2^n$, at width $w>2$. Write the binary symplectic action on $X,Z$ labels as $(x,z)\mapsto (A x+B_0 z,C x+D z)$, with $j=\operatorname{rank} B_0$. Set $U=\operatorname{im}B_0$ and $W=\operatorname{im}B_0^t$. A projective Clifford with nonzero $V_{00}$ has support +$$ + T=\{(i,k): i+U=A k+U\}. +$$ +To see this, the image of the diagonal input Paulis translates each column's support by $U$ while the diagonal stabilizers impose $n-j$ independent equations. Thus the support of column zero is a single $U$-coset. It is $U$ when the origin is supported. Conjugating $X_k$ translates this support by $A k$. Symplecticity says $AB_0^t=B_0 A^t$, so the quotient map kills $W$. Since the first $n$ rows of the symplectic matrix are independent, the induced map $E/W\to E/U$ is onto and is an isomorphism. Each nonzero matrix entry has magnitude $2^{-j/2}$. Among the $q^2$ Pauli translates of a fixed symplectic map, exactly $q2^j$ support the origin, by the freedom to translate the output index and choose its Pauli phase label. + +For fixed $j$, all choices of $U,W$ and quotient isomorphism are equally likely. Indeed independent left and right computational changes of basis preserve the shell and origin and act transitively on those triples. The number of symplectic elements in shell $j$ is +$$ + |\mathrm{Sp}(2n,2)|\,{n\brack j}_2\,2^{j(j+1)/2}/\prod_{s=1}^n(2^s+1). +$$ +For instance, choose the $(n-j)$-dimensional intersection with the fixed diagonal Lagrangian. In its symplectic quotient the transversal Lagrangians are symmetric $j\times j$ matrices. The stabilizer has order $|\mathrm{Sp}|/\prod_s(2^s+1)$, since the full group acts transitively on Lagrangians. + +Suppose $i\ne h$, $k\ne l$. When both matchings survive the support test, $a=i+h\in U$ and $b=k+l\in W$ are nonzero. Choose $z$ with $B_0z=a$. The identity for $V Z_z V^*$ expresses $V_{i+a,k}/V_{ik}$ as a phase independent of $k$ times $(-1)^{z\cdot k}$. Consequently the ratio between direct and crossed products is the sign $(-1)^{z\cdot b}$. The pairing $(a,b)\mapsto z\cdot b$ is perfect on $U\times W$: the ambiguity in $z$ is $W^\perp$, and $z\cdot W=0$ implies $a=0$. Conditional on $T$, composing the output with any linear map acting arbitrarily on $U$ and identically on the quotient preserves $T$ and $V_{00}\ne0$. It transports this pairing by the corresponding inverse basis change on $U$. Therefore for fixed $a,b\ne0$ the mean sign is $-1/(2^j-1)$, by summing a nontrivial character on all nonzero vectors. At $j=0$ both matchings cannot survive. + +For each graph $T$ let $s,t$ be the indicators for direct and crossed support. The diagonal contributions are proportional to $s,t$, and the off-diagonal to $-st/(2^j-1)$ when appropriate. The common multiplier for the **average** over the graphs in shell $j$ is +$$ + (1+\mathbf{1}_{(i,k)\ne(h,l)})\; q^{1-w}\, 2^{-j(w-1)}\; \#\{S:\operatorname{rank}B_0=j\}. +$$ +Indeed the normalization contributes $q^{-w}$, the $q2^j$ translates support the origin, and each surviving product in a normal entry has magnitude $2^{-jw}$. The remaining factor comes from the orthonormal symmetric basis. Summing these exact integers and rationals over $j$ gives the table. + +[Exact graph and spectrum calculation](two_site_spectrum.py) · [Independent two-qubit full-group verification](check_two_site_spectrum.py). The latter also checks characteristic-factor multiplicities, irreducibility of the sole quadratic, the sharp extrema and the flat-shell counts. The lower-dimensional control generates all 11,520 projective matrices with explicit Hadamard, phase and CNOT gates and measures products of their entries directly. A separate four-qubit gate check evaluates every supported rectangle in explicit phase-decorated partial-Hadamard matrices. For each nonflat or flat shell with $j>0$ it averages a transitive family of $2^j-1$ linear permutations and measures total interference $-1$ on every such rectangle. diff --git a/research/clifford-two-site-canonical/VERIFY.json b/research/clifford-two-site-canonical/VERIFY.json new file mode 100644 index 0000000000..aa52c77c43 --- /dev/null +++ b/research/clifford-two-site-canonical/VERIFY.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_flag_weights.py" + ], + "timeout_seconds": 120, + "checks": "Three integral orbit partitions, 354 normal equations, independent direct inverse probes and retained byte pins" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_cross.py" + ], + "timeout_seconds": 120, + "checks": "Four direct reciprocal-class probes across interior and exterior flags" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_double.py" + ], + "timeout_seconds": 120, + "checks": "Literal phase checks at all five Hadamard ranks and all 1,536 normal equations of a restricted Clifford dictionary" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_full_readout.py" + ], + "timeout_seconds": 120, + "checks": "Both one-site limits, singleton exchanges and the published exact two-site example" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_two_site_spectrum.py" + ], + "timeout_seconds": 120, + "checks": "Exact two-site normal spectrum, phase interference, flat-frame rank and all 11,520 two-qubit Cliffords" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_address_census.py" + ], + "timeout_seconds": 120, + "checks": "Complete coordinate support histograms, binary relation counts, 240 normal-block counts and trace identities" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/denominators.py" + ], + "timeout_seconds": 120, + "checks": "All five shell representatives, 327,680 Walsh multipliers, two matrix-unit witnesses and one integer input attaining the full divisor" + } + ] +} diff --git a/research/clifford-two-site-canonical/address_census.py b/research/clifford-two-site-canonical/address_census.py new file mode 100644 index 0000000000..e95213d6fc --- /dev/null +++ b/research/clifford-two-site-canonical/address_census.py @@ -0,0 +1,97 @@ +"""Distribution of nonzero adjoint coefficients over coordinate observations.""" +from collections import Counter +from fractions import Fraction +from math import prod + + +def injections(domain, target): + """Number of independent ordered domain-tuples in a binary target.""" + if not 0 <= domain <= target: + return 0 + return prod((1 << target) - (1 << i) for i in range(domain)) + + +def subspace_count(n, k): + if not 0 <= k <= n: + return 0 + return injections(k, n) // injections(k, k) + + +def choices_off_projection(n, projection_dim, kernel_dim, h): + """Choose an h-plane with one prescribed intersection with a fixed plane.""" + free = h - kernel_dim + if not 0 <= free <= n - projection_dim: + return 0 + return subspace_count(n - projection_dim, free) << ((projection_dim - kernel_dim) * free) + + +def compatible_relations(n, a, b, c, h): + """Quotient-isomorphism supports at rank h containing one displacement space.""" + total = 0 + for e in range(c + 1): + constrained = c - e + complement = n - h - constrained + if complement < 0: + continue + left = choices_off_projection(n, a, a - c + e, h) + right = choices_off_projection(n, b, b - c + e, h) + extensions = injections(complement, complement) << (constrained * complement) + total += subspace_count(c, e) * left * right * extensions + return total + + +def shell_profile(n, a, b, c): + """Occupied symplectic fibres by Hadamard rank. c is the common quotient rank.""" + if not (0 <= c <= min(a, b) and max(a, b) <= n): + raise ValueError("Invalid displacement type") + parabolic = injections(n, n) << (n * (n + 1) // 2) + counts = [] + for h in range(n + 1): + per_relation, remainder = divmod( + parabolic << (h * (h + 1) // 2), injections(n - h, n)) + if remainder: + raise ArithmeticError("Expected integral fibre multiplicity") + counts.append(per_relation * compatible_relations(n, a, b, c, h)) + return tuple(counts) + + +def nonzero_labels(n, profile): + return sum(count << (n + h) for h, count in enumerate(profile)) + + +def adjoint_norm_squared(n, width, profile): + return sum(Fraction(count, 1 << ((n + h) * (width - 1))) + for h, count in enumerate(profile)) + + +def type_multiplicities(n, free_sites): + """For fixed base address, count ordered lists of independent input slots. + + Each of the free_sites slots may repeat any address. The displacement + type records the two projected dimensions and their common quotient. + """ + if n < 1 or free_sites < 0: + raise ValueError("Expected positive qubit dimension and nonnegative slot count") + for a in range(n + 1): + for b in range(n + 1): + for c in range(min(a, b) + 1): + d = a + b - c + if d > free_sites: + continue + spaces = (subspace_count(n, a) * subspace_count(n, b) + * subspace_count(a, c) * subspace_count(b, c) + * injections(c, c)) + yield (a, b, c), spaces * injections(d, free_sites) + + +def support_histogram(n, free_sites): + """Map total occupied label count to ordered address count, base fixed.""" + result = Counter() + for kind, count in type_multiplicities(n, free_sites): + result[nonzero_labels(n, shell_profile(n, *kind))] += count + return dict(sorted(result.items())) + + +if __name__ == "__main__": + for support, multiplicity in support_histogram(4, 2).items(): + print(support, multiplicity) diff --git a/research/clifford-two-site-canonical/check_address_census.py b/research/clifford-two-site-canonical/check_address_census.py new file mode 100644 index 0000000000..c4214167e8 --- /dev/null +++ b/research/clifford-two-site-canonical/check_address_census.py @@ -0,0 +1,134 @@ +"""Independent finite-relation enumeration and global norm/normalization checks.""" +from collections import Counter +from itertools import product +from math import prod + +from address_census import ( + adjoint_norm_squared, compatible_relations, nonzero_labels, shell_profile, + support_histogram, type_multiplicities, +) + + +def require(actual, expected, label): + if actual != expected: + raise ValueError(f"{label}: {actual} != {expected}") + + +def binary_rank(values): + pivots = {} + for value in values: + while value and value.bit_length() in pivots: + value ^= pivots[value.bit_length()] + if value: + pivots[value.bit_length()] = value + return len(pivots) + + +def all_planes(n): + # Insert one independent generator at a time; the frozenset is canonical. + found = {frozenset([0])} + for vector in range(1, 1 << n): + found.update(space.union(x ^ vector for x in space) + for space in list(found) if vector not in space) + return found + + +def independent_relation_census(n): + # Describe each actual support as r+H=T(c). Enumerate H and every + # surjection T on the n explicit coordinate generators. + types = list(dict(type_multiplicities(n, 2 * n))) + counts = {kind: Counter() for kind in types} + total = 0 + for plane in all_planes(n): + h = binary_rank(plane) + quot = [min(x ^ u for u in plane) for x in range(1 << n)] + classes = sorted(set(quot)) + # Minimum representatives form the linear complement to RREF pivots. + if any(quot[x ^ y] != quot[x] ^ quot[y] + for x in range(1 << n) for y in range(1 << n)): + raise ValueError("Nonlinear quotient coordinates") + # Canonical displacement spaces have a-c pure row generators, + # b-c pure column generators and c tied coordinate generators. + constraints = [] + for a, b, c in types: + if any(quot[1 << i] for i in range(a - c)): + continue + required = (0,) * (b - c) + tuple(quot[1 << i] for i in range(a - c, a)) + constraints.append((required, (a, b, c))) + for columns in product(classes, repeat=n): + if binary_rank(columns) != n - h: + continue + total += 1 + for required, kind in constraints: + if columns[:len(required)] == required: + counts[kind][h] += 1 + require(total, 1 << (n*n), "number of distinct support relations") + for (a, b, c), shells in counts.items(): + for h in range(n + 1): + require(shells[h], compatible_relations(n, a, b, c, h), + (n, a, b, c, h)) + + +def check_spectrum_counts(): + from two_site_spectrum import pair_types, support_counts + + pairs = pair_types(4) + for h in range(5): + _, tally = support_counts(4, h) + for (row, col), expected in tally.items(): + (i, j), _ = pairs[row] + (k, l), _ = pairs[col] + direct = [(i, k), (j, l)] + crossed = [(i, l), (j, k)] + counts = [] + for seq in (direct, crossed, direct + crossed): + a = binary_rank(x for x, _ in seq) + b = binary_rank(y for _, y in seq) + d = binary_rank(x << 4 | y for x, y in seq) + counts.append(compatible_relations(4, a, b, a+b-d, h)) + require(counts, expected, (row, col, h, "normal block support counts")) + + +def check(): + check_spectrum_counts() + for n in range(1, 5): + independent_relation_census(n) + + types = Counter() + for first, second in product(range(256), repeat=2): + a = binary_rank((first >> 4, second >> 4)) + b = binary_rank((first & 15, second & 15)) + d = binary_rank((first, second)) + types[a, b, a+b-d] += 1 + require(types, dict(type_multiplicities(4, 2)), "all 65536 two-site observations") + + two = support_histogram(4, 2) + require(list(two.items()), [ + (5929571450880, 420), (5978984546304, 1350), (6028397641728, 18900), + (6078693113856, 44100), (6670767882240, 90), (6781947346944, 675), + (8338459852800, 1), + ], "two-site census") + all_addresses = support_histogram(4, 12) + require(len(all_addresses), 30, "full support-size count") + require(all_addresses[min(all_addresses)], 74959609988606102773113260160, + "multiplicity of the minimum at a fixed base address") + require(sum(all_addresses.values()), 1 << 96, "all addresses at a fixed base") + require([len(support_histogram(4, k)) for k in range(7)], + [1, 3, 7, 13, 22, 27, 30], "support growth with free positions") + + for n in range(1, 5): + group = (1 << (n*n)) * prod((1 << (2*i)) - 1 for i in range(1, n+1)) + require(sum(shell_profile(n, 0, 0, 0)), group, "all symplectic fibres") + for w in (1, 2, 6, 13): + mass = 0 + for kind, count in type_multiplicities(n, w - 1): + profile = shell_profile(n, *kind) + mass += count * adjoint_norm_squared(n, w, profile) + # Full basis sum is |Sp|*4^n because every column has unit norm; + # dividing by the 4^n equivalent base addresses leaves |Sp|. + require(mass, group, (n, w, "trace")) + print("PASS exact coordinate histograms, exhaustive support relations n=1..4 and trace identities and all spectrum block tallies") + + +if __name__ == "__main__": + check() diff --git a/research/clifford-two-site-canonical/check_cross.py b/research/clifford-two-site-canonical/check_cross.py new file mode 100644 index 0000000000..2e007e0e7c --- /dev/null +++ b/research/clifford-two-site-canonical/check_cross.py @@ -0,0 +1,58 @@ +"""Independent class-displacement audit of four interior/exterior inverse weights.""" +from fractions import Fraction +import json + +import flag_weights as F +from compile_row import apply, inverse, pairing + + +def cross_weights(): + data = json.loads((F.P.HERE / 'predecessor/source/CLASS-ALGEBRA.json').read_bytes()) + reciprocals = F.P.class_inverse(data) + bases, spaces, _ = F.P.quotient() + accum = [Fraction(0), Fraction(0)] + # A common scaling makes all distance weights integral. + factors = [(-1)**j * 32**(4-j) for j in range(5)] + for cls, reciprocal in zip(data['classes'], reciprocals, strict=True): + previous = None + for g in cls['representatives']: + rev = inverse(tuple(g)) + back = [apply(rev, v) for v in range(256)] + paired = sum(1 << v for v in range(256) if pairing(v, apply(g, v))) + sums = [0, 0] + for basis, L in zip(bases, spaces, strict=True): + preimage = F.P.point_set(tuple(back[x] for x in basis)) + shared = (L & preimage).bit_count() + j = 5 - shared.bit_length() + exterior = preimage & ~L + paired_count = (exterior & paired).bit_count() + sums[0] += factors[j] * (exterior.bit_count() - paired_count) + sums[1] += factors[j] * paired_count + if previous is not None and sums != previous: + raise ValueError("Rational packet has unequal cross displacement sums") + previous = sums + for bit, val in enumerate(previous): + accum[bit] += cls['size'] * reciprocal * val + # For one nonzero interior vector, exactly 112 exterior vectors are + # perpendicular and 128 have nonzero pairing. There are 15 choices of u. + return tuple(val / (2295 * 15 * choices * 32**4 * 4**13) + for choices, val in zip((112, 128), accum, strict=True)) + + +def check(): + expected = cross_weights() + if not all(expected) or expected[0] == expected[1]: + raise ValueError("Cross-displacement probes should be distinct and nonzero") + for bit, inside, outside in ((0, 1, 32), (1, 1, 16)): + if pairing(inside, outside) != bit: + raise ValueError("Invalid representative") + for u, w in ((inside, outside), (outside, inside)): + got = F.weight(F.BASE, u, F.BASE, w) + if got != expected[bit]: + raise ValueError((bit, u, w, got, expected[bit])) + print("PASS direct reciprocal class sums for interior/exterior and reversed mark pairs", + *map(str, expected)) + + +if __name__ == '__main__': + check() diff --git a/research/clifford-two-site-canonical/check_double.py b/research/clifford-two-site-canonical/check_double.py new file mode 100644 index 0000000000..861d4fb869 --- /dev/null +++ b/research/clifford-two-site-canonical/check_double.py @@ -0,0 +1,164 @@ +"""Verify the phase, normalization and group convolution on literal width-13 Choi columns.""" +from fractions import Fraction +from functools import cache +from double_readout import P, prepare +from bell_reads import transvection +from compile_row import apply, compose, inverse + +mul = P.Q.multiply +D = 4**13 + + +def power(value, exponent): + result = (1, 0) + for _ in range(exponent): + result = mul(result, value) + return result + + +def sym(axes): + S = P.IDENTITY + for axis in axes: + S = tuple(transvection(axis, v) for v in S) + return S + + +def raw_weight(L, u, X, w): + return Fraction(-1, 32)**P.distance(L, X)/D if u == w else Fraction(0) + + +def direct(S, p, row, col, terms, left=P.IDENTITY, right=P.IDENTITY): + def at(r, c): + return P.conjugate(P.transition(S, p, r, c, left, right)) + base = power(at(row, col), 11) + real = imag = Fraction(0) + for i, k, m, n, scalar in terms: + a, b = mul(mul(at(i, k), at(m, n)), scalar) + real += a + imag += b + a, b = mul((real, imag), base) + return a/D, b/D + + +def check_raw(): + left, right = sym((19, 138, 73)), sym((17, 8, 82, 35)) + nonzero = set() + complex_seen = False + for j in range(5): + relative = sym(tuple(17 << i for i in range(j))) + for L, R in ((P.IDENTITY, P.IDENTITY), (left, right)): + S = compose(L, compose(relative, inverse(R))) + terms = [(3^1, 1, 3, 1^1, (2,-3)), (3,1^1,3^1,1,(-1,2)), + (3,1,3,1,(0,11)), (5,12,10,6,(Fraction(1,5), Fraction(-7,13)))] + read = prepare(S, 3, 1, terms, raw_weight, L, R) + for p in (0, 1, 3, 16, 32, 35, 48, 80, 130, 199, 255): + expected = direct(S, p, 3, 1, terms, L, R) + P.require(expected == read(p), "literal 11+2 tensor and flag expansion differ") + if expected != (0,0): + nonzero.add(j) + complex_seen |= all(expected) + P.require(nonzero == set(range(5)) and complex_seen, "insufficient nonzero phase controls") + + +def embedded(): + generators = [sym((1,)), sym((16,))] + group = [P.IDENTITY] + for S in group: + for T in generators: + U = compose(S, T) + if U not in group: + group.append(U) + P.require(len(group) == 6, "expected the one-qubit symplectic group") + return group + + +def inverse_gram_column(group): + # Invert the genuine principal group block, with all 256 Pauli translates kept. + rhs = [int(S == P.IDENTITY) for S in group] + F = {} + for S in group: + fixed = sum(apply(S, v) == v for v in range(256)) + F[S] = Fraction((-64)**(fixed.bit_length()-1), 16**12) + A = [[F[compose(inverse(S), T)] for T in group] + [c] + for S, c in zip(group, rhs, strict=True)] + for i in range(len(A)): + scale = A[i][i] + P.require(scale != 0, "nonpositive principal pivot") + A[i] = [x/scale for x in A[i]] + for j in range(len(A)): + if i != j: + scale = A[j][i] + A[j] = [x-scale*y for x,y in zip(A[j], A[i], strict=True)] + return {S: row[-1] for S, row in zip(group, A, strict=True)} + + +def trace_slices(S, T): + # Frobenius inner products Tr(U_S^* W_h U_T). All entries outside the + # explicitly retained sparse list are checked to have zero trace. + from canonical import unitary + a, e = unitary(S) + b, f = unitary(T) + overlaps = [] + for h in range(256): + x, z = divmod(h,16) + real = imag = 0 + for j, av in enumerate(a): + if av == (0,0): + continue + bv = b[j^x] + sign = -1 if (z & (j^x)).bit_count()%2 else 1 + re, im = mul(P.conjugate(av), bv) + real += sign*re + imag += sign*im + if real or imag: + den = 16 << (e+f) + overlaps.append((h, power((Fraction(real,den), Fraction(imag,den)), 13))) + return overlaps + + +def check_subdictionary(): + group = embedded() + H = inverse_gram_column(group) + actions = {a: [apply(a,v) for v in range(256)] for a in group} + + @cache + def restricted(L, u, X, w): + total = Fraction(0) + pts = [v for v in range(256) if (X >> v) & 1] + for a, kernel in H.items(): + action = actions[a] + if action[w] == u: + image = sum(1 << action[v] for v in pts) + total += kernel * raw_weight(L, u, image, u) + return total + + terms = [(1,0,0,1,(3,2)), (0,1,1,1,(0,-3)), + (1,1,1,0,(Fraction(1,5),2)), (0,0,1,1,(1,0))] + coeffs = {} + for S in group: + read = prepare(S, 0, 0, terms, restricted) + coeffs[S] = [read(p) for p in range(256)] + changed = result_nonzero = count = 0 + for S in group: + outputs = [[Fraction(0), Fraction(0)] for _ in range(256)] + for T in group: + for h, overlap in trace_slices(S,T): + for p in range(256): + sign = -1 if ((p & 15) & (h >> 4)).bit_count()%2 else 1 + a,b = mul(overlap, coeffs[T][p ^ h]) + outputs[p][0] += sign*a + outputs[p][1] += sign*b + for p, output in enumerate(outputs): + truth = direct(S,p,0,0,terms) + P.require(tuple(output) == truth, "literal normal equation on six complete Pauli fibres") + result_nonzero += coeffs[S][p] != (0,0) + changed += truth != coeffs[S][p] + count += 1 + P.require(count == 1536 and result_nonzero and changed, "vacuous restricted Gram") + print("PASS literal 1,536-column Choi Gram times decoded vector equals the raw adjoint;", + result_nonzero, "nonzero canonical entries.") + + +if __name__ == '__main__': + check_raw() + check_subdictionary() diff --git a/research/clifford-two-site-canonical/check_flag_weights.py b/research/clifford-two-site-canonical/check_flag_weights.py new file mode 100644 index 0000000000..25d03878b1 --- /dev/null +++ b/research/clifford-two-site-canonical/check_flag_weights.py @@ -0,0 +1,67 @@ +"""Check the three exact orbital solves, class representatives, and independent diagonal probes.""" +from collections import Counter +from fractions import Fraction +import hashlib +import json +from pathlib import Path + +import flag_weights as F +from compile_row import apply, pairing + + +def check_pins(): + root = Path(__file__).resolve().parent + inventory = json.loads((root/'SOURCE-PINS.json').read_bytes()) + expected = {p.relative_to(root).as_posix() for p in (root/'predecessor').rglob('*') + if p.is_file() and '__pycache__' not in p.parts} + F.P.require({pin['local'] for pin in inventory} == expected, "retained inventory") + for pin in inventory: + content = (root/pin['local']).read_bytes() + F.P.require(hashlib.sha256(content).hexdigest() == pin['sha256'], "retained SHA256") + + +def check_inverse(): + data = json.loads((F.P.HERE/'predecessor/source/CLASS-ALGEBRA.json').read_bytes()) + classes = data['classes'] + recip = F.P.class_inverse(data) + bases, masks, _ = F.spaces() + # At an aligned marked flag, the full group sum can be averaged over all + # flags of that type. This uses conjugacy masses directly, independently + # of the two class operators and their polynomial interpolation. + census = [Counter() for _ in range(3)] + for c, k in zip(classes, recip, strict=True): + s = c['representatives'][0] + action = [apply(s,v) for v in range(256)] + fixed = sum(1 << v for v in range(256) if action[v] == v) + rank = 8 - (fixed.bit_count().bit_length()-1) + if c['size'] in (255,5355): + chosen = c['size'] == 5355 + F.P.require(rank == 1 + chosen and + all(not pairing(v,action[v]^v) for v in range(256)) == chosen, + "pinned transvection and alternating rank-two classes") + counts = [Counter() for _ in range(3)] + for B,L in zip(bases,masks,strict=True): + X = F.P.point_set(tuple(action[v] for v in B)) + j = F.P.distance(L, X) + n = (L & fixed).bit_count() + for counter,value in zip(counts,(1,n-1,fixed.bit_count()-n),strict=True): + counter[j] += value + for acc, by_shell in zip(census,counts,strict=True): + for j,m in by_shell.items(): + acc[j] += c['size']*k*m + for root, dim, orbit_count, totals in zip((0,1,16),(2295,34425,550800), + (28,77,249),census,strict=True): + labels, reps = F.orbits(root) + F.P.require(len(reps) == orbit_count and len(labels) == 587520, "orbit count") + sol = F.solution(root) + raw = tuple(F.rhs(F.P.distance(F.BASE,masks[i])) if w == root else Fraction(0) + for i,w in reps) + F.P.require(F.apply_gram(root,sol,False) == raw, "full orbital normal equations") + aligned = sum(F.rhs(j)*n for j,n in totals.items())/dim + F.P.require(F.weight(F.BASE,root,F.BASE,root) == aligned, "direct central inverse probe") + print("PASS all 354 orbital equations, both conjugacy classes and three direct inverse probes") + + +if __name__ == '__main__': + check_pins() + check_inverse() diff --git a/research/clifford-two-site-canonical/check_full_readout.py b/research/clifford-two-site-canonical/check_full_readout.py new file mode 100644 index 0000000000..718e2d2a8c --- /dev/null +++ b/research/clifford-two-site-canonical/check_full_readout.py @@ -0,0 +1,52 @@ +"""Full-group controls from the 12+1 decoder, symmetry, and direct rotated matrix elements.""" +import json +from pathlib import Path +import subprocess +import sys +from fractions import Fraction +from double_readout import P, prepare +from flag_weights import weight +from check_double import sym + + +def full_checks(): + left = sym((17, 34, 129)) + right = sym((1, 131, 68, 65)) + count = 0 + numerator_gains = 0 + for S, L, R in ((P.IDENTITY, P.IDENTITY, P.IDENTITY), + (sym((17, 34, 68, 136)), P.IDENTITY, P.IDENTITY), + (sym((17, 32, 54, 99)), left, right)): + r, c = 3, 4 + terms = [(r^1,c^3,(2,-1)), (r,c^2,(1,3)), (r^6,c,(0,7)), (r,c,(1,0))] + first = prepare(S,r,c,[(i,k,r,c,g) for i,k,g in terms],weight,L,R) + second = prepare(S,r,c,[(r,c,i,k,g) for i,k,g in terms],weight,L,R) + for p in (0,16,55,127,194,241): + expected = P.coefficient(S,p,r,c,terms,L,R) + P.require(first(p)==second(p)==expected, "failed independently computed 12+1 limit") + numerator_gains += int(expected != (0,0)) + count += 1 + terms2 = [(r^1,c^2,r^6,c^12,(1,3)), (r^1,c^7,r^2,c,(3,8)), + (r,c^2,r^6,c^12,(Fraction(1,3),1))] + direct = prepare(S,r,c,terms2,weight,L,R) + other = prepare(S,r,c,[(m,n,i,k,v) for i,k,m,n,v in terms2],weight,L,R) + for p in (0,15,61,111,155,240): + P.require(direct(p)==other(p),"independent singleton exchange") + P.require(numerator_gains and count==18,"vacuous canonical controls") + print("PASS 18 predecessor canonical limits in both singleton orders and 18 genuine pair exchanges.") + + query = [(1,0,0,1,(1,0))] + got = prepare(P.IDENTITY,0,0,query,weight)(0) + expected = Fraction(3639905331779, 47774121329355220800000) + P.require(got == (expected,0), "identity coefficient of two changing sites") + here = Path(__file__).resolve().parent + run = subprocess.run([sys.executable, "-E", "-s", "-W", "error", "-B", + str(here/"double_readout.py"), str(here/"example.json")], + check=True, capture_output=True, text=True) + P.require(json.loads(run.stdout) == [[str(expected),"0"],[str(-expected),"0"],["0","0"]], + "published command and all three example outputs") + print("Full-group canonical readout for E00^11, E10, E01 at the identity:", *got) + + +if __name__ == '__main__': + full_checks() diff --git a/research/clifford-two-site-canonical/check_two_site_spectrum.py b/research/clifford-two-site-canonical/check_two_site_spectrum.py new file mode 100644 index 0000000000..92aa9bbc7d --- /dev/null +++ b/research/clifford-two-site-canonical/check_two_site_spectrum.py @@ -0,0 +1,163 @@ +"""Independent projective Clifford enumeration and exact width-13 spectral controls.""" +from collections import Counter +from fractions import Fraction +from itertools import combinations, combinations_with_replacement +from math import isqrt + +from two_site_spectrum import eigenpolynomials, normal_blocks, pair_types + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def projective(matrix): + for unit in (1, -1, 1j, -1j): + first = unit * next(x for x in matrix if x) + if first.real > 0 and first.imag >= 0: + return tuple(unit * x for x in matrix) + raise ValueError("failed to fix Gaussian phase") + + +def all_two_qubit_gates(): + # Entries of 2V belong to Z[i] on both qubits. Dyadic real and imaginary + # intermediates are exactly representable when computing these gate updates. + identity = tuple(2 * int(i == k) for i in range(4) for k in range(4)) + pending, seen = [identity], {identity} + for gate in pending: + yield gate + for bit in (1, 2): + phase = tuple((1j if i & bit else 1) * gate[4*i+k] + for i in range(4) for k in range(4)) + h = tuple((1+1j)/2 * (gate[4*(i & ~bit)+k] + + (-1 if i & bit else 1) * gate[4*(i | bit)+k]) + for i in range(4) for k in range(4)) + for successor in (h, phase): + new = projective(successor) + if new not in seen: + pending.append(new) + seen.add(new) + cnot = projective(tuple(gate[4*(i ^ (2 if i & 1 else 0))+k] + for i in range(4) for k in range(4))) + if cnot not in seen: + pending.append(cnot) + seen.add(cnot) + + +def direct_two_qubit(): + # Evaluate direct matrix monomials; check every type representative, both + # matchings, and selected blocks between different diagonal characters. + width = 13 + types = pair_types(2) + blocks = [(r, c) for r in types for c in types] + expected = normal_blocks(2, width) + total = {key: [0] * len(value) for key, value in expected.items()} + offblock = [0j] * (len(blocks) - 1) + group_size = 0 + for gate in all_two_qubit_gates(): + group_size += 1 + origin = gate[0] + if not origin: + continue + weight = int((origin * origin.conjugate()).real)**(width - 2) + leading = [] + for key in blocks: + (i, h), _ = types[key[0]] + (k, l), _ = types[key[1]] + x = gate[4*i+k] * gate[4*h+l] + y = gate[4*i+l] * gate[4*h+k] + leading.append(x) + scale = weight * (1 if (i,k) == (h,l) else 2) + block = total[key] + block[0] += scale * x * x.conjugate() + if len(block) == 3: + block[1] += scale * y * y.conjugate() + block[2] += scale * x.conjugate() * y + for s, (x, y) in enumerate(zip(leading, leading[1:])): + offblock[s] += weight * x.conjugate() * y + require(group_size == 11520 and not any(offblock), "group size or character leakage") + for key, entries in total.items(): + require(all(z.imag == 0 and z.real.is_integer() for z in map(complex, entries)), + "two-qubit literal entries not real integral") + actual = tuple(Fraction(int(z.real), 4**(2*width)) for z in entries) + require(actual == expected[key], f"two-qubit block disagrees at {key}") + + +def check_character_separation(): + signatures = set() + for x, y in combinations_with_replacement(range(16), 2): + signature = tuple((x >> i & 1) + (y >> i & 1) for i in range(4)) + tuple( + (((x >> i) & (x >> j)) ^ ((y >> i) & (y >> j))) & 1 + for i in range(4) for j in range(i)) + signatures.add(signature) + require(len(signatures) == 136, "diagonal Clifford characters collide") + + +def direct_four_qubit_interference(): + """Measure signed rectangle interference in literal partial-Hadamard matrices.""" + # Primitive polynomials in degrees 1 through 4. Multiplication by x + # permutes all nonzero low-bit vectors transitively. Each matrix below + # is a linear output permutation of H^{tensor j} times diagonal gates. + for j, modulus in enumerate((0b11, 0b111, 0b1011, 0b10011), start=1): + q = 1 << j + row_map = list(range(q)) + both_sums = Counter() + row_pairs = list(combinations(range(16), 2)) + phases = (1, 1j, -1, -1j) + phases_seen = set() + for _ in range(q - 1): + phases_seen.add(row_map[1]) + # sqrt(q)V: Gaussian unit entries; use row/column chirps to + # ensure that the rectangle sum tests cancellation of phases. + gate = [[phases[((i & 3).bit_count() + (k & 7).bit_count() + + 2 * (row_map[i % q] & k).bit_count()) % 4] + if i // q == k // q else 0 for k in range(16)] for i in range(16)] + for i, h in row_pairs: + for k, l in row_pairs: + x, y = gate[i][k] * gate[h][l], gate[i][l] * gate[h][k] + if x and y: + both_sums[i, h, k, l] += x * y.conjugate() + row_map = [((v << 1) ^ (modulus if v & (q >> 1) else 0)) for v in row_map] + expected_count = (16 // q) * (q * (q-1) // 2)**2 + require(len(phases_seen) == q-1 and len(both_sums) == expected_count, + "incomplete four-qubit rectangle control") + require(set(both_sums.values()) == {-1}, "four-qubit rectangle signs") + + +def check_four_qubit(): + blocks = normal_blocks() + scale = 1 << 70 + lower, upper = Fraction(83059830, scale), Fraction(87222165730875, scale) + factors = eigenpolynomials(4, blocks) + require(len(factors) == 12 and sum((len(p)-1)*m for p,m in factors.items()) == 32896, + "wrong nonzero characteristic factors") + multiplicity = Counter() + for p, count in factors.items(): + if len(p) == 2: + root = -p[1] + require(lower <= root <= upper, "linear root outside endpoints") + multiplicity[root] = count + else: + _, b, c = p + discriminant = b*b - 4*c + require(discriminant > 0 and count == 225, "quadratic multiplicity") + require(isqrt(discriminant.numerator)**2 != discriminant.numerator or + isqrt(discriminant.denominator)**2 != discriminant.denominator, + "quadratic is reducible") + require(lower < -b/2 < upper and + lower**2 + b*lower + c > 0 and upper**2 + b*upper + c > 0, + "quadratic roots outside endpoints") + require(multiplicity[lower] == 210 and multiplicity[upper] == 1, "endpoint multiplicity") + require(upper/lower == Fraction(2100225, 2), "squared condition number") + # Full-support subensemble alone has no additional null directions. + flat = eigenpolynomials(4, normal_blocks(only_shell=4)) + require({-p[1]*scale: m for p, m in flat.items()} == + {315: 256, 630: 3840, 588: 14400, 672: 14400}, "flat-frame spectrum") + + +if __name__ == '__main__': + check_character_separation() + direct_two_qubit() + check_four_qubit() + print('PASS two-site raw spectrum, flat subframe, kernel and all 11,520 two-qubit controls') diff --git a/research/clifford-two-site-canonical/denominators.py b/research/clifford-two-site-canonical/denominators.py new file mode 100644 index 0000000000..da17480ac7 --- /dev/null +++ b/research/clifford-two-site-canonical/denominators.py @@ -0,0 +1,81 @@ +"""Amount of odd division needed by every matrix-unit readout of the two-site decoder.""" +from collections import Counter +from fractions import Fraction +from math import gcd, lcm +from double_readout import P, binary_transform, prepare +from flag_weights import solution, weight +from compile_row import apply +from bell_reads import transvection + + +def shell_map(j): + S = P.IDENTITY + for i in range(j): + S = tuple(transvection(17 << i, v) for v in S) + return S + + +def census(): + unit = lcm(*(v.denominator for root in (0,1,16) for v in solution(root))) + denominator = unit * 16 + shells = [] + for j in range(5): + S = shell_map(j) + X = P.point_set(S[:4]) + P.require(P.distance(P.BASE, X) == j, "shell representative") + ws = [apply(S,v) for v in range(256)] + counts = Counter() + distinct = set() + zeros = 0 + for x in range(16): + for y in range(16): + numerators = [] + for t in range(16): + for z in range(16): + val = weight(P.BASE, z | (x<<4), X, ws[t | (y<<4)]) + numerators.append(val.numerator * (unit // val.denominator)) + binary_transform(numerators) + for value in numerators: + d = denominator // gcd(denominator, value) + odd = d // (d & -d) + zeros += value == 0 + distinct.add(abs(value)) + counts[odd] += 1 + shells.append((j, len(distinct), counts, zeros)) + return shells + + +def verify(): + full = 21556663020569210160884269703315625 + shells = census() + profile = [(distinct, zeros, len(counts)) for _,distinct,counts,zeros in shells] + P.require(profile == [(10,64140,10),(25,62720,22),(42,57216,35), + (44,38912,36),(27,0,24)], "shell multipliers or zeros") + for j, _, counts, _ in shells: + P.require(sum(counts.values()) == 65536 and full not in counts and + lcm(*counts) == (full//3 if j == 0 else full), "shell common divisor") + + divisors = [] + for j,i,k,m,n,expected in ( + (0,1,1,1,1,562788258996425089753125), + (1,2,2,4,4,6293916210385170849893217431625), + ): + read = prepare(shell_map(j),0,0,[(i,k,m,n,(1,0))],weight) + gauss = read(0) + den = lcm(*(v.denominator for v in gauss)) + divisor = den // (den & -den) + P.require(divisor == expected, "nonzero matrix-unit divisor witness") + divisors.append(divisor) + P.require(lcm(*divisors) == full and full.bit_length() == 115, + "minimal joint odd divisor") + joint = [(0,0,1,1,(1,0)), (1,1,2,2,(1,0)), (1,1,4,2,(2,0))] + value = prepare(shell_map(4),0,0,joint,weight)(0) + expected = Fraction(35434033216309953801405149, 1412737467716023757103711499276492800000) + P.require(value == (expected,0) and expected.denominator == (full << 16), + "one superposed input attains the complete divisor") + print("PASS 327,680 exact Walsh multipliers and a pair of matrix-unit witnesses.", + "Sharp common odd divisor:", full) + + +if __name__ == '__main__': + verify() diff --git a/research/clifford-two-site-canonical/double_readout.py b/research/clifford-two-site-canonical/double_readout.py new file mode 100644 index 0000000000..7c09d1113f --- /dev/null +++ b/research/clifford-two-site-canonical/double_readout.py @@ -0,0 +1,81 @@ +"""Canonical four-qubit Clifford coordinates for eleven repeated sites and an arbitrary pair.""" +import argparse +from collections import defaultdict +from fractions import Fraction +import json +from pathlib import Path + +from predecessor import pointed as P +from compile_row import apply + + +def binary_transform(table): + """Walsh coefficients in the low four output and high four input bits.""" + for bit in range(8): + step = 1 << bit + for k in range(0, 256, 2 * step): + for i in range(k, k + step): + left, right = table[i], table[i + step] + table[i], table[i + step] = left + right, left - right + + +def prepare(target, row, column, joint, weights, left_basis=P.IDENTITY, right_basis=P.IDENTITY): + """Return a shared-block readout for Pauli translates of a supplied symplectic map. + + joint contains (i,k,m,n,(real,imag)) in the indicated bases. Duplicate terms add. + weights(L,u,X,w) is the inverse-transformed marked radial input for the two flags. + """ + target, left, right = tuple(target), tuple(left_basis), tuple(right_basis) + relative = P.transformed_inputs(target, left, right) + P.require(all(type(k) is int and 0 <= k < 16 for k in (row, column)), + "expected four-bit repeated coordinates") + space = P.point_set(relative[:4]) + images = [apply(relative, v) for v in range(256)] + blocks = defaultdict(list) + for i, k, m, n, (real, imag) in joint: + P.require(all(type(v) is int and 0 <= v < 16 for v in (i, k, m, n)), + "expected four-bit joint coordinates") + blocks[row ^ i, column ^ k].append((m, n, Fraction(real), Fraction(imag))) + + lanes = {} + for (x, y), terms in blocks.items(): + table = [weights(P.BASE, (x << 4) | z, space, images[(y << 4) | t]) + for t in range(16) for z in range(16)] + binary_transform(table) + for m, n, real, imag in terms: + h = table[(row ^ m) | ((column ^ n) << 4)] * Fraction(1,16) + address = x ^ m, y ^ n + a, b = lanes.get(address, (0, 0)) + lanes[address] = a + h * real, b + h * imag + active = [(m, n, scalar) for (m, n), scalar in lanes.items() if scalar != (0, 0)] + + def read(p): + P.require(type(p) is int and 0 <= p < 256, "expected an eight-bit Pauli label") + real = imag = Fraction(0) + for m, n, scalar in active: + val = P.conjugate(P.transition(target, p, m, n, left, right)) + a, b = P.Q.multiply(scalar, val) + real += a + imag += b + return real, imag + return read + + +def main(): + from flag_weights import weight + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('request', type=Path) + req = json.loads(parser.parse_args().request.read_text()) + left, right = req.get('left_basis', P.IDENTITY), req.get('right_basis', P.IDENTITY) + readouts = {} + results = [] + for S, p in req['queries']: + S = tuple(S) + if S not in readouts: + readouts[S] = prepare(S, req['row'], req['column'], req['joint'], weight, left, right) + results.append([str(x) for x in readouts[S](p)]) + print(json.dumps(results)) + + +if __name__ == '__main__': + main() diff --git a/research/clifford-two-site-canonical/example.json b/research/clifford-two-site-canonical/example.json new file mode 100644 index 0000000000..cd8e6956fe --- /dev/null +++ b/research/clifford-two-site-canonical/example.json @@ -0,0 +1,10 @@ +{ + "row": 0, + "column": 0, + "joint": [[1, 0, 0, 1, [1, 0]]], + "queries": [ + [[1, 2, 4, 8, 16, 32, 64, 128], 0], + [[1, 2, 4, 8, 16, 32, 64, 128], 1], + [[1, 2, 4, 8, 16, 32, 64, 128], 16] + ] +} diff --git a/research/clifford-two-site-canonical/flag_weights.py b/research/clifford-two-site-canonical/flag_weights.py new file mode 100644 index 0000000000..2d87f8771e --- /dev/null +++ b/research/clifford-two-site-canonical/flag_weights.py @@ -0,0 +1,224 @@ +"""Invert the width-13 central Gram on all marked Lagrangians, including exterior marks.""" +from array import array +from collections import Counter +from fractions import Fraction +from functools import cache +from itertools import combinations +import json +from math import lcm + +from predecessor import pointed as P +from compile_row import UPPER, apply, compose, pairing, shear + +IDENTITY = P.IDENTITY +BASE = P.BASE + + +@cache +def spaces(): + bases, masks, _ = P.quotient() + return bases, masks, {mask: i for i, mask in enumerate(masks)} + + +@cache +def parabolic_generators(): + generators = [shear(1 << k) for k in range(len(UPPER))] + for i in range(4): + for j in range(4): + if i != j: + columns = list(IDENTITY) + columns[i] ^= 1 << j + columns[j+4] ^= 1 << (i+4) + generators.append(tuple(columns)) + return tuple(generators) + + +@cache +def mark_transports(): + # Maps (Z, arbitrary mark) to one of the three fixed flags. + maps = {} + for root in (0, 1, 16): + queue = [root] + maps[root] = (root, IDENTITY) + for v in queue: + for g in parabolic_generators(): + w = apply(g, v) + if w not in maps: + maps[w] = root, compose(maps[v][1], g) + queue.append(w) + P.require(len(maps) == 256, "three parabolic mark orbits") + return maps + + +@cache +def actions(columns): + bases, _, index = spaces() + vec = bytes(apply(columns, v) for v in range(256)) + lag = array('H', (index[P.point_set(tuple(vec[b] for b in B))] for B in bases)) + return vec, lag + + +@cache +def orbits(root): + """Stabilizer orbits on pairs (variable Lagrangian, unrestricted mark).""" + _, masks, _ = spaces() + gens = [actions(g) for g in parabolic_generators() if apply(g, root) == root] + labels = bytearray([255]) * (len(masks) * 256) + reps = [] + for seed in range(len(labels)): + if labels[seed] != 255: + continue + idx = len(reps) + P.require(idx < 255, "orbit labels fit the inventory") + reps.append(divmod(seed, 256)) + labels[seed] = idx + queue = array('I', [seed]) + for state in queue: + space, mark = divmod(state, 256) + for vec, lag in gens: + dest = (lag[space] << 8) | vec[mark] + if labels[dest] == 255: + queue.append(dest) + labels[dest] = idx + return labels, reps + + +@cache +def class_actions(): + moves = [actions(tuple(b ^ (a if pairing(a, b) else 0) for b in IDENTITY)) for a in range(256)] + planes = [(a, b, a ^ b) for a, b in combinations(range(1, 256), 2) + if b < (a ^ b) and not pairing(a,b)] + P.require(len(planes) == 5355, "isotropic two-plane census") + return moves, planes + + +@cache +def class_rows(root): + labels, reps = orbits(root) + moves, planes = class_actions() + rows = [] + for L, v in reps: + tr = Counter(labels[(lag[L] << 8) | vec[v]] for vec, lag in moves[1:]) + alt = Counter() + for a, b, c in planes: + av, al = moves[a] + bv, bl = moves[b] + cv, cl = moves[c] + alt[labels[(cl[bl[al[L]]] << 8) | cv[bv[av[v]]]]] += 1 + rows.append((tr, alt)) + return rows + + +@cache +def character_levels(): + """Joint class-sum eigenvalues and Gram scalars on the three permutation modules.""" + table = json.loads((P.HERE/'predecessor/source/CLASS-ALGEBRA.json').read_bytes()) + classes = table['classes'] + indices = [next(i for i, c in enumerate(classes) if c['size'] == size) + for size in (255, 5355)] + bases, masks, _ = spaces() + fixed = [] + for c in classes: + previous = None + for s in c['representatives']: + vec = [apply(s, v) for v in range(256)] + fixed_marks = sum(1 << v for v in range(256) if vec[v] == v) + counts = [0, 0, 0] + for basis, mask in zip(bases, masks, strict=True): + if all((mask >> vec[b]) & 1 for b in basis): + inside = (mask & fixed_marks).bit_count() + counts[0] += 1 + counts[1] += inside-1 + counts[2] += fixed_marks.bit_count()-inside + P.require(previous in (None, counts), "fixed flags across rational packet") + previous = counts + fixed.append(previous) + levels = {} + dims = [0, 0, 0] + for row in table['characters']: + norm, rem = divmod(sum(c['size'] * x*x for c, x in zip(classes, row)), P.ORDER) + P.require(norm and not rem, "character packet norm") + mult = [Fraction(sum(c['size'] * x * m[i] for c, x, m in zip(classes, row, fixed)), + P.ORDER * norm) for i in range(3)] + P.require(all(n.denominator == 1 and n >= 0 for n in mult), "flag character multiplicity") + for i, n in enumerate(mult): + dims[i] += row[0] * n + if not any(mult): + continue + pair = tuple(Fraction(classes[i]['size'] * row[i], row[0]) for i in indices) + P.require(all(x.denominator == 1 for x in pair), "integral class-sum spectrum") + scalar = Fraction(sum(c['size'] * x * (-64)**c['fixed'] for c, x in zip(classes, row)), + row[0] * 16**12) + key = tuple(map(int, pair)) + P.require(scalar > 0 and key not in levels, "separating central class sums") + levels[key] = scalar + P.require(dims == [2295,34425,550800] and len(levels) == 31, "marked module dimensions") + return levels + + +@cache +def separating_operator(): + levels = character_levels() + # Both class operators have integer eigenvalues; a scale above the entire + # transvection interval prevents collisions in their integer linear combination. + scale = 511 + values = {a + scale*b: val for (a,b), val in levels.items()} + P.require(len(values) == len(levels), "central interpolation nodes") + return scale, values + + +def newton_values(nodes, values): + coeff = list(values) + for width in range(1,len(nodes)): + for i in range(len(nodes)-1,width-1,-1): + coeff[i] = (coeff[i]-coeff[i-1]) / (nodes[i]-nodes[i-width]) + return coeff + + +def rhs(j): + return Fraction(1, 4**13) * Fraction(-1,32)**j + + +@cache +def class_matrix(root): + scale, _ = separating_operator() + result = [] + for tr, alt in class_rows(root): + counts = tr.copy() + counts.update({k: scale*v for k,v in alt.items()}) + result.append(tuple(counts.items())) + return result + + +def apply_gram(root, vector, reciprocal): + _, levels = separating_operator() + nodes = sorted(levels) + coeff = newton_values(nodes, [1/levels[k] if reciprocal else levels[k] for k in nodes]) + den = lcm(*(c.denominator for c in coeff)) + ci = [int(c*den) for c in coeff] + input_den = lcm(*(x.denominator for x in vector)) + src = [int(x*input_den) for x in vector] + state = [ci[-1]*v for v in src] + matrix = class_matrix(root) + for j in reversed(range(len(nodes)-1)): + state = [sum(w*state[k] for k,w in row) - nodes[j]*state[i] + ci[j]*src[i] + for i,row in enumerate(matrix)] + return tuple(Fraction(x, den*input_den) for x in state) + + +@cache +def solution(root): + _, reps = orbits(root) + _, masks, _ = spaces() + raw = tuple(rhs(P.distance(BASE, masks[i])) if v == root else Fraction(0) for i,v in reps) + return apply_gram(root, raw, True) + + +def weight(L, u, X, w): + """Value at (X,w) of the inverse of h(distance(Z,X)) [u=w], with L=Z.""" + P.require(L == BASE, "left Lagrangian must be the reference Z in the supplied bases") + _, _, index = spaces() + root, g = mark_transports()[u] + vec, lag = actions(g) + idx = orbits(root)[0][(lag[index[X]] << 8) | vec[w]] + return solution(root)[idx] diff --git a/research/clifford-two-site-canonical/predecessor/pointed.py b/research/clifford-two-site-canonical/predecessor/pointed.py new file mode 100644 index 0000000000..8280ca60f7 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/pointed.py @@ -0,0 +1,161 @@ +"""Canonical 12+1 readout via pointed Lagrangians. All coefficient pairs are Gaussian rational.""" +import argparse +from collections import Counter +from fractions import Fraction +from functools import cache +import json +from math import lcm +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0,str(HERE/'predecessor')) +from canonical import IDENTITY, ORDER, conjugate, distance, point_set, quotient, transition +from adjoint import Q +from compile_row import apply, compose, inverse, is_symplectic, pairing, span + +BASE = (1 << 16)-1 +NFLAGS = 34425 + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def relation(L, v, X, w): + """Ordered orbit of (L,v),(X,w); marks must be nonzero members.""" + return (distance(L,X), int(v==w), (X>>v)&1, (L>>w)&1, pairing(v,w)) + + +@cache +def geometry(): + bases,spaces,rings = quotient() + elems = [span(B) for B in bases] + flags = [(L,v) for L,vs in zip(spaces,elems,strict=True) for v in vs if v] + counts = Counter(relation(BASE,1,L,v) for L,v in flags) + reps = {relation(BASE,1,L,v):(L,v) for L,v in flags} + require(len(flags)==NFLAGS and list(counts.values()).count(0)==0,"flag inventory") + return spaces,elems,counts,reps + + +def class_inverse(data): + classes = data['classes'] + rows = data['characters'] + coeffs = [] + for chi in rows: + n,rem = divmod(sum(c['size']*a*a for c,a in zip(classes,chi,strict=True)),ORDER) + require(not rem and chi[0]%n==0,"ordinary packet size") + degree = chi[0]//n + eig = Fraction(sum(c['size']*a*(-64)**c['fixed'] for c,a in zip(classes,chi,strict=True)), + chi[0]*16**12) + coeffs.append(degree/eig) + den = lcm(*(x.denominator for x in coeffs)) + nums = [(x*den).numerator for x in coeffs] + return [Fraction(sum(v*c for v,c in zip(col,nums,strict=True)),den*ORDER) + for col in zip(*rows,strict=True)] + + +@cache +def orbital_kernels(): + data = json.loads((HERE/'predecessor'/'source'/'CLASS-ALGEBRA.json').read_text()) + spaces,elems,counts,_ = geometry() + gram,recip = Counter(),Counter() + for c,reciprocal in zip(data['classes'],class_inverse(data),strict=True): + old = None + for S in c['representatives']: + action = [apply(S,v) for v in range(256)] + obs = Counter() + for L,vs in zip(spaces,elems,strict=True): + ws = [action[v] for v in vs] + X = sum(1<>v)&1,(L>>w)&1,pairing(v,w))] += 1 + if old is not None: + require(old==obs,"rationally fused classes have unequal displacement census") + old=obs + for key,n in old.items(): + mass=c['size']*n + gram[key]+=mass*(-64)**c['fixed'] + recip[key]+=mass*reciprocal + G = {k:Fraction(gram[k],NFLAGS*m*16**12) for k,m in counts.items()} + I = {k:recip[k]/(NFLAGS*m) for k,m in counts.items()} + return G,I + + +def rhs(j): + return Fraction(1,4**13)*Fraction(-1,64)**j/(1<<(4-j)) + + +@cache +def weights(): + """Scalar weights for the unmarked summand and every ordered pointed pair.""" + spaces,_,_,reps = geometry() + _,kernel = orbital_kernels() + # Recover the unmarked kernel by summing inverse transition weights over + # all marked target points at a fixed Lagrangian, starting at one marked flag. + by_shell = {} + bases,_,rings = quotient() + for B,L,j in zip(bases,spaces,rings,strict=True): + if j not in by_shell: + by_shell[j]=sum(kernel[relation(BASE,1,L,v)] for v in span(B) if v) + unmarked=[] + candidates = {j:L for j,L in zip(rings,spaces,strict=True)} + for j in range(5): + X=candidates[j] + unmarked.append(sum(by_shell[distance(X,Y)]*rhs(i) for Y,i in zip(spaces,rings,strict=True))) + restricted = [(Y,rhs(i)) for Y,i in zip(spaces,rings,strict=True) if (Y>>1)&1] + pointed = {k:sum(kernel[relation(X,x,Y,1)]*b for Y,b in restricted) + for k,(X,x) in reps.items()} + return tuple(unmarked),pointed + + +def transformed_inputs(target,left_basis,right_basis): + for S in (target,left_basis,right_basis): + require(is_symplectic(S),"four-qubit symplectic map required") + return compose(inverse(tuple(left_basis)),compose(tuple(target),tuple(right_basis))) + + +def site_weights(relative,r,c,unmarked,pointed): + """Walsh factors indexed in the repeated site's left and right bases.""" + require(type(r) is int and type(c) is int and 0<=r<16 and 0<=c<16,"invalid repeated-site labels") + X=point_set(relative[:4]) + raw=[Fraction(0)]*256 + raw[0]=unmarked[distance(BASE,X)] + for v in range(1,16): + w=apply(relative,v) + for u in range(1,16): + raw[u | (v<<4)]=pointed[relation(BASE,u,X,w)] + for bit in range(8): + shift=1<> 1) & argument).bit_count() % 2 + + +def linear_forms(offset, columns, width): + return [((offset >> i) & 1) | sum(((c >> i) & 1) << (j+1) + for j,c in enumerate(columns)) for i in range(width)] + + +def evaluate_forms(forms, argument): + return sum(evaluate_form(f,argument) << j for j,f in enumerate(forms)) + + +def substitute_form(f, forms): + return reduce(xor, (forms[j] for j in Q.bits(f >> 1)), f & 1) + + +def validate(chart, n): + width, offset, cols, terms, a, b, e = chart + Q.need(width == n and all(type(x) is int for x in (width,a,b,e)) and e >= 0, + "Invalid chart width or scalar") + Q.validate_integer(offset,1 << n,"Invalid chart offset") + for col in cols: + Q.validate_integer(col,1 << n,"Invalid support column") + Q.basis(cols) + phase = dict(terms) + Q.need(len(phase)==len(terms),"Repeated phase monomial") + for m,v in phase.items(): + Q.validate_integer(m,1 << len(cols),"Invalid phase monomial") + Q.need(type(v) is int and 1 <= v <= 3 and + (m.bit_count() <= 1 or (m.bit_count() == 2 and v == 2)),"Invalid quadratic phase") + + +def table(target): + """Normalized Choi numerators at local address r+16c; common denominator 2**e.""" + Q.need(is_symplectic(target) and all(type(v) is int for v in target), "Invalid symplectic map") + axes = decompose(target) + values = [(int((j & 15) == (j >> 4)),0) for j in range(256)] + for axis in axes: + x,z = divmod(axis,16) + updated = [] + for j,(a,b) in enumerate(values): + e = 1 + ((x & z).bit_count() & 1) + 2*((z & (j ^ x)).bit_count() & 1) + u,v = Q.multiply_i(values[j ^ x],e) + updated.append(Q.multiply((1,1),(a+u,b+v))) + values = updated + return values, len(axes)+2 + + +@cache +def site(target): + vals, den = table(target) + active = [j for j,x in enumerate(vals) if x != (0,0)] + origin = min(active) + independent = [] + pivots = {} + for j in active: + u = j ^ origin + if Q.coordinates(pivots, u) is None: + independent.append(u) + pivots = Q.basis(independent) + positions = sorted(pivots) + columns = [pivots[j][0] for j in positions] + rotations = [Q.multiply_i(vals[origin],k) for k in range(4)] + phase = {1 << i: rotations.index(vals[origin ^ c]) for i,c in enumerate(columns)} + for i,c in enumerate(columns): + for h,d in enumerate(columns[:i]): + value = (rotations.index(vals[origin ^ c ^ d]) - phase[1<> i) & 1) << h for h,i in enumerate(positions)) + reconstructed = reduce(xor,(columns[h] for h in Q.bits(coords)),origin) + expected = rotations[Q.value(phase,coords)] if reconstructed == j else (0,0) + Q.need(value==expected,"Single-site affine phase reconstruction") + return origin, positions, columns, phase, vals[origin], den + + +def eliminate(n, fixed, phase): + """Sum n-fixed Boolean variables, retaining the affine conditions on the fixed ones.""" + scalar = (1,0) + constraints = [] + while n > fixed: + n -= 1 + last = 1 << n + a = phase.pop(last,0) + neighbours = 0 + for mask in tuple(phase): + if mask & last: + neighbours ^= mask ^ last + del phase[mask] + if a & 1: + scalar = Q.multiply(scalar,(1,1 if a == 1 else -1)) + Q.affine(phase,neighbours << 1,-a) + continue + scalar = (2*scalar[0],2*scalar[1]) + if neighbours >> fixed: + # Solve a second *summed* variable. No factor accompanies fixing this bit. + _,forms = solution(n,[(neighbours,a//2)]) + phase = Q.substitute(phase,forms) + n -= 1 + else: + constraints.append((neighbours,a//2)) + resolved = solution(fixed,constraints) + if resolved is None: + return None + rank, forms = resolved + return rank, forms, Q.substitute(phase,forms), scalar + + +class Observation: + def __init__(self, chart): + validate(chart,104) + _,offset,columns,terms,a,b,self.denominator = chart + self.rank = len(columns) + self.scalar = (a,b) + self.phase = dict(terms) + # The high half of each address is the physical row, the low half its column. + raw = linear_forms(offset,columns,104) + raw = [((f >> 1) << 9) | (f & 1) for f in raw] + self.blocks = [] + for t in range(13): + rows = [raw[52+4*t+j] ^ (1 << (5+j)) for j in range(4)] + self.blocks.append(rows + raw[4*t:4*t+4]) + + def fibre(self,target): + origin,pivots,cols,local,anchor,den = site(tuple(target)) + equations = [] + phase = {k << 8:v for k,v in self.phase.items()} + for block in self.blocks: + displaced = [f ^ ((origin >> j) & 1) for j,f in enumerate(block)] + coords = [displaced[j] for j in pivots] + for j in range(8): + if j not in pivots: + eq = reduce(xor,(coord for col,coord in zip(cols,coords,strict=True) if col >> j & 1), + displaced[j]) + equations.append((eq >> 1,eq & 1)) + for k,v in Q.substitute(local,coords).items(): + Q.term(phase,k,-v) + for j in range(4): + Q.product(phase,1 << (1+j),block[j]) + zero = (8,0,(),(),0,0,0) + resolved = solution(8+self.rank,equations) + if resolved is None or self.scalar == (0,0): + return zero + n,forms = resolved + labels = forms[:8] + # Highest-pivot elimination leaves a prefix of free label variables before observations. + label_mask = reduce(int.__or__,(f >> 1 for f in labels),0) + fixed = label_mask.bit_length() + Q.need(label_mask == (1 << fixed)-1,"Noncontiguous free labels") + summed = eliminate(n,fixed,Q.substitute(phase,forms)) + if summed is None: + return zero + rank, pars, q, scale = summed + label = [substitute_form(f,pars) for f in labels] + offset = evaluate_forms(label,0) + columns = tuple(evaluate_forms(label,1 << j) ^ offset for j in range(rank)) + scalar = Q.multiply(Q.multiply(self.scalar,power(conjugate(anchor),13)),scale) + scalar = Q.multiply_i(scalar,q.pop(0,0)) + (a,b),e = Q.normalize(scalar,self.denominator+13*den) + return 8,offset,columns,tuple(sorted(q.items())),a,b,e + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('input',type=Path) + request = json.loads(parser.parse_args().input.read_text()) + if ('chart' in request) == ('circuit' in request): + parser.error("Supply exactly one of chart or circuit") + chart = request['chart'] if 'chart' in request else Q.signature(104,request['circuit'],request.get('initial',0)) + observation = Observation(chart) + print(json.dumps([observation.fibre(target) for target in request['targets']])) diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/canonical.py b/research/clifford-two-site-canonical/predecessor/predecessor/canonical.py new file mode 100644 index 0000000000..4168b9aecb --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/canonical.py @@ -0,0 +1,128 @@ +"""Canonical coefficients for any repeated site coordinate, via the five Lagrangian distances.""" +import argparse +from collections import Counter +from fractions import Fraction +from functools import cache +from pathlib import Path +import json +import sys + +sys.path.insert(0,str(Path(__file__).resolve().parent)) +from adjoint import HERE, IDENTITY, Q, conjugate, table +from bell_reads import transvection +from compile_row import apply, span + +ORDER = 47377612800 +COUNTS = (1,30,280,960,1024) + + +def point_set(point): + return sum(1 << v for v in span(point)) + + +def distance(left,right): + return 5-(left & right).bit_count().bit_length() + + +@cache +def quotient(): + # Close the diagonal Lagrangian under a fixed list of symplectic transvections. + base = (1,2,4,8) + initial = point_set(base) + queue = [base] + seen = {initial} + axes = (1,2,4,8,16,32,64,128,3,6,12) + for point in queue: + for axis in axes: + image = tuple(transvection(axis,v) for v in point) + key = point_set(image) + if key not in seen: + seen.add(key) + queue.append(image) + points = [point_set(point) for point in queue] + rings = [distance(initial,X) for X in points] + Q.need(tuple(rings.count(j) for j in range(5))==COUNTS,"2,295 Lagrangians with correct sphere census") + return queue,points,rings + + +@cache +def radial_matrix(): + bases,points,rings = quotient() + classes = json.loads((HERE/'source/CLASS-ALGEBRA.json').read_text())['classes'] + mass = [0]*5 + for c in classes: + counts = [] + for s in c['representatives']: + action = [apply(s,v) for v in range(256)] + moved = [point_set(tuple(action[v] for v in X)) for X in bases] + counts.append(Counter(distance(a,b) for a,b in zip(moved,points,strict=True))) + Q.need(all(h==counts[0] for h in counts),"Rational packet has dissimilar displacements") + for j in range(5): + mass[j] += c['size']*(-64)**c['fixed']*counts[0][j] + kernel = [Fraction(v,len(points)*cnt*16**12) for v,cnt in zip(mass,COUNTS,strict=True)] + reps = [points[rings.index(j)] for j in range(5)] + return tuple(tuple(sum(kernel[distance(Y,X)] for X,r in zip(points,rings,strict=True) if r==k) + for k in range(5)) for Y in reps) + + +def solve(matrix,rhs): + augmented = [list(row)+[v] for row,v in zip(matrix,rhs,strict=True)] + for j in range(5): + pivot = next(i for i in range(j,5) if augmented[i][j]) + augmented[j],augmented[pivot] = augmented[pivot],augmented[j] + augmented[j]=[v/augmented[j][j] for v in augmented[j]] + for i in range(5): + if i!=j: + a=augmented[i][j] + augmented[i]=[v-a*w for v,w in zip(augmented[i],augmented[j],strict=True)] + return tuple(row[-1] for row in augmented) + + +@cache +def profile(): + # Stored values multiply conjugate(V[r,c]); factor 1/16 of extraction is absorbed. + rhs = tuple(Fraction(1,4**13)*Fraction(-1,64)**j for j in range(5)) + return solve(radial_matrix(),rhs) + + +@cache +def unitary(target): + # table divides the literal unitary by 4 for Choi normalization. + matrix, shift = table(target) + return matrix,shift-2 + + +def transition(target,p,r,c,left_basis=IDENTITY,right_basis=IDENTITY): + """Literal for a,b supplied as normalized stabilizer columns.""" + Q.need(all(type(v) is int and 0 <= v < m for v,m in ((p,256),(r,16),(c,16))),"site/Pauli labels") + x,z = divmod(p,16) + mid,e = unitary(tuple(target)) + left,u = unitary(tuple(left_basis)) + right,v = unitary(tuple(right_basis)) + result = (0,0) + for j in range(16): + l = conjugate(left[(j ^ x) | (r << 4)]) + if (z & j).bit_count()%2: + l = (-l[0],-l[1]) + if l == (0,0): + continue + for k in range(16): + term = Q.multiply(l,Q.multiply(mid[j | (k << 4)],right[k | (c << 4)])) + result = result[0]+term[0],result[1]+term[1] + return tuple(Fraction(value,1 << (e+u+v)) for value in result) + + +def coefficient(target,p,r,c,left_basis=IDENTITY,right_basis=IDENTITY): + val = conjugate(transition(target,p,r,c,left_basis,right_basis)) + j = distance(point_set(tuple(left_basis[:4])),point_set(tuple(apply(target,b) for b in right_basis[:4]))) + weight = profile()[j] + return val[0]*weight,val[1]*weight + + +if __name__=='__main__': + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('input',type=Path) + rec=json.loads(parser.parse_args().input.read_text()) + print(json.dumps([[str(v) for v in coefficient(tuple(t),p,rec['row'],rec['column'], + tuple(rec.get('left_basis',IDENTITY)),tuple(rec.get('right_basis',IDENTITY)))] + for t,p in rec['queries']])) diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/CLASS-ALGEBRA.json b/research/clifford-two-site-canonical/predecessor/predecessor/source/CLASS-ALGEBRA.json new file mode 100644 index 0000000000..cbee453d50 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/CLASS-ALGEBRA.json @@ -0,0 +1,165 @@ +{ +"classes":[ +{"size":1,"fixed":8,"representatives":[[1,2,4,8,16,32,64,128]]}, +{"size":987033600,"fixed":1,"representatives":[[154,29,55,73,118,33,251,224]]}, +{"size":987033600,"fixed":1,"representatives":[[42,98,59,245,15,85,165,198]]}, +{"size":329011200,"fixed":1,"representatives":[[194,245,128,166,5,82,143,80]]}, +{"size":329011200,"fixed":1,"representatives":[[42,68,222,16,40,150,76,9]]}, +{"size":987033600,"fixed":1,"representatives":[[148,211,117,173,154,193,22,185]]}, +{"size":987033600,"fixed":1,"representatives":[[12,254,217,49,93,7,62,237]]}, +{"size":1480550400,"fixed":1,"representatives":[[44,208,158,123,160,196,75,245]]}, +{"size":1480550400,"fixed":1,"representatives":[[178,14,118,201,167,84,222,107]]}, +{"size":1184440320,"fixed":1,"representatives":[[117,186,49,214,200,79,180,213]]}, +{"size":1184440320,"fixed":1,"representatives":[[141,25,146,248,190,37,63,252]]}, +{"size":329011200,"fixed":1,"representatives":[[42,28,89,20,121,225,38,248]]}, +{"size":1974067200,"fixed":1,"representatives":[[148,92,234,47,105,104,164,132]]}, +{"size":36556800,"fixed":1,"representatives":[[148,47,108,122,240,41,153,9]]}, +{"size":1579253760,"fixed":1,"representatives":[[181,94,208,41,23,69,31,21]]}, +{"size":3384115200,"fixed":1,"representatives":[[226,135,81,47,123,219,75,180]]}, +{"size":2632089600,"fixed":1,"representatives":[[231,237,30,164,118,139,248,6]]}, +{"size":493516800,"fixed":2,"representatives":[[194,16,78,230,46,247,12,54]]}, +{"size":164505600,"fixed":2,"representatives":[[194,146,231,40,134,187,130,58]]}, +{"size":493516800,"fixed":2,"representatives":[[197,55,22,26,8,20,107,73]]}, +{"size":370137600,"fixed":2,"representatives":[[42,223,98,199,129,25,131,158]]}, +{"size":370137600,"fixed":2,"representatives":[[95,188,85,7,143,2,140,76]]}, +{"size":592220160,"fixed":2,"representatives":[[119,62,242,34,183,156,99,237]]}, +{"size":164505600,"fixed":2,"representatives":[[89,66,216,101,202,121,52,152]]}, +{"size":54835200,"fixed":2,"representatives":[[194,123,14,193,111,187,130,211]]}, +{"size":123379200,"fixed":2,"representatives":[[86,114,172,52,93,59,60,219]]}, +{"size":41126400,"fixed":2,"representatives":[[232,159,179,86,135,43,76,48]]}, +{"size":92534400,"fixed":2,"representatives":[[33,30,96,168,49,32,204,104]]}, +{"size":92534400,"fixed":2,"representatives":[[150,177,85,206,245,15,163,255]]}, +{"size":61689600,"fixed":2,"representatives":[[232,80,90,191,69,196,130,248]]}, +{"size":197406720,"fixed":2,"representatives":[[118,42,240,89,25,227,210,21]]}, +{"size":109670400,"fixed":2,"representatives":[[65,203,139,2,211,95,157,104]]}, +{"size":658022400,"fixed":2,"representatives":[[241,178,184,242,90,116,201,87]]}, +{"size":12185600,"fixed":2,"representatives":[[220,125,224,203,172,77,115,192]]}, +{"size":526417920,"fixed":2,"representatives":[[34,175,29,217,44,122,5,114]]}, +{"size":1128038400,"fixed":2,"representatives":[[108,66,67,192,128,241,209,101]]}, +{"size":877363200,"fixed":2,"representatives":[[97,40,33,147,246,168,167,243]]}, +{"size":82252800,"fixed":3,"representatives":[[93,57,125,85,223,5,122,129]]}, +{"size":82252800,"fixed":3,"representatives":[[136,7,100,190,106,169,140,191]]}, +{"size":123379200,"fixed":3,"representatives":[[42,158,160,46,192,177,131,223]]}, +{"size":123379200,"fixed":3,"representatives":[[229,170,69,68,198,196,214,90]]}, +{"size":41126400,"fixed":3,"representatives":[[1,193,172,225,185,10,13,14]]}, +{"size":46267200,"fixed":3,"representatives":[[127,234,236,158,100,33,76,101]]}, +{"size":15422400,"fixed":3,"representatives":[[1,230,135,72,181,132,107,79]]}, +{"size":7711200,"fixed":3,"representatives":[[6,139,138,104,202,121,253,3]]}, +{"size":7711200,"fixed":3,"representatives":[[1,171,69,160,159,33,164,205]]}, +{"size":164505600,"fixed":3,"representatives":[[194,119,41,230,73,144,107,54]]}, +{"size":54835200,"fixed":3,"representatives":[[32,193,184,149,23,197,21,140]]}, +{"size":197406720,"fixed":3,"representatives":[[27,66,91,129,188,58,101,19]]}, +{"size":10281600,"fixed":4,"representatives":[[241,248,41,37,26,30,151,180]]}, +{"size":15422400,"fixed":4,"representatives":[[251,36,203,199,37,51,165,67]]}, +{"size":3427200,"fixed":4,"representatives":[[191,40,120,202,175,118,254,170]]}, +{"size":3855600,"fixed":4,"representatives":[[1,204,69,138,180,108,107,101]]}, +{"size":1285200,"fixed":4,"representatives":[[56,47,230,178,135,154,182,79]]}, +{"size":963900,"fixed":4,"representatives":[[238,147,149,118,101,188,215,26]]}, +{"size":64260,"fixed":4,"representatives":[[1,199,40,36,48,32,168,68]]}, +{"size":10967040,"fixed":4,"representatives":[[42,28,218,214,56,35,107,181]]}, +{"size":3655680,"fixed":4,"representatives":[[42,46,180,147,79,127,168,135]]}, +{"size":13160448,"fixed":4,"representatives":[[242,144,61,228,54,120,244,159]]}, +{"size":514080,"fixed":5,"representatives":[[1,140,138,111,122,201,77,3]]}, +{"size":514080,"fixed":5,"representatives":[[1,230,224,134,119,74,169,141]]}, +{"size":321300,"fixed":5,"representatives":[[1,40,198,202,17,200,64,170]]}, +{"size":685440,"fixed":5,"representatives":[[120,170,125,80,224,32,64,161]]}, +{"size":16065,"fixed":6,"representatives":[[1,230,224,236,29,32,169,141]]}, +{"size":5355,"fixed":6,"representatives":[[175,217,170,125,190,85,155,245]]}, +{"size":10880,"fixed":6,"representatives":[[1,96,102,225,249,171,64,105]]}, +{"size":255,"fixed":7,"representatives":[[1,235,237,225,249,32,64,105]]}, +{"size":329011200,"fixed":0,"representatives":[[32,57,133,76,234,200,17,81]]}, +{"size":1974067200,"fixed":0,"representatives":[[201,133,191,158,129,229,135,24]]}, +{"size":1579253760,"fixed":0,"representatives":[[151,214,54,11,144,217,9,96]]}, +{"size":526417920,"fixed":0,"representatives":[[60,220,203,186,37,133,74,161]]}, +{"size":164505600,"fixed":0,"representatives":[[200,110,217,245,24,12,235,215]]}, +{"size":27417600,"fixed":0,"representatives":[[201,65,253,221,9,44,99,191]]}, +{"size":609280,"fixed":0,"representatives":[[201,165,25,57,237,44,99,91]]}, +{"size":2256076800,"fixed":0,"representatives":[[108,32,33,41,105,122,209,140]]}, +{"size":1754726400,"fixed":0,"representatives":[[145,156,85,2,67,128,151,230]]}, +{"size":3158507520,"fixed":0,"representatives":[[103,29,224,202,59,123,105,97]]}, +{"size":2368880640,"fixed":0,"representatives":[[227,240,64,89,106,98,101,58]]}, +{"size":157925376,"fixed":0,"representatives":[[242,56,95,43,27,187,107,238]]}, +{"size":5573836800,"fixed":0,"representatives":[[209,255,139,43,149,49,125,71],[134,149,130,47,108,131,93,132]]} +], +"characters":[ +[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], +[35,0,-2,2,0,-2,0,1,-1,-1,1,1,-1,-3,-1,0,0,0,2,0,1,1,1,-2,0,2,-2,-1,3,-1,3,3,1,-1,-1,0,2,-4,0,1,-3,-2,-1,-1,3,-5,-2,0,-1,2,3,6,-1,7,3,-5,0,2,5,-1,-9,-5,-6,11,3,14,-21,1,-1,0,2,1,-3,5,0,-1,0,0,0,1], +[51,-2,0,0,2,0,-2,-1,1,1,-1,1,-1,-3,-1,0,0,0,2,0,1,1,1,2,4,-2,2,3,-1,3,-1,1,-1,-3,1,2,0,0,-4,-3,1,-2,-1,-1,-5,3,-2,0,-1,2,3,-2,7,-1,3,11,4,6,1,-9,-1,-5,-6,11,19,6,-21,2,0,-1,1,2,-2,6,-1,0,1,1,1,0], +[85,0,0,-2,-2,0,0,-1,-1,-1,-1,-2,0,2,0,-1,-1,2,0,2,1,1,1,2,0,2,2,1,1,1,1,0,2,4,2,1,1,-2,-2,-3,-3,-2,-3,-3,-3,-3,-2,-4,-3,6,5,6,5,5,5,5,6,4,5,-11,-11,-11,-10,21,21,22,-43,-1,1,1,-1,-1,3,-5,1,1,0,0,0,0], +[119,-1,1,-1,1,1,-1,-1,1,1,-1,0,0,0,0,0,0,1,1,1,1,1,1,-1,-1,3,-1,-1,3,-1,3,2,2,2,0,0,2,5,1,1,5,3,3,3,-1,7,3,3,3,7,7,11,3,11,7,-1,5,5,9,11,19,15,15,31,23,35,63,-1,-1,0,0,-1,-1,-1,0,-1,-1,-1,-1,0], +[135,1,-1,1,-1,-1,1,1,-1,-1,1,0,0,0,0,0,0,1,1,1,1,1,1,3,3,-1,3,3,-1,3,-1,0,0,0,2,2,0,1,5,5,1,3,3,3,7,-1,3,3,3,7,7,3,11,3,7,15,9,9,5,19,11,15,15,31,39,27,63,0,0,-1,-1,0,0,0,-1,0,0,0,0,-1], +[238,0,0,-2,2,-1,1,0,0,0,-2,1,1,1,-1,0,1,-2,0,-1,2,-2,0,2,0,1,5,2,2,-2,2,3,-1,-5,-1,0,1,-5,-1,2,-2,1,2,-2,-6,-6,-2,4,2,-3,2,9,-2,14,-2,14,-6,4,8,10,-22,-2,-11,30,-18,49,-98,-1,1,-1,-1,-1,3,-5,0,1,0,-1,3,0], +[510,1,1,3,-1,1,-1,0,0,-1,1,-1,1,3,-1,-1,0,-1,1,-1,-2,2,1,3,1,1,5,2,2,-2,3,1,-1,-3,-1,-1,0,3,-1,-2,2,5,2,-2,10,10,-1,-3,-1,1,2,13,-2,14,14,30,-5,-3,5,-6,26,14,9,46,-2,69,174,-1,1,0,2,3,7,15,-1,0,0,0,0,0], +[595,-1,1,1,-1,1,1,1,-1,0,0,1,-1,5,1,0,-1,-1,1,-1,1,-3,-2,1,-1,-1,-1,-1,3,3,2,5,-1,1,1,0,1,7,-1,1,1,-5,-5,-1,-1,7,1,-1,-2,-5,-1,11,-1,23,-13,-5,-1,1,10,-5,35,-5,11,43,-13,91,203,2,0,-1,1,-2,2,10,0,1,0,0,0,0], +[595,0,0,-2,-2,-1,-1,1,1,0,0,3,1,-1,0,0,-1,0,2,1,-1,-1,0,0,-6,1,-7,7,-1,-1,0,-3,-1,1,0,0,1,1,1,-1,-1,-3,3,-5,3,3,0,2,0,5,-5,-3,-5,11,3,51,0,10,0,-5,-5,3,5,35,-45,-35,35,-1,-1,0,0,3,3,19,0,1,-1,1,5,0], +[918,0,0,2,-2,1,-1,0,0,-2,0,0,0,0,0,1,0,0,2,-1,-2,2,-2,0,6,1,-3,2,2,6,0,0,0,0,-2,1,0,-1,-5,-2,2,-3,2,6,-6,-6,0,6,0,-7,2,-3,22,6,6,54,0,18,-2,-22,10,6,-15,38,150,-27,-90,0,0,0,-2,0,0,0,1,0,0,-1,3,0], +[1190,1,1,-1,3,-1,1,0,0,1,-1,-2,0,2,0,0,-1,1,3,-1,2,-2,-1,1,7,1,-3,2,2,6,1,-2,0,2,-2,0,-1,-1,3,2,-2,1,2,6,10,10,1,-1,-3,-3,2,1,22,6,22,70,1,11,-5,26,-6,22,5,54,166,-7,182,0,0,1,1,4,4,20,0,-1,0,0,0,0], +[1275,1,-1,-1,1,1,1,-1,1,0,0,2,0,6,0,-1,0,-3,-1,-1,-3,1,0,-1,5,3,3,3,-1,-1,0,2,0,6,0,1,0,-1,7,1,1,-1,-5,-9,7,-1,-1,-3,0,-1,-1,-1,15,-9,-21,35,5,15,0,35,-5,-13,15,35,155,15,195,3,-1,0,0,-1,-1,15,1,0,0,0,0,0], +[1512,-1,1,1,-1,1,-1,0,0,1,1,0,0,0,1,0,0,-1,1,-1,0,0,1,-3,3,1,-3,0,0,0,1,0,0,0,-1,0,0,-5,-1,4,-4,-3,0,0,8,-8,-3,3,1,1,8,21,-8,24,8,-24,-9,9,17,16,-64,-24,-39,136,-24,189,-504,0,0,1,-1,0,0,0,0,0,0,1,-3,-1], +[1785,0,0,0,0,0,0,-1,-1,-1,-1,1,1,9,1,0,0,0,4,0,1,1,1,-4,0,-4,-4,-3,-3,-3,-3,3,-1,3,-1,0,0,0,0,-3,-3,4,1,1,-15,-15,4,0,1,4,9,-12,-7,-7,9,-55,0,12,5,9,9,25,36,121,57,84,441,2,0,0,2,2,6,30,0,0,0,0,0,0], +[1785,0,0,2,-2,0,2,-1,1,-1,-1,1,-1,-3,1,0,0,2,0,-2,-1,-1,1,2,-4,0,4,5,1,-3,-3,-1,1,3,-1,0,0,2,-2,3,-1,4,-3,5,-15,9,-2,0,1,0,1,-4,-3,-11,-7,65,-10,12,5,29,-11,1,-24,81,-103,84,-399,-2,0,0,2,2,-10,30,0,0,0,0,0,0], +[2295,1,-1,-1,1,0,0,-1,1,0,0,0,0,0,1,1,0,1,-1,0,-3,1,-2,3,-3,0,0,-1,3,3,2,0,0,0,1,-1,0,-4,4,-3,-3,0,-1,3,-5,-13,3,-3,-2,8,3,24,3,27,7,15,9,-9,10,-25,-65,-33,-24,143,87,216,-657,0,0,-1,1,0,0,0,-1,0,0,0,0,0], +[2856,1,-1,-3,-1,-1,1,0,0,0,0,-2,0,-6,0,0,0,-1,-1,-1,0,0,0,-3,1,1,-3,0,0,0,0,-2,0,-6,-2,0,0,3,-1,-4,4,1,0,0,-8,8,1,-3,0,5,8,25,-8,24,8,-24,-5,3,16,0,80,40,45,200,40,273,840,0,0,0,-2,0,-8,-24,0,0,1,1,1,0], +[2856,1,-1,-1,1,-1,1,0,0,1,1,0,0,0,1,0,0,-1,1,-1,0,0,1,1,-1,-3,1,0,0,0,1,2,-2,-6,1,0,0,-1,-5,-4,4,-3,0,0,-8,8,-3,3,1,1,8,-19,24,-8,8,40,11,21,1,-64,16,-24,-39,136,296,21,-504,-2,0,1,1,-2,2,-6,0,0,-1,0,-4,0], +[2975,-1,-1,-1,-1,0,0,1,1,0,0,1,1,-7,0,0,-1,1,1,0,-1,-1,0,-3,5,-4,4,3,3,-5,0,5,1,5,0,0,-1,-4,-4,3,3,4,-1,7,-1,-1,1,-7,0,4,-9,-4,-1,31,-17,15,5,5,0,-25,-25,31,20,-65,95,140,-385,1,1,0,0,-3,5,5,0,-1,0,0,0,0], +[2975,-1,1,1,-1,0,0,1,-1,0,0,1,1,1,0,0,1,-1,-3,0,1,-3,0,1,3,4,4,3,-1,-1,0,-3,1,5,0,0,-1,4,-4,-3,-3,4,-1,-5,-13,-5,1,-5,0,12,3,12,19,-5,-1,55,15,5,0,-65,-25,-41,-20,135,255,140,-665,1,-1,0,0,1,-3,5,0,-1,0,0,0,0], +[3213,-1,-1,1,1,-1,-1,-1,1,0,2,0,0,0,1,0,0,-1,1,1,3,-1,0,3,-3,1,9,1,-3,-3,-2,0,0,0,-1,0,0,1,1,-1,-1,-3,-3,9,17,-7,3,-3,-2,-11,1,-3,1,9,-19,69,-9,9,8,-35,37,-27,21,85,-147,189,693,0,0,1,-1,0,0,0,0,0,0,-1,3,0], +[3213,1,1,1,1,1,1,1,1,0,0,0,0,0,-1,0,0,1,1,1,1,1,0,-3,-3,-3,-3,-3,-3,-3,-4,0,0,0,-1,0,0,1,1,1,1,-3,-3,-3,13,13,-3,-3,-4,13,13,-3,-3,-3,13,-51,9,9,8,-35,-35,-51,-51,205,141,189,-819,0,0,-1,-1,0,0,0,0,0,0,-1,3,0], +[3400,-1,-1,1,1,0,0,0,0,0,0,3,-1,3,0,0,0,1,-1,2,0,0,0,1,-1,2,2,0,0,0,0,-1,-1,7,0,-2,-2,-2,-2,0,0,6,8,8,8,8,-3,3,0,14,8,14,8,8,40,40,5,-5,0,40,40,72,30,200,200,190,840,2,0,0,0,-2,2,10,1,1,0,0,0,0], +[3570,-1,-1,1,1,1,1,0,0,0,0,-2,0,-6,0,0,0,1,-5,-3,2,2,0,-3,-1,1,9,-2,-2,6,0,2,0,6,0,0,0,1,1,-2,-2,1,2,-6,2,2,1,3,0,1,-6,-7,-14,18,34,66,5,15,0,10,10,-14,-15,-110,50,105,210,0,0,0,0,0,8,24,0,0,-1,1,5,0], +[3570,0,0,2,2,-1,-1,0,0,0,0,0,0,0,-1,0,0,0,-2,-1,-2,-2,-2,0,-2,-1,-1,-2,-2,-2,-2,-2,2,6,1,0,0,-1,-1,2,2,-9,-6,-6,-6,-6,0,6,2,7,2,7,2,2,-30,-30,16,6,10,50,50,18,39,178,178,231,882,-1,1,1,1,3,7,15,0,0,0,0,0,0], +[3570,2,0,0,-2,1,-1,0,0,0,0,-2,0,-6,-1,0,0,0,2,1,2,-2,-2,2,-4,-1,3,-2,-2,2,-2,2,0,6,1,0,0,-3,1,-2,2,7,6,-6,-10,6,-2,0,2,-13,-2,-1,2,18,-30,50,-4,6,10,30,-50,34,-21,98,-142,231,-798,3,-1,1,1,-1,-1,15,0,0,0,0,0,0], +[3808,1,-1,1,-1,0,0,0,0,1,-1,-2,0,-6,0,0,0,-1,3,0,0,0,1,-3,1,0,0,0,0,0,3,-2,0,10,2,0,-2,4,-4,0,0,-8,0,0,16,-16,1,-3,3,0,0,16,0,0,32,-96,-5,7,-7,16,-16,-32,0,96,-32,112,-672,0,0,0,2,0,-8,40,0,1,0,-1,3,0], +[4200,-1,1,-1,-3,1,-1,0,0,0,0,-2,0,-6,0,0,0,-1,-1,-1,0,0,0,1,-3,-3,1,0,0,0,0,0,-2,-12,0,0,0,-1,3,4,-4,1,0,0,8,-8,1,-3,0,5,8,-15,24,-8,8,40,15,15,0,80,0,40,45,200,360,105,840,-2,0,0,0,-2,-6,-30,0,0,0,0,0,1], +[4760,1,-1,-1,1,1,-1,0,0,-1,-1,2,0,-2,0,0,1,1,-1,1,0,0,1,-1,1,-1,-5,0,0,0,1,4,-2,8,2,0,-1,5,1,4,-4,-1,0,0,-8,8,-1,1,-3,-13,-8,7,8,40,-8,-40,1,-1,5,-16,64,-40,-5,56,-104,287,952,-2,0,1,-1,2,-2,-10,0,-1,0,0,0,0], +[5712,0,0,0,0,0,0,0,0,0,0,-1,1,3,-1,0,0,-2,2,0,0,0,0,-2,-6,4,4,0,0,0,-4,3,1,15,1,0,0,0,0,0,0,-4,0,16,0,0,2,6,-4,-4,0,12,16,16,16,16,-6,6,-8,0,0,80,-36,80,336,-84,336,-2,0,-1,1,-2,-6,-30,0,0,0,1,-3,0], +[5950,0,0,0,0,-1,-1,0,0,0,0,-4,0,4,0,0,1,2,-2,1,-2,-2,0,-2,2,1,1,2,2,2,0,2,-2,10,0,0,1,-3,-3,2,2,5,-10,6,6,6,2,-2,0,13,-2,-19,-2,-2,14,-50,-10,10,0,30,30,-34,-35,190,-130,-35,-770,1,-1,0,0,1,5,-35,0,1,0,0,0,0], +[5950,1,1,-1,-1,-1,-1,0,0,0,0,2,0,6,0,0,0,-1,-3,-1,2,2,0,3,1,-1,-1,-6,2,2,0,4,2,-8,0,0,-2,-1,-1,2,2,-1,-2,6,-2,-2,-1,-3,0,15,-10,-17,-10,38,14,30,-5,25,0,-10,-10,14,15,-210,190,175,-210,-1,-1,0,0,3,-5,-5,0,1,0,0,0,0], +[7140,-1,-1,-1,-1,0,0,0,0,1,1,0,0,0,0,0,0,1,1,2,0,0,-1,1,1,2,-6,-4,-4,4,-1,4,0,12,-2,0,0,2,2,0,0,6,-4,-12,-4,-4,-3,-3,3,-2,-4,22,20,-12,4,100,-11,21,-5,-4,-4,-60,30,4,484,-42,-252,-3,1,-1,1,1,1,-15,0,0,0,0,0,0], +[8160,-1,1,-1,1,0,0,0,0,-1,1,-2,0,-6,0,0,0,-1,3,0,0,0,1,1,5,0,0,0,0,0,-1,2,0,6,2,-2,0,-4,4,0,0,-8,0,0,-16,16,1,-3,3,0,0,-16,0,0,32,160,-1,-21,5,-16,16,-32,0,96,224,-48,-672,0,0,-1,-1,4,-4,60,1,0,0,0,0,0], +[8925,-1,-1,-3,1,2,0,1,-1,0,0,0,0,0,0,0,0,1,3,0,-1,-1,0,1,-1,2,6,-3,1,-3,0,-4,0,-12,0,0,0,0,4,-1,3,6,-7,9,5,-19,-3,3,0,-6,-3,-10,-7,33,13,-155,5,15,0,-15,25,21,-30,165,125,-210,-315,0,0,0,0,4,-4,60,0,0,0,0,0,0], +[8925,1,1,-1,3,1,-1,1,-1,0,0,1,-1,-3,0,0,0,1,-1,-1,-1,-1,0,1,3,-3,1,5,1,-3,0,3,1,15,0,0,0,-1,3,-5,-1,1,1,-7,13,-11,1,3,0,5,5,-15,-15,-23,13,85,-15,15,0,-55,-15,37,45,245,-195,105,1365,-2,0,0,0,-2,-6,-30,0,0,0,0,0,0], +[8960,0,0,-2,2,0,0,0,0,-1,1,0,0,8,0,0,-1,0,-2,0,0,0,1,0,2,0,0,0,0,0,-1,-4,0,-4,2,0,-1,4,-4,0,0,0,0,0,0,0,0,2,3,-8,0,8,0,0,0,0,-16,14,5,64,-64,0,-40,256,-256,392,-1792,0,0,-1,-1,0,8,-40,0,-1,0,0,0,1], +[9639,0,0,0,0,0,0,-1,-1,1,1,0,0,0,0,0,0,0,0,0,-1,-1,1,0,0,0,0,-1,7,-1,-3,0,0,0,0,0,0,0,0,3,3,0,7,-9,-9,-9,0,0,-3,0,-9,0,15,-33,39,-105,0,0,9,-9,-9,-9,0,-9,-153,0,567,-3,-1,0,0,-3,9,81,0,0,1,0,4,0], +[10200,-1,1,3,1,-1,1,0,0,0,0,0,0,0,0,-1,0,1,-3,1,0,0,0,-1,-1,-1,-5,0,0,0,0,2,-2,-6,0,1,0,-3,1,-4,4,3,0,0,8,-8,3,3,0,-9,-8,11,8,40,-8,-40,5,-15,0,0,-80,24,15,120,-40,435,-1800,-2,0,0,0,2,-10,30,1,0,0,0,0,0], +[11900,0,0,-2,-2,0,0,0,0,0,0,-1,-1,7,0,0,1,-2,0,2,0,0,0,-2,-8,-2,-2,4,4,4,0,1,1,-7,0,0,-1,-2,-2,0,0,2,-4,-4,12,12,2,4,0,-6,-4,10,-20,-20,28,220,10,20,0,-20,-20,-4,10,60,-260,-70,700,1,1,0,0,1,1,65,0,-1,0,0,0,0], +[11900,1,1,-1,-1,0,0,0,0,0,0,3,-1,3,0,0,0,-1,1,0,0,0,0,-1,1,0,8,-4,-4,4,0,-5,-1,11,0,0,2,-4,-4,0,0,0,4,-4,4,4,3,-3,0,16,-12,-8,12,44,-4,-100,-5,5,0,20,20,-36,0,220,-260,-280,-420,-1,1,0,0,-1,-5,35,0,-1,0,0,0,0], +[13056,0,0,2,-2,0,0,0,0,1,-1,0,0,0,-1,1,0,0,-2,0,0,0,1,0,2,0,0,0,0,0,-1,-4,0,-12,1,1,0,-4,4,0,0,0,0,0,0,0,0,-6,-1,-8,0,8,0,0,0,0,-16,6,1,-64,64,0,24,256,-256,456,2304,0,0,-1,1,0,8,24,1,0,-1,0,-4,0], +[13600,0,0,0,0,0,0,0,0,0,0,2,0,-2,0,-1,1,2,-2,0,0,0,0,-2,2,-4,-4,0,0,0,0,-4,2,-8,0,-1,1,0,0,0,0,-4,0,0,0,0,2,-2,0,-20,0,-4,32,32,32,160,-10,10,0,0,0,32,-20,160,800,-260,160,2,0,0,0,-2,2,10,-1,1,0,0,0,0], +[14280,-1,-1,-1,-1,0,0,0,0,0,0,-1,1,3,0,0,0,3,-1,-2,0,0,0,-1,-5,2,2,0,0,0,0,1,-1,-3,0,0,0,2,2,0,0,-10,8,-8,8,8,-1,3,0,14,-8,-2,8,8,-24,104,-5,15,0,-40,-40,8,30,200,-440,-210,840,2,0,0,0,2,-2,6,0,0,1,-1,-5,0], +[14280,1,1,-1,-1,0,0,0,0,0,0,1,-1,-3,-1,0,0,1,3,-2,0,0,2,1,-5,2,2,0,0,0,-2,1,-1,-3,-1,0,0,2,2,0,0,-2,-8,8,-8,-8,1,3,2,6,-8,22,8,8,40,40,1,-21,-10,-40,-40,-56,54,72,328,294,-1848,2,0,1,-1,-2,10,-30,0,0,0,0,0,0], +[14688,-1,1,-1,1,0,0,0,0,-1,1,0,0,0,1,0,0,-1,-1,0,0,0,-1,-3,-3,0,0,0,0,0,1,0,0,0,1,2,0,-4,4,0,0,0,0,0,-16,16,-3,-3,1,8,0,24,0,0,32,-96,-9,-9,-17,-16,16,96,-24,224,96,216,2016,0,0,1,1,0,0,0,-1,0,0,-1,3,0], +[16065,-1,-1,-1,-1,0,0,1,-1,1,-1,0,0,0,0,0,0,-1,-1,2,-1,3,-1,3,3,-2,6,1,-3,-3,1,0,0,0,-2,0,0,2,2,3,3,-6,1,-3,-19,5,3,3,-3,2,5,-6,-11,-3,17,105,-9,-9,-5,41,-31,-39,-30,329,-159,378,-2583,0,0,1,1,0,0,0,0,0,0,0,0,0], +[16065,0,0,2,-2,-1,1,-1,1,1,1,0,0,0,-1,0,0,0,2,1,-1,-1,-1,0,6,-1,3,-3,1,-3,3,0,0,0,1,0,0,5,1,-1,-5,3,-3,-3,-15,9,0,6,-1,-1,1,-21,-19,21,33,-135,0,18,-5,-19,-59,57,39,329,33,-189,1449,0,0,0,-2,0,0,0,0,0,0,0,0,0], +[16065,0,0,2,2,-1,-1,1,-1,1,-1,0,0,0,1,0,0,0,2,-1,-1,3,-1,0,-6,3,3,1,5,-3,-3,0,0,0,1,0,0,-1,-1,-1,-1,3,1,-3,-3,21,0,-6,1,-13,5,3,-3,21,-15,-135,0,18,-5,41,-31,-87,51,89,417,-189,441,0,0,0,-2,0,0,0,0,0,0,0,0,0], +[16065,0,0,2,2,1,1,-1,-1,1,1,0,0,0,-1,0,0,0,2,-1,1,1,-1,0,-6,-1,-9,5,-3,-3,3,0,0,0,1,0,0,-1,-1,1,1,3,1,9,-15,-15,0,-6,-1,11,-7,3,-7,9,-15,225,0,18,-5,41,41,-15,-21,209,-447,-189,-1071,0,0,0,-2,0,0,0,0,0,0,0,0,0], +[16065,1,1,-1,-1,0,0,-1,-1,1,1,0,0,0,0,0,0,1,-1,2,1,1,-1,-3,3,-2,6,5,5,-3,-1,0,0,0,-2,0,0,2,2,-3,-3,-6,1,9,1,1,-3,3,3,2,-7,-6,1,33,-47,-15,9,-9,-5,41,41,-63,-30,-31,129,378,1953,0,0,-1,1,0,0,0,0,0,0,0,0,0], +[17850,-1,1,-1,1,-1,1,0,0,0,0,-1,1,3,0,0,0,1,5,-1,-2,2,0,3,-1,-3,1,-2,-2,2,0,-1,1,3,0,0,0,-1,-5,2,-2,5,-2,-14,14,-2,-1,3,0,-7,-10,5,-6,10,10,90,5,-15,0,-10,70,-22,-15,170,-70,525,2730,1,-1,0,0,-3,-7,-15,0,0,0,0,0,0], +[17850,0,2,-2,0,-1,1,0,0,0,0,-1,-1,-9,0,0,0,0,-2,1,-2,2,0,2,0,3,-1,-2,-2,-6,0,3,-1,3,0,0,0,1,-3,2,-2,-1,6,2,6,-10,2,0,0,-5,-2,15,-6,-22,-54,-70,0,30,0,-50,30,74,-45,10,570,-105,-630,2,0,0,0,2,6,30,0,0,0,0,0,0], +[18360,-1,1,1,-1,-1,1,0,0,-1,-1,0,0,0,0,1,0,-1,1,1,0,0,1,-3,3,-1,3,0,0,0,1,0,0,0,2,-1,0,1,5,-4,4,3,0,0,8,-8,-3,3,-3,7,-8,3,8,-24,-40,120,-9,9,5,64,-16,-72,15,-104,696,27,792,0,0,1,-1,0,0,0,-1,0,0,0,0,0], +[19040,1,-1,1,-1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,-1,0,0,0,-1,1,1,0,0,0,0,0,-3,4,0,-4,1,0,2,4,-4,0,0,0,0,0,16,-16,-3,-3,1,8,0,-8,0,0,32,160,-5,-37,-5,16,-16,96,-24,224,352,56,2016,0,0,0,-2,4,4,20,0,-1,0,0,0,0], +[23800,-1,-1,-1,-1,0,0,0,0,0,0,-1,-1,7,0,0,1,-1,3,-2,0,0,0,-1,3,-2,-2,0,0,0,0,-3,1,13,0,0,1,2,2,0,0,2,8,8,8,8,-1,-5,0,-6,-8,-6,-8,-8,-40,-40,15,-5,0,-40,-40,56,10,120,120,490,-3080,-2,0,0,0,2,6,-50,0,1,0,0,0,0], +[23800,1,-1,1,3,1,-1,0,0,0,0,-2,0,2,0,0,-1,-1,-1,1,0,0,0,-3,1,-1,3,0,0,0,0,-2,0,-14,0,0,1,1,-3,4,-4,7,0,0,-8,8,1,5,0,11,-8,7,8,-24,-40,120,-5,-5,0,-80,0,-8,35,-40,760,175,-1960,0,0,0,0,0,-8,40,0,1,0,0,0,0], +[26775,0,0,0,0,-1,-1,-1,-1,0,0,3,1,-9,0,0,0,0,0,-1,-1,-1,0,0,0,3,-5,-1,-1,7,0,3,1,-9,0,0,0,3,3,-1,-1,3,-1,7,15,15,0,0,0,3,-1,-21,-9,-41,-9,-105,0,0,0,15,15,-9,-45,375,-105,315,-3465,1,1,0,0,-3,-3,45,0,0,0,0,0,0], +[26775,0,0,0,0,-1,-1,1,1,0,0,-3,-1,9,0,0,0,0,0,-1,-1,-1,0,0,0,3,-5,3,-5,-5,0,3,1,-9,0,0,0,3,3,-1,-1,3,7,-1,-9,-9,0,0,0,3,-1,-21,15,31,39,-105,0,0,0,15,15,-57,-45,-345,-105,315,1575,1,1,0,0,-3,-3,45,0,0,0,0,0,0], +[28560,0,0,2,2,0,0,0,0,-1,-1,-2,0,-6,1,0,0,-2,0,2,0,0,1,2,4,2,-6,0,0,0,-3,-2,0,-6,-1,0,0,2,2,0,0,-2,0,0,0,0,-2,0,1,6,-16,-2,-16,48,16,80,10,12,5,-16,-16,16,6,336,-368,-546,336,0,0,0,2,-4,4,-60,0,0,0,0,0,0], +[28917,0,0,0,0,0,0,-1,1,-2,0,0,0,0,0,0,0,0,0,0,3,-1,-2,0,0,0,0,1,5,-3,0,0,0,0,0,0,0,0,0,3,3,0,5,-15,9,-15,0,0,0,0,9,0,-15,9,21,-99,0,0,-18,-27,45,-99,0,333,405,0,-2835,0,0,0,0,0,0,0,0,0,0,1,-3,0], +[30464,0,0,2,-2,0,0,0,0,1,-1,0,0,8,0,0,-1,0,-2,0,0,0,1,0,-6,0,0,0,0,0,3,0,0,8,0,0,-1,-4,4,0,0,0,0,0,0,0,0,2,3,-8,0,-24,0,0,0,0,0,-10,9,-64,64,0,-40,256,768,-280,-1792,0,0,0,0,0,0,-64,0,-1,1,0,4,0], +[32130,-1,-1,1,1,1,1,0,0,0,0,0,0,0,-1,0,0,-1,1,1,-2,-2,2,3,-3,-3,-3,-2,6,6,-2,0,0,0,-1,0,0,1,1,-2,-2,-3,2,-6,2,2,3,-3,2,13,10,-3,-6,42,-46,-30,-9,9,-10,10,10,18,-51,-398,258,189,882,0,0,1,-1,0,0,0,0,0,0,0,0,0], +[32130,1,-1,1,-1,1,-1,0,0,0,0,0,0,0,1,0,0,1,1,-1,2,-2,2,3,3,1,-3,-2,-2,-6,2,0,0,0,-1,0,0,-5,-1,-2,2,-3,-2,-6,-2,14,3,3,-2,1,-10,21,-14,-30,-14,-30,9,9,-10,70,-10,18,-39,82,642,189,2898,0,0,-1,-1,0,0,0,0,0,0,0,0,0], +[32130,1,1,1,1,-1,-1,0,0,0,0,0,0,0,1,0,0,1,1,1,-2,-2,2,-3,-3,1,9,-2,-2,6,2,0,0,0,-1,0,0,1,1,2,2,-3,2,-6,-14,-14,-3,-3,-2,-11,10,-3,-14,18,-14,210,9,9,-10,10,10,66,21,-158,-318,189,-2142,0,0,-1,-1,0,0,0,0,0,0,0,0,0], +[34425,0,0,0,0,1,1,-1,-1,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,0,5,-3,5,-3,-3,0,0,0,0,0,-1,0,-3,-3,1,1,-3,-7,-15,9,9,0,0,0,-3,1,-27,17,33,9,-135,0,0,0,-15,-15,105,45,-375,-135,405,-2295,0,0,0,0,0,0,0,-1,0,0,0,0,0], +[34425,0,0,0,0,1,1,1,1,0,0,0,0,0,0,-1,0,0,0,1,1,1,0,0,0,5,-3,1,1,9,0,0,0,0,0,-1,0,-3,-3,1,1,-3,1,9,-15,-15,0,0,0,-3,1,-27,-7,-39,-39,-135,0,0,0,-15,-15,-39,45,345,-135,405,4185,0,0,0,0,0,0,0,-1,0,0,0,0,0], +[34560,0,0,-2,2,0,0,0,0,-1,1,0,0,0,-1,1,0,0,-2,0,0,0,1,0,-6,0,0,0,0,0,3,0,0,0,-1,1,0,4,-4,0,0,0,0,0,0,0,0,-6,-1,-8,0,-24,0,0,0,0,0,-18,5,64,-64,0,24,256,768,-216,2304,0,0,0,2,0,0,0,1,0,0,0,0,-1], +[38080,0,0,0,0,0,0,0,0,0,0,2,0,-10,0,0,-1,-2,-2,0,0,0,0,-2,-2,0,0,0,0,0,0,-2,0,10,0,0,1,0,0,0,0,8,0,0,0,0,2,2,0,-8,0,-8,0,0,64,64,10,10,0,0,0,-64,-40,-320,-320,280,2240,0,0,0,0,4,4,-44,0,1,1,-1,-5,0], +[38556,0,0,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,-4,-4,-4,3,0,0,0,0,0,0,0,0,0,0,0,-4,12,12,12,0,0,3,0,12,0,12,12,-36,156,0,0,-9,-36,-36,-36,0,-36,-612,0,2268,-3,-1,0,0,-3,9,81,0,0,1,1,1,0], +[43520,0,0,0,0,0,0,0,0,0,0,0,0,-8,1,-1,1,0,4,0,0,0,-2,0,-4,0,0,0,0,0,2,-4,0,-4,1,1,-1,0,0,0,0,0,0,0,0,0,0,4,-2,16,0,-16,0,0,0,0,-16,-4,10,0,0,0,16,-512,512,176,-512,0,0,-1,1,0,8,-40,1,-1,0,0,0,0], +[47600,0,0,0,0,0,0,0,0,0,0,-1,1,3,0,0,0,0,-4,0,0,0,0,4,0,-4,-4,0,0,0,0,-3,-1,17,0,0,2,0,0,0,0,-4,0,16,0,0,-4,0,0,-4,0,12,-16,-16,48,-80,0,20,0,0,0,-16,60,-400,240,140,-1680,2,0,0,0,-2,-6,50,0,-1,0,0,0,0], +[48195,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0,0,0,0,0,0,-1,-1,0,0,0,0,0,-5,3,-5,0,0,0,0,0,0,0,0,0,3,3,0,3,3,3,3,0,0,0,0,3,0,27,-21,3,51,0,0,0,-45,-45,-45,0,-45,-765,0,2835,3,1,0,0,3,-9,-81,0,0,-1,1,5,0], +[51408,0,0,-2,-2,0,0,0,0,1,1,0,0,0,0,0,0,0,-2,-2,0,0,1,0,6,2,-6,0,0,0,-3,0,0,0,2,0,0,-2,-2,0,0,6,0,0,0,0,0,6,-3,-2,16,6,-16,48,-48,144,0,-18,-7,16,16,-48,30,16,-48,-378,-1008,0,0,0,2,0,0,0,0,0,0,-1,3,0], +[53550,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,-2,-2,0,0,0,-3,5,2,-6,2,0,6,2,-18,0,0,0,-3,-3,-2,-2,-3,6,6,6,6,0,0,0,-3,-2,21,6,-10,30,-210,0,0,0,30,30,-66,45,30,-210,-315,-1890,-1,-1,0,0,3,3,-45,0,0,0,0,0,0], +[57120,0,0,0,0,0,0,0,0,0,0,2,0,6,-1,0,0,2,2,0,0,0,-2,-2,6,4,4,0,0,0,-2,0,-2,-12,1,0,0,0,0,0,0,-4,0,0,0,0,2,-6,2,-4,0,12,-32,-32,32,160,6,6,10,0,0,32,-36,-352,288,-84,672,-2,0,1,1,-2,-6,-30,0,0,0,0,0,0], +[65536,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,-2,2,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-32,16,0,0,0,0,0,0,-512,0,0,0,0,-2,0,0,64,-1,1,-1,0,-4,1], +[68850,0,0,0,0,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-1,2,2,0,0,0,-5,3,6,-2,6,0,0,0,0,0,-2,0,3,3,2,2,3,-6,-6,-6,-6,0,0,0,3,2,27,10,-6,-30,-270,0,0,0,-30,-30,66,-45,-30,-270,-405,1890,0,0,0,0,0,0,0,1,0,0,0,0,0], +[85050,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,-6,10,-6,0,0,0,0,0,0,0,0,0,-6,-6,0,-6,-6,-6,-6,0,0,0,0,-6,0,42,-54,-6,90,0,0,0,90,90,90,0,90,-1350,0,-5670,0,0,0,0,0,0,0,0,0,0,0,0,-1] +]} diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/INPUTS.json b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/INPUTS.json new file mode 100644 index 0000000000..f9d4fd9206 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/INPUTS.json @@ -0,0 +1,72 @@ +[ + { + "local": "PR5704-quadratic.py", + "origin": "research/exact-clifford-quadratic-replay/quadratic.py", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "d406584aed1479b75c387bc964b9e797b2f4f75e5f8c6bbea00df07f7d590a91", + "git_blob": "ce3c86ec07fd5767741e02ff0c88b93ba9164fb4" + }, + { + "local": "PR5704-PROOF.md", + "origin": "research/exact-clifford-quadratic-replay/PROOF.md", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "e5039414a02e36cdeab82fb9803fc4de0c3e0f3997e8812ef9d227e5d417ec91", + "git_blob": "559f9f4b207783c6eb908450b63eed3431594c22" + }, + { + "local": "PR5704-NOTICE.md", + "origin": "research/exact-clifford-quadratic-replay/NOTICE.md", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "a77adc71861e3b9c73c703c5db5b671f61a1101d85d14cca08547e21d6d8dce4", + "git_blob": "b96b400e5ca04b3a9003a8b2c70a2461972d39d7" + }, + { + "local": "PR5526-PROOF.md", + "origin": "research/clifford-pointwise-faithfulness/PROOF.md", + "head": "df0137efd35e11b4445734bf612bdd4c7ebc330c", + "sha256": "45483e4b5f604a5e70602c5caaa4394d4a0d0d1a6d0b6e8a93b836d50b23f764", + "git_blob": "465009d9d1b6947e80e6f1e868022f47ddab1f3c" + }, + { + "local": "clifford_exact.py", + "origin": "research/exact-clifford-quadratic-replay/source/source/clifford_exact.py", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2" + }, + { + "local": "prune_native.py", + "origin": "research/exact-clifford-quadratic-replay/source/source/prune_native.py", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "f2b37c183a10922eabc8e0436b426a08866430e96bd0adc7e178951c7fbb5257", + "git_blob": "8c3e11b2408fa96eefa3ebe7952d1b11b90b772b" + }, + { + "local": "PHYSICAL.json", + "origin": "research/exact-clifford-quadratic-replay/source/PHYSICAL.json", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "f78ba861d23ff33f2c9ffeca8c3ab6a7f1ec906f38adff5d325c13efb187c7c3", + "git_blob": "375b30b8c7aa16df521deaec04f16d1af8532abd" + }, + { + "local": "CONSTRUCTION.json.gz", + "origin": "research/exact-clifford-quadratic-replay/source/CONSTRUCTION.json.gz", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "00d13d7774adf087f93bc58d4c5860e296f8408c0ee25a4db254a056f8da7dec", + "git_blob": "31c6d481dd8b32e30d3c137bd2561a59a9d9fcc0" + }, + { + "local": "PR5698-NOTICE.md", + "origin": "research/exact-clifford-quadratic-replay/source/NOTICE.md", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "1f55b3e4bb80a60611b1fca0622da5a99fe7877446f03d0edd1dc8f3a5abadd2", + "git_blob": "56712e3195faf8c83319100065183b8b2488809d" + }, + { + "local": "LICENSE", + "origin": "research/exact-clifford-quadratic-replay/source/source/LICENSE", + "head": "daa4d9dbd102d2a3677afc5614c56466bd2cf3a2", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64" + } +] diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/contractions.py b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/contractions.py new file mode 100644 index 0000000000..76c807dece --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/contractions.py @@ -0,0 +1,236 @@ +"""Exact Clifford contractions with absolute phase. Apache-2.0. + +Classical affine-support and quadratic Gauss-sum methods. Prepared by +Ali Romman with substantial OpenAI Codex assistance. +""" +from fractions import Fraction +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path +import sys + +ROOT = Path(__file__).resolve().parent + + +def load_source(name, filename): + records = json.loads((ROOT / 'INPUTS.json').read_text()) + record = next(x for x in records if x['local'] == filename) + path = ROOT / 'source' / filename + if sha256(path.read_bytes()).hexdigest() != record['sha256']: + raise ValueError('Changed frozen input: ' + filename) + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + spec.loader.exec_module(module) + return module + + +Q = load_source('contraction_quadratic', 'PR5704-quadratic.py') + + +def add(a, b): + return a[0] + b[0], a[1] + b[1] + + +def conjugate(a): + return a[0], -a[1] + + +def power(a, exponent): + Q.need(type(exponent) is int and exponent >= 0, 'Nonnegative integral exponent') + result = (1, 0) + while exponent: + if exponent & 1: + result = Q.multiply(result, a) + a = Q.multiply(a, a) + exponent >>= 1 + return result + + +def solution(n, equations): + """Return every binary solution as affine coordinate forms, or None.""" + rows = {} + for mask, rhs in equations: + Q.validate_integer(mask, 1 << n, 'Equation variable mask') + Q.validate_integer(rhs, 2, 'Equation right side') + while mask: + pivot = mask.bit_length() - 1 + if pivot not in rows: + rows[pivot] = (mask, rhs) + break + other, value = rows[pivot] + mask ^= other + rhs ^= value + if not mask and rhs: + return None + free = [j for j in range(n) if j not in rows] + forms = [0] * n + for k, j in enumerate(free): + forms[j] = 1 << (k + 1) + for pivot in sorted(rows): + mask, rhs = rows[pivot] + forms[pivot] = rhs + for j in Q.bits(mask ^ (1 << pivot)): + forms[pivot] ^= forms[j] + return len(free), forms + + +def gauss(n, poly): + """Return sum_x i**q(x) as an exact Gaussian integer.""" + Q.need(type(n) is int and n >= 0, 'Nonnegative Gauss dimension') + for mask, coefficient in poly.items(): + Q.validate_integer(mask, 1 << n, 'Phase variable mask') + Q.need(type(coefficient) is int and 0 < coefficient < 4, + 'Canonical nonzero phase coefficient') + Q.need(mask.bit_count() <= 2 and (mask.bit_count() != 2 or coefficient == 2), + 'Only even quadratic terms') + poly = dict(poly) + scalar = (1, 0) + while n: + last = 1 << (n - 1) + a = poly.pop(last, 0) + linear = 0 + for mask in list(poly): + if mask & last: + linear ^= mask ^ last + del poly[mask] + n -= 1 + if a & 1: + scalar = Q.multiply(scalar, (1, 1 if a == 1 else -1)) + Q.affine(poly, linear << 1, -a) + elif linear: + resolved = solution(n, [(linear, a // 2)]) + Q.need(resolved is not None, 'A nonzero linear form takes both values') + n, forms = resolved + poly = Q.substitute(poly, forms) + scalar = (2 * scalar[0], 2 * scalar[1]) + elif a: + return (0, 0) + else: + scalar = (2 * scalar[0], 2 * scalar[1]) + return Q.multiply_i(scalar, poly.get(0, 0)) + + +def inner(left, right): + """Return the exact inner product of two valid engine states. + + Inputs come from signature or choi. Arbitrary serialized states are not + admitted without the source engine's construction contract. + """ + n, offset, cols, terms, a, b, den = left + m, other, cols2, terms2, c, d, den2 = right + Q.need(n == m, 'Equal state dimensions') + r = len(cols) + allcols = cols + cols2 + equations = [(sum(((v >> i) & 1) << j for j, v in enumerate(allcols)), + ((offset ^ other) >> i) & 1) for i in range(n)] + resolved = solution(len(allcols), equations) + if resolved is None: + return Fraction(0), Fraction(0) + dimension, forms = resolved + phase = Q.substitute(dict(terms2), forms[r:]) + for mask, coefficient in Q.substitute(dict(terms), forms[:r]).items(): + Q.term(phase, mask, -coefficient) + total = Q.multiply(Q.multiply((a, -b), (c, d)), gauss(dimension, phase)) + return Fraction(total[0], 1 << (den + den2)), Fraction(total[1], 1 << (den + den2)) + + +def choi(n, circuit): + """Return a normalized Choi state, retaining one common Bell phase.""" + Q.need(type(n) is int and n >= 0, 'Nonnegative circuit width') + preparation = [('C', (1 << j) | (1 << (n + j)), 1) for j in range(n)] + preparation.append(('D', tuple(1 << j if j < n else 0 for j in range(2 * n)), + (1,) * n + (0,) * n)) + expanded = [] + for gate in circuit: + # Validate the original arity and domain before extension. + Q.signature(n, [gate]) + kind = gate[0] + if kind == 'P': + expanded.append(('P', tuple(gate[1]) + tuple(1 << j for j in range(n, 2 * n)))) + elif kind == 'D': + expanded.append(('D', tuple(gate[1]) + (0,) * n, tuple(gate[2]) + (0,) * n)) + else: + expanded.append(gate) + return Q.signature(2 * n, preparation + expanded) + + +def trace(n, circuit): + result = inner(choi(n, []), choi(n, circuit)) + return result[0] * (1 << n), result[1] * (1 << n) + + +def kernel(states): + """Return normalized trace(U_i^* U_j) for valid equal-width circuits.""" + return [[inner(a, b) for b in states] for a in states] + + +def residual_norm(gram, coefficients, width): + """Return ||sum c_i U_i^(tensor width)||_HS^2 / d^width.""" + Q.need(type(width) is int and width > 0, 'Positive tensor width') + size = len(coefficients) + Q.need(len(gram) == size and all(len(row) == size for row in gram), 'Gram dimensions') + result = (Fraction(0), Fraction(0)) + for i, a in enumerate(coefficients): + for j, b in enumerate(coefficients): + result = add(result, Q.multiply(Q.multiply(conjugate(a), b), power(gram[i][j], width))) + Q.need(result[1] == 0 and result[0] >= 0, 'A valid Gram norm is real and nonnegative') + return result[0] + + +def decide(n, circuits, coefficients): + """Apply the credited four-width theorem to one fixed expanded residual.""" + Q.need(len(circuits) == len(coefficients), 'One fixed coefficient per circuit') + for a in coefficients: + Q.need(len(a) == 2 and all(type(x) in (int, Fraction) for x in a), + 'Exact rational real and imaginary coefficients') + gram = kernel([choi(n, c) for c in circuits]) + first = 4 * n + 4 if n else 1 + norms = [residual_norm(gram, coefficients, f) for f in range(first, first + 4)] + return dict(widths=list(range(first, first + 4)), norms=norms, + all_positive_widths_zero=all(x == 0 for x in norms)) + + +def divide(a, b): + scale = b[0] ** 2 + b[1] ** 2 + Q.need(scale != 0, 'Nonzero complex pivot') + value = Q.multiply(a, conjugate(b)) + return Fraction(value[0]) / scale, Fraction(value[1]) / scale + + +def best_approximation(states, target, width): + """Minimize the normalized squared residual in the supplied finite span. + + Coefficients may depend on this width. Dependent columns are permitted. + This operation does not admit a physical readout or new native queries. + """ + Q.need(type(width) is int and width > 0, 'Positive tensor width') + size = len(states) + gram = kernel(states + [target]) + matrix = [[power(gram[i][j], width) for j in range(size)] + + [power(gram[i][size], width)] for i in range(size)] + pivots = [] + for col in range(size): + row = next((r for r in range(len(pivots), size) if matrix[r][col] != (0, 0)), None) + if row is None: continue + k = len(pivots) + matrix[k], matrix[row] = matrix[row], matrix[k] + pivot = matrix[k][col] + matrix[k] = [divide(x, pivot) for x in matrix[k]] + for r in range(size): + if r != k: + factor = matrix[r][col] + matrix[r] = [add(x, Q.multiply((-factor[0], -factor[1]), y)) + for x, y in zip(matrix[r], matrix[k])] + pivots.append(col) + Q.need(all(row[-1] == (0, 0) for row in matrix[len(pivots):]), 'Consistent Gram normal equations') + coefficients = [(Fraction(0), Fraction(0))] * size + for row, col in enumerate(pivots): coefficients[col] = matrix[row][-1] + residual = residual_norm(gram, [(-x, -y) for x, y in coefficients] + [(1, 0)], width) + # Orthogonality is an independently inspectable optimum certificate. + for i in range(size): + value = (Fraction(0), Fraction(0)) + for j in range(size): value = add(value, Q.multiply(power(gram[i][j], width), coefficients[j])) + Q.need(value == power(gram[i][size], width), 'Exact residual orthogonality') + return dict(coefficients=coefficients, squared_residual=residual, span_rank=len(pivots)) diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/LICENSE b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5698-NOTICE.md b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5698-NOTICE.md new file mode 100644 index 0000000000..56712e3195 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5698-NOTICE.md @@ -0,0 +1,9 @@ +# Attribution + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. + +Dugongue PR5687 supplies the actual two-line C coframe proposal and its complete profile, source interpretation and moment/tail proof. The native-dual-suppliers source supplies the actual restriction, native maps and main normalizers. Preserve Cao Yifan PR4610/4470, Cinna Davis and the native/frame/helper/ROW/controller lineage, DaysSky, Nick Petalas, Ryanson Jonathan, zxv, Jacob Alan Sussman, and every retained phase, scalar, compiler, precision, stock and analytic notice. + +Seventeen source files are retained byte for byte. Their original comments and attribution remain unchanged. INPUTS.json and SOURCES.json give exact commits, paths, Git objects and SHA256 hashes. Dinic's integral flow algorithm and the submodular graph-cut construction are classical methods, not new mathematics claimed here. + +The new work is the complete 423-frame binary optimization, four additional folds, exact emitted physical program and phase certificates, finite optimality headroom bound, stronger full gain, and charged higher-moment transfer. No global literature priority, independent human acceptance or new kappa is claimed. diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-NOTICE.md b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-NOTICE.md new file mode 100644 index 0000000000..b96b400e5c --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-NOTICE.md @@ -0,0 +1,33 @@ +# Attribution + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. + +The affine-support and quadratic-phase representation is classical stabilizer +simulation. Credit Jeroen Dehaene and Bart De Moor, Physical Review A 68, 042318 +(2003), and the phase-sensitive stabilizer literature, including Bravyi, Browne, +Calpin, Campbell, Gosset and Howard (arXiv:1808.00128). The proof gives a direct +induction for this exact Gaussian-dyadic gate grammar. No discovery or optimal +simulation-complexity claim is made. + +Charles Bethin PR662 supplies the byte-exact table evaluator and prior runtime +work. Its retained NOTICE credits icekylinx, DreamingOfClouds, chafreaky, Jeremy +Kothe and the prior Clifford/wrapper/compiler lineage. Its source and notice +are frozen in tables/. They are used as a comparison engine and finite oracle. + +Ali Romman PR5698 supplies the complete actual restricted-C coframe construction, +source replay and proof checks. Its 32 package files and all nested notices are +frozen in source/. replay.py and verify_source.py are explicitly marked derived +copies with only source paths and state-equality calls changed. Preserve +Dugongue PR5687, Cao Yifan PR4610/4470, Cinna Davis, DaysSky, Nick Petalas, +Ryanson Jonathan, zxv, Jacob Alan Sussman and all native/helper/phase/ROW/controller, +compiler, precision and stock attribution in those retained files. + +BigCactusLabs PR702 and Joshua Snider's cold-wrapper quadratic certificate are +related independent finite amplitude/phase audits. Their scopes and credit are +separate from this implementation. No source contribution is reassigned here. + +The new contribution is the exact polynomial-state engine, explicit full-source +integration, proof-check preservation binding, independent representation tests, +all-actual-state cross-check and complete same-fixture runtime evidence. There +is no change to the mathematical construction, selected result or physical bill. +No independent human review or proof-kernel acceptance is claimed. diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-quadratic.py b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-quadratic.py new file mode 100644 index 0000000000..ce3c86ec07 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/engine/source/PR5704-quadratic.py @@ -0,0 +1,283 @@ +"""Exact affine-support states for the retained Gaussian-dyadic gate grammar. + +The method is classical stabilizer simulation. This implementation keeps the +absolute Gaussian-integer scalar. Ali Romman with substantial OpenAI Codex +assistance. Apache-2.0. +""" + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def bits(mask): + while mask: + bit = mask & -mask + yield bit.bit_length() - 1 + mask ^= bit + + +def term(poly, mask, value): + value = (poly.get(mask, 0) + value) % 4 + if value: + poly[mask] = value + else: + poly.pop(mask, None) + + +def affine(poly, form, coefficient): + """Add a coefficient times an affine Boolean form, modulo four.""" + coefficient %= 4 + if not coefficient: + return + constant = form & 1 + term(poly, 0, coefficient * constant) + signed = coefficient * (1 - 2 * constant) + indices = list(bits(form >> 1)) + for i in indices: + term(poly, 1 << i, signed) + if coefficient & 1: + for k, i in enumerate(indices): + for j in indices[k + 1:]: + term(poly, (1 << i) | (1 << j), 2) + + +def product(poly, left, right): + """Add twice the product of two affine Boolean forms.""" + a, b = left & 1, right & 1 + u, v = list(bits(left >> 1)), list(bits(right >> 1)) + term(poly, 0, 2 * a * b) + if b: + for i in u: + term(poly, 1 << i, 2) + if a: + for j in v: + term(poly, 1 << j, 2) + for i in u: + for j in v: + term(poly, (1 << i) | (1 << j), 2) + + +def substitute(poly, forms): + result = {} + for mask, coefficient in poly.items(): + if not mask: + term(result, 0, coefficient) + elif mask.bit_count() == 1: + affine(result, forms[mask.bit_length() - 1], coefficient) + else: + need(mask.bit_count() == 2 and coefficient == 2, + 'A phase must have only even quadratic terms') + i, j = bits(mask) + product(result, forms[i], forms[j]) + return result + + +def value(poly, argument): + return sum(c for mask, c in poly.items() if argument & mask == mask) % 4 + + +def basis(columns): + """Return reduced binary columns with their original coordinates.""" + rows = {} + for j, column in enumerate(columns): + vector, coordinates = column, 1 << j + while vector: + pivot = vector.bit_length() - 1 + if pivot not in rows: + rows[pivot] = (vector, coordinates) + break + other, witness = rows[pivot] + vector ^= other + coordinates ^= witness + need(vector != 0, 'Support columns must be independent') + for pivot in sorted(rows): + vector, witness = rows[pivot] + for other in sorted(rows): + if other > pivot and rows[other][0] >> pivot & 1: + x, y = rows[other] + rows[other] = (x ^ vector, y ^ witness) + return rows + + +def coordinates(rows, vector): + result = 0 + for pivot in sorted(rows, reverse=True): + if vector >> pivot & 1: + column, witness = rows[pivot] + vector ^= column + result ^= witness + return None if vector else result + + +def multiply_i(pair, power): + a, b = pair + return ((a, b), (-b, a), (-a, -b), (b, -a))[power % 4] + + +def multiply(left, right): + a, b = left + c, d = right + return a * c - b * d, a * d + b * c + + +def normalize(pair, denominator): + need(pair != (0, 0), 'A unitary state cannot be zero') + while denominator and not ((pair[0] | pair[1]) & 1): + pair = (pair[0] // 2, pair[1] // 2) + denominator -= 1 + return pair, denominator + + +def matrix_vector(rows, vector): + return sum(((row & vector).bit_count() & 1) << j for j, row in enumerate(rows)) + + +def validate_integer(value_, limit, message): + need(type(value_) is int and 0 <= value_ < limit, message) + + +def signature(n, circuit, initial=0, counters=None): + """Return a canonical exact state without an exponential vector. + + A state is scalar times i^q(z) at offset xor columns*z. The columns + remain independent. The returned tuple describes every amplitude. + """ + need(type(n) is int and n >= 0, 'The width must be a nonnegative integer') + validate_integer(initial, 1 << n, 'Initial basis index') + columns, offset, poly = [], initial, {} + scalar, denominator = (1, 0), 0 + counts = counters if counters is not None else {} + + def count(key): + counts[key] = counts.get(key, 0) + 1 + + for gate in circuit: + need(isinstance(gate, (tuple, list)) and gate, 'Nonempty gate record') + kind = gate[0] + r = len(columns) + if kind == 'P': + need(len(gate) == 2 and len(gate[1]) == n, 'Permutation dimensions') + rows = gate[1] + for row in rows: + validate_integer(row, 1 << n, 'Binary permutation row') + basis(rows) + offset = matrix_vector(rows, offset) + columns = [matrix_vector(rows, x) for x in columns] + elif kind == 'X': + need(len(gate) == 2, 'Translation record') + validate_integer(gate[1], 1 << n, 'Translation mask') + offset ^= gate[1] + elif kind == 'phase': + need(len(gate) == 2 and type(gate[1]) is int, 'Global phase record') + term(poly, 0, gate[1]) + elif kind == 'D': + need(len(gate) == 3 and len(gate[1]) == len(gate[2]) == n, + 'Diagonal dimensions') + rows, linear = gate[1], gate[2] + for i in range(n): + validate_integer(rows[i], 1 << n, 'Binary diagonal row') + need(type(linear[i]) is int and linear[i] % 2 == (rows[i] >> i & 1), + 'Diagonal parity lift') + for j in range(i): + need((rows[i] >> j & 1) == (rows[j] >> i & 1), + 'Symmetric diagonal matrix') + forms = [(offset >> i & 1) | + sum((column >> i & 1) << (j + 1) for j, column in enumerate(columns)) + for i in range(n)] + for i, coefficient in enumerate(linear): + affine(poly, forms[i], coefficient) + for j in bits(rows[i] >> (i + 1)): + product(poly, forms[i], forms[i + 1 + j]) + elif kind == 'C': + need(len(gate) == 3 and type(gate[2]) is int and gate[2] in (-1, 1), + 'Translation-root record and sign') + q, sign = gate[1:] + validate_integer(q, 1 << n, 'Translation-root mask') + witness = coordinates(basis(columns), q) + scalar = multiply(scalar, (1, sign)) + denominator += 1 + term(poly, 1 << r, -sign) + if witness is None: + columns.append(q) + count('independent_root') + else: + # The last variable has zero output after this substitution. + forms = [(1 << (i + 1)) | (((witness >> i) & 1) << (r + 1)) + for i in range(r)] + [1 << (r + 1)] + poly = substitute(poly, forms) + last = 1 << r + coefficient = poly.pop(last, 0) + neighbours = 0 + for mask in list(poly): + if mask & last: + need(mask.bit_count() == 2 and poly[mask] == 2, + 'Dependent-root quadratic term') + neighbours ^= mask ^ last + del poly[mask] + if coefficient & 1: + scalar = multiply(scalar, (1, 1 if coefficient == 1 else -1)) + affine(poly, neighbours << 1, -coefficient) + count('odd_elimination') + else: + scalar = (2 * scalar[0], 2 * scalar[1]) + constant = coefficient // 2 + if neighbours: + pivot = (neighbours & -neighbours).bit_length() - 1 + free = [i for i in range(r) if i != pivot] + forms = [0] * r + for j, i in enumerate(free): + forms[i] = 1 << (j + 1) + forms[pivot] = constant | sum( + 1 << (j + 1) for j, i in enumerate(free) if neighbours >> i & 1) + poly = substitute(poly, forms) + if constant: + offset ^= columns[pivot] + columns = [columns[i] ^ (columns[pivot] if neighbours >> i & 1 else 0) + for i in free] + count('even_restriction') + else: + need(constant == 0, 'A unitary root cannot annihilate the state') + count('even_free') + scalar, denominator = normalize(scalar, denominator) + else: + raise ValueError('Unknown gate: ' + str(kind)) + need(len(columns) <= n, 'Support dimension cannot exceed width') + counts['peak_support_rank'] = max(counts.get('peak_support_rank', 0), len(columns)) + + rows = basis(columns) + reduced_offset, shift = offset, 0 + for pivot in sorted(rows, reverse=True): + if reduced_offset >> pivot & 1: + column, witness = rows[pivot] + reduced_offset ^= column + shift ^= witness + ordered = [rows[p] for p in sorted(rows)] + forms = [(shift >> i & 1) | sum(((witness >> i) & 1) << (j + 1) + for j, (_, witness) in enumerate(ordered)) for i in range(len(columns))] + poly = substitute(poly, forms) + scalar = multiply_i(scalar, poly.pop(0, 0)) + scalar, denominator = normalize(scalar, denominator) + return (n, reduced_offset, tuple(x for x, _ in ordered), tuple(sorted(poly.items())), + scalar[0], scalar[1], denominator) + + +def amplitude(state, index): + n, offset, columns, terms, real, imag, denominator = state + validate_integer(index, 1 << n, 'Amplitude index') + argument = coordinates(basis(columns), index ^ offset) + if argument is None: + return (0, 0), 0 + pair = multiply_i((real, imag), value(dict(terms), argument)) + return pair, denominator + + +def equal_operators(left, right): + """Compare valid retained Clifford objects, including absolute phase. + + Their tableaus must be derived from their circuits by the retained exact + constructors. An arbitrary supplied tableau is not a valid input contract. + """ + return (left.n == right.n and left.tab == right.tab and + signature(left.n, left.circuit) == signature(right.n, right.circuit)) diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/row/bell_reads.py b/research/clifford-two-site-canonical/predecessor/predecessor/source/row/bell_reads.py new file mode 100644 index 0000000000..32b2ed2a94 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/row/bell_reads.py @@ -0,0 +1,128 @@ +"""Emit the phase-corrected Bell measurements for the compiled Clifford row. + +Use --emit for the identity fibre in order. Labels have four low Z bits +and four high X bits. apoursh with substantial OpenAI Codex assistance. +Apache-2.0. Phase correction is from PR7799. +""" +import argparse +from functools import cache +import json +from typing import NamedTuple + +from compile_row import DENOMINATOR, IDENTITY, SEED, apply, iter_terms, pairing + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def parity(value): + return value.bit_count() % 2 + + +def q0(v): + return parity((v >> 4) & v) + + +def transvection(axis, vector): + return vector ^ (axis if pairing(axis, vector) else 0) + + +def decompose(matrix): + """Write a symplectic map as a sequence of transvections in application order.""" + columns = list(matrix) + corrections = [] + for i, target in enumerate(IDENTITY): + source = columns[i] + if source == target: + continue + if pairing(source, target): + axes = (source ^ target,) + else: + middle = next(v for v in range(256) + if pairing(v, source) and pairing(v, target) + and all(pairing(source ^ v, fixed) == 0 for fixed in IDENTITY[:i])) + axes = (source ^ middle, middle ^ target) + for axis in axes: + columns = [transvection(axis, v) for v in columns] + corrections.append(axis) + require(tuple(columns) == IDENTITY, "transvection reduction failed") + return tuple(reversed(corrections)) + + +def step(axis, v, bell): + """Phase exponent modulo four of a transvection on one unphased Weyl label.""" + out = transvection(axis, v) + exponent = 0 + if out != v: + exponent = 1 + q0(axis) + 2 * parity((axis & 15) & (v >> 4)) + if bell: + if q0(axis): + exponent += 1 + else: + exponent += 2 + 2 * parity((out & 15) & (axis >> 4)) + out ^= axis + return out, exponent % 4 + + +def label_sum(labels): + total = 0 + for label in labels: + total ^= label + return total + + +@cache +def transported_seed(matrix): + """Return the six output labels and the seed's transport phase exponent.""" + labels = list(SEED) + weight = label_sum(SEED) + phase = 0 + for axis in decompose(matrix): + next_weight, gamma = step(axis, weight, False) + values = [step(axis, label, True) for label in labels] + labels = [value for value, _ in values] + phase += sum(theta for _, theta in values) - gamma + weight = next_weight + # Independent affine check. q(Sv+b)=q(v) fixes the offset b uniquely. + offset = labels[0] + require(all(q0(apply(matrix, u) ^ offset) == q0(u) for u in (0, *IDENTITY)), + "Bell offset violates transpose parity") + require(all(label == apply(matrix, v) ^ offset for v, label in zip(SEED, labels, strict=True)) + and weight == label_sum(labels), "misordered symplectic transport") + return tuple(labels), phase % 4 + + +class Read(NamedTuple): + numerator: int + input_labels: tuple[int, ...] + output_labels: tuple[int, ...] + correction_i: int + + +def iter_reads(target=IDENTITY): + """Weight is numerator/DENOMINATOR. Multiply the corrected singleton by i^correction_i.""" + for term in iter_terms(target): + i, phase_i = transported_seed(term.input_map) + j, phase_j = transported_seed(term.output_map) + yield Read(term.numerator, i, j, (phase_i - phase_j) % 4) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--emit", action="store_true", help="emit one JSON object per identity-fibre read") + args = parser.parse_args() + pairs = set() + for read in iter_reads(): + pair = read.input_labels, read.output_labels + require(pair not in pairs, "repeated literal Bell address") + pairs.add(pair) + if args.emit: + print(json.dumps(dict(read._asdict(), denominator=DENOMINATOR))) + if not args.emit: + print(f"PASS_BELL_READS distinct_pairs={len(pairs)}") + + +if __name__ == "__main__": + main() diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/row/compile_row.py b/research/clifford-two-site-canonical/predecessor/predecessor/source/row/compile_row.py new file mode 100644 index 0000000000..daf35d6a26 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/row/compile_row.py @@ -0,0 +1,247 @@ +"""Compile the shear-character certificate in PR7799 into signed Bell reads. + +Binary vectors have four low Z bits and four high X bits, least significant +bit for qubit one. A matrix is the tuple of images of the standard basis. +apoursh, with substantial OpenAI Codex and separate agent assistance. +Apache-2.0. The seed, character cases and plane selection are from PR7799. +""" +import argparse +from collections import Counter, defaultdict +from functools import cache +from itertools import combinations, combinations_with_replacement +import json +from typing import NamedTuple + + +IDENTITY = tuple(1 << i for i in range(8)) +DENOMINATOR = 1024 +SEED = (0, 1, 2, 4, 8, 128) +UPPER = tuple(combinations_with_replacement(range(4), 2)) + + +class Term(NamedTuple): + numerator: int + input_map: tuple[int, ...] + output_map: tuple[int, ...] + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def apply(columns, vector): + result = 0 + while vector: + bit = vector & -vector + result ^= columns[bit.bit_length() - 1] + vector ^= bit + return result + + +def compose(left, right): + return tuple(apply(left, v) for v in right) + + +def pairing(u, v): + return (((u >> 4) & v) ^ ((v >> 4) & u)).bit_count() % 2 + + +def span(basis): + points = [0] + for v in basis: + points += [u ^ v for u in points] + return points + + +def is_symplectic(matrix): + return (len(matrix) == 8 and all(isinstance(v, int) and 0 <= v < 256 for v in matrix) + and all(pairing(matrix[i], matrix[j]) == pairing(IDENTITY[i], IDENTITY[j]) + for i, j in combinations(range(8), 2))) + + +@cache +def shear(mask): + """Send (z,x) to (z+B x,x), with B's upper triangle given by mask.""" + result = list(IDENTITY) + for index, (i, j) in enumerate(UPPER): + if mask & (1 << index): + result[4 + i] ^= 1 << j + if i != j: + result[4 + j] ^= 1 << i + return tuple(result) + + +def pair_mask(u, v): + return sum(((((u >> i) & (v >> j)) ^ ((u >> j) & (v >> i))) & 1) << k + for k, (i, j) in enumerate(UPPER)) + + +def quadratic_address(v): + return sum(1 << k for k, (i, j) in enumerate(UPPER) if v & (1 << i) and v & (1 << j)) + + +def select_plane(ch): + # Match the deterministic binary ordering used by the PR7799 verifier. + values = tuple((ch & quadratic_address(v)).bit_count() % 2 for v in range(16)) + + def polar(u, v): + return values[u] ^ values[v] ^ values[u ^ v] + + if any(all(polar(v, b) == 0 for b in (1, 2, 4, 8)) for v in range(1, 16)): + return next(w for w in combinations(range(1, 16), 3) + if len(set(span(w))) == 8 and all(polar(i, j) == 0 for i, j in combinations(w, 2))) + r = next(v for v in range(1, 16) if values[v] == 0) + hyperplane = [u for u in range(16) if polar(r, u) == 0] + z2 = next(v for v in hyperplane if v not in (0, r)) + dual = next(x for x in range(1, 16) if all((x & v).bit_count() % 2 == 0 for v in hyperplane)) + return r, z2, dual << 4 + + +def canonical_basis(points): + basis = [] + for v in sorted(points): + if v not in span(basis): + basis.append(v) + return tuple(basis) + + +def extend_basis(w): + z = list(w) + z.append(next(v for v in range(1, 256) if v not in span(z) and all(pairing(v, u) == 0 for u in z))) + x = [] + for i in range(4): + x.append(next(v for v in range(1, 256) + if all(pairing(v, u) == int(i == j) for j, u in enumerate(z)) + and all(pairing(v, b) == 0 for b in x))) + matrix = tuple(z + x) + require(is_symplectic(matrix), "plane transporter is not symplectic") + return matrix + + +def walsh(characters): + values = [0] * 1024 + for ch in characters: + values[ch] = 1 + step = 1 + while step < len(values): + for start in range(0, len(values), 2 * step): + for i in range(start, start + step): + j = i + step + values[i], values[j] = values[i] + values[j], values[i] - values[j] + step *= 2 + return values + + +def normalizer_representatives(w, p_basis): + if len(p_basis) == 3: + return [0] + dual = next(v for v in w if v >> 4) + p = span(p_basis) + representatives = {} + for mask in range(1024): + b_dual = apply(shear(mask), dual) ^ dual + key = min(b_dual ^ u for u in p) + representatives.setdefault(key, mask) + require(len(representatives) == 4, "mixed-plane normalizer index") + return sorted(representatives.values()) + + +def iter_terms(target=IDENTITY): + """Yield numerator / DENOMINATOR weights on transported coset *sums*. + + Apply the source and target transporters to SEED via the affine Bell + action and undo the singleton/transport phases as specified in PROOF.md. + The weighted sum of those 16-by-16 blocks is the target's fibre matrix + on the image of the observation map. Target defaults to the identity. + """ + require(is_symplectic(target), "invalid target symplectic matrix") + by_plane = defaultdict(list) + for ch in range(1024): + by_plane[canonical_basis(span(select_plane(ch)))].append(ch) + for w, chars in sorted(by_plane.items()): + pure = tuple(z for z in w if z < 16) + h = span(tuple(pair_mask(u, v) for u, v in combinations(pure, 2))) + representatives = normalizer_representatives(w, pure) + g = extend_basis(w) + values = walsh(chars) + divisor = 4 if len(pure) == 2 else 1 + for delta, value in enumerate(values): + if not value or delta != min(delta ^ offset for offset in h): + continue + require(value % divisor == 0, "coefficient needs a finer denominator") + for b in representatives: + right = compose(shear(b), g) + left = compose(target, compose(shear(delta ^ b), g)) + yield Term(value // divisor, right, left) + + +def seed_subgroup(): + hats = [pair_mask(1 << i, 1 << j) for i, j in combinations(range(3), 2)] + return tuple(shear(mask) for mask in span(hats)) + + +@cache +def inverse(matrix): + # Binary symplectic inverse from the images of a paired basis. + return tuple(sum(pairing(matrix[i ^ 4], u) << i for i in range(8)) for u in IDENTITY) + + +def bell_tuple(matrix): + # q(L v)=q(v) gives = q(u)+q(S^-1 u), hence b from the + # images of basis vectors under the inverse. q(e_j)=0. + inv = inverse(matrix) + offset = 0 + for j in range(8): + v = inv[j ^ 4] + offset |= (((v >> 4) & v).bit_count() % 2) << j + return tuple(apply(matrix, v) ^ offset for v in SEED) + + +def check(target): + accum = Counter() + seen = set() + terms = list(iter_terms(target)) + subgroup = seed_subgroup() + for weight, right, left in terms: + products = {compose(left, compose(c, inverse(right))) for c in subgroup} + key = frozenset(products) + require(len(products) == 8 and key not in seen, "repeated or malformed coset") + seen.add(key) + for item in products: + accum[item] += weight + require({k: v for k, v in accum.items() if v} == {target: DENOMINATOR}, + "signed coset sum is not the single target") + require(len(accum) == 8304, "expanded union size") + mass_by_input = Counter() + for term in terms: + mass_by_input[bell_tuple(term.input_map)] += abs(term.numerator) + require(Counter(mass_by_input.values()) == {128: 29, 192: 10, 224: 8, 240: 8, 288: 12}, + "absolute coefficient mass by input") + require(8 * sum(m*m for m in mass_by_input.values()) * 64 == 1319 * DENOMINATOR**2, + "simultaneous squared norm bound") + numerators = [term.numerator for term in terms] + require(len(terms) == 4265 and sum(abs(w) for w in numerators) == 12800, + "row sparsity or absolute mass") + require(sum(w*w for w in numerators) == DENOMINATOR**2 // 8, "squared row mass") + require(any(w % 2 for w in numerators), "denominator 1024 not attained") + return len(accum) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--emit", action="store_true", help="emit the identity row as JSON lines") + args = parser.parse_args() + if args.emit: + for term in iter_terms(): + print(json.dumps(term._asdict(), separators=(",", ":"))) + return + covered = check(IDENTITY) + # Hadamard on each qubit swaps the two coordinate registers. + require(check(IDENTITY[4:] + IDENTITY[:4]) == covered, "translated support") + print(f"PASS_COMPRESSED_CLIFFORD_ROW terms=4265 group_terms=34120 union={covered}" + " denominator=1024 absolute_mass=25/2 squared_mass=1/8 row_norm_squared=2^45") + + +if __name__ == "__main__": + main() diff --git a/research/clifford-two-site-canonical/predecessor/predecessor/source/width13-spectrum.json b/research/clifford-two-site-canonical/predecessor/predecessor/source/width13-spectrum.json new file mode 100644 index 0000000000..039f22ba0b --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/source/width13-spectrum.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-two-site-canonical/predecessor/predecessor/spherical.py b/research/clifford-two-site-canonical/predecessor/predecessor/spherical.py new file mode 100644 index 0000000000..7cfa882a15 --- /dev/null +++ b/research/clifford-two-site-canonical/predecessor/predecessor/spherical.py @@ -0,0 +1,66 @@ +"""Independent polar-graph verification of the canonical answer on repeated coordinates.""" +from fractions import Fraction +from pathlib import Path +import json +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0,str(HERE)) + + +def spherical_solution(): + rows = json.loads((HERE/"source"/"width13-spectrum.json").read_text())["rows"] + shell_sizes = [1] + down = [2**i-1 for i in range(5)] + up = [2*(16-2**i) for i in range(5)] + stay = [30-a-b for a,b in zip(up,down,strict=True)] + for i in range(4): + shell_sizes.append(shell_sizes[-1]*up[i]//down[i+1]) + size = sum(shell_sizes) + if shell_sizes != [1,30,280,960,1024]: + raise ValueError("Incorrect polar-graph shells") + rhs = [Fraction(16,4**13)*Fraction(-1,64)**i for i in range(5)] + answer = [Fraction(0)]*5 + eigensystem = [] + for theta in [30,13,3,-5,-15]: + u = [Fraction(1)] + for i in range(4): + prev = down[i]*u[i-1] if i else 0 + u.append(((theta-stay[i])*u[i]-prev)/up[i]) + if down[-1]*u[-2]+stay[-1]*u[-1] != theta*u[-1]: + raise ValueError("Incorrect radial eigenvector") + degree = Fraction(size,sum(k*x*x for k,x in zip(shell_sizes,u,strict=True))) + matching = [Fraction(*row["eigenvalue"]) for row in rows if row["quotient_degree"]==degree] + if len(matching) != 1: + raise ValueError(("Nonunique quotient representation",degree)) + scalar = matching[0] + coeff = degree/size*sum(k*x*y for k,x,y in zip(shell_sizes,rhs,u,strict=True)) + for i in range(5): + answer[i] += coeff*u[i]/scalar + eigensystem.append((theta,int(degree),scalar,tuple(u))) + if sum(d for _,d,_,_ in eigensystem)!=size or any(v==0 for v in answer): + raise ValueError("Radial decomposition or unexpectedly empty shell") + mass = Fraction(20643840,16)*sum(k*x*y for k,x,y in zip(shell_sizes,answer,rhs,strict=True)) + if not 0 < mass < 1: + raise ValueError("Repeated coordinate projection must be proper and nonzero") + return tuple(answer),mass,eigensystem + + + +def compare(): + from canonical import profile, radial_matrix + weights, mass, eigensystem = spherical_solution() + if tuple(a/16 for a in weights) != profile(): + raise ValueError("Independent canonical coefficient profiles disagree") + if mass != Fraction(478566778595,5856573836677349376): + raise ValueError("Projection mass mismatch") + matrix = radial_matrix() + for theta,degree,scalar,u in eigensystem: + result = [sum(x*y for x,y in zip(row,u,strict=True)) for row in matrix] + if result != [scalar*v for v in u]: + raise ValueError(("Geometric and character Gram actions disagree",theta,degree)) + print("PASS all five radial eigenspaces, canonical profile, exact projection mass",mass) + + +if __name__ == "__main__": + compare() diff --git a/research/clifford-two-site-canonical/two_site_spectrum.py b/research/clifford-two-site-canonical/two_site_spectrum.py new file mode 100644 index 0000000000..35e80ae5aa --- /dev/null +++ b/research/clifford-two-site-canonical/two_site_spectrum.py @@ -0,0 +1,142 @@ +"""Exact normal operator of the width-13 two-variable-site raw adjoint.""" +from collections import Counter +from fractions import Fraction +from functools import cache +from itertools import product +from math import prod + + +@cache +def subspaces(n, dimension): + """All binary subspaces, as sorted tuples of members.""" + spaces = {frozenset((0,))} + for _ in range(dimension): + spaces = { + space | {u ^ v for u in space} + for space in spaces for v in range(1, 1 << n) if v not in space + } + return tuple(sorted(tuple(sorted(space)) for space in spaces)) + + +@cache +def isomorphisms(d): + """Linear bijections in quotient coordinates, given by value tables.""" + tables = [(0,)] + for _ in range(d): + tables = [table + tuple(t ^ v for t in table) + for table in tables for v in range(1, 1 << d) if v not in table] + return tuple(tables) + + +def quotient(n, kernel): + """Linear map to coordinates of the quotient by kernel.""" + # Least coset representatives form a vector space (binary row reduction). + reps = [min(x ^ u for u in kernel) for x in range(1 << n)] + labels = {value: j for j, value in enumerate(sorted(set(reps)))} + return tuple(labels[value] for value in reps) + + +def pair_types(n): + q = 1 << n + return { + '00': ((0, 0), 1), + 'xx': ((1, 1), q - 1), + '0x': ((0, 1), q - 1), + 'xy': ((1, 2), (q - 1) * (q - 2) // 2), + } + + +def support_counts(n, j): + """For each row/column multiset type, count graphs supporting each matching.""" + types = pair_types(n) + blocks = list(product(types, repeat=2)) + counts = {block: [0, 0, 0] for block in blocks} + lookups = [quotient(n, space) for space in subspaces(n, j)] + graphs = 0 + for left in lookups: + for right in lookups: + for mapping in isomorphisms(n - j): + graphs += 1 + # Only labels 0,1,2 occur in the chosen GL orbit representatives. + image = [mapping[right[k]] for k in range(3)] + for row, column in blocks: + (i, h), _ = types[row] + (k, l), _ = types[column] + direct = left[i] == image[k] and left[h] == image[l] + cross = left[i] == image[l] and left[h] == image[k] + tally = counts[row, column] + tally[0] += direct + tally[1] += cross + tally[2] += direct and cross + return graphs, counts + + +def gaussian_binomial(n, k): + return prod((1 << (n - i)) - 1 for i in range(k)) // prod( + (1 << (k - i)) - 1 for i in range(k)) + + +def normal_blocks(n=4, width=13, only_shell=None): + """Block entries (a,b,c) of [[a,c],[c,b]], (a,) for one-dimensional blocks. + + Each is in the orthonormal symmetric monomial basis with unnormalized + group counting, for the dictionary normalized as vec(V)/sqrt(2**n). + """ + if n < 2 or width <= 2: + raise ValueError("need n >= 2 and at least one frozen site") + if only_shell is not None and not 0 <= only_shell <= n: + raise ValueError("shell outside supported range") + q = 1 << n + symplectic_order = (1 << n**2) * prod((1 << (2 * i)) - 1 for i in range(1, n + 1)) + lagrangians = prod((1 << i) + 1 for i in range(1, n + 1)) + types = pair_types(n) + blocks = {} + for row, column in product(types, repeat=2): + size = 3 if row in ('0x', 'xy') and column in ('0x', 'xy') else 1 + blocks[row, column] = [Fraction(0)] * size + shells = range(n + 1) if only_shell is None else (only_shell,) + for j in shells: + graphs, counts = support_counts(n, j) + multiplicity = gaussian_binomial(n, j) << (j * (j + 1) // 2) + factor = Fraction(q * (symplectic_order // lagrangians) * multiplicity, + (q**width) * (1 << ((width - 1) * j)) * graphs) + for key, block in blocks.items(): + row, column = key + norm = 1 if row in ('00', 'xx') and column in ('00', 'xx') else 2 + first, other, both = counts[key] + block[0] += norm * factor * first + if len(block) > 1: + block[1] += norm * factor * other + if both: + block[2] -= norm * factor * Fraction(both, (1 << j) - 1) + return {key: tuple(block) for key, block in blocks.items()} + + +def eigenpolynomials(n, blocks): + """Exact rational eigenvalues or quadratic factors and multiplicities.""" + types = pair_types(n) + factors = Counter() + for (row, column), block in blocks.items(): + multiplicity = types[row][1] * types[column][1] + if len(block) == 1: + factors[(1, -block[0])] += multiplicity + continue + a, b, c = block + if a == b: + factors[(1, -a - c)] += multiplicity + factors[(1, -a + c)] += multiplicity + elif not c: + factors[(1, -a)] += multiplicity + factors[(1, -b)] += multiplicity + else: + factors[(1, -a - b, a * b - c * c)] += multiplicity + return factors + + +if __name__ == '__main__': + blocks = normal_blocks() + for key, block in blocks.items(): + print(*key, *(str(entry) for entry in block)) + print('Characteristic factors of the symmetric sector (descending coefficients; multiplicity)') + for poly, count in eigenpolynomials(4, blocks).items(): + print(' '.join(str(coefficient) for coefficient in poly), count)