betaFeedback

WorksPhysics and Astronomy

Exact distances and measurement allocation for logical Pauli readout

Abstract

The minimum fault weight of a logical readout depends jointly on data-error persistence, check redundancy and time-boundary constraints. For any binary check matrix HH and nonzero parity support ww, we prove that a repeated-readout model with a zero-syndrome endpoint has exact distance min⁡w⋅y=1[wt⁡(y)+qwt⁡(Hy)]\min_{w\cdot y=1}[\operatorname{wt}(y)+q\operatorname{wt}(Hy)] for at least qq wrong readouts. This reduces the search over fault histories to one weighted spatial minimum and gives the minimum repetition count for each adjacent-column check in square Bacon–Shor and generalized Shor readouts. Combining those checks with redundant Gauss-check pair products yields an exact joint distance and an outcome-count optimum within the specified gauged-readout family. At target distance mm, one round uses m2m^2 outcomes, compared with m(2m−1)m(2m-1) for the repeated baseline in the same phenomenological model. For a one-epoch bare-ancilla CNOT implementation, we prove a schedule-dependent distance upper bound by constructing an accepted wrong readout from one gate fault and outcome flips. The bound identifies necessary timing conditions for retaining the target distance and gives matching upper bounds of three for the best tested schedules at both m=3m=3 and m=5m=5.

Introduction

Quantum error correction protects encoded information by measuring checks that detect errors without measuring the logical state [1, 2]. Threshold theorems establish reliable computation at sufficiently small physical error rates [3], and quantum low-density parity-check codes offer favorable rates, distances and memory overheads [6] [4, 5]. Computation also needs reliable logical operations, including logical Pauli measurements. Topological and homological codes provide the code families on which these operations were first developed [7, 8]. Lattice surgery implements logical measurements by merging and splitting code patches [9]. Gauging gives a systematic construction using an auxiliary graph and local checks on data and edge ancillas [10]. The product of the Gauss-check outcomes is the logical result; Figure 1 illustrates the construction.

Gauging the weight-four logical operator

Figure 1. Gauging the weight-four logical operator L=X1X2X3X4L = X_1X_2X_3X_4. (a) Circles are support data; squares are edge ancillas initialized in ∣0⟩\lvert0\rangle. Dark markers show A1=X1X12X41A_1 = X_1X_{12}X_{41}; the outcome product of all four Gauss checks measures LL. (b) The dashed line separates the vertex set SS from its complement ScS^{\mathrm{c}}, cutting two edges. C1C_1 requires ∣∂S∣≥min⁡(∣S∣,∣Sc∣)\lvert\partial S\rvert\ge\min(\lvert S\rvert,\lvert S^{\mathrm{c}}\rvert) for every SS. (c) Displayed Gauss checks and the cycle check BC=Z12Z23Z34Z41B_C = Z_{12}Z_{23}Z_{34}Z_{41}; blank cells denote II. Original checks, their deformed partners and other data qubits are omitted. (d) Four measurement-outcome flips on A1A_1 pass every adjacent-round comparison and reverse every logical readout. Here ℓ\ell is the ideal logical outcome and ℓt\ell_t is the observed outcome in round tt. Here zv,tz_{v,t} marks a flipped check outcome and Dv,t=zv,t⊕zv,t+1D_{v,t} = z_{v,t} \oplus z_{v,t+1} is its comparison detector. Fault weight is four in this measurement-only example. OpenAI Codex assisted the drawing code and layout; see Section VI.

A reliable readout must protect that result from both data errors and faulty measurement records. Repeating checks and measuring redundant products can provide this protection, but their costs depend on how data faults persist and on which records are compared. We ask how these choices set the exact minimum fault weight, and how to allocate measurements to reach a target distance.

Our main theorem reduces a multiround fault problem to one weighted spatial minimum. For any binary check matrix HH and nonzero parity support ww, the model defined in Section III has exact distance min⁡w⋅y=1[wt⁡(y)+qwt⁡(Hy)]\min_{w\cdot y=1}[\operatorname{wt}(y)+q\operatorname{wt}(Hy)]. Data errors persist, the checks and logical parity share a noisy record, and endpoint checks constrain the syndrome to zero. The formula replaces a search over fault histories by a search over parity-flipping vectors yy. It also yields a criterion for selecting endpoint checks and the minimum number of copies of each adjacent-column check in square Bacon–Shor and generalized Shor readouts.

For a gauged readout, we combine these checks with redundant pair products of the Gauss outcomes. The exact joint distance separates a measurement-record bottleneck from a persistent-data bottleneck. Within the family of fixed adjacent-column checks and Gauss pair products, we minimize the outcome count over allocations and round counts. At target distance mm, one round uses m2m^2 outcomes, compared with m(2m−1)m(2m-1) for the repeated baseline in the same phenomenological model. A separate circuit bound identifies low-weight accepted errors from the timing of the CNOTs and supplies a necessary condition for preserving distance mm with bare ancillas.

These results build on data-syndrome coding. Ashikhmin, Lai and Brun encode syndrome bits through redundant stabilizer products and include repeated measurements as a repetition-code special case [11]; Fujiwara also studies protection against data and syndrome errors [12]. Generalized data-syndrome codes represent accumulating data faults and noisy syndrome records across multiple rounds [13]. Here the quantity optimized is a selected logical parity under an explicit acceptance and readout predicate. The resulting contributions are the exact threshold-dependent spatial reduction, the minimum Shor-family check allocation, and the joint outcome-count optimum for the specified gauged-readout family. The CNOT bound then tests whether a chosen schedule can preserve that phenomenological distance.

Williamson and Yoder establish the gauging construction and its spatial, temporal and spacetime bounds under explicit construction and boundary assumptions [10]. The present readout and circuit results have direct proofs; the Supplemental Material also provides formalized algebraic results and code examples that separate graph, boundary and check-redundancy effects.

Section II proves the general distance formula and check allocation, Section III gives the joint gauged-readout distance and measurement count, and Section IV establishes the circuit scheduling bound. The Supplemental Material [14] gives the proofs, verification scope and reproduction commands.

Exact distances and check allocation

We first solve a repeated-readout problem for an arbitrary binary matrix. The same formula then determines which checks to repeat in a Shor-family readout.

Fault model and readout predicate

We call the model with accumulating data errors the persistent-fault readout model. Rounds are indexed by t=0,…,T−1t=0,\ldots,T-1, with T≥1T\ge1. For the general model, let HH be a binary check matrix with nn columns and let w∈F2nw\in\mathbb{F}_2^n be a nonzero parity support. In each round, dtd_t is a new data error, μt\mu_t is a readout-record error, and γt\gamma_t is a check-result error; each nonzero bit is one independent fault location. The data errors persist, so xt=∑s=0tdsx_t=\sum_{s=0}^{t}d_s. The checks and logical parity use the same noisy record xt+μtx_t+\mu_t, with independent check-result flips added afterward:

σt=H(xt+μt)+γt,rt=w⋅(xt+μt).(1)\sigma_t=H(x_t+\mu_t)+\gamma_t,\qquad r_t=w\cdot(x_t+\mu_t). \tag*{(1)}

Here σt\sigma_t collects the check-result error bits, and rt=1r_t=1 means that the round readout differs from the ideal logical value. This shared record explains why μt\mu_t enters both expressions. (1) defines a phenomenological model; a circuit realization must specify observables and fault propagation that produce these effects. With a boundary constraint, the detectors require σ0=0\sigma_0=0 and σt+σt−1=0\sigma_t+\sigma_{t-1}=0 for t≥1t\ge1. Without it, they impose only the adjacent comparisons. Let D(f)=0D(f)=0 mean that a fault ff fires no detector. The distance for an undetected strict-majority error is

dmaj(T)=min⁡{wt⁡(f):D(f)=0, 2∣{t:rt=1}∣>T}.(2)d_{\mathrm{maj}}(T)=\min\{\operatorname{wt}(f):D(f)=0,\ 2|\{t:r_t=1\}|>T\}. \tag*{(2)}

Ties are outside this predicate. To compute a decoder failure distance, one must specify the decoder’s observed inputs and its decision or rejection rule, including ties.

A spatial minimum for a multiround fault problem

The exact distance has a closed form for any threshold qq of wrong readouts. For 1≤q≤T1\le q\le T, let dq(H,w;T)d_q(H,w;T) minimize the number of fault locations over detector-free patterns with at least qq wrong readouts. With the model in (1) and the zero-syndrome endpoint constraint, we prove

Theorem 1 Exact repeated-readout distance. For every binary matrix HH, nonzero ww, positive TT, and 1≤q≤T1\le q\le T,

dq(H,w;T)=Γq(H,w)=min⁡w⋅y=1[wt⁡(y)+qwt⁡(Hy)].(3)d_q(H,w;T)=\Gamma_q(H,w)=\min_{w\cdot y=1}\left[\operatorname{wt}(y)+q\operatorname{wt}(Hy)\right]. \tag*{(3)}

In particular, strict majority uses q=⌊T/2⌋+1q=\lfloor T/2\rfloor+1, so dmaj(T)=Γ⌊T/2⌋+1(H,w)d_{\mathrm{maj}}(T)=\Gamma_{\lfloor T/2\rfloor+1}(H,w).

To see the lower bound, choose the wrong round with the fewest transient faults among the at least qq wrong rounds. If y=xt+μty=x_t+\mu_t in that round, zero syndrome gives Hy=γtHy=\gamma_t and a wrong readout gives w⋅y=1w\cdot y=1. If kt=wt⁡(μt)+wt⁡(γt)k_t=\operatorname{wt}(\mu_t)+\operatorname{wt}(\gamma_t), then qktqk_t is no greater than the total transient-fault cost in the wrong rounds. Also, wt⁡(y)≤wt⁡(xt)+wt⁡(μt)\operatorname{wt}(y)\le\operatorname{wt}(x_t)+\operatorname{wt}(\mu_t) and wt⁡(xt)\operatorname{wt}(x_t) is at most the total data-fault cost. Together these inequalities give wt⁡(y)+qwt⁡(Hy)\operatorname{wt}(y)+q\operatorname{wt}(Hy) no greater than the total fault weight. For the upper bound, introduce one minimizing data error yy at the start of the final qq-round block and cancel HyHy with check-result faults in those rounds. The full proof is in the Supplemental Material, Supplemental Sec. S2.

The theorem removes the time history from the minimization. The vector yy specifies a parity-flipping error in one round, and qwt⁡(Hy)q\operatorname{wt}(Hy) is the cost of hiding its syndrome in qq wrong rounds. No longer history can give a cheaper undetected pattern. At q=1q=1, the expression is the parity-restricted binary data-and-syndrome minimum: the undetected pair is (y,Hy)(y,Hy) [11]. Equation (3) identifies when the multiround problem reduces exactly to that weighted spatial minimum.

Which endpoint checks are needed?

Removing the boundary syndrome constraint reduces the distance to one for every T≥1T\ge1. One data fault in the logical support, introduced in the first round, persists through all later rounds. Every round then has the same syndrome, so adjacent-round comparisons detect nothing while every readout is flipped. More generally, let HH be any check matrix and let ww be a nonzero linear parity readout on the data. Choose a coordinate jj with wj=1w_j=1 and introduce the unit error eje_j in the first round. This weight-one fault is undetected by adjacent comparisons and flips every readout. Since a zero-weight fault cannot flip a linear readout, the distance is exactly one. Thus boundary collapse follows from error accumulation and comparison-only detection, for any original code distance.

The zero-syndrome constraint can be imposed at either endpoint. Adjacent comparisons make all syndromes equal, so requiring either the first or the last syndrome to vanish forces all of them to vanish. Requiring a zero syndrome at the second endpoint gives no further restriction on undetected faults in this model.

The endpoint constraint acts on the total syndrome, so fault contributions may cancel there. The source convention and its surrounding error correction are described under C3 in Supplemental Sec. S5.

The endpoint need not constrain every syndrome bit. Suppose adjacent comparisons still use the full syndrome σt\sigma_t, but an endpoint checks only Bσt=0B\sigma_t=0 for a binary linear map BB. Define δB=min⁡{wt⁡(y):BHy=0, w⋅y=1}\delta_B=\min\{\operatorname{wt}(y): BH y=0,\ w\cdot y=1\} and assume this set is nonempty. For strict majority, the resulting distance obeys

min⁡{δB,q+1}≤dmajB(T)≤δB,q=⌊T2⌋+1.(4)\min\{\delta_B,q+1\}\le d_{\mathrm{maj}}^B(T)\le\delta_B,\qquad q=\left\lfloor\frac{T}{2}\right\rfloor+1. \tag*{(4)}

It equals δB\delta_B when q≥δB−1q\ge\delta_B-1. Thus, for a target dd, the endpoint map must detect every parity-flipping vector below weight dd; this condition is also sufficient once q≥d−1q\ge d-1. The proof and the cases where the bound is not tight are given in Supplemental Sec. S2.

Minimum repetitions for Shor-family checks

For the square m×mm\times m Bacon–Shor and generalized Shor families with m≥2m\ge2, the exact formula also determines how often to measure each adjacent-column check. Let vjv_j be the parity of the data error in column jj, so the logical readout is v0v_0 and check jj measures vj−1+vjv_{j-1}+v_j for 1≤j<m1\le j<m. If check jj has cj≥1c_j\ge1 independent copies per round, then

dq(Hc,w;T)=min⁡{m, min⁡1≤j<m(j+qcj)},(5)d_q(H_c,w;T)=\min\left\{m,\ \min_{1\le j<m}(j+qc_j)\right\}, \tag*{(5)}
cj∗=⌈m−jq⌉(dq=m).c_j^\ast=\left\lceil\frac{m-j}{q}\right\rceil\qquad(d_q=m).

The copy counts cj∗c_j^\ast are the componentwise minimum that gives distance mm within this fixed family of checks. They allocate more repetitions to checks closer to the selected readout column. The derivation appears in Supplemental Sec. S2.

Measurement allocation for gauged readout

Gauging measures a logical Pauli operator through the product of local Gauss-check outcomes [10]. We combine those outcomes with the repeated-check formula to protect both the data and the measurement records.

An XX-type gauging graph GG places a vertex on each data qubit in the measured logical support and an edge ancilla in ∣0⟩\lvert0\rangle on each edge. Its Gauss check is Av=∏e∋vXeA_v=\prod_{e\ni v}X_e. Multiplying all Gauss checks cancels every edge factor, leaving the original logical operator. These are checks on the enlarged system; measuring the original stabilizers alone does not measure that logical operator. Figure 1 shows the check supports and a constant measurement-error history. The complete gauging construction also includes the deformed original checks and cycle checks [10]. For its spatial guarantee, the source uses the sufficient graph condition C1, ∣∂S∣≥min⁡(∣S∣,∣Sc∣)|\partial S|\ge\min(|S|,|S^c|) for every vertex set SS, together with the check-completion hypotheses. The readout model below specifies the original-check and Gauss records explicitly; Supplemental Sec. S4 gives the full construction background.

Let A0,…,Am−1A_0,\ldots,A_{m-1} be the commuting Gauss checks whose product is the logical operator LL. Use a separate simple graph KK to choose additional pair products AuAvA_uA_v for measurement. This graph KK is independent of the auxiliary graph GG used to construct the gauged code. If a∈F2ma\in\mathbb{F}_2^m is the vector of original Gauss outcomes, the added records are the pair parities au+ava_u+a_v for edges {u,v}∈E(K)\{u,v\}\in E(K). Same-round detectors check each pair result against its two original outcomes.

With independent outcome flips and fault-free data, an undetected logical flip is a set SS of original outcomes and the pair outcomes on its cut ∂KS\partial_KS. Its weight is ∣S∣+∣∂KS∣|S|+|\partial_KS|, and it changes the logical result exactly when ∣S∣|S| is odd. The minimum measurement-only distance is

dpair(K)=min⁡∣S∣ odd(∣S∣+∣∂KS∣)=1+min⁡vdeg⁡K(v).(6)d_{\mathrm{pair}}(K)=\min_{|S|\ \mathrm{odd}}(|S|+|\partial_KS|)=1+\min_v\deg_K(v). \tag*{(6)}

For TT repeated rounds with adjacent comparisons of the original Gauss outcomes, the distance is Tdpair(K)Td_{\mathrm{pair}}(K). Consequently, reaching single-round distance δ≤m\delta\le m requires at least ⌈m(δ−1)/2⌉\lceil m(\delta-1)/2\rceil pair-product measurements; a simple graph attaining this count exists for every such mm and δ\delta. The proof and graph constructions are in Supplemental Sec. S2.

We now combine these records with persistent data and auxiliary-edge errors. Let PP restrict the original data error to the mm qubits in the measured support, and let JGJ_G be the vertex-edge incidence matrix of the gauging graph GG. Thus 1TP=wT\mathbf{1}^{T}P=\boldsymbol{w}^{T} and 1TJG=0\mathbf{1}^{T}J_G=0: the Gauss product reads the selected parity, and each edge ancilla touches two vertices. Let HcH_c be the original XX-check matrix with the chosen repeated adjacent-column checks, and let RKR_K encode the original Gauss outcomes and pair products. Here RKa=(a,(au+av){u,v}∈E(K))R_Ka=(a,(a_u+a_v)_{\{u,v\}\in E(K)}). xtx_t and ete_t are the cumulative ZZ-type errors on the original data and edge ancillas through round tt. Each round also has independent result errors ηt\eta_t on original checks and independent result errors νt\nu_t on the encoded Gauss records. Each new data or edge error bit and each result-error bit counts as one fault location. All syndrome and Gauss-record vectors in this model are flips relative to the fault-free measurement history.

Proposition 1 Exact joint gauged-readout distance. In the persistent-fault model above, let T≥1T \ge1 and use a zero-syndrome endpoint check, adjacent-round syndrome and Gauss-record comparisons, and same-round pair consistency. An accepted wrong readout has one fixed vector zz with 1⋅z=11 \cdot z = 1 in every round, and its exact minimum fault weight is

σt=Hcxt+ηt=0,\sigma_t = H_c x_t + \eta_t = 0,
bt=RK(Pxt+JGet)+νt=RKz,(7)b_t = R_K(Px_t + J_G e_t) + \nu_t = R_K z, \tag*{(7)}
dgauge(T;Hc,w,RK)=min⁡{TδRK,ΓT(Hc,w)},d_{\mathrm{gauge}}(T; H_c, w, R_K) = \min\{T\delta_{R_K}, \Gamma_T(H_c,w)\},
δRK=min⁡1⋅u=1wt⁡(RKu).\delta_{R_K} = \min_{\mathbf{1}\cdot u=1} \operatorname{wt}(R_Ku).

Here bt=RKzb_t = R_Kz means the encoded Gauss records are mutually consistent and unchanged between rounds, and a wrong logical result has 1⋅z=1\mathbf{1} \cdot z = 1. The first term is the cost of repeating an odd-parity Gauss-result error; the second is the cost of hiding a persistent data error from the original checks in every round. The proof appears in Supplemental Sec. VII E.

For the square Shor-family instance, the exact distance gives a resource optimum within the family that repeats fixed adjacent-column checks and adds pair products.

Corollary 1 Minimum outcome count. For the square m×mm \times m Shor-family readout with m≥1m \ge1, use the joint model of Proposition 1 and the same measurement allocation in every round. Allow the mm Gauss checks, at least one independent copy of each fixed adjacent-column check, and pair products selected by a simple graph KK. At target distance mm and 1≤T≤m1 \le T \le m, the minimum total outcome count is

NT∗=T[m+⌈m(⌈m/T⌉−1)2⌉+∑s=1m−1⌈sT⌉]N_T^* = T\left[m + \left\lceil\frac{m(\lceil m/T\rceil-1)}{2}\right\rceil + \sum_{s=1}^{m-1}\left\lceil\frac{s}{T}\right\rceil\right]
≥m2+m(T−1)2.(8)\ge m^2 + \frac{m(T-1)}{2}. \tag*{(8)}

It is attained by cj=⌈(m−j)/T⌉c_j = \lceil(m-j)/T\rceil and a pair graph with minimum degree ⌈m/T⌉−1\lceil m/T\rceil-1 and (m2)⌈(m/T)−1⌉/2\binom{m}{2}\lceil(m/T)-1\rceil/2 edges. Over all positive round counts, one round uniquely minimizes the total at m2m^2 outcomes.

For T>mT > m, the mm Gauss outcomes per round already cost Tm>m2Tm > m^2. The proof of the minimum for 1≤T≤m1 \le T \le m, the attaining allocations and the bound in Eq. (8) appears in Supplemental Sec. VII F. The repeated baseline with T=mT = m measures the mm Gauss checks and all m−1m - 1 adjacent-column checks in every

round, for m(2m−1)m(2m-1) outcomes. For m=5m=5, these counts are 25 and 45 at the same phenomenological distance five. The quantity compared here is the number of measurement outcomes in the stated model; gate, ancilla, deformed-check and surrounding-round resources are outside this count. The next section gives a circuit scheduling bound for a bare-ancilla implementation of this measurement family.

A circuit scheduling bound

Figure 2 illustrates an accepted one-gate fault in a serial readout with three Gauss checks.

A consistent wrong record caused by one gate fault

Figure 2. A consistent wrong record caused by one gate fault. (a) For three Gauss checks and their three pair products, the displayed vectors are flips relative to the ideal records, with pair order (01, 02, 12). The Gauss errors (1, 0, 0) and pair errors (1, 1, 0) satisfy every pair-consistency relation but flip the logical product; the three original-check records have zero error. (b) A serial schedule measures all original XX checks, then the Gauss checks, then the pair products. The drawing shows one Gauss-ancilla CNOT on the selected support qubit q0q_0; the blocks denote complete stages, with other interactions omitted. A ZZ on both CNOT qubits immediately after the gate flips A0A_0 and propagates to the later pair-product controls. There is no later original check and no earlier pair check on q0q_0, so α=β=0\alpha=\beta=0 and the circuit distance is one by Proposition 2. For the distance-three Shor allocation, the same measured-check family has phenomenological distance three. OpenAI Codex assisted the drawing code and layout; see Section VI.

The outcome-count optimum treats data and result faults as independent locations. In a circuit, one gate fault can create both, and the order of the checks matters. We now give a bound for a specified one-epoch implementation of the same measurement family. The fault-free input is an original-code state with the gauging edge ancillas initialized in ∣0⟩\lvert0\rangle.

Each original XX check, Gauss check AvA_v, and selected pair product AuAvA_uA_v is measured once using its own bare ancilla. Every ancilla starts in ∣+⟩\lvert+\rangle, controls one CNOT to each qubit in its check support, and is measured in XX after its last CNOT. The CNOTs may be interleaved in any order that uses each qubit at most once per time step; data and edge qubits are always targets, and no other gates or error-correction rounds are inserted. The detectors are the original-check results and the same-round pair-consistency relations. We count a Pauli fault after a CNOT as one location and each independent outcome flip as one location. The allowed gate faults include ZZ on the target and ZZ on both control and target. The numerical search also includes initial Pauli faults on original-data and edge qubits and preparation faults on extraction ancillas; each faulty input qubit or preparation counts as one location. An accepted wrong readout passes these detectors but reverses the product of the Gauss outcomes relative to the fault-free circuit.

For each support qubit qvq_v, consider a CNOT gg on qvq_v no later than its CNOT with the AvA_v ancilla. Let αv(g)\alpha_v(g) count original-check CNOTs on qvq_v strictly after gg, and let βv(g)\beta_v(g) count pair-product CNOTs on qvq_v strictly before gg. Independent copies of an original check are counted separately.

Proposition 2 Schedule-dependent circuit bound. For any valid schedule SS in the circuit family above, its accepted-wrong readout distance obeys

dbare(S)≤1+min⁡v,g[αv(g)+βv(g)].(9)d_{\mathrm{bare}}(S) \le1+\min_{v,g}\left[\alpha_v(g)+\beta_v(g)\right]. \tag*{(9)}

To construct the fault, insert target ZZ after gg; also insert control ZZ at the same location if gg belongs to a Gauss or pair-product check. This flips the AvA_v result and every later check on qvq_v. If gg is a pair-product CNOT, the control ZZ also flips that pair result. Cancel the αv(g)\alpha_v(g) affected original-check results and flip the βv(g)\beta_v(g) earlier pair results. The Gauss record now differs by the unit vector at vv, and every pair record agrees with it. All detectors vanish and the logical product is wrong, with the weight in Eq. (9). The Supplemental Material gives the full Pauli-propagation proof.

This bound gives a necessary condition on a distance-mm implementation: αv(g)+βv(g)≥m−1\alpha_v(g)+\beta_v(g)\ge m-1 at every eligible gate. For example, a serial schedule that measures all original checks, then all Gauss checks, then all pair products has αv(g)=βv(g)=0\alpha_v(g)=\beta_v(g)=0 at a Gauss CNOT. Its distance is exactly one, even when the independent-outcome model has distance mm. Thus the measured-check family alone does not determine the circuit distance; the checks must also detect errors introduced during extraction.

Backward Pauli propagation gives exact distance three for the best tested m=3m=3 and m=5m=5 schedules among 1,024 schedules of each size. Equation (9) also gives three for both schedules, so explicit three-fault patterns attain the bound. At m=3m=3, flipping all three Gauss outcomes leaves every pair relation unchanged and reverses the logical product. This witness applies to every schedule in the circuit family, so the saved distance-three schedule is optimal within that family. At m=5m=5, one final-outcome flip and two target-ZZ gate faults give the accepted wrong readout listed in Supplemental Sec. VIII. The value three is the largest found in the finite test set, below the target distance five; the complete schedules and fault locations are given in Supplemental Sec. S3. Deformed ZZ checks, cycle checks, flagged ancillas and surrounding error-correction rounds require their own detector and fault analysis.

Examples and design implications

The general formulas distinguish the effects of the readout predicate, the check allocation and the auxiliary graph. We illustrate these effects with a nine-qubit readout, a distance-five allocation, and two gauged codes on the same measured support.

A nine-qubit readout with persistent faults

We specialize the persistent-fault model of Section II to the nine-qubit Bacon–Shor readout. The Bacon–Shor distance three refers to its protected subsystem; this readout tests the selected logical parity using two XX-type stabilizer checks. The nine-qubit Bacon–Shor instance used in Table I has n=9n=9, two check rows and qubit labels j=3a+bj=3a+b on a three-by-three grid. Its two rows of HH have supports {0,1,3,4,6,7}\{0,1,3,4,6,7\} and {1,2,4,5,7,8}\{1,2,4,5,7,8\}, and w=1{0,3,6}w=\mathbf{1}_{\{0,3,6\}}.

In the measurement-fault model, each fault flips an independent measurement outcome, and the detectors compare consecutive logical parities.

The persistent-fault model also permits ties at two rounds. At two rounds, a final-round data fault on qubit zero and a canceling check-result fault give (r0,r1)=(0,1)(r_0,r_1)=(0,1) with zero syndromes and weight two. A first-round readout fault and its canceling check-result fault instead give (1,0)(1,0). Table I collects the four model choices and their independently reproduced values.

For the original two checks, Eq. (5) at m=3m=3 gives dq=min⁡{3,1+q}d_q=\min\{3,1+q\}. Strict majority therefore has distance two at T=1T=1 and three for every T≥2T\ge2. At one round, a data error on qubit zero changes the logical parity and one check; a check-result flip hides that syndrome, giving weight two. Duplicating the first check changes the allocation to (c1,c2)=(2,1)(c_1,c_2)=(2,1) and makes d1=3d_1=3. An error on the readout column must then be hidden in both copies, while a weight-three logical data error gives the matching upper bound. This raises the one-round distance by adding one independent check-result location, without changing the static check row space.

Figure 3 compares this readout with two other models. The measurement-only model compares consecutive logical parities and requires a wrong answer in every round, giving distance TT. The persistent-fault model uses syndrome comparisons and the strict-majority predicate, so its relevant threshold is q=⌊T/2⌋+1q=\lfloor T/2\rfloor+1. Removing its endpoint constraint admits a constant nonzero syndrome and gives distance one. A second implementation recomputes the figure, and all twelve of its points are exactly the proved ones, four on each curve. The circuit and joint gauged-readout analyses use their separately stated record-consistency predicates; their distances should be evaluated with those predicates.

Exact distances for the three Bacon–Shor models

Figure 3. Exact distances for the three Bacon–Shor models in Table I. The blue circles show dmajd_{maj}: two at one round and three for T≥2T\ge2. Deleting the endpoint syndrome constraint gives the green triangles at one for every positive TT. Orange squares show the measurement-only distance TT. The dotted line is the static code distance d=3d=3; shading spans the region down to the no-boundary curve. Independent enumeration reproduces all twelve values, each certified in Lean. OpenAI Codex assisted the drawing code and layout; see Section VI.

Allocating measurements at distance five

For m=5m=5, Table II makes the outcome-count optimum concrete. At T=1T=1, the original adjacent-column checks have copy counts (4,3,2,1)(4,3,2,1), and the pair graph is complete. The ten original-check outcomes, ten pair outcomes and five Gauss outcomes give 25 in total. At T=2T=2, a five-cycle pair graph gives δRK=3\delta_{RK}=3, while the original-check allocation is (2,2,1,1)(2,2,1,1). This uses 16 outcomes per round and 32 overall. At T=5T=5, pair products are unnecessary and each original check is measured once per round, giving the repeated baseline of 45. Each entry reaches the same target distance five in the joint phenomenological model. The comparison counts these measured records; Proposition 2 separately tests the timing of a bare-ancilla implementation.

Spatial distance and readout distance

The auxiliary graph GG defines the deformed quantum code, whereas KK chooses the redundant Gauss-result measurements. Their distance statements concern differ… ent fault sets. The spatial distance tests all nontrivial logical operators of the deformed code; the readout distance tests faults that change the selected result while passing its detectors.

ModelFault locationsDetectorsError criterionDistances
Measurement onlyMeasurement outcomesLogical comparisonsConstant logical flip1, 2, 3, 4
Persistent faultsData, check results, readoutBoundary and syndrome comparisonsStrict majority2, 3, 3, 3
No boundary constraintData, check results, readoutSyndrome comparisonsStrict majority1, 1, 1, 1
Last-round controlData, check results, readoutBoundary and syndrome comparisonsLast readout wrong2, 2, 2, 2

Table 1. Readout models and exact distances at T=1,2,3,4T = 1, 2, 3, 4 rounds. Data faults persist; check-result and readout faults act in their own round. The boundary constraint is σ0=0\sigma_0 = 0; syndrome comparisons impose σt=σt−1\sigma_t = \sigma_{t-1}. Logical comparisons instead require consecutive logical readouts to agree. The first three rows’ twelve values are certified in Lean; the last row is a numerical control.

TTδRK\delta_{RK}ccPairs/roundNT∗N_T^*
15(4, 3, 2, 1)1025
23(2, 2, 1, 1)532
32(2, 1, 1, 1)339
42(1, 1, 1, 1)348
51(1, 1, 1, 1)045

Table 2. Minimum outcome counts at target distance five within the fixed adjacent-column and Gauss-pair measurement family. TT is the round count, δRK\delta_{RK} is the Gauss-record distance per round, cc lists the adjacent-column check copy counts, and NT∗N_T^* is the total number of outcomes. The five Gauss outcomes per round are included in every total.

For a stabilizer code, [[n,k,d]][[n,k,d]] denotes nn physical qubits, kk encoded qubits and distance dd. Two paths on the same weight-four logical support of the toric code [[8,2,2]][[8,2,2]] illustrate the spatial distinction (Figure 4). Both paths violate C1, because a two-vertex set has only one outgoing edge. One path gives physical X-type distance one and physical Z-type distance five. The other has physical X-type distance two and no weight-one logical on either side, so its total distance is two. The source’s sufficient expansion condition does not determine the exact distance of each construction below its threshold. Supplemental Sec. S7 gives the check completions and finite census.

Two paths on the same weight-four support of the toric code

Figure 4. Two paths on the same weight-four support of the toric code [[8,2,2]][[8,2,2]] give different deformed-code distances. Vertex numbers label data qubits; each edge adds one ancilla. Both paths fail C1 at a two-vertex cut with one outgoing edge. Braces show the physical X-type distances: one and two. The corresponding physical Z-type distances are five and at least two, so the total distances are one and two. For the left path, a zero Z-check column and the corresponding unit vector outside the X-check row space give the weight-one logical operator. OpenAI Codex assisted the drawing and layout; see Section VI.

For the distance-one path, a zero column of the deformed Z-check matrix and a unit vector outside the X-check row space identify the weight-one logical operator. The zero column means that no Z check detects it; the row-space condition means that it is not a product of X stabilizers. This matrix test concerns the deformed static code. The weighted formula and circuit bound additionally account for record faults and the order of extraction.

Verification and reproducibility

The general readout, allocation and circuit statements have direct proofs in the Supplemental Material. Independent dynamic programs check the readout formulas on finite instances, and backward Pauli propagation checks the circuit witnesses and saved schedules. Supplemental Sec. S3 specifies the circuit fault locations, complete schedules and minimum-weight witnesses. The separate Lean arithmetic project verifies five lemmas used in the resource count. The algebraic and finite code results in the supplement are supported by the main Lean development; Supplemental Sec. S7 reports its axiom audit. The general matrix theorems and circuit proposition are established by the direct proofs, rather than by that formal audit.

Conclusion

The weighted minimum Γq(H,w)\Gamma_q(H,w) gives the exact distance for a threshold of wrong readouts in the persistent-fault model. It turns measurement allocation into a spatial problem: an error costs its data weight plus the cost of hiding its syndrome in the required wrong rounds. The endpoint criterion and Shor-family allocation make this relation explicit.

For gauged readout, the joint distance separates persistent-data faults from measurement-record faults and gives the one-round outcome-count optimum within the stated measurement family. The circuit scheduling bound identifies how a gate fault can connect those two mechanisms during extraction. Together, the exact formula, allocation rule and explicit circuit witnesses give conditions for designing and auditing logical Pauli readouts at the model and circuit levels.

Acknowledgments

This work was supported by the National Natural Science Foundation of China under Grant No. 12674609 and by the Guangdong Provincial Key Laboratory of Computility Microelectronics under Grant No. 2024B1212010007. The authors declare no competing interests. The authors used DeepSeek-V4.1-Flash for text polishing, the Lean derivations, and the debugging of individual numerical values. They also used OpenAI Codex (GPT-6) for manuscript revision, literature checks, numerical cross-checks, formal-proof exploration and figure-code preparation. The authors are responsible for all of its content.

Author Contributions

All authors contributed equally to this work.

Data availability

The formal development and baseline numerical data are archived on Zenodo [15], together with a last-round-readout control and its regression tests. The readout-analysis scripts, selected CNOT schedules and fault witnesses are provided as Supplemental data and code. The Supplemental Material [14] identifies the formal statement supporting each claim and explains how to reproduce every numerical value. The formal layer beneath these results is released as a separate package [16].

References

Supplemental material: Exact distances and measurement allocation for logical Pauli readout

S1 How to read this supplement

All references cited here are listed in the bibliography of the main article.

The first proof section establishes the general readout formula, endpoint bounds, measurement allocations and circuit scheduling bound. The next section specifies the circuit fault model, full best-tested schedules and explicit accepted-error witnesses. The remaining sections identify the Lean statements supporting the algebraic and finite results, give the cosystolic-distance and surgery analysis, and present step-by-step protocol derivations. The final sections state the conventions, report the axiom audit and provide reproduction commands.

S2 Readout-distance and allocation proofs

This section proves the weighted repeated-readout formula, the selected-endpoint bound, the Shor-family check allocation and the pair-product results used in the main text. These statements concern the fault models defined there. The general matrix formulas are proved directly here; the separate Lean project certifies arithmetic lemmas used in the resource bound, not the full matrix theorems.

Exact distance for a threshold of wrong readouts

Let A=∑twt⁡(dt)A = \sum_t \operatorname{wt}(d_t) be the total persistent data-fault cost and let bt=wt⁡(μt)+wt⁡(γt)b_t = \operatorname{wt}(\mu_t) + \operatorname{wt}(\gamma_t) be the transient cost in round tt. Consider a detector-free fault pattern with at least qq wrong readouts. Among those rounds choose tt with minimum btb_t, so qbt≤∑sbsq b_t \le\sum_s b_s. Set y=xt+μty = x_t + \mu_t. The zero-syndrome condition gives Hy=γtHy = \gamma_t, and the wrong readout gives w⋅y=1w \cdot y = 1. Also, wt⁡(y)≤wt⁡(xt)+wt⁡(μt)≤A+wt⁡(μt)\operatorname{wt}(y) \le\operatorname{wt}(x_t) + \operatorname{wt}(\mu_t) \le A + \operatorname{wt}(\mu_t). Therefore, by the definition of Γq\Gamma_q, we have Γq(H,w)≤wt⁡(y)+qwt⁡(Hy)≤A+wt⁡(μt)+qwt⁡(γt)≤A+qbt≤A+∑sbs\Gamma_q(H,w) \le\operatorname{wt}(y) + q\operatorname{wt}(Hy) \le A + \operatorname{wt}(\mu_t) + q\operatorname{wt}(\gamma_t) \le A + qb_t \le A + \sum_s b_s, where the penultimate inequality uses q≥1q \ge1. This is the lower bound on total fault weight. For the matching upper bound, choose yy minimizing wt⁡(y)+qwt⁡(Hy)\operatorname{wt}(y) + q\operatorname{wt}(Hy) subject to w⋅y=1w \cdot y = 1, introduce one data error dt=yd_t = y at the start of the final qq-round block, and set γt=Hy\gamma_t = Hy in those rounds. Set all other faults to zero. Then exactly those qq readouts are wrong, every syndrome is zero, and the fault weight is wt⁡(y)+qwt⁡(Hy)\operatorname{wt}(y) + q\operatorname{wt}(Hy). This proves Eq. (3) for all binary HH, nonzero ww, and 1≤q≤T1 \le q \le T.

Selected endpoint checks

Suppose adjacent comparisons constrain the full syndrome, while one endpoint checks only Bσt=0B\sigma_t = 0. Since the comparisons make σt\sigma_t constant, the accepted syndrome lies in ker⁡B\ker B. Let δB\delta_B be the minimum weight of a data vector yy satisfying BHy=0BHy = 0 and w⋅y=1w \cdot y = 1, and assume this set is nonempty. An initial data error attaining δB\delta_B has a constant syndrome in ker⁡B\ker B and flips all TT readouts, so dmajB(T)≤δBd_{\mathrm{maj}}^B(T) \le\delta_B.

For the lower bound, suppose a detector-free fault has total weight K<min⁡{δB,q+1}K < \min\{\delta_B,q+1\} and at least qq wrong readouts. If it contains a data fault, then every wrong round must also contain at least one transient fault. Indeed, a wrong round with μt=γt=0\mu_t = \gamma_t = 0 would have BHxt=0BHx_t = 0, w⋅xt=1w \cdot x_t = 1, and wt⁡(xt)≤K<δB\operatorname{wt}(x_t) \le K < \delta_B, a contradiction. The data fault and the required transient faults in qq distinct rounds would give K≥q+1K \ge q+1, also a contradiction.

If there are no data faults, then a wrong round cannot be produced by a single check-result fault, since γt\gamma_t does not enter rtr_t. A single readout fault would have to satisfy BHμt=0BH\mu_t = 0 and w⋅μt=1w \cdot\mu_t = 1, which would imply δB=1\delta_B = 1; this is incompatible with K<δBK < \delta_B for any nonzero fault. Thus every wrong round costs at least two transient faults. The qq wrong rounds then cost at least 2q≥q+1>K2q \ge q+1 > K. This contradiction proves dmajB(T)≥min⁡{δB,q+1}d_{\mathrm{maj}}^B(T) \ge\min\{\delta_B,q+1\}. The equality when q≥δB−1q \ge\delta_B - 1 follows by combining the two bounds. For a target dd, the condition δB≥d\delta_B \ge d is necessary; together with q≥d−1q \ge d-1, it is sufficient.

The lower bound need not be tight. At T=q=1T=q=1, the Shor allocation cj=m−jc_j = m-j with B=IB=I has δB=m\delta_B=m and exact distance mm, whereas the bound min⁡{δB,q+1}\min\{\delta_B,q+1\} is only two for m>2m>2. The exact value follows from the allocation formula proved next.

Adjacent-column check allocation

For the square Shor-family readout with m≥2m \ge2, write vjv_j for the parity of the data-error bits in column jj. The logical readout error is v0v_0, and check jj has syndrome vj−1+vjv_{j-1}+v_j. If this check is measured in cjc_j independent copies per round, its row appears cjc_j times in HcH_c, with an independent check-result fault bit for each copy.

Consider any data error with v0=1v_0=1. If every vj=1v_j=1, at least one data bit is needed in each of the mm columns, so its weight is at least mm. Otherwise, let jj be the first column with vj=0v_j=0. The first jj column parities are odd, requiring at least jj data bits, and check jj has nonzero syndrome in all cjc_j copies. To hide this syndrome in at least qq wrong readout sequences requires at least qcjqc_j check-result faults. Hence the weighted cost is at least j+qcjj+qc_j. Conversely, one data error in each of the first jj columns and none in later columns makes check jj the only nonzero adjacent-column syndrome; canceling its cjc_j copies in the final qq rounds attains j+qcjj+qc_j. Taking the least of these witnesses and the all-odd-column witness proves Eq. (5).

The condition that this distance be at least mm is exactly j+qcj≥mj+qc_j\ge m for every jj. Since cjc_j must be a positive integer, the componentwise smallest allocation is cj=⌈(m−j)/q⌉c_j=\lceil(m-j)/q\rceil. Summing over jj gives ∑s=1m−1⌈s/q⌉\sum_{s=1}^{m-1}\lceil s/q\rceil check-result locations per round. This is optimal only within the family that repeats these fixed adjacent-column checks.

Pair products and their distance

Let KK be a simple graph on the mm Gauss-check labels. For a set SS of original outcomes flipped in one round, consistency of the pair records forces exactly the outcomes on the cut ∂KS\partial_K S to flip as well. The logical product is wrong if and only if ∣S∣|S| is odd. Thus the one-round distance is the minimum of ∣S∣+∣∂KS∣|S|+|\partial_K S| over odd sets.

Write r=min⁡vdeg⁡K(v)r=\min_v\deg_K(v) and k=∣S∣k=|S|. The singleton consisting of a minimum-degree vertex has cost r+1r+1. For the converse, when k≤r+1k\le r+1, the sum of degrees in SS is at least krkr, while at most k(k−1)k(k-1) of this sum can come from internal edges. Therefore ∣∂KS∣≥kr−k(k−1)|\partial_K S|\ge kr-k(k-1) and the same count gives ∣S∣+∣∂KS∣≥k(r−k+2)≥r+1|S|+|\partial_K S|\ge k(r-k+2)\ge r+1, where the last inequality follows from (k−1)(r+1−k)≥0(k-1)(r+1-k)\ge0. When k≥r+1k\ge r+1, the kk original outcome flips already cost at least r+1r+1. This proves Eq. (6).

For target distance δ≤m\delta\le m, the graph must have minimum degree at least δ−1\delta-1, so the degree sum gives ∣E(K)∣≥⌈m(δ−1)/2⌉|E(K)|\ge\lceil m(\delta-1)/2\rceil. This lower bound is attainable. Put r=δ−1r=\delta-1. If mrmr is even, an rr-regular circulant graph exists: connect each vertex to its r/2r/2 nearest neighbors on each side when rr is even, and add the antipodal matching when rr is odd and mm is even. If both mm and rr are odd, first form the (r+1)(r+1)-regular circulant graph on the odd cycle and remove a matching covering all but one vertex; the unmatched vertex has degree r+1r+1 and all others have degree rr. The result has the required minimum degree and exactly ⌈mr/2⌉\lceil mr/2\rceil edges.

Under repeated adjacent comparisons, a detector-free encoded outcome must be the same RKzR_Kz in every round. If 1⋅z=1\mathbf{1}\cdot z=1, each round costs at least δRK=min⁡1⋅u=1wt⁡(RKu)\delta_{R_K}=\min_{\mathbf{1}\cdot u=1}\operatorname{wt}(R_Ku), and repeating a minimum-weight odd uu attains the bound. The measurement-only distance is therefore TδRK=Tdpair(K)T\delta_{R_K}=Td_{\mathrm{pair}}(K).

Joint gauged-readout distance

This subsection proves Proposition 1 of the main text. Write H=HcH=H_c for the original-check matrix with its repeated rows.

Use AA for the total number of persistent data and edge-ancilla fault bits, and let kt=wt⁡(ηt)+wt⁡(νt)k_t=\operatorname{wt}(\eta_t)+\operatorname{wt}(\nu_t) be the result-fault cost in round tt. Consider a detector-free pattern with odd output vector zz. In a round with w⋅xt=1w\cdot x_t=1, the original-check constraint gives Hxt=ηtHx_t=\eta_t, so the repeated-readout formula implies ΓT(H,w)≤wt⁡(xt)+Twt⁡(ηt)≤A+Tkt\Gamma_T(H,w)\le\operatorname{wt}(x_t)+T\operatorname{wt}(\eta_t)\le A+Tk_t.

In a round with w⋅xt=0w\cdot x_t=0, the vector u=z+Pxt+JGϵtu=z+Px_t+JG\epsilon_t has odd parity: 1⋅z=1\mathbf{1}\cdot z=1, 1TPxt=w⋅xt=0\mathbf{1}^{\mathsf T}Px_t=w\cdot x_t=0, and 1TJG=0\mathbf{1}^{\mathsf T}J_G=0. Since bt=RK(Pxt+JGϵt)+νt=RKzb_t=R_K(Px_t+JG\epsilon_t)+\nu_t=R_Kz, we have νt=RKu\nu_t=R_Ku, and therefore wt⁡(νt)≥δRK\operatorname{wt}(\nu_t)\ge\delta_{R_K}. In either case, min⁡{TδRK,ΓT(H,w)}≤A+Tkt\min\{T\delta_{R_K},\Gamma_T(H,w)\}\le A+Tk_t. Averaging over all TT rounds gives the lower bound by the total fault weight A+∑tktA+\sum_t k_t.

Both terms are attainable. For TδRKT\delta_{R_K}, repeat in every round an outcome-fault vector RKuR_Ku attaining δRK\delta_{R_K} for odd uu, with no data faults. For ΓT(H,w)\Gamma_T(H,w), introduce a minimizing data error yy in the first round, set ηt=Hy\eta_t=Hy in every round, and set the edge and encoded Gauss-result faults to zero. The output is then the constant odd vector PyPy. These witnesses prove Eq. (7).

Outcome-count optimum

This subsection proves Corollary 1 of the main text within the stated measurement family.

At m=1m=1, there is one Gauss check and no original or pair checks, so target distance one is reached at a cost of TT outcomes. We henceforth take m≥2m\ge2.

For target distance mm and 1≤T≤m1\le T\le m, the Gauss-result code must have δRK≥⌈m/T⌉\delta_{R_K}\ge\lceil m/T\rceil. The graph bound above shows that the fewest pair outcomes are obtained with ⌈m(⌈m/T⌉−1)/2⌉\lceil m(\lceil m/T\rceil-1)/2\rceil edges. The path formula shows that the fewest adjacent-column check outcomes per round are obtained with cj=⌈(m−j)/T⌉c_j=\lceil(m-j)/T\rceil, whose sum is ∑s=1m−1⌈s/T⌉\sum_{s=1}^{m-1}\lceil s/T\rceil. Adding the mm original Gauss outcomes per round proves the exact count in Eq. (8).

For the lower bound on this count, T⌈m(⌈m/T⌉−1)/2⌉≥m(m−T)/2T\lceil m(\lceil m/T\rceil-1)/2\rceil\ge m(m-T)/2, and T∑s=1m−1⌈s/T⌉≥m(m−1)/2T\sum_{s=1}^{m-1}\lceil s/T\rceil\ge m(m-1)/2. Thus NT∗≥Tm+m(m−T)/2+m(m−1)/2=m2+m(T−1)/2N_T^*\ge Tm+m(m-T)/2+m(m-1)/2=m^2+m(T-1)/2. The value m2m^2 is attained at T=1T=1; for T≥2T\ge2 the lower bound is strictly larger. At T=mT=m, the construction has no pair-product edges, one copy of each adjacent-column check, and m(2m−1)m(2m-1) total outcomes.

These outcome counts do not include every gate, ancilla, deformed check or surrounding error-correction round. A commuting XX-type check can be measured with a ∣+⟩|+\rangle ancilla, controlled CNOTs to its support, and an XX measurement of the ancilla. Measuring a pair product adds a consistency result without changing the joint eigenspaces already fixed by the individual commuting Gauss checks. State-vector and projector comparisons verified this ideal measurement map for the tested four-cycle examples.

For T>mT>m, the required mm original Gauss outcomes per round give a count at least Tm>m2Tm>m^2 before any other checks are added. Together with the bound for 1≤T≤m1\le T\le m, this proves the one-round optimum over all positive round counts within the specified family.

Circuit scheduling bound

We use exactly the one-epoch circuit family and detectors defined in main-text Section IV. All extraction ancillas are controls, all original and edge qubits are targets, and each check uses a distinct ancilla prepared in ∣+⟩\lvert+ \rangle and measured in XX. There is one CNOT for each nontrivial check-support entry. For a readout-support qubit qvq_v, its incident checks are AvA_v, the pair products indexed by edges of KK incident to vv, and the original XX checks whose supports contain qvq_v.

Fix an eligible CNOT gg on qvq_v at or before its AvA_v interaction. Insert ZZ on qvq_v immediately after gg. If gg belongs to AvA_v or a pair-product check, include ZZ on its control at the same gate-fault location; if gg belongs to an original check, leave the control unchanged. Under a later CNOT with control aa and target qvq_v, conjugation maps ZqvZ_{q_v} to ZaZqvZ_aZ_{q_v}. The accumulated ZaZ_a flips that ancilla’s final XX result, and it commutes with the ancilla’s other CNOTs. The fault therefore flips every subsequent check interaction on qvq_v. If gg precedes the Gauss interaction, that later interaction flips AvA_v; if gg is the Gauss interaction itself, the control ZZ flips AvA_v. No other original Gauss outcome flips.

For each pair product incident to vv, an interaction after gg flips its result through propagation. If gg is itself a pair interaction, the control ZZ flips that result. The only missing pair flips are thus the βv(g)\beta_v(g) pair interactions strictly before gg. Insert an independent outcome flip at each of those measurements. The Gauss and pair record is then exactly RKevR K_{e_v}, so every pair-consistency detector is zero and the logical product is wrong. The αv(g)\alpha_v(g) original checks strictly after gg are the only original-check results changed by propagation; cancel each by one outcome flip. An original check at gg itself has no control ZZ and remains correct. All original-check detectors now vanish as well. The pattern occupies one CNOT location and αv(g)+βv(g)\alpha_v(g) + \beta_v(g) distinct measurement locations. Minimizing over eligible gates and support vertices proves Eq. (9).

This construction is valid for arbitrary interleavings in the stated family, because each original or edge qubit is a target and each check has its own control ancilla. It proves an upper bound, not a converse: satisfying its necessary timing inequalities does not guarantee the target distance. In the serial original-check/Gauss/pair schedule, a Gauss interaction has no later original check and no earlier pair check. The constructed one-location fault is accepted and wrong; with fault-free input, zero faults cannot change the ideal logical product, so the distance is exactly one.

We also searched one-epoch CNOT circuits for m=3m = 3 and m=5m = 5, including the original XX checks, pair products, input Pauli faults, CNOT Pauli faults and outcome flips. The generated test set contains 1,024 schedules at each size. The largest accepted-wrong readout distance found was three at both sizes. The best m=3m = 3 schedule therefore retains its phenomenological target distance, while the best tested m=5m = 5 schedule has distance three rather than five. An independent backward Pauli calculation reproduced the fault signatures and minimum-weight witnesses for the best schedules. The witnesses from Eq. (9) attain weight three on both best schedules. The schedule bound applies to the entire defined circuit family, while the reported best distances refer to this finite test set. The tested fault model includes the original XX checks, pair products and listed Pauli and outcome faults; it leaves out the deformed ZZ checks, cycle checks and surrounding error-correction rounds.

Finite dynamic programs test the repeated-readout, partial-endpoint and joint gauged-model formulas on 29,232, 9,198 and 4,608 instances, respectively; the general statements follow from the proofs above. The separate Lean development verifies five arithmetic lemmas in the resource analysis. The matrix theorems and circuit scheduling bound have direct proofs above; the optimum over tested schedules refers to the stated finite search.

S3 Circuit fault model, schedules and witnesses

Fault locations and detector signatures

The numerical search uses the one-epoch circuit family in main-text Sec. IV, with complete graphs for both the gauging graph GG and the pair-product graph KK at m=3,5m = 3, 5. Original data qubits are indexed by q=mi+bq = mi + b for 0≤i,b<m0 \leq i,b < m, and the readout support is column b=0b = 0. Edge-ancilla indices start at m2m^2 and follow lexicographic order of the unordered pairs of row labels. Extraction-ancilla indices aa enumerate the measured checks: the mm Gauss checks first, the pair products in lexicographic order next, and then m−jm-j copies of adjacent-column check jj for 1≤j<m1 \leq j < m. All tabulated indices are zero based; a layer index is one based.

Fault locations are initial original-data or edge-qubit Pauli errors, extraction-ancilla preparation errors, Pauli errors immediately after a CNOT, and independent flips of a final ancilla outcome. Each faulty preparation, input qubit, CNOT or outcome is one location; a two-qubit Pauli after a CNOT still counts as one location. No idle faults, deformed ZZ checks, cycle checks or surrounding error-correction rounds are included in this numerical model. For the final XX records, the XX components of a Pauli commute with the backward-propagated XX observables. The record signatures therefore depend only on the ZZ components. Control ZZ is equivalent to a single flip of that ancilla’s final outcome; target ZZ flips all later extraction controls acting on the target; their product gives the third nonzero gate signature. An extraction preparation error has the same relevant signature as an outcome flip or has zero signature. Thus the input-ZZ, outcome, target-ZZ and control-target-ZZZZ channels cover the record effects of all allowed Pauli faults.

The detector signature consists of all original-check reresult errors and the pair-relation errors au+av+puva_u+a_v+p_{uv}. The logical signature is the parity of the original Gauss-result error vector. An accepted wrong record has zero detector signature and logical signature one. The minimum-weight search operates on these signatures; the general schedule bound is proved independently in Sec. VII G.

Explicit witnesses and exactness checks

For m=3m=3, the three outcome faults M0M_0, M1M_1, M2M_2 flip every Gauss record. Each pair parity remains unchanged, and the odd number of Gauss flips reverses the logical product. This weight-three outcome witness applies to every m=3m=3 schedule in the defined family, so a schedule with exact distance three also maximizes the distance over that family. For m=5m=5, the target-ZZ fault (1,16,15;Ztarget)(1,16,15; Z_{\mathrm{target}}) flips the later A3A_3 record, its four pair records, and original-check records 15, 17 and 18. The target-ZZ fault (8,21,11;Ztarget)(8,21,11; Z_{\mathrm{target}}) flips original-check records 17 and 18, canceling those two errors. The outcome fault M15M_{15} cancels the remaining original-check error. Both witnesses therefore have weight three and give a consistent odd Gauss record with no detector response.

Independent backward Pauli propagation checks every stored channel. For either saved schedule, neither one channel nor any pair of channels has the accepted-wrong signature. Together with the explicit witnesses, these tests establish the exact distances of the saved schedules in the stated fault model. The bound of Proposition 2 gives matching upper bounds on both schedules; satisfying its necessary inequalities alone would not establish either lower bound.

Complete best-tested schedules

The generated test set contains 1,024 valid schedules per size, obtained by decomposing the padded regular bipartite check-support incidence graph into perfect matchings. The search uses Julia 1.12.7 with MersenneTwister seeds 1 through 1,024 at each size. The largest exact distance within each set is three. The saved m=3m=3 schedule (seed 145) uses 12 input qubits, 9 checks, 6 CNOT layers and 39 CNOTs. Its exact distance is three, attained by the outcome faults M0M_0, M1M_1, M2M_2. The saved m=5m=5 schedule (seed 2) uses 35 input qubits, 25 checks, 10 layers and 205 CNOTs. Its exact distance is also three, attained by M15M_{15} and the two target-ZZ gate faults (8,21,11;Ztarget)(8,21,11; Z_{\mathrm{target}}) and (1,16,15;Ztarget)(1,16,15; Z_{\mathrm{target}}). The schedules below list every CNOT as a target qubit with its execution layer, grouped by extraction ancilla. This grouping specifies the full schedule without relying on the seed or its random-number generator. The machine-readable check supports, layers and fault signatures are included in the Supplementary data and code at gate_schedule_m3.json and gate_schedule_m5.json. Table S1 and Table S2 give all CNOT layers for the two saved schedules.

aaMeasured checkTarget qubit qq @ layer tt
0A0A_00@60@6, 9@19@1, 10@310@3
1A1A_13@23@2, 9@49@4, 11@611@6
2A2A_26@16@1, 10@510@5, 11@211@2
3A0A1A_0A_10@20@2, 3@63@6, 10@410@4, 11@111@1
4A0A2A_0A_20@10@1, 6@46@4, 9@69@6, 11@511@5
5A1A2A_1A_23@13@1, 6@56@5, 9@39@3, 10@210@2
6C1(1)C_1^{(1)}0@50@5, 1@61@6, 3@43@4, 4@34@3, 6@26@2, 7@17@1
7C1(2)C_1^{(2)}0@30@3, 1@41@4, 3@53@5, 4@14@1, 6@66@6, 7@27@2
8C2(1)C_2^{(1)}1@51@5, 2@62@6, 4@44@4, 5@25@2, 7@37@3, 8@18@1

Table S1. Complete CNOT schedule for m=3m=3. For each extraction ancilla aa, q@tq@t means a CNOT with control aa and target qq in layer tt. Gauss labels are AvA_v, pair labels are AuAvA_uA_v, and Cj(c)C_j^{(c)} is copy cc of adjacent-column check jj.

aaMeasured checkTarget qubit qq @ layer tt
0A0A_00@100@10, 25@525@5, 26@826@8, 27@127@1, 28@428@4
1A1A_15@25@2, 25@325@3, 29@529@5, 30@730@7, 31@831@8
2A2A_210@310@3, 26@526@5, 29@629@6, 32@132@1, 33@1033@10
3A3A_315@215@2, 27@827@8, 30@130@1, 32@432@4, 34@534@5
4A4A_420@1020@10, 28@328@3, 31@631@6, 33@533@5, 34@134@1
5A0A1A_0A_10@60@6, 5@85@8, 26@326@3, 27@1027@10, 28@228@2, 29@129@1, 30@430@4, 31@731@7
6A0A2A_0A_20@30@3, 10@810@8, 25@225@2, 27@927@9, 28@528@5, 29@1029@10, 32@732@7, 33@433@4
7A0A3A_0A_30@40@4, 15@515@5, 25@725@7, 26@926@9, 28@628@6, 30@230@2, 32@1032@10, 34@334@3
8A0A4A_0A_40@70@7, 20@120@1, 25@825@8, 26@626@6, 27@427@4, 31@931@9, 33@333@3, 34@1034@10
9A1A2A_1A_25@105@10, 10@210@2, 25@625@6, 26@726@7, 30@930@9, 31@331@3, 32@532@5, 33@133@1
10A1A3A_1A_35@55@5, 15@315@3, 25@425@4, 27@627@6, 29@829@8, 31@1031@10, 32@232@2, 34@734@7
11A1A4A_1A_45@65@6, 20@820@8, 25@125@1, 28@728@7, 29@229@2, 30@330@3, 33@933@9, 34@434@4
12A2A3A_2A_310@110@1, 15@615@6, 26@1026@10, 27@727@7, 29@429@4, 30@830@8, 33@233@2, 34@934@9
13A2A4A_2A_410@510@5, 20@720@7, 26@426@4, 28@1028@10, 29@329@3, 31@231@2, 32@932@9, 34@834@8
14A3A4A_3A_415@915@9, 20@220@2, 27@327@3, 28@128@1, 30@630@6, 31@531@5, 32@832@8, 33@733@7
15C1(1)C_1^{(1)}0@20@2, 1@91@9, 5@75@7, 6@56@5, 10@1010@10, 11@311@3, 15@815@8, 16@116@1, 20@420@4, 21@621@6
16C1(2)C_1^{(2)}0@50@5, 1@71@7, 5@35@3, 6@86@8, 10@910@9, 11@211@2, 15@115@1, 16@416@4, 20@620@6, 21@1021@10
17C1(3)C_1^{(3)}0@80@8, 1@11@1, 5@45@4, 6@76@7, 10@610@6, 11@911@9, 15@1015@10, 16@216@2, 20@520@5, 21@321@3
18C1(4)C_1^{(4)}0@10@1, 1@61@6, 5@95@9, 6@26@2, 10@710@7, 11@1011@10, 15@415@4, 16@516@5, 20@320@3, 21@821@8
19C2(1)C_2^{(1)}1@31@3, 2@92@9, 6@66@6, 7@17@1, 11@511@5, 12@212@2, 16@816@8, 17@417@4, 21@721@7, 22@1022@10
20C2(2)C_2^{(2)}1@101@10, 2@12@1, 6@96@9, 7@47@4, 11@611@6, 12@712@7, 16@316@3, 17@217@2, 21@521@5, 22@822@8
21C2(3)C_2^{(3)}1@21@2, 2@102@10, 6@36@3, 7@57@5, 11@811@8, 12@412@4, 16@716@7, 17@617@6, 21@921@9, 22@122@1
22C3(1)C_3^{(1)}2@82@8, 3@93@9, 7@27@2, 8@38@3, 12@612@6, 13@713@7, 17@117@1, 18@1018@10, 22@522@5, 23@423@4
23C3(2)C_3^{(2)}2@22@2, 3@43@4, 7@87@8, 8@98@9, 12@512@5, 13@1013@10, 17@717@7, 18@318@3, 22@622@6, 23@123@1
24C4(1)C_4^{(1)}3@63@6, 4@84@8, 8@28@2, 9@79@7, 13@313@3, 14@914@9, 18@518@5, 19@119@1, 23@1023@10, 24@424@4

Table S2. Complete CNOT schedule for m=5m=5. For each extraction ancilla aa, q@tq@t means a CNOT with control aa and target qq in layer tt. Gauss labels are AvA_v, pair labels are AuAvA_uA_v, and Cj(c)C_j^{(c)} is copy cc of adjacent-column check jj.

S4 Setting: gauging a logical measurement

Related constructions and formal developments

Related constructions include auxiliary-graph surgery [42], homological measurement [43], adapters between code blocks [28], and auxiliary-hypergraph surgery [18]. Parallel measurements [27], parsimonious surgery [26] and lifted surgery [44] address concurrency, ancilla overhead and fast logical operations. Gauging also supports higher-form transversal gates [29] and magic-state preparation [35]; gauge measurements enable code switching [41]. Spacetime codes describe circuit faults and detectors [21, 30], and gauging has been applied directly to them [17]. QECCLean provides Lean formalizations of foundational quantum-error-correction constructions [24], while Lean-QEC formalizes stabilizer-code theory and machine-checked distance certificates [23]. Our development also treats repeated readouts, persistent faults and boundary detectors. The distance statements provide inputs to fault-tolerance analyses with specified noise models and decoders [6, 20, 32].

Check matrices and the two components

A logical measurement has two useful descriptions: an effective code on the original data qubits and an enlarged code containing the gauging ancillas. We write [[n,k,d]][[n,k,d]] for a code with nn physical qubits, kk logical qubits and distance dd. For the effective description, take a CSS code with binary check matrices HX,HZH_X,H_Z satisfying HXHZT=0H_XH_Z^{\mathsf T}=0. We use physical Pauli labels dXphysd_X^{\mathrm{phys}} and dZphysd_Z^{\mathrm{phys}} for the minimum weights in ker⁡HZ∖rowspan⁡HX\ker H_Z\setminus\operatorname{rowspan}H_X and ker⁡HX∖rowspan⁡HZ\ker H_X\setminus\operatorname{rowspan}H_Z, respectively. The formal library names these quantities dZd_Z and dXd_X, indexing them by the kernel matrix; Section S13 records this conversion. An XX-type logical operator is a vector L∈ker⁡HZL\in\ker H_Z, meaning HZL=0H_ZL=0, that cannot be written as a binary sum of the rows of HXH_X. Conditioning on the measured eigenvalue adds LL to the effective XX checks. The new check commutes with the ZZ checks and is independent of the original XX rows, so the resulting CSS code has one fewer logical qubit. For example, the length-three repetition code has two adjacent-pair ZZ checks and no XX check. Adding its all-ones logical vector as an XX check leaves no logical qubit.

The physical gauging construction realizes this measurement by adding ancilla qubits and local checks. Its auxiliary graph has one vertex per qubit in the support of LL and one ancilla per edge. Each vertex has a Gauss-law check Av=Xv∏e∋vXeA_v=X_v\prod_{e\ni v}X_e, acting on that vertex and its incident edges. Every edge ancilla appears in two Gauss checks, so multiplying all Gauss checks cancels the edge factors and leaves LL. Completing the construction requires the deformed original checks, cycle checks and gauge initialization specified in the source. The spatial distance minimizes the weight of nontrivial logical Pauli operators of the full deformed code, including original and auxiliary qubits. Measuring one independent logical Pauli operator leaves k−1k-1 logical qubits from an original kk. Our formalization starts from the resulting check matrices and proves their algebraic properties. Section S6 computes the enlarged codes including their ancillas; the single-row argument above explains the loss of one logical degree of freedom on the original qubit set.

To isolate the role of repeated measurements, the temporal model assigns one measurement-fault bit to each of T≥1T \ge1 rounds. Its fault class consists of independent measurement-outcome flips, detected by comparisons between adjacent rounds. A nonzero fault that passes every comparison must occupy every round, so its weight is exactly TT. If the chosen linear readout returns one on this constant pattern, the temporal fault distance is TT. This is the repetition mechanism behind Supplementary Lemma 3 of the gauging paper, whose round count is to−tit_o-t_i. Theorem 3 and Eq. (12) state this identity; Section S7 separately studies models with persistent data errors.

The spatial and temporal theorems

Theorem 2 spatial X-type component. Let the auxiliary graph be loop-free and have expansion at least one. Assume every vector in ker⁡HZ\ker H_Z outside the row space of HXH_X has weight at least dd. The weight of an operator is the number of qubits on which it acts. Assume the deformed code has the following check-matrix structure. The Gauss laws Av=Xv∏e∋vXeA_v=X_v\prod_{e\ni v}X_e are XX checks, and the lifted original XX checks belong to the deformed XX check space. Each original ZZ check has a deformed partner that differs only on edge qubits. The deformed ZZ checks include a cycle basis of the auxiliary graph, and every Gauss law commutes with every deformed ZZ check. Let FF be an XX-type logical operator of the deformed code: it lies in the kernel of its ZZ checks and outside the row space of its XX checks. Write SS for its vertex support and RR for its support outside the auxiliary graph. Then its edge support is a cut ∂U\partial U for some vertex set UU with ∣U∣≤∣Uc∣|U|\leq|U^c|, and d≤∣S∣+∣∂U∣+∣R∣=wt⁡(F)d\leq|S|+|\partial U|+|R|=\operatorname{wt}(F).

Theorem 2 bounds physical XX-type logical operators. A bound on the full static CSS distance also requires the ZZ-type component. The finite instances reported below check both components separately. The spatial proof identifies the edge support, removes it with Gauss checks, and bounds the remaining logical operator’s weight. First, an undetectable edge pattern has even overlap with every cycle check. Cut–cycle duality therefore makes its edge support a cut E=∂UE=\partial U. We can choose UU no larger than its complement. Second, multiplying by the Gauss laws over UU removes this edge support: in binary support notation, their product is the mod-two sum of the AvA_v vectors, with ones on UU and its crossing edges.

∑v∈UAv=(1U,1E).(10)\sum_{v\in U} A_v=(\mathbf{1}_U,\mathbf{1}_E). \tag*{(10)}

Multiplying by stabilizer checks changes the operator’s support while preserving its action on the encoded information. The cleaned operator has support S△US\mathbin{\triangle}U on vertices and RR outside the graph, with no edge support. The construction hypotheses make it a nontrivial logical operator of the original code, so

d≤∣S△U∣+∣R∣≤∣S∣+∣U∣+∣R∣≤∣S∣+∣∂U∣+∣R∣.(11)d\leq|S\mathbin{\triangle}U|+|R|\leq|S|+|U|+|R|\leq|S|+|\partial U|+|R|. \tag*{(11)}

Section S16 gives the coordinate proof of each step. Expansion is used only in the last inequality of Eq. (11). It bounds the number of vertex checks needed to remove the edge support by the number of edges already in that support.

Theorem 3 temporal component. Let one check be repeated over T≥1T\geq1 rounds, with a comparison between each pair of adjacent rounds. Every nonzero binary fault pattern that passes all comparisons is the all-ones pattern and has weight TT.

Write zt∈Z2z_t\in\mathbb{Z}_2 for the measurement-fault bit in round tt. Fault weight counts the independently flipped measurement bits. Each comparison checks zt+zt+1z_t+z_{t+1}, so passing all T−1T-1 comparisons requires all bits to be equal. A nonzero binary pattern must then be one in every round. This pattern is a logical fault whenever the specified linear readout returns one on it, giving temporal fault distance TT. At T=1T=1 there is no comparison, and the same identity holds:

zt=1 for all t,∣supp⁡F∣=T.(12)z_t=1\ \text{for all }t,\qquad|\operatorname{supp}F|=T. \tag*{(12)}

Remark the assembly. Once both static CSS components have lower bound dd, a temporal distance T≥dT\geq d places both the spatial and temporal distances at least dd. This final comparison uses the two component bounds. Applying it to the source protocol also requires the assumptions used to establish those bounds, including the relevant boundary and detector conventions. Section S14 gives the statement in the source’s notation.

S5 Checking the conditions

C1 and C2 can be checked directly from the auxiliary graph, round count and target distance. Section S6 gives exact values on two named codes, and Section S7 examines what changes when a condition fails. The two tests are

∣∂S∣≥min⁡(∣S∣,∣Sc∣) for all Sandto−ti≥d,(13)|\partial S|\geq\min\left(|S|,|S^c|\right)\ \text{for all }S \qquad\text{and}\qquad t_o-t_i\geq d, \tag*{(13)}

where ∂S\partial S is the set of edges leaving SS and to−tit_o-t_i is the duration of the deformation in rounds. C4 is also a finite predicate: it tests for linear dependencies among same-round checks. C3 instead specifies a boundary convention. We study its effect through related syndrome constraints in explicit fault models.

The conditions, item by item

We use C1–C4 to collect assumptions from different statements in the published supplement of Ref. [10]. Its item numbers differ from those in the arXiv version. These are separate from the source’s four requirements on the auxiliary graph. The two lists share the expansion requirement. The source also requires sparsity, constant-size matchings and a constant-weight cycle basis to keep the deformed code low-density. The resource comparison below minimizes edge ancillas subject to expansion alone.

  • C1: graph expansion. Every vertex set SS has at least min⁡(∣S∣,∣Sc∣)\min(|S|, |S^{\mathrm{c}}|) outgoing edges. This is one of the two explicit hypotheses of the source’s spacetime-fault-distance theorem. Methods Remark 2 and Corollary 1 already preserve distance when the first layer has expansion at least one, even if cycle sparsification gives a final graph with expansion at most one half.

  • C2: enough rounds. The deformation lasts to−ti≥dt_o-t_i \ge d rounds. Supplementary Lemma 3 already proves that the source’s measurement-and-initialization fault distance is exactly to−tit_o-t_i. Supplementary Definition 3 defines spacetime fault distance, and Lemma 4 separates spatial and temporal contributions. The spacetime-distance theorem uses the smaller contribution. Theorem 3 verifies the round-count identity in our measurement-fault model. Our necessity statement allows any linear parity readout that evaluates to one on the all-ones pattern. This readout condition states explicitly when the source’s constant-pattern witness is a logical fault in our model.

  • C3: perfect boundary measurements. The source takes the first and last stabilizer-measurement rounds to be perfect. Supplementary Remark 3 explains this convention using the dd rounds of error correction before and after gauging. In that argument, a process involving both the gauging measurement and a boundary has distance greater than dd. Our protocol models impose an endpoint syndrome constraint: the syndrome at that endpoint must be zero. Endpoint faults are allowed when their contributions to the syndrome cancel. This defines a model without the source’s surrounding error correction, whose noisy-boundary behavior requires a separate analysis.

  • C4: no same-round detector. A local detector is a nonempty set of one round’s check rows whose sum is zero. C4 is an assumption used to generate the source’s detector set. Supplementary Remark 2 explains that local relations, also called meta-checks, can produce such detectors. The lemma can be extended to include them. C4 holds exactly when the check rows are linearly independent, so matrix rank decides it. A dependent set has a fixed combined ideal outcome; for example, two identical checks must have the same ideal outcome.

Expansion and ancilla count

Choosing a graph family with a proved expansion bound satisfies C1 for every family member. The complete graph KmK_m is one example. If ∣S∣≤m/2|S| \le m/2, any vertex in a nonempty SS has ∣Sc∣|S^{\mathrm{c}}| edges to the complement, which is at least ∣S∣|S|. For a larger set, apply the same argument to its complement. Lean verifies this bound and supplies the expansion hypothesis of the spatial theorem.

With one ancilla per edge, KmK_m uses m(m−1)/2m(m-1)/2 ancillas for a measured support of size mm. C2 can likewise be satisfied by choosing dd deformation rounds. The schedule then meets C2 at the cost of dd measurement rounds. For the toric family, constructed from two repetition codes [31], the Künneth formula determines the code dimension from the homology of the factors [22]. Choosing a complete auxiliary graph and dd rounds then satisfies C1 and C2 throughout the family. C1 concerns the auxiliary graph, and C2 concerns the schedule; neither is an intrinsic property of the original code.

The minimum ancilla count for expansion alone is linear in the support size. A star on mm vertices satisfies C1 with m−1m-1 edges, and this is the minimum possible edge count. Adding edges preserves C1, so a star with rr additional edges between its leaves uses m−1+rm-1+r ancillas. At four vertices and cycle rank three, this graph is K4K_4, and both constructions use six ancillas. This is the auxiliary graph of the bivariate bicycle example in § 1.17. At seven vertices, a star with three chords uses nine ancillas, whereas K7K_7 uses twenty-one. Their cycle ranks are three and fifteen, respectively, so this is a comparison of two C1-satisfying graphs, not a comparison at fixed cycle rank. A star has unbounded maximum degree as mm grows. A low-density implementation additionally needs the source’s degree, matching-size and cycle-weight bounds.

The supplement reports an exhaustive finite census over edge multisets for the overall minimum and over simple graphs for specified cycle ranks. In the tested rows with a solution, the star-based witness uses fewer edges than the complete graph except when completeness is forced: three vertices with one cycle and four with three. The supplement specifies the search range and reproduction script, and Lean verifies the reported witnesses.

The lower bound m−1m-1 follows from rank and nullity. Assign a bit to each vertex and map the assignment to the difference of the endpoint bits on every edge. A nonconstant assignment in the kernel would split the vertices into two nonempty sets with no edge between them, contradicting C1. The kernel therefore has dimension at most one, giving m≤ϵ+1m \le\epsilon+ 1 for ϵ\epsilon edges. A connected graph with cycle rank rr has ϵ=m−1+r\epsilon= m - 1 + r. For fixed cycle rank three, the complete graph has this edge count only at m=4m = 4. Separately, the formalized toric family has k=2k = 2 for every cycle length m≥2m \ge2, and measuring one independent logical operator reduces this to one logical qubit.

Instances

Two examples show how the spatial construction and the measurement model enter exact distance calculations. The bivariate bicycle example computes the static code after adding the gauging ancillas. The Bacon–Shor example isolates spatial and temporal behavior in two separately defined measurement models.

A gauged bivariate bicycle code

We use the bivariate bicycle code [[18, 4, 4]] at shift parameters ℓ=m=3\ell= m = 3 [6]. These shift parameters are distinct from the auxiliary-graph support size denoted by mm above. Its check matrices come from the Lean-QEC development [23]. Gauging a weight-four logical operator with auxiliary graph K4K_4 adds six ancillas and gives a [[24, 3, 4]] code. The construction reduces the number of logical qubits by one and preserves both static distance components at four.

Lean constructs the Gauss-law, pairing and cycle checks from the K4K_4 data and verifies their matrix entries. The Gauss laws sum to the measured logical operator, placing it in the deformed check row space. The code dimension and both distances are computed exactly.

Expansion follows from the complete-graph theorem, and choosing four rounds satisfies C2. A Lean theorem combines C1 and C2 with the independently computed static distances to establish this instance’s spatial bound. The exact values dX=dZ=4d_X = d_Z = 4 are certified separately; Section S13 defines each label by the check matrix whose kernel is used. The temporal value is separately T=4T = 4 in the measurement-fault model with adjacent-round comparisons. The temporal value follows from the repetition identity for independent measurement faults.

A transversal measurement

The second example is the Bacon–Shor subsystem code [[9, 1, 3]] on a three-by-three grid [19, 20]. It protects one logical qubit and also contains unprotected gauge degrees of freedom. The distance three refers to the protected subsystem. Treating the gauge degrees of freedom as additional logical qubits instead gives the associated stabilizer code distance two. Thus the protected subsystem and the associated stabilizer code have different distance conventions.

In the static single-round model, every data qubit is measured in X, and two X-type stabilizers provide parity checks. A bare Z-type logical operator of weight three is one minimum-weight undetected readout error. Lean verifies this bare-logical witness and proves the lower bound over all undetected readout-flipping faults, including those that act on the gauge subsystem. The temporal value comes from a different model: independent faults in the repeated support readout, detected by comparisons between adjacent rounds. Its distance is TT, so three rounds give temporal distance three. The static value counts data-only readout errors, while the temporal value counts repeated measurement-outcome faults.

With only two rounds, the measurement-fault model has an explicit undetected readout error of weight two:

dtemporal(T)=T,d_{\mathrm{temporal}}(T) = T,
dtemporal(d−1)=2<3=d,(14)d_{\mathrm{temporal}}(d - 1) = 2 < 3 = d, \tag*{(14)}

(14) makes the round requirement explicit: with independent measurement faults and fault-free data, T≥dT \ge d is necessary. In the persistent-fault readout model of main-text Sec. II, data, check-result and readout faults are all allowed. Its strict-majority distance is three at two rounds, using the predicate defined there. The comparison changes the fault locations, detectors and readout criterion, as tbl:I makes explicit.

How each condition affects distance

Each condition controls a different part of the distance argument. C1 and C2 enter the assembled spatial and temporal statements. C1 is sufficient under the construction hypotheses but does not determine every instance’s distance. C2 is necessary in the measurement-fault model. C3 motivates the endpoint syndrome constraint in the persistent-fault readout model, and C4 tests for redundant same-round checks. For redundancy, we first prove static distance invariance and then analyze the additional measurement in the protocol model.

C1: distance below the expansion threshold depends on the construction. We gauge the same weight-four logical operator of the smallest toric code using two different four-vertex paths (main-text Figure 4). Both paths violate C1 because some two-vertex set has only one outgoing edge. Changing one edge changes the resulting code distance. For the distance-losing path, dXphys=1d_X^{\mathrm{phys}} = 1 and dZphys=5d_Z^{\mathrm{phys}} = 5. For the distance-preserving path, dXphys=2d_X^{\mathrm{phys}} = 2, and neither side has a weight-one logical operator, so dZphys≥2d_Z^{\mathrm{phys}} \ge2. The total distances are therefore one and two, while the original code has distance two.

A zero column of the deformed Z-check matrix explains the weight-one logical operator in the first path. For any CSS matrix pair, a unit vector eje_j is such an operator exactly when the jjth ZZ-check column is zero and eje_j lies outside the XX-check row space. The zero column means that no ZZ check detects eje_j, and the row-space condition means that eje_j is not a product of XX stabilizers. Applying this criterion on both CSS sides decides whether distance one occurs; larger distances require searching higher-weight vectors.

Each deformed ZZ check is completed by an auxiliary-edge set whose mod-two boundary equals the check’s support on the auxiliary graph [10]. The number of selected edges incident to a vertex is odd on that support and even elsewhere. This allows three selected edges to meet at a support vertex, so it is more general than an ordinary perfect matching. An auxiliary-edge column is zero exactly when the edge appears in no completed ZZ check and no cycle check. For the distance-losing path, we verify the zero column directly in the deformed matrix.

A second implementation enumerates every measured logical of support at most six and every connected auxiliary graph on that support for the toric codes [[8, 2, 2]] and [[18, 2, 3]]. Each deformed check uses a minimum-weight edge completion that commutes with every Gauss law, following the source’s parity-based matching definition. All enumerated C1-satisfying instances preserve the original distance. Among the C1-violating instances, the distance ranges from one to the original distance. The path pair and finite census therefore exhibit both distance loss and distance preservation below the expansion threshold using graphs without dummy vertices. All enumerated instances have same-round detectors, placing this census in the regime where the source’s detector construction must include local check relations.

The same-round detectors come from dependencies in the original code. The four XX checks of the smallest toric code sum to zero, and their lifted checks retain this relation after gauging. The bivariate bicycle instance also has a local relation. Supplementary Remark 2 discusses precisely this case: the detector set must include the same-round relations. By contrast, the eight generators of the Shor [[9, 1, 3]] code are linearly independent and satisfy C4.

The construction also requires every deformed ZZ row to commute with every Gauss law. This is equivalent to requiring the row’s edge completion to have odd-degree vertices exactly on the relevant support, the source’s matching condition. This condition constrains the edge completion, whereas C1 constrains the graph. The construction must check the edge-completion condition and the graph-expansion condition separately.

C2 is necessary in the measurement-fault model. The Bacon–Shor example with T=2T=2 has an undetected readout error of weight two, below d=3d=3. The general witness is the all-ones pattern: the same measurement bit is flipped in every round. Adjacent-round comparisons see no change, and the fault weight is TT. Any linear parity readout ww with w⋅1=1w \cdot\mathbf{1}=1 reads this pattern as a logical error. For every positive T<dT<d, this gives a fault lighter than dd. Our result states the readout condition explicitly, while Supplementary Lemma 3 of the source gives the exact distance for its measurement-and-initialization fault class.

Throughout the protocol analysis, an undetectable logical fault fires no detector and satisfies the specified readout-error predicate. The protocol distance is the minimum weight among these faults; the static distance instead minimizes over nontrivial logical operators in the check kernel outside the stabilizer row space. Static distance tests all nontrivial logical operators, while protocol distance uses the selected logical readout and its decision rule.

C3: a boundary syndrome constraint detects constant nonzero syndromes. The persistent-fault readout model includes data, check-result and readout faults and requires the first syndrome to be zero. At T=1T=1, one data fault paired with a check-result fault that cancels its syndrome gives an undetected readout error of weight two. Lean proves that no weight-one fault satisfies both the detector and readout conditions. The one-round distance is therefore two, compared with three in the static data-only model and one in the measurement-fault model. The fault class and detector set therefore change the one-round distance even for the same code.

For every T≥2T \ge2, dmaj(T)=3d_{\mathrm{maj}}(T)=3. This statement uses the predicate of Eq. (2).

For T≥4T \ge4, the lower bound follows from three observations. First, a weight-at-most-two fault occupies at most two rounds. Second, in a round with no new faults, the syndrome is HH times the accumulated data error. The boundary syndrome constraint and adjacent comparisons force every syndrome to zero. The accumulated error has weight at most two, so the single-round distance three prevents it from flipping that round’s readout. Third, only the at most two occupied rounds can have flipped readouts, which is not a strict majority when T≥4T \ge4. Lean checks T=2T=2 and T=3T=3 by finite enumeration. A weight-three logical data fault in the first round gives the matching upper bound for all TT.

The general boundary-collapse construction is given in main-text Sec. II. Lean certifies its Bacon–Shor specialization.

The one-round formula is the q=1q=1 case of Eq. (3); its Bacon–Shor value is also certified in Lean. Let yy be the merged data and readout error, let HH be the check matrix, and let ww be the logical parity support. An undetected fault must use check-result error HyHy to cancel the syndrome, while a readout error requires w⋅y=1w \cdot y=1. Minimizing the total weight gives

dT=1=min⁡{wt⁡(y)+wt⁡(Hy):w⋅y=1},(15)d_{T=1}=\min\{\operatorname{wt}(y)+\operatorname{wt}(Hy):w\cdot y=1\}, \tag*{(15)}

For the Bacon–Shor model, the minimum is attained at y=e0y=e_0: one data error and one check-result error that cancels its syndrome. The value is two. For other check matrices and readout supports, Eq. (15) gives the value directly. § 1.27 gives related lower bounds and endpoint variants. The paired data and check-result errors count as two independent fault locations.

Figure 3 of the main text compares the persistent-fault model, the measurement-fault model and the persistent-fault model without its boundary syndrome constraint. A second implementation recomputes the figure, and all twelve of its points are exactly the proved ones, four on each curve.

C4: check redundancy preserves static distance and can improve protocol distance. A same-round detector is a nonzero linear combination of check rows that sums to zero. Such a combination exists exactly when the row rank is smaller than the number of rows. A redundant row is a binary sum of existing check rows, so adding it leaves both the check row space and the check kernel unchanged. Both CSS distance components therefore remain unchanged. A code with redundant generators represents the same static code after those generators are removed.

Measuring an extra check has a separate protocol effect. In our persistent-fault readout model, duplicating the first check adds an independent check-result fault location. Deleting the extra check-result fault location leaves the readout unchanged, preserves the original detector constraints and can only reduce or preserve the fault weight. The duplicated-check distance is therefore at least the original distance for every round count. At T=1T = 1, the distance rises from two to three: a single data fault that flips the logical parity must be hidden in both copies of the check using two independent check-result faults. The improvement uses one extra check measurement and one extra independent check-result fault location per round. The detector-generating lemma describes relations among measurement outcomes. These results show how same-round detectors can be retained alongside the spatial and temporal analysis.

Extensions to surgery and fault complexes

The same matrix-based approach yields further results for surgery, mapping cones and fault complexes. The gauging operation verified here acts on check matrices. The graph, ancillas, cycle checks and edge completions of Ref. [10] enter through explicit construction hypotheses. The named instances construct these data and verify the resulting matrix entries. Connecting these results to a gate-level circuit requires identifying that circuit’s checks, fault locations and error propagation with the specified matrices.

The check-matrix construction includes a useful commutation criterion. A deformed check commutes with every Gauss law exactly when its edge completion has odd-degree vertices exactly on the check’s relevant support. This is the source’s parity-based meaning of a matching. Such a completion exists on a connected graph without self-loops when the support has even cardinality. The parity condition ensures commutation, and expansion supplies the weight bound used in the spatial proof.

The verified graph regime. Lean verifies all three steps of Theorem 2. Cut–cycle duality identifies edge sets orthogonal to every cycle with cuts. The cycle space is the kernel of the edge-to-vertex incidence map and is spanned by graph cycles. The formalized auxiliary graph is on all original code qubits. Every vertex therefore carries a data qubit; adding the source’s dummy vertices would require extending this construction to vertices that carry checks without data. Thus the outside-graph term RR in the displayed counting argument is not instantiated by this formal construction. The verified XX-type spatial bound assumes loop-free graphs with h(G)≥1h(G) \ge1; self-loops and 0<h(G)<10 < h(G) < 1 require additional arguments. Section S13 defines the Cheeger constant h(G)h(G).

The C4 results concern check dependencies and static distances, together with the specified duplicated-check protocol model. The detector-generating statement uses a label model in which distinct labels can take arbitrary outcome values, while repeated occurrences of one label share an outcome. In this model, a parity combination vanishes for every allowed outcome assignment exactly when each label occurs an even number of times. Relations among dependent check operators must also be included when applying this model to their measurements. Within this label model, adjacent comparisons leave precisely the repeated-label fault patterns undetected. Initialization and readout contribute single-site detectors at the endpoints. These sites define the spacetime check set, to which a circuit-level fault model can be attached by specifying how gate faults change the outcomes.

Surgery and the coupling between complexes. We verify a ZZ-type specialization of the distance conclusion of Theorem 7.7 of Ref. [18] for the single-block model described below. Its second proof case compares a deformed-code logical operator L‾Z\overline{L}_Z with an auxiliary-hypergraph vertex set κ\kappa. An explicit coupling is needed to compare the logical operator and the vertex set because they belong to different spaces. We use the one-to-one data attachment of formula (2), together with the chain-map construction in §4 and §5 of Ref. [18].

In this specialization, the port covers all original data qubits. Lean proves that the kernel of the deformed XX-check matrix HX′H'_X is contained in the row space of the deformed ZZ-check matrix HZ′H'_Z. Thus every undetected physical ZZ-type operator in this specialization is a stabilizer; no logical operator remains on that side. For a free coupling in our own model, complete cycle checks make all legal couplings agree on admissible vectors. Cleaning removes the coupling contribution without requiring the coupling itself to vanish.

The source obtains its block-reading fault-distance guarantee from the gauging arguments in §3.1. A mapping cone puts the deformed-code complex, the auxiliary complex and the map connecting them into one complex, allowing us to analyze distance transfer in that combined object. The connecting map, called the port map, has three linear components F1F_1, F2F_2, F3F_3. In the specific small-code and triangular-auxiliary assembly studied here, the commuting-square condition requires F2F_2 to have three equal columns. A second implementation enumerates the squares and confirms that these are exactly the admissible F2F_2 matrices. For every admissible port in this assembly, the cone distance equals the small code’s distance when the first column of F3F_3 is nonzero, and equals one when that column is zero. The column test is an exact distance criterion for this small-code and triangular-auxiliary assembly.

A separate theorem gives the general algebraic criterion. Let DD be the idle-volume complex and CC the auxiliary complex, and suppose DD is exact at the middle. Exactness means that every cycle at that term is a boundary. A pair (u,v)(u,v) is then an undetected nontrivial cone fault exactly when D.d2u+F3v=0D.d_2u+F_3v=0 and v∉im⁡C.d2v \notin\operatorname{im} C.d_2. A nontrivial undetected fault must satisfy the linear equation and lie outside the specified image space. Once the chain-map conditions hold, this fault criterion is determined by F3F_3 and the two complex differentials. A weight-one cone fault exists exactly when a weight-one auxiliary vector vv lies outside im⁡C.d2\operatorname{im} C.d_2 and satisfies F3v=0F_3v=0. The first-column test above is this criterion specialized to the triangular assembly.

The exactness condition concerns the idle-volume complex DD. For DD built as a tensor product of a two-term factor and a code complex, the supplement gives a complete criterion for middle exactness. Its criterion uses the homology of both factors. A code complex with vanishing H0H_0 and H1H_1 gives middle exactness with every partner.

Cosystolic distance and its assumptions. When ker⁡δ2∖im⁡δ1\ker\delta_2 \setminus\operatorname{im} \delta_1 is nonempty, the auxiliary quantity d1∗d_1^* is the minimum weight of its vectors (Figure S1). A component is a vertex set that meets every hyperedge in an even number of vertices. The component family WW is a chosen collection of these sets. The vector must pass all component parity checks but cannot be generated by adding hyperedge vectors; over F2\mathbb{F}_2, both requirements are finite parity tests on its support. When the set is nonempty, a lower bound excludes all lighter admissible supports, and an upper bound supplies one admissible support. The characterization reduces distance calculation to a minimum-weight search subject to the two parity tests. The problem is to find the lightest vector in a linear code outside a specified subcode. The supplement gives a reduction from linear-code minimum distance, which is NP-hard [40]. The free-coupling problem has the same algebraic form: a linear system together with exclusion from a specified subspace.

Auxiliary four-term complex used in the surgery analysis

Figure S1. The auxiliary four-term complex used in the surgery analysis of Ref. [18]. From left to right, the spaces are spanned by the chosen component family, vertices, hyperedges and cycles. The maps δ2,δ1,δ0\delta_2,\delta_1,\delta_0 point left, and consecutive compositions vanish. Both ker⁡δ2\ker\delta_2 and im⁡δ1\operatorname{im}\delta_1 therefore lie in the vertex space. The shaded region represents ker⁡δ2∖im⁡δ1\ker\delta_2 \setminus\operatorname{im}\delta_1. When this set is nonempty, d1∗d_1^* is its minimum vector weight. The formal definition assigns zero when this set is empty. OpenAI Codex assisted the drawing code and layout; see main-text Sec. VI.

Cosystolic bounds for simplicial complexes suggest ways to construct auxiliary systems [36, 37, 38, 39]. Using a specific bound here requires identifying the corresponding cochain complex, relating its weight convention to ours, and verifying all hypotheses of that theorem. For three structured families, the supplement gives exact distance formulas. These families have one nonempty hyperedge, so their cycle space is zero. Applying them to sparse surgery requires bounds on incidence degrees and check weights as the family grows, together with the code and coupling hypotheses of the chosen surgery theorem. The supplement identifies the entries whose weights grow in these examples.

The graph specialization illustrates why nonemptiness matters. Each hyperedge is then an ordinary edge, and δ1\delta_1 is the edge-to-vertex incidence map. On a connected graph, leaving a vertex out of the chosen component family gives distance one. Whether this occurs depends on the chosen component family. If the whole vertex set is the single chosen component, ker⁡δ2∖im⁡δ1\ker\delta_2 \setminus\operatorname{im} \delta_1 is empty. The formal definition assigns zero in this case because it uses the natural-number infimum, which equals zero for an empty set. Here zero records an empty admissible set, so it represents the absence of a cosystolic vector. Positive lower-bound criteria therefore require at least one admissible vector.

Two foliations give different distance laws. Foliation stacks a code complex along a time direction [33]. With repetition-code foliation, the matrix-indexed distance dZd_Z is TT whenever the code complex has nonzero zeroth homology H0H_0. Here H0H_0 is the cokernel of the bottom map. With dual foliation, the corresponding distance equals the original code’s matrix-indexed distance dZd_Z for every positive TT, provided that the original code has a nontrivial logical operator on that side. For an empty logical set, the fault-complex infimum is zero, whereas the static finite-search function returns n+1n+1 for an nn-qubit code. These values record the absence of candidates; neither is the weight of a logical operator. The Künneth formula describes the homology [18]; separate weight bounds and explicit faults attaining them give these distance laws. Selecting the distance law for a physical circuit therefore requires identifying which foliation models that circuit.

The supplement lists the formal declarations supporting these results and states the assumptions needed to connect them to the source constructions. It also verifies that each detector functional vanishes on the image of the fault-complex boundary map, as required by the complex condition. To use this identity in the source’s spacetime cleaning proof, one must identify the fault coordinates and establish the corresponding weight bound. Related work describes fault complexes as graph states [25] and extends the construction through spacetime lifting [34].

Proof verification and numerical calculations

Lean verifies the proof scripts, and separate numerical implementations check the reported finite instances. DeepSeek-V4.1-Flash assisted the Lean derivations and numerical debugging; OpenAI Codex (GPT-6) assisted literature checks, formal-proof exploration and numerical cross-checks. AI-generated proof code is checked by the Lean kernel, and numerical claims are checked against independently computed values. OpenAI Codex also assisted the four TikZ schematics and the plotting code; their supports, operator relations and plotted distances were checked against the definitions and numerical data.

column in Section S7 is checked in the full deformed ZZ-check matrix, including the cycle checks.

Formal statements supporting the results

The development is a single Lean project of 75 modules plus a root module. This repository contains 19 modules and imports 56 from QECCertificates, which provides the GF(2) and Pauli layers and part of the Codes layer. The project also depends on mathlib and the Lean-QEC formalization at QCL-SUAT/Lean-QEC; full revision hashes pin all three dependencies. Table S3 and Table S4 group the modules by layer and name the theorem or group of results supporting each claim.

LayerModuleSupporting statement
machineGF2.BasicspanL_map_addSmul_append, Matrix.rowSpace_eq_spanL_ofFn
machineGF2.RowReducespanL_rowReduce, isReduced.rowReduce
GF2.KernelBasiskerL_rowReduce
GF2.CanonicalrowReduce_mem_iff_of_spanL_eq
GF2.RankCertificateMatrix.rank_eq_length_rowReduce
GF2.RankEchelonrankEchelon_eq_length_rowReduce
GF2.WitnessDualWitness.not_mem_rowSpace, eq_minWeight_of_bounds
GF2.MembershipinSpanB_iff, inKerB_iff
GF2.LowerBoundeq_minWeight_of_decide, lightCand_length_le
GF2.WeightEnummem_lightVecs
GF2.HGP, GF2.HGPCompressionhgp_orthogonal, hgpHX_mulVec_eq_zero_iff
GF2.HGPCleaning, GF2.HGPCleaningDualcleaning lemmas, two-sided
GF2.KunnethCore, GF2.HGPKunnethfinrank_colsRows, hgp_kunneth
Pauli.Exproperator tree to symplectic representation
decisionCodes.Separationseparation judgment; C2’s necessity: exists_logicalFault_of_rounds_lt
Codes.LocalDetectorC4 by row rank; redundant rows preserve static distance
Codes.MatchingCriterionan obstruction for ordinary graph perfect matchings
Codes.BoundaryCollapsecomparison-only model: removing the constraint gives distance 1
Codes.SeparationInstancessepFail_lightLogical: C1 counterexamples
Codes.SeparationClosedFormone_le_c1Witness
Codes.ToricFamilySpatialtoric_family_separation_closed_spatial
Codes.C1CensusC1’s ancilla cost: expansionOne_star_six, expansionOne_append
Codes.C1Optimalm−1m-1 is a lower bound: card_sub_one_le_length_of_hasExpansion
One
Codes.C1CycleRankthe cycle-rank bound: card_ge_of_finrank_cycleSpace
spatialCodes.GaugingdeformX_k, the dimension drop; timeLike_weight_eq
Homology.HypergraphSurgeryhypergraph Gauss law; starOp_graphOf, hypergraphSurgery_k
Homology.AuxComplexfour-term complex; 1-cosystolic distance d11=1d_1^1=1 for gauging
Homology.ModuleExpansionmodular expansion; thickening (7.8); Cor. 7.10; 7.7’s premise
Codes.SurgeryScheduleW-components; spatial expansion; O(d)O(d) round accounting
Codes.SurgeryProtocol, Codes.SurgeryFaultDistanceround accounting; timeline detector
Codes.SurgeryProtocolComplexthe cone over a chosen port; two readings; the transfer criterion, refuted on one port
Codes.ConeReductionthe cone reduction on a general assembly; the weight-one criterion
Homology.SubcodeLayerthe two subcode distances, with matrix convention and assumptions in Sec. S11
Homology.SubcodeChainMapthe chain map of Def. 2.5, degree shift at p. 32; the p. 17 assembly
port function fpf_p and WW
Homology.MappingConemapping cone over a 4-term cochain complex
Homology.MappingConeSnakesnake-lemma rank formula for the cone
Homology.FaultComplexthe fault complex of App. A.1, its Koszul realization, the conserved parity
Codes.CircuitFaultSlotsA.1’s blocks: entry faults give the check matrix, for any check matrix
Homology.BoundaryLinearCoreexactness by rank; legal couplings agree on cycles; the printed modulus, read on vectors
Homology.CosystolicCertificatethe certificate interface; the 1-cosystolic cells are the shared undetectable set

Table S3. TABLE S3. Modules and the results they support, part I: the machine, decision and first spatial layers. Every module is in the default build; § 1.29 reports the axiom dependencies of its supporting statements. Codes are written [[n,k,d]][[n,k,d]], d11d_1^1 is the 1-cosystolic distance of the auxiliary hypergraph and fpf_p is the port function.

LayerModuleSupporting statement
spatialCodes.LegalCouplingInvarianceboth coupling invariances on the deformed code
Codes.DistancePreservationdistance bounds when checks are appended on the original qubit set
Codes.DeformedCodeZ-type bounds for the single-block model, Case 1 and legal couplings; the free coupling’s candidates are a linear system in the coupling matrix, and the coupling-to-vertex commutation identity C∂S=HXfp−1(S)C \partial S = H_X f_p^{-1}(S) holds whenever each deformed check commutes with the vertex rows, with its two corollaries; at distance three the drop criterion as a disjunction, couplingDrop_shape_three
Codes.CouplingRangeSeparationan explicit Steane assembly with a purely auxiliary logical fault of weight two but no weight-two logical fault on one data and one auxiliary qubit, steane_m4_separates
Homology.FaultDistancethe fault predicate; both cases; Z-side distance on both standard foliations
Codes.VennPartitionseven-region count; relation (2) of the proof of Thm. 7.7 as an identity
Codes.TimeLikeInstancem=3m = 3, T=4T = 4 instance
Codes.BB24Separationthe bivariate bicycle [[24,3,4]][[24, 3, 4]]: both components
Codes.BB24Gauged, Codes.BB18Anchorthe code and its base-code certificate; the gauging construction verified by the proof assistant
Homology.CosystolicLowerBoundweight-one/two criteria; two unbounded families
Codes.CosystolicBlockFamilya third unbounded family: d1=min⁡i∣Bi∣d_1 = \min_i |B_i| on one full hyperedge
Codes.FaultComplexGraphStatethe graph-state reading: the biadjacency matrix and the detector rows
Homology.FaultComplexKunneththe Künneth dimensions; the decoupling spanning in general
temporalCodes.MeasurementProtocolspacetimeWeight_witness: the weight law
Codes.BaconShor[[9,1,3]][[9, 1, 3]]: gauge and stabilizer ranks, k=1k = 1, d=3d = 3
Codes.BaconShorMeasurementtransversal: spatial 3, temporal 3
Codes.FullProtocolFaultsuniversal recovery, boundary removal, duplicated checks, one-round form
familyCodes.ToricFamilySpatial, Codes.HGPToricFamilyclosed-form spatial bound on both families
Codes.ToricFamilyGaugedKtoric_family_gauged_k: the family’s dimension drop, from the drop theorem
Codes.CutCycleDualitycut space = the even subgraphs’ orthogonal complement; step 1 of the counting lemma
Homology.DetectorDecompositionadjacent comparisons generate the window ones; both generating lemmas
Codes.SpacetimeChecksthe spacetime check set: a site is a (round, check) pair, its label round-free
Codes.GaussCleaningstep 2 of the counting lemma: cleaning, and the two hypotheses it derives
Codes.ToricFamilySpatialstep 3 of the counting lemma, space_fault_weight_ge_of_expansion
Codes.MatchingDeformationthe gauging paper’s Methods Lemma 1: Gauss law, cycle checks, matching deformation
Homology.CosystolicLowWeightd1∗≥3d_1^* \ge3 as a decidable low-weight criterion
Homology.CosystolicCharacterizationthe parity criterion at every weight; bounds as sets; the hardness realization
bookkeepingCodes.DistanceLabelX/Z labeling and the two-sided ledger
Codes.CSSPair, Codes.CaseMatrixCSS bridge; case matrix

Table S4. TABLE S4. Modules and the results they support, part II: the remaining spatial layer, temporal results, code families and bookkeeping. The conventions and audit scope are those of Table S3; rows citing the gauging paper’s Methods use the numbering from that version.

The Künneth row summarizes several results, whose derivations are given below. The dimension identities cover all four Künneth degrees, including both a zero differential in the two-term factor and the general case. For repetition-code foliation, which stacks the code along time, the project also proves elementwise decoupling as described below.

Ordinary graph matching. The declaration no_pair_of_isolated concerns a matching that uses graph edges and pairs every support vertex with exactly one other support vertex. If deleting an edge’s two endpoints leaves an isolated support vertex, no such matching contains that edge. For the four-vertex path, path4_not_matched applies this obstruction to its middle edge. Gauging instead requires an edge set whose mod-two boundary equals the relevant support; it does not require degree one at every support vertex. For example, all three edges of a four-vertex star have odd boundary at all four vertices, although the graph has no ordinary perfect matching. The matching obstruction therefore does not determine which edges can occur in a gauging completion. The zero

Calculating the 1-cosystolic distance

The auxiliary 1-cosystolic distance d1∗d_1^* is the minimum weight in ker⁡δ2∖im⁡δ1\ker\delta_2 \setminus\operatorname{im}\delta_1 when this set is nonempty. It enters the round requirement of the surgery paper. A component is a vertex set that meets every hyperedge in an even number of vertices. WW is a chosen family of these sets. Over F2\mathbb{F}_2, every vector is the indicator of its support. Membership can therefore be tested by two parity conditions. Here δ2\delta_2 maps vertices to the chosen component family WW, and δ1\delta_1 maps hyperedges to vertices:

1S∈ker⁡δ2∖im⁡δ1⟺∣S∩Ww∣ even for all w ∧ ∣S∩C∣ odd for some component C,(16)\mathbf{1}_S \in\ker\delta_2 \setminus\operatorname{im}\delta_1 \Longleftrightarrow |S \cap W_w| \text{ even for all } w \ \wedge\ |S \cap C| \text{ odd for some component } C, \tag*{(16)}

the left factor by the row-wise reading of δ2\delta_2 and the right by im⁡δ1=(ker⁡δ1T)⊥\operatorname{im}\delta_1 = (\ker\delta_1^{\mathsf T})^\perp, is Cosystolic.indVec_iff. Both factors are finite checks. Provided at least one cosystolic vector exists, every lower bound on d1∗d_1^* therefore rules out a small admissible set, le_cosystolicDistance_iff_isnet. An admissible set is one whose indicator vector is cosystolic. Every upper bound comes from one admissible set, cosystolicDistance_le_card_of_indVec. The formal distance is an infimum in the natural numbers, so an empty admissible set has value zero, not infinity. A claim that no small admissible set exists is then vacuous and gives no positive distance bound. All distance lower-bound criteria in this section assume nonemptiness; the membership criteria do not.

For weights one and two, Eq. (16) gives explicit membership criteria. When the component family covers the vertex set, no cosystolic vector has weight one on an even

hypergraph. The vectors of weight one and of weight two each have a complete criterion:

u=1{v}:cosystolic⟺v∉Ww for every w,u = \mathbf{1}_{\{v\}}:\quad\text{cosystolic} \Longleftrightarrow v \notin W_w\ \text{for every }w,
u=1{a,b}:cosystolic⟺a,b in one W-class, separated by a component(17)u = \mathbf{1}_{\{a,b\}}:\quad\text{cosystolic} \Longleftrightarrow a,b\ \text{in one }W\text{-class, separated by a component} \tag*{(17)}

the first on an even hypergraph, one whose every hyperedge has even cardinality, isCosystolic_indVec_singleton_iff and the second on any hypergraph, isCosystolic_indVec_pair_iff_component. Here WwW_w is the ww-th chosen component, and a separating SS has a∈Sa \in S exactly when b∉Sb \notin S. Two distinct vertices are in the same WW-class when, for every WwW_w, either both lie in it or neither does. On an even hypergraph, covering the vertex set rules out weight-one cosystolic vectors by two_le_hammingNorm_of_isCosystolic, giving d1∗≥2d_1^* \ge2 when the candidate set is nonempty. On three structured families the distance is computed exactly, the first two in the display below and the third in the text that follows it,

d1∗=∣V∣−1andd1∗=min⁡(∣Q∣,∣Qc∣),(18)d_1^* = |V| - 1 \qquad\text{and}\qquad d_1^* = \min(|Q|, |Q^c|), \tag*{(18)}

The first formula holds on the pair family: the single hyperedge is {a,b}\{a,b\} with a≠ba \ne b, and WW consists of all triples {a,b,t}\{a,b,t\} with t∈V∖{a,b}t \in V \setminus\{a,b\}, cosystolicDistance_pair_eq_card_sub_one. The second holds on the connected family: the single hyperedge is VV, both QQ and QcQ^c have at least two vertices, and WW consists of all distinct vertex pairs within either set, cosystolicDistance_univEdge_splitPairW_eq. These formulas give exact distances for the specified auxiliary complexes. A third family generalizes the second along the number of blocks. Split the vertices into r≥2r \ge2 blocks of at least two each, take the whole vertex set as the single hyperedge and every pair inside a block as a component; the distance is then min⁡i∣Bi∣\min_i |B_i|, the smallest single block. Both the lower and the upper bound are theorems, cosystolicDistance_univEdge_blockPairW_eq: equal blocks of size nn give distance nn for arbitrary nn, so the family is unbounded, cosystolicDistance_univEdge_blockPairW_const. It generalizes the connected family above rather than sitting beside it, since at two blocks its components are point-wise those of splitPairW, blockPairW_two_eq_splitPairW. Each family has one nonempty hyperedge, so the edge-to-vertex incidence map is injective and the cycle space is zero. The pair family has growing incidence degree at aa and bb. The whole-vertex hyperedge has weight ∣V∣|V|, and the within-block pair checks give each vertex a number of incidences that grows with its block size. Using these distance formulas in sparse surgery therefore requires controlling incidence degrees and check weights, as well as satisfying the relevant code-distance and coupling conditions.

The parity characterization (S7) defines a minimum-weight search. The component-family parity checks impose the linear constraint u∈ker⁡δ2u \in\ker\delta_2, while odd overlap with some component requires exclusion from the subspace im δ1\delta_1, that is, u∉im⁡δ1u \notin\operatorname{im}\delta_1, since im⁡δ1=(ker⁡δ1T)⊥\operatorname{im}\delta_1 = (\ker\delta_1^{\mathsf T})^\perp. The admissible sets are therefore a linear code with one of its subcodes removed, Λ∖Λ0\Lambda\setminus\Lambda_0 with Λ=ker⁡δ2\Lambda= \ker\delta_2 and Λ0=im⁡δ1⊆Λ\Lambda_0 = \operatorname{im}\delta_1 \subseteq\Lambda, and the quantity is the least weight in a nonzero coset of Λ0\Lambda_0. Both the closed-form question and the three-coupling question ask for the lightest vector in one matrix’s kernel outside another matrix’s row space. The admissible sets are that set by definition, is Cosystolic_iff_undetectable, and the free coupling’s candidates solve a linear system in the coupling matrix together with the cycle conditions, pairVec_mem_ker_iff_coupling, whose remaining condition is the same non-membership. The following construction shows that this minimum-weight problem includes arbitrary binary linear-code instances. For every binary linear code CC and every subcode DD of it, there is a hypergraph whose admissible sets are C∖DC \setminus D. Take the code’s coordinates as the vertices, its parity checks as the component family and a basis of DD as the hyperedges: then ker⁡δ2=C\ker\delta_2 = C and im⁡δ1=D\operatorname{im}\delta_1 = D, and the composite δ2δ1\delta_2\delta_1 vanishes because D⊆CD \subseteq C. The construction is machine-checked, surgery_D2_matRowSupport and surgeryD1_hypergraphOfRows realizing the two maps and isCosystolic_hypergraphOfRows the membership. With no hyperedge at all the distance is exactly the code’s minimum nonzero weight, cosystolicDistance_eq_IsInf_ker_ne_zero. A general method for d1∗d_1^* would therefore compute the minimum distance of a linear code, a problem cited in § 1.19 as NP-hard.

Two consequences of the parity criterion help evaluate the round-count requirement. Below weight three the question is settled outright when a cosystolic vector exists, since the criterion turns d1∗≥3d_1^* \ge3 into a finite statement, three_le_cosystolicDistance_iff_no_small, the same criterion that Homology.CosystolicLowWeight states by enumerating weight-one and weight-two vectors. If one member of the component family is the whole vertex set, then every cosystolic vector has even weight, even_hammingNorm_of_isCosystolic_univ, so the value three never occurs there. For the single-hyperedge families, the empty cycle basis satisfies the cycle-space requirement. The growing incidence degrees and check weights are the conditions to address when seeking a low-density family.

Surgery and fault-complex results

This section lists the formal declarations behind the statements in § 1.19. It distinguishes our models from the constructions of Cowtan et al. and Williamson and Yoder.

Gauging subcode and distance transfer. Let the auxiliary graph be nonempty, connected and free of self-loops, and take the chosen component family to be W=∅W = \varnothing. On its vertex space, use the chain-complex check matrices HXA=δ1TH_X^A = \delta_1^{\mathsf T} and HZA=δ2H_Z^A = \delta_2. Following Section S13,

dXAd_X^A uses ker⁡HXA\ker H_X^A and dZAd_Z^A uses ker⁡HZA\ker H_Z^A. The side distances are then

dZA=1,dXA=∣V∣,(19)\begin{aligned} d_Z^A &= 1,\\ d_X^A &= |V|, \tag*{(19)} \end{aligned}

by subcodeDistanceZ_eq_one and subcodeDistanceX_graphOf_eq_card, respectively. These declarations use the opposite names for the two check matrices; chainCodeX_eq_subcodeZChecks and chainCodeZ_eq_subcodeXChecks identify them with the pair above. Thus the weight-one logical operator is physical XX type, while the physical ZZ-type logical operator acts on every vertex. We make the matrix construction underlying the source’s subcode statement explicit. The source’s only explicit assembly for this operation is the edge-to-check map on pp. 17–18 with G=HXTG = H_X^T; we construct this map and build the chain map of Definition 2.5 from it. The formal construction uses the following two specializations. The source’s edge-to-check bijection becomes two injections, and the nontrivial part of the chain map is taken at W=∅W = \varnothing, which is where the surgery paper sets that term aside as well.

For distance transfer, distance_preservation_of_portData proves that appending the specified check rows preserves the lower bound. The deformation adds checks on the same qubits, so every vector passing the new checks also passes the old ones, and the distance bound transfers operator by operator. Kernel inclusion is the mechanism behind this transfer. This fixed-qubit argument uses only the original kernel and appended rows, leaving the port function, logical-support coverage and modular expansion as separate auxiliary-data conditions. The statement distance_preservation_of_portData_full carries all three as unused hypotheses.

The preceding fixed-qubit model leaves out the auxiliary qubits. With auxiliary qubits included, distance_preserved_originalForm_caseOne proves Case 1 of the source argument under its stated assumptions. In the specific small-code and triangular-auxiliary assembly, admissible ports have three equal columns in F2\mathbb{F}_2. The theorem coneDistance_generalF2 gives the cone distance for every such port: the small code’s distance when the first column of F3F_3 is nonzero, and one when it is zero. This exact distance formula is specific to that assembly.

The general cone criterion assumes that the idle-volume complex DD is exact at the middle. For an auxiliary complex CC and a valid port FF, cone_fault_iff_of_middleExact states that (u,v)(u,v) is an undetected nontrivial fault exactly when D.d2u+F3v=0D.d_2u + F_3v = 0 and v∉im⁡C.d2v \notin\operatorname{im} C.d_2. For a valid port, the criterion uses F3F_3 and the differentials of the two complexes. The weight-one specialization requires a unit auxiliary vector outside the image of C.d2C.d_2 and killed by F3F_3. The theorem coneWeightOne_triAux evaluates this condition on the triangular assembly. Middle exactness is essential: middleExact_fails_koszul gives a counterexample with all factor and code differentials zero.

That condition also has a complete classification for the Koszul fault complex, the tensor product of the two-term factor complex with the three-term code complex. Over F2\mathbb{F}_2, where both factors are free and Künneth carries no Tor term, it is exact at the middle exactly when dim⁡ker⁡R⋅h0(C)\dim\ker R \cdot h_0(C) and dim⁡coker⁡R⋅h1(C)\dim\operatorname{coker} R \cdot h_1(C) both vanish, oszulFaultComplex_middleExact_iff. The criterion pairs the factor with the code, which the exhaustive probe over small factor–code pairs confirms. The homology of both factors must therefore enter an exactness test. A code complex whose h0h_0 and h1h_1 both vanish is exact at the middle against every factor, koszulFaultComplex_middleExact_of_codeCyclic. The assembly in Section S8 satisfies this exactness condition: both its factor map and the three-qubit code’s check map are surjective, as shown by idleVolume_middleExact_kunneth.

Machinery. The cone machinery of the surgery paper is formalized as a complex, a fault complex and a rank formula, Homology.MappingCone, Homology.FaultComplex and Homology.MappingConeSnake. Its mapping cone is defined in §2.2 and its rank formula is in Appendix A. The expansion machinery itself is formalized: modular expansion, the thickening theorem with its degree decomposition, and the constructive form of the distance-preservation corollary. Three further parts of the source argument are verified in their original form. First, its Theorem 7.7 in the first case of its proof, Case 1 here taken at the vertex set that the proof fixes rather than over every vertex set, distance_preserved_originalForm_caseOne. Second, venn_card_identity proves the seven-region counting step as an exact identity. Third, the round accounting of its intermediate-time theorem.

Ancilla counts for expansion alone. The census covers supports of three to eight vertices and cycle ranks up to three. It minimizes edges over edge multisets for the overall minimum and over simple graphs for fixed cycle ranks. Among the tested rows with a solution, the star-based witnesses use fewer edges than the complete graph except at K3K_3 with cycle rank one and K4K_4 with cycle rank three. Lean verifies the star and edge-addition constructions through expansionOne_star_six and expansionOne_append. At seven vertices, the three-chord star uses nine ancillas, while K7K_7 uses twenty-one. At eight vertices, the corresponding counts are ten and twenty-eight. The star-based graphs have cycle rank three, while the complete graphs have cycle ranks fifteen and twenty-one. These comparisons optimize the C1 edge count; cycle rank and the source’s additional low-density requirements are separate constraints. The archived Julia script reproduces the census. The theorems card_sub_one_length_of_hasExpansionOne and card_ge_of_finrank_cycleSpace prove the m−1m-1 and cycle-rank lower bounds.

Case 1 of Theorem 7.7 depends on the scope of the vertex-set quantifier. For positive target distance, requiring its condition for every vertex set is impossible because the minimum includes the empty set, as proved by not caseOneAll of pos. For the fixed vertex set used in the proof, caseOneAt_holds gives a verified instance. The theorem caseOneAt_boundary verifies the counting lemma on that instance; this is the three-step argument used in the spatial theorem of Section S4.

The round accounting of the intermediate-time theorem is a round count per term,

as printed: ⌈αi⌉\lceil\alpha_i \rceil rounds, under d/αi≤did/\alpha_i \le d_i,

taken tight: ⌈d/di⌉\lceil d/d_i \rceil, (S11)

Here did_i is the 1-cosystolic distance and αi>0\alpha_i > 0 is the parameter in the surgery theorem. For di>0d_i > 0, least_rounds_eq_ceil proves that ⌈d/di⌉\lceil d/d_i\rceil is the smallest integer round count nn satisfying d≤ndid \le nd_i. For the second proof case, hammingNorm_ge_of_connVanishes gives a bound when the coupling contribution vanishes on the fault. The theorem below treats every legal coupling under its construction hypotheses. The source construction uses the one-to-one attachment in formula (2) and the chain maps in its §4 and §5. For the related adapter construction, Eq. (9) of Swaroop, Jochym-O’Connor and Yoder extends each original check onto auxiliary paths pairing vertices in its port image. Its weight bound discards that auxiliary support, so it does not require the coupling contribution to vanish.

For the single-block model whose port covers every original data qubit, distance_preserved_of_blockReading proves the Z-type distance bound. The kernel of the deformed X checks is contained in the row space of the deformed Z checks, so this model has no nontrivial Z-type logical operator. Under the original-code distance bound and the stated construction and expansion assumptions, the free-coupling model gives a Z-type distance lower bound for every coupling satisfying the commutation conditions, including those with a nonzero contribution to the fault. This bound allows nontrivial logical operators; it does not require the port to cover all original data qubits. The deformed stabilizer space must contain the lifted original stabilizers and the vertex stabilizers, and the cycle checks must be complete. On the linear maps, once the cycle checks are complete, the admissible auxiliary vectors lie in the image of the boundary map. There a legal coupling is fixed by the requirement that the extended original rows commute with the vertex rows, so every legal coupling yields the same kernel and the same distance, legal_couplings_agree_on_cycles. Multiplying by vertex stabilizers removes the coupling contribution and leaves an operator whose original-data part is a nontrivial logical operator of the original code. The port’s weight condition keeps the correction no heavier than the boundary part it removes, so the bound holds without that contribution vanishing, distance_of_legal_coupling with expansion_cases. The port weight bound follows from injectivity on the disjoint union of the supports: each vertex carries at most one data qubit by portFiber_card_le_one, and summing these contributions gives the bound. The expansion bound starts from the source’s modular-expansion predicate evaluated on vector supports, expansionCriterion_of_modularExpansion; inf'_image_indOf_eq_modExpMin identifies its infimum with the source’s minimum, and expansion_cases gives the two-case bound when every representative is a cycle and the port weight bound holds. The search recorded by the free-coupling probe of the archived snapshot agrees with this. At distance three the criterion is settled as a disjunction: a valid kernel element lighter than the distance is a pair candidate or a purely auxiliary element, and conversely, couplingDrop_shape_three, the pure-data case being the one that is excluded, not_pureData_witness. The search witnesses couple some check to more than one auxiliary qubit and commute with every vertex check, so they satisfy the commutation conditions of our free-coupling matrix model; each fails the expansion condition required by the distance bound.

C4 and static distance. A same-round detector is a nonempty set of check rows summing to zero. The declarations hasLocalDetector_not_linearIndependent and hasLocalDetector_of_not_linearIndependent prove that such a detector exists exactly when the rows are dependent. The cosetopposite not hasLocalDetector_of_linearIndependent verifies C4 on independent check sets. Two versions of a two-qubit code, one full-rank and one with a repeated row, are decided directly in Lean. The bivariate decic instances also have dependent X checks, as recorded by the rank calculations supporting bb18_k and bb24_k.

Appending a redundant row preserves the kernel by ker_appendRow_of_mem_rowSpace and the row space by rowSpace_appendRow_of_mem_rowSpace. Both CSS distances are then unchanged, by min_weight_appendRow_of_mem_rowSpace and min_weight_not_mem_rowspace_of_appendRow. This invariance concerns the static code; measuring an extra check adds protocol resources. The duplicated-check protocol result below proves that adding an independent check-result fault location does not lower distance in the specified model.

The derivations below show that duplicating this check never lowers the specified protocol distance, at any round count. The detector-generating lemma uses a label model in which distinct labels can take arbitrary outcome values, while repeated occurrences of one label share an outcome. In this model, a parity combination vanishes for every allowed outcome assignment exactly when each label occurs an even number of times. Relations among dependent check operators must also be included when applying this model to their measurements. Within this label model, those combinations are generated by one operator across adjacent rounds, isDeterministic_iff_mem_span_pairForm; a comparison across a window of rounds is the sum of the adjacent ones, sum_adjPairVec_eq_windowVec. Dually, the faults no comparison can see are exactly the patterns constant on each measured operator, stabilizer_iff_const_on_labels, generated by the per-operator indicators, const_on_labels_iff_mem_span_classInd. At the two end rounds the operators are initialized and read out, and the deformation resets the state, so one operator need not repeat its outcome. An endpoint site with outcome fixed to zero imposes a constraint on its operator class, expressed by classSum_zero_of_isDetZ. The detector generators therefore include that single endpoint site, isDetZ.iff_mem_span. The spacetime check set SpacetimeChecks labels each site by a check and a round; the operator label identifies the check, and endpoint sites have fixed outcomes. The faults fire those sites through the differential of the fault complex, and a boundary fires none of them. Applying this check-set result to a circuit requires specifying how its elementary faults change the measurement outcomes.

The Künneth formula and the two foliations.

The Künneth formula the surgery paper applies to Eq. (5) is

dim⁡Hn(R⊗C)=∑i+j=ndim⁡Hi(R)dim⁡Hj(C),(20)\dim H_n(\mathcal{R} \otimes C) = \sum_{i+j=n} \dim H_i(\mathcal{R}) \dim H_j(C), \tag*{(20)}

with R\mathcal{R} the two-term factor complex of the foliation and CC the code complex. It is machine-checked in all four degrees, both on the family where the two-term factor has zero differential and in general, together with the two premises it rests on at every round count: the coefficient field is F2\mathbb{F}_2 and both factors are free. Instantiating the general formula at the repetition-code foliation and at its dual recovers the two closed forms the surgery paper prints, and with them the count of each logical fault type in terms of the code’s own homology dimensions.

For the general family, the differential has one block per factor, and dimension lemmas describe both blocks and the map sending a tensor product of cycles of CC and R\mathcal{R} into the third homology. The formula is proved as a dimension identity, not as an isomorphism of the homology groups themselves. For repetition-code foliation, the other summand vanishes, and the decomposition is also proved for individual vectors. Every cycle of the fault complex is the sum of a vector constant along the timeline and a boundary, so every class admits a representative constant along time. This proves a normal form for the specified repetition foliation; identifying it with the source protocol’s decoupling requires a correspondence between the fault complexes. The dual foliation has a spacelike normal form obtained from injectivity of its foliation map. When H0(C)≠0H_0(C) \ne0, the repetition-foliation distance proof shows that every nontrivial fault has a nonzero entry in each time slice and constructs a constant unit-vector witness, faultComplexDistanceZ_koszul_repR. For dual foliation, summing along time cannot increase weight and preserves nontriviality; a single-slice logical operator attains the code distance when such operators exist, faultComplexDistanceZ_koszul_repRdual. For comparison with the static dZd_Z in Section S13, take the adjacent code-complex maps to be dC1=HZdC_1 = H_Z and dC2=HXTdC_2 = H_X^{\mathsf{T}}. The code-side candidate set is then ker H_Z | rowSpace H_X. This theorem equates two natural-number infima, both of which are zero when their candidate sets are empty. The static function min_weight_ker_not_mem_rowspace instead returns n+1n+1 for an empty candidate set on nn coordinates, as recorded by static_empty_divergence. The equality with the static distance therefore assumes a nonempty logical set. The same analysis also gives a reusable identity: over Z2\mathbb{Z}_2 a vector lies in the column space of a matrix exactly when it is orthogonal to that matrix’s left kernel. When both summands are present, one decomposition theorem includes both normal forms as special cases. Write TT for the elements whose every C0C_0-fiber lies in the kernel of the foliation map, C0C_0 being the degree-zero part of the code complex CC. Every cycle of the fault complex is then the sum of a boundary, a spacelike vector and an element of TT, for a general two-term factor rather than only where one of the two summands vanishes, ker_koszulD0_lesup_general. The proof constructs the decomposition directly using linear projections. The timeline part is projected onto the image of the code differential. That projection commutes with the foliation map and is the identity on the image, so the difference between a cycle and its projection lies in TT, and what is left has a zero timeline part and therefore lies in the spacelike subspace. The repetition and dual normal forms follow as special cases of this decomposition. When the foliation map is injective, TT vanishes, which recovers the dual-side statement above. For the repetition-code factor, its kernel is spanned by the all-ones vector, so TT consists of constant families, recovering the repetition-code normal form.

The bijection between the fault complex and a graph state is a matrix identity, not an isomorphism of maps, which is what the surgery paper’s use of it requires. The surgery paper cites Hillmann, Dauphinais, Tzitrin and Vasmer for that formalism. Their paper prints that ∂2\partial_2 is the biadjacency matrix of the bipartite fault-tolerant graph state it builds over the fault locations, its FTGS. The biadjacency matrix is the block of an adjacency matrix that joins a bipartite graph’s two sides. In this development’s column-vector convention

∂2here=(∂2printed)T=BT,(21)\partial_2^{\mathrm{here}} = \left(\partial_2^{\mathrm{printed}}\right)^{\mathsf{T}} = B^{\mathsf{T}}, \tag*{(21)}

and both the formula and its round trip are formalized here. The half of the correspondence that names the detectors is the Hillmann et al. definition rather than a consequence of the other half. The consequence the surgery paper draws from it at p. 63, that a fault complex cannot describe protocols with input or output qubits, is not formalized.

The counting lemma’s own boundary. Its cycle space enters in algebraic form, the kernel of the transpose of the incidence map, here written inc with one row per edge and one column per vertex. The cycle space is also formalized in classical form. That space is spanned by the graph’s cycles, the minimal nonempty even subgraphs, venSubgraphSpace_eq_span_minCycle. Meeting every cycle evenly and meeting every even subgraph evenly are therefore one test:

even subgraphs=ker⁡inc⁡T,E a cut⟺E⊥ every even subgraph,(22)\text{even subgraphs} = \ker\operatorname{inc}^{\mathsf{T}}, \qquad E\text{ a cut} \Longleftrightarrow E \perp\text{ every even subgraph}, \tag*{(22)}

the lemma’s first step is that equivalence, cut_iff_forall_dot_evenSubgraph; the cut’s size then follows, hammingNorm_mulVec_indVec_eq_cutSize. The remaining hypotheses of Theorem 2 are the structural facts of Lemma 1 of the gauging paper’s Methods, packaged as one object rather than constructed:

[deformed check, Av]=0for every v⟺deg⁡odd(E)=supp⁡(the check),(23)[\text{deformed check},\, A_v] = 0\quad\text{for every }v \Longleftrightarrow\operatorname{deg}_{\mathrm{odd}}(E)=\operatorname{supp}(\text{the check}), \tag*{(23)}

a deformed check commutes with every Gauss law exactly when its edge set has odd-degree vertices exactly at the check’s support. Cycle checks commute automatically, and such an edge set exists whenever the auxiliary graph is connected and loop-free and the support has even cardinality. The auxiliary graph is taken on all the code qubits of that instance, so the gauging paper’s dummy vertices, vertices carrying a check and no data qubit, are not modeled. The weights are read off one explicit check set, instance by instance. The lemma’s general case, an expansion factor below one, is not claimed. Section S10 records where the 1-cosystolic classification stops.

Three protocol derivations, step by step

Each round of the Bacon–Shor persistent-fault readout model has twenty independent fault locations: nine data, two check-result and nine readout positions. The check-result positions are called ancilla faults in the implementation. The numerical implementation uses this order; the formal implementation swaps the ancilla and readout blocks, preserving weight. Data errors persist, so round tt contains the cumulative error cumt=∑s≤tds\mathrm{cum}_t=\sum_{s\leq t}d_s. Let μt\mu_t and γt\gamma_t be the readout and check-result errors in that round. The check parities and logical parity use the same noisy data record cumt+μt\mathrm{cum}_t+\mu_t; independent check-result flips γt\gamma_t are then added. With in-round check matrix HH and logical parity support ww, the syndrome and readout-error bit are

σt=H(cumt+μt)+γt,rt=w⋅(cumt+μt),(24)\sigma_t=H(\mathrm{cum}_t+\mu_t)+\gamma_t,\qquad r_t=w\cdot(\mathrm{cum}_t+\mu_t), \tag*{(24)}

The bit rtr_t is one exactly when round tt’s readout differs from the ideal logical value. The strict-majority distance dmajd_{\mathrm{maj}} requires 2∣{t:rt=1}∣>T2|\{t:r_t=1\}|>T, as defined in Eq. (2). At T=2T=2, a final-round data fault on qubit zero with a canceling check-result fault has weight two, zero syndromes and (r0,r1)=(0,1)(r_0,r_1)=(0,1). A first-round readout fault with its canceling check-result fault instead gives (1,0)(1,0). These weight-two ties lie outside the strict-majority predicate.

A decoder failure distance requires its observed inputs and a decision or rejection rule for ties.

The boundary detector imposes σ0=0\sigma_0=0. Together with adjacent comparisons, it forces every syndrome to zero, making an additional terminal syndrome constraint redundant. Endpoint fault pairs are allowed when their syndrome contributions cancel. Deleting this detector studies the present accumulation model, without the surrounding error correction used in the source protocol.

The lower bound for every round count. Let ff be a fault of weight at most two that fires no detector. First, every syndrome vanishes: the boundary detector gives σ0=0\sigma_0=0, each comparison σt+σt−1=0\sigma_t+\sigma_{t-1}=0 propagates it forward, and that is bsDetectorsOK_syndrome_eq_zero. Second, on a round untouched by μ\mu and γ\gamma the syndrome is H cumtH\,\mathrm{cum}_t alone, hence

H cumt=0,wt⁡(cumt)≤wt⁡(f)≤2<3,(25)H\,\mathrm{cum}_t=0,\qquad\operatorname{wt}(\mathrm{cum}_t)\leq\operatorname{wt}(f)\leq2<3, \tag*{(25)}

where the weight bound holds because a sum of data errors weighs no more than their total. The data-only readout bound implies w⋅v=0w\cdot v=0 for every vector in the check kernel of weight below three, so rt=0r_t=0. Third, a round with rt=1r_t=1 must therefore carry a nonzero μt\mu_t or γt\gamma_t of its own. A fault pattern of weight at most two has nonzero fault bits in at most two rounds. At most two of the TT readouts can then be one, and a majority needs more than T/2T/2 of them, so T/2<2T/2<2, that is T≤3T\leq3. That is the whole proof of bsHook_no_light_of_four, the case of four rounds and up. The two counts below it are kernel enumerations, bsHook_T2_distance_eq_three and bsHook_T3_distance_eq_three, and bsHook_distance_eq_three_universal is the three cases together. The weight-three witness that matches it from above is the spatial logical operator held as a data error from round zero on, hookW3gen_witness, whose syndrome is zero in every round because HH kills it and whose every readout is one.

Duplicating a check. Duplicate the first check row and give the copy its own check-result fault location, so a round can have twenty-one locations and the syndrome has three components; the third uses the first check row but has an independent check-result fault bit. The projection deletes the new location and reads the original twenty. Data faults, readout faults and the original check-result faults retain their original locations, so every readout is unchanged. The projected fault weighs no more than the fault it came from, one location having been dropped. The new detector conditions include all the old ones, which are the first two syndrome components. A fault of weight at most ss that fires no detector in the twenty-one-location model would therefore project to one of weight at most ss in the twenty-location model, which is hookCandDup_no_light_of. The duplicated check never lowers the fault distance, at any round count. At one round the duplication raises the fault distance from two to three: concealing a single data fault that flips the logical parity requires two independent check-result faults, one for each copy of the first check, as verified by `hookCandDup_T1_n o_light_two and dupHook_T1 witness. The one-round closed form. At a single round the accumulation is the round’s own data error, and the boundary detector σ0=0\sigma_0 = 0 reads γ0=H(d0+μ0)\gamma_0 = H(d_0 + \mu_0). The check-result error must cancel the syndrome of everything else. Merge the data and measurement errors into y=d0+μ0y = d_0 + \mu_0. The readout is r0=w⋅yr_0 = w \cdot y, so a logical fault needs w⋅y=1w \cdot y = 1, and the fault’s weight is

wt⁡(d0)+wt⁡(μ0)+wt⁡(Hy)≥wt⁡(y)+wt⁡(Hy),(26)\operatorname{wt}(d_0) + \operatorname{wt}(\mu_0) + \operatorname{wt}(Hy) \ge\operatorname{wt}(y) + \operatorname{wt}(Hy), \tag*{(26)}

because weights are subadditive, and equality is available by taking μ0=0\mu_0 = 0. The witness puts yy in the data locations and HyHy in the check-result locations, t1Wit, of weight exactly the right-hand side. The lower bound and this witness prove the equality in bsHook_T1_formula. On the [[9,1,3]][[9,1,3]] code the minimum is two, attained at y=e0y = e_0, one data fault and the check-result fault that cancels its syndrome, bsHook_T1_min and bsHook_T1_distance_eq_two_formula.

Conventions

Matrix-indexed distance conventions

We write [[n,k,d]][[n,k,d]] for a code with nn physical qubits, kk logical qubits and distance dd. The formal development labels each CSS distance by the matrix used as its kernel. Thus dXd_X minimizes weight in ker⁡HX\ker H_X outside the row space of HZH_Z, and dZd_Z minimizes weight in ker⁡HZ\ker H_Z outside the row space of HXH_X. Consequently, dXd_X describes physical ZZ-type logical operators, and dZd_Z describes physical XX-type logical operators. Some texts interchange these names; the numerical values should be compared using the defining matrix, not the subscript alone.

KmK_m is the complete graph on mm vertices. The Cheeger constant h(G)h(G) is the minimum of ∣∂S∣/min⁡(∣S∣,∣Sc∣)|\partial S|/\min(|S|,|S^c|) over nonempty proper vertex sets. The formal indicator η\eta is one when C1 holds and zero otherwise, so η=1\eta= 1 exactly when h(G)≥1h(G) \ge1 in this setting. TT is the repeated-measurement round count, UU is the vertex set in Theorem 2, and to−tit_o - t_i is the number of rounds between deformation steps.

X and Z labels. dXd_X and dZd_Z name the two side distances and are defined by which check matrix plays the role of the kernel,

dX=min⁡{wt⁡(v):v∈ker⁡HX, v∉rowspace⁡HZ},d_X = \min\{\operatorname{wt}(v) : v \in\ker H_X,\ v \notin\operatorname{rowspace} H_Z\},
dZ=min⁡{wt⁡(v):v∈ker⁡HZ, v∉rowspace⁡HX},(27)d_Z = \min\{\operatorname{wt}(v) : v \in\ker H_Z,\ v \notin\operatorname{rowspace} H_X\}, \tag*{(27)}

In this convention, dXd_X describes physical ZZ-type logical operators, and dZd_Z describes physical XX-type ones. Some texts swap the labels. The declarations libDX and textbookDX and their swap lemmas verify the relation. The distinction matters when the two components differ.

Two formal witnesses gauge logical operators of the smallest toric code [[8,2,2]][[8,2,2]] on different supports. The losing graph has edges (0,2)(0,2), (0,4)(0,4), (4,5)(4,5) on four support qubits and produces an eleven-qubit code. Its distances are dX=5d_X = 5 and dZ=1d_Z = 1, certified by sepFail_dx and sepFail_dz. The preserving graph has edges (0,1)(0,1), (0,2)(0,2), (0,3)(0,3), (0,4)(0,4), (1,3)(1,3), (4,5)(4,5) on six support qubits and produces a fourteen-qubit code. Its distances are dX=3d_X = 3 and dZ=2d_Z = 2, certified by sepKeep_dx and sepKeep_dz. Both graphs violate C1; the six-vertex graph fails at {4,5}\{4,5\}, which has only one outgoing edge. Weight-two support {0,2}\{0,2\} and weight-one support {9}\{9\} provide the respective dZd_Z witnesses, sepKeep_lightLogical_two and sepFail_lightLogical.

The main figure uses a different pair with the same logical support 0,2,4,50,2,4,5. Its losing path is the four-vertex graph above, while its preserving path has edges (0,4)(0,4), (2,5)(2,5), (4,5)(4,5). The preserving path has dZ=2d_Z = 2 and no weight-one logical operator on either side, giving dX≥2d_X \ge2. These claims are sepFail_summary and sepKeepPath_summary; an exact dXd_X for the preserving path is not asserted. Relabeling the support in increasing order gives edge lists [(0,1),(0,2),(2,3)][(0,1),(0,2),(2,3)] and [(0,2),(1,3),(2,3)][(0,2),(1,3),(2,3)]. Both fail C1 at the two-vertex cut with one outgoing edge. Both inherit a same-round detector from the original X-check dependencies and therefore violate C4. The Shor [[9,1,3]][[9,1,3]] code provides a contrasting C4-satisfying example with eight independent generators, shor-generators_independent. The other named instances with both distances computed have equal components, as recorded in the _dx_eq_dz ledger.

Distance. When nontrivial operators exist, each static CSS distance component is the minimum weight in one check kernel outside the other check row space; protocol distances use their specified detector and readout-error predicates. The finite static instances are computed from weight-limited enumeration, with a kernel-checked covering lemma, mem_lightVecs:

∣{v:wt⁡(v)<d}∣=∑j<d(nj)≤dnd−1(n≥1),(28)\left|\{v : \operatorname{wt}(v) < d\}\right| = \sum_{j<d} \binom{n}{j} \le d n^{d-1}\qquad(n \ge1), \tag*{(28)}

The equality length_lightVecs counts the generated weight list, and lightCand_length_le bounds the candidate list by this count. The polynomial bound follows term by term: each (nj)≤nd−1\binom{n}{j} \le n^{d-1} for j≤d−1j \le d-1, and there are dd terms. It is polynomial at fixed dd and supports the small-distance calculations reported here. If the threshold exceeds nn, the generated weight list contains all 2n2^n binary vectors.

Undetectable logical fault. In a protocol, a candidate must fire no detector and satisfy the specified readout-error predicate. A chosen linear parity and a strict-majority rule define different predicates. For the static specialization, flipsReadout_readoutsOff_iff equates non-membership in a check row space with flipping some readout in its orthogonal complement. A selected logical parity tests a subset of the faults relevant to the full static distance.

Supplements are cited by the numbering of the gauging paper’s published Supplementary Information: the time fault-distance identity is its Lemma 3, the boundary convention its Remark 3, and the no-local-detector assumption its Remark 2. The arXiv v2 numbers the same three statements Lemma 6, Remark 5 and Remark 4.

Symbols. mm is the number of checks of the repeated measurement in the temporal instance, and TT the number of rounds. In the expansion conditions mm is the size of the support the logical operator acts on, and KmK_m the complete graph on it. In the bivariate bicycle instances mm is the second shift parameter, and in the toric family it is the cycle length. WW is the chosen component family of the auxiliary hypergraph, and fpf_p is the port function defined in the surgery paper’s construction. That paper’s §7 re-uses WW for the subspace the port images generate, so a reader following the symbol there meets the second reading. The two-term factor complex of the foliation is written R\mathcal{R} in the Künneth formula, and RR denotes its differential matrix. Its repetition-code instances are rep⁡Rℓ\operatorname{rep}_{R}\ell, whose matrix has ℓ\ell rows and ℓ+1\ell+1 columns. The number of time coordinates is therefore T=ℓ+1T=\ell+1.

The assembly in the source’s notation

The source’s spatial bound is dspatial≥min⁡(h(G),1)⋅dd_{\mathrm{spatial}} \ge\min(h(G),1)\cdot d, with h(G)h(G) defined in Section S13. Combined with enough rounds, the two component statements read

min⁡(1,h(G))⋅d≤dspatialanddtemporal=T≥d,(29)\min(1,h(G))\cdot d \le d_{\mathrm{spatial}} \quad\text{and}\quad d_{\mathrm{temporal}}=T\ge d, \tag*{(29)}

C1 gives h(G)≥1h(G)\ge1, making the spatial prefactor in Eq. (29) equal to one. The formal development uses the indicator η\eta rather than the full Cheeger constant. It therefore verifies the expansion-at-least-one regime, without claiming the source’s h(G)dh(G)d bound when h(G)<1h(G)<1. The XX-type spatial theorem and temporal identity are proved separately. The assembled arithmetic statement takes these two component facts as hypotheses; it does not build a common circuit model.

The one-round protocol

We prove Eq. (15) by matching lower and upper bounds. Write the one-round data, readout and check-result errors as d0d_0, μ0\mu_0, γ0\gamma_0, and set y=d0+μ0y=d_0+\mu_0. The zero-syndrome condition requires γ0=Hy\gamma_0=Hy, and a logical readout error requires w⋅y=1w\cdot y=1. Since the fault blocks are disjoint, the total weight is wt⁡(d0)+wt⁡(μ0)+wt⁡(γ0)\operatorname{wt}(d_0)+\operatorname{wt}(\mu_0)+\operatorname{wt}(\gamma_0). Subadditivity gives wt⁡(d0)+wt⁡(μ0)≥wt⁡(y)\operatorname{wt}(d_0)+\operatorname{wt}(\mu_0)\ge\operatorname{wt}(y), so every candidate has weight at least wt⁡(y)+wt⁡(Hy)\operatorname{wt}(y)+\operatorname{wt}(Hy). Conversely, choose d0=yd_0=y, μ0=0\mu_0=0 and γ0=Hy\gamma_0=Hy. This fault has zero syndrome Hy+Hy=0Hy+Hy=0, readout w⋅y=1w\cdot y=1 and weight exactly wt⁡(y)+wt⁡(Hy)\operatorname{wt}(y)+\operatorname{wt}(Hy). Minimizing over admissible yy proves the identity.

The counting lemma, step by step

The coordinate argument below expands the three steps of Theorem 2. Let FF be a physical XX-type operator in the deformed ZZ-check kernel but outside the deformed XX-check row space. Let SS and EE be its supports on vertex and edge qubits, and let RR be its support outside the auxiliary graph.

Step one: cut–cycle duality. Since FF commutes with the cycle checks, EE meets every cycle evenly. Cut–cycle duality gives E=∂UE=\partial U for some vertex set UU. Replacing UU by its complement leaves the cut unchanged, so choose ∣U∣≤∣Uc∣|U|\le|U^{\mathrm{c}}|.

Step two: cleaning. Multiply FF by the Gauss laws indexed by UU. Each vertex in UU is flipped once. An edge is flipped once if it leaves UU, and zero or twice otherwise. Thus the product has vertex support UU and edge support ∂U\partial U, as in Eq. (10). The edge support cancels EE, leaving S△US\triangle U on vertices and RR outside the graph. Multiplication by checks preserves membership in the check kernel and non-membership in the stabilizer row space.

Step three: counting. With no edge support, the cleaned operator commutes with the original ZZ checks. The lifted original XX checks lie in the deformed XX-check row space. Hence nontriviality in the deformed code implies nontriviality of the cleaned operator in the original code. Its weight is at least dd, giving the first inequality of Eq. (11). The set identity ∣S△U∣=∣S∖U∣+∣U∖S∣≤∣S∣+∣U∣|S\triangle U|=|S\setminus U|+|U\setminus S|\le|S|+|U| gives the second. C1 and the choice of the smaller side give ∣U∣≤∣∂U∣|U|\le|\partial U|, yielding the third. The final expression counts the disjoint vertex, edge and outside supports of FF and equals its weight. The construction hypotheses therefore imply both the smaller-side choice and the logicality of the cleaned operator.

Axiom audit

The proof assistant prints the axiom dependencies of every declaration in the audit region. Of the 1,031 audited declarations, 1,009 use exactly the standard base {propext,Classical.choice,Quot.sound}\{\texttt{propext},\texttt{Classical.choice},\texttt{Quot.sound}\}, 17 use a proper subset and 5 use none. No audited declaration uses reflection or compiler evaluation, and the development contains no unproved step.

Audit procedure

At the end of the root module, the proof assistant prints every declaration in the audit region together with the axioms it uses. The audit script checks that each declaration belongs to the build closure, lists every unaudited declaration for manual review and compares the four class counts with the values reported above. A mismatch fails the build-time gate, and a stale log is marked as unmeasured. The 17 declarations in the proper-subset class rest on propext alone, on Quot.sound alone, or on propext together with Quot.sound.

S18 Reproduction

  1. Readout and circuit bounds. The scripts in research/prxq-strengthening check the formulas in the first proof section. The Julia script verify_exact_distances.jl supplies the finite dynamic programs; gate_signature_check.py independently checks the saved CNOT schedules by backward Pauli propagation. The script circuit_schedule_bound.py verifies every eligible constructive witness on those schedules, on two serial schedules and on 128 additional interleavings. It also checks all 120 local orderings of a five-interaction example. These finite checks accompany the direct proofs; they establish no optimum over all circuits.

  1. Build. lake build, run in the development directory of the archived snapshot named in the paper’s data-availability statement, fetches every dependency from its pinned revision, so no machine-local path is configured. One of those dependencies is the QECCertificates package, which ships the modules named throughout this supplement and is pinned like the rest. On a machine that has not built mathlib before, lake exe cache get is run first. The build ends with the audit lines summarized in § 1.29 of this supplement.

  1. Audit. The classification is read off those lines and then checked against the build log. A declaration whose list is not a subset of the three standard axioms, or one that mentions a reflection axiom, fails the counting gate, which compares the transcribed numbers with what the build printed.

  1. Numbers. Every instance parameter and all three families are recomputed by the kernel during the build: the instance parameters by a by decide evaluation over finite Z2\mathbb{Z}_2 data, the three families by general theorems; every point of the data figure is a kernel assertion, and the second implementation below recomputes all of them independently. The instance table covers seven code families and sixteen parameter sets. Each parameter set has its check matrices written out, and both its dimension and its exact distance are settled by by decide.

  1. Enumerations. Several computations are Julia scripts in that snapshot, run from its code directory as julia --project=<code-directory> <script>. They are the enumerations behind the data figure; the classification of the expansion condition over every measured logical of support at most six and every connected auxiliary graph on its support, on the two smallest members of the toric family; and the condition-cost census. Each carries assertions on the values this paper quotes from it, and the figure’s script asserts every value it shares with a kernel-checked distance. The classification covers 107,428 pairs on the [[8,2,2]][[8,2,2]] code and 1,388,136 on the [[18,2,3]][[18,2,3]] one; the support-size cap excludes no logical operator on the first code, where none is heavier than six, and restricts the search to supports of size at most six on the second. Each deformed check is completed by a minimum-weight edge set satisfying the source’s parity condition. Minimum weight is a choice of this numerical implementation, not an additional requirement of the source’s definition. On both codes every instance meeting the condition keeps the code’s distance. The XX-side reading is recorded in the same snapshot, and no instance on either code carries an XX-side logical below the code distance.

  1. A control model. The data files also carry a further fault model, over the same detector set with the criterion requiring a strict majority of wrong readouts replaced by a flip of the last round’s readout. Its distances at T=1,2,3,4T=1,2,3,4 are 2, 2, 2, 2, where the strict-majority model gives 2, 3, 3, 3: a final-round data fault and its canceling check-result fault suffice at every round count. This numerical control is not among the twelve kernel-certified points drawn in the figure. Its regression tests distinguish a last-round flip from flipping every round and explicitly check the two-round ties.

  1. Cross-checks. The independent probes used as further cross-checks are two Julia scripts for the two foliation distances, over 202 and 3564 small instances respectively, with no counterexample to the closed form each tests. The dual one was run beside two competing closed forms, (ℓ+1)dZ(\ell+1)d_Z and ℓdZ\ell d_Z, with ℓ\ell the length of the repetition factor, and refutes each of them, on 2286 and 1524 instances. The census carries its own checker beside it. A third probe, in the snapshot’s own tools directory, tests the Künneth identity of the foliated construction for general factor differentials RR over 136 random pairs of chain complexes, with no counterexample to the formula, and uses the zero-differential case R=0R=0 as a control. The remaining probes in that directory are cross-checks, not sources of quoted numbers.

  1. The gauging step. The step itself is carried inside the kernel. The development builds the Gauss laws, pairing edges and cycle checks from the K4K_4 data and checks them entrywise against the matrices of the modules listed in Table S3. It states two facts as theorems: the measured operator’s promotion to a check, bb24L_mem_rowSpace, and the dimension drop, bb18_gauged_drop. The numerical prototype is the independent second path of the step.

References

  1. [6]S. Bravyi, A. W. Cross, J. M. Gambetta, D. Maslov, P. Rall, and T. J. Yoder, High-threshold and low-overhead fault-tolerant quantum memory, Nature 627, 778 (2024).DOI
  2. [14]Supplemental material, see Supplemental Material at [URL will be inserted by publisher] for the module map, the conventions the numbers depend on, the axiom audit, and the commands that reproduce every number quoted here.. (n.d.). Supplemental material, see Supplemental Material at [URL will be inserted by publisher] for the module map, the conventions the numbers depend on, the axiom audit, and the commands that reproduce every number quoted here..
  3. [15]S. An and F. Yang, The cost of each side condition in a gauged logical measurement (2026), version 0.3, formal development and numerical data.DOI
  4. [16]S. An, QECCertificates: checkable distance certificates for quantum error correction (2026).DOI
  5. [17]G. Lee, Gauging the spacetime code (2026), arXiv:2606.05664.arXiv
  6. [18]A. Cowtan, Z. He, D. J. Williamson, and T. J. Yoder, Fast and fault-tolerant logical measurements: auxiliary hypergraphs and transversal surgery (2025), arXiv:2510.14895.arXiv
  7. [19]D. Bacon, Operator quantum error-correcting subsystems for self-correcting quantum memories, Phys. Rev. A 73, 012340 (2006).DOI
  8. [20]P. Aliferis and A. W. Cross, Subsystem fault tolerance with the Bacon-Shor code, Phys. Rev. Lett. 98, 220502 (2007).pubmed.ncbi.nlm.nih.gov/17677825
  9. [21]E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, Topological quantum memory, J. Math. Phys. 43, 4452 (2002).DOI
  10. [22]Bravyi, S., & Hastings, M. B. (2014). Homological product codes. Proceedings of the 46th Annual ACM Symposium on Theory of Computing (STOC), 273–282.
  11. [23]Ehatamm, M., Lee, Y., Wu, X., & Tao, R. (2026). End-to-end formalization of quantum error correction. https://github.com/VerifiedQC/Lean-QECgithub.com/VerifiedQC/Lean-QEC
  12. [24]Jain, S. (2025). QECLean: Formalized quantum error correction. GitHub Repository.
  13. [25]T. Hillmann, G. Dauphinais, I. Tzitrin, and M. Vasmer, Single-shot and measurement-based quantum error correction via fault complexes, Phys. Rev. A 112, L040401 (2025).DOI
  14. [26]A. C. Yuan, A. Cowtan, Z. He, T.-C. Lin, and D. J. Williamson, Parsimonious quantum low-density parity-check code surgery (2026), arXiv:2603.05082.arxiv.org/abs/2603.05082
  15. [27]A. Cowtan, Z. He, D. J. Williamson, and T. J. Yoder, Parallel logical measurements via quantum code surgery, PRX Quantum 7, 020325 (2026).DOI
  16. [28]E. Swaroop, T. Jochym-O’Connor, and T. J. Yoder, Universal adapters between quantum low-density parity check codes, PRX Quantum 7, 010324 (2026).DOI
  17. [29]D. J. Williamson, Fast magic state preparation by gauging higher-form transversal gates in parallel (2026), arXiv:2601.22939.arxiv.org/abs/2601.22939
  18. [30]N. Delfosse and A. Paetznick, Spacetime codes of Clifford circuits (2023), arXiv:2304.05943.arxiv.org/abs/2304.05943
  19. [31]S. B. Bravyi and A. Y. Kitaev, Quantum codes on a lattice with boundary (1998), arXiv:quant-ph/9811052.DOI
  20. [32]A. G. Fowler, M. Mariantoni, J. M. Martinis, and A. N. Cleland, Surface codes: Towards practical large-scale quantum computation, Phys. Rev. A 86, 032324 (2012).DOI
  21. [33]A. Bolt, G. Duclos-Cianci, D. Poulin, and T. M. Stace, Foliated quantum error-correcting codes, Phys. Rev. Lett. 117, 070501 (2016).DOI
  22. [34]Y. Xu, Y. Wang, and Z.-W. Liu, A framework for low-overhead quantum fault tolerance via spacetime lifting (2026), arXiv:2606.06365.arxiv.org/abs/2606.06365
  23. [35]B. Hetényi, B. J. Brown, and D. J. Williamson, Constant-depth magic state cultivation with Clifford measurements by gauging, Phys. Rev. Lett. 137, 140601 (2026).DOI
  24. [36]Evra, S., Kaufman, T., & Zémor, G. (2024). Decodable quantum LDPC codes beyond the $\sqrt{n}$ distance barrier using high-dimensional expanders. SIAM J. Comput., 53, FOCS20–276.
  25. [37]T. Kaufman and I. Oppenheim, High order random walks: Beyond spectral gap, Combinatorica 40, 245 (2020).arxiv.org/abs/1707.02799
  26. [38]A. Lubotzky, High dimensional expanders, in Proceedings of the International Congress of Mathematicians (ICM 2018) (World Scientific, 2019) pp. 705–730.arxiv.org/abs/1712.02526
  27. [39]Y. Dikstein and I. Dinur, Coboundary and cosystolic expansion without dependence on dimension or degree, in Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM 2024), LIPICS, Vol. 317 (Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024) pp. 62:1–62:24.arxiv.org/abs/2304.01608
  28. [40]A. Vardy, The intractability of computing the minimum distance of a code, IEEE Trans. Inf. Theory 43, 1757 (1997).DOI
  29. [41]S. Wu, D. Zhong, T. A. Brun, and D. A. Lidar, Universal weakly fault-tolerant quantum computation via code switching in the [[8, 3, 2]] code, Phys. Rev. Research 8, 033380 (2026).DOI
  30. [42]A. W. Cross, Z. He, P. J. Rall, and T. J. Yoder, Improved QLDP code surgery: logical measurements and bridging codes (2024), arXiv:2407.18393.arxiv.org/abs/2407.18393
  31. [43]B. Ide, M. G. Gowda, P. J. Nadkarni, and G. Dauphinais, Fault-tolerant logical measurements via homological measurement, Phys. Rev. X 15, 021088 (2025).DOI
  32. [44]L. Berent, L. Z. Cohen, and A. O. Quintavalle, Lifted surgery: Fast processing with qldpc codes (2026), arXiv:2609.11723.arxiv.org/abs/2609.11723

Paper details

vlnc:W_r3fmeacf
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

DeepSeek V4.1 Flash (bare), OpenAI Codex (GPT-6)

View statement
Looking for related papers…
Contents