Skip to content

A subsystem code stores information in one factor of an encoded Hilbert space while allowing another factor, called the gauge subsystem, to change. Gauge measurements can therefore simplify error correction without preserving every encoded degree of freedom. The distinction is physical: changing a gauge qubit is harmless to the protected information; changing a logical qubit is not.

We first make that distinction explicit in four qubits, then develop the Bacon–Shor family and its decoding limits. Low-weight gauge measurements are useful, but neither their weight nor the static code distance determines the reliability of a complete recovery circuit.

Required background. Why Quantum Error Correction Is Possible explains error spans and exact correctability. Stabilizer Formalism supplies Pauli commutation and independent stabilizer counts.

Helpful background. Syndrome Measurement distinguishes a measured observable from the circuit that realizes it. Shor Code gives a related nine-qubit subspace code.

Choose an encoded sector with projector PP and decomposition

H=(HL⊗HG)⊕HR.\mathcal H=(\mathcal H_L\otimes\mathcal H_G)\oplus\mathcal H_R.

Here LL carries the protected information, GG is the gauge subsystem, and RR is the unused remainder. A typical input is ρL⊗ρG\rho_L\otimes\rho_G, with arbitrary gauge state. An operation IL⊗UGI_L\otimes U_G changes the physical state but leaves ρL\rho_L intact. Gauge qubits are generally distributed encoded degrees of freedom, not physical sites set aside and left unused.

For an error set {Ea}\{E_a\}, the operator-QEC condition is

PEa†EbP=IL⊗Mab,PE_a^\dagger E_bP=I_L\otimes M_{ab},

with the equality understood on the encoded sector. It requires every pairwise error product to act trivially on LL after projection, while permitting an operator MabM_{ab} on GG. When GG is one dimensional, MabM_{ab} becomes a scalar and the ordinary Knill–Laflamme condition returns. Kribs and collaborators (2006) develop this generalization; the linked correctability page gives the underlying recovery argument.

A recovery can restore ρL\rho_L while replacing ρG\rho_G. It need not reverse the physical error on every encoded degree of freedom. Correctability is required for the declared error span and all protected inputs, including inputs entangled with an external reference. It does not establish the reliability of a noisy recovery implementation.

There is a subtle distinction between preserving an unconditional state and preserving every conditional state. A gauge measurement has operators IL⊗KmI_L\otimes K_m. On a product input its outcome probabilities are independent of ρL\rho_L, and every nonzero branch preserves that logical state. On an initially correlated LGLG state, selecting an outcome can change the conditional state of LL, just as measuring one member of an entangled pair can steer the other. Ignoring the gauge outcome leaves the reduced state on LL unchanged. Exercise 1 works through this distinction.

Number a square as 1,21,2 across the top and 3,43,4 across the bottom. Take four Hermitian gauge generators

A=X1X2,B=X3X4,C=Z1Z3,D=Z2Z4.\begin{aligned} A&=X_1X_2,&B&=X_3X_4,\\ C&=Z_1Z_3,&D&=Z_2Z_4. \end{aligned}

The two horizontal operators commute, as do the two vertical operators. Every horizontal operator anticommutes with every vertical one because they overlap once. Their products

SX=AB=X1X2X3X4,SZ=CD=Z1Z2Z3Z4\begin{aligned} S_X&=AB=X_1X_2X_3X_4,\\ S_Z&=CD=Z_1Z_2Z_3Z_4 \end{aligned}

commute with all four generators. Restrict to their common +1+1 eigenspace. Its dimension is 24−2=42^{4-2}=4: enough for one logical and one gauge qubit.

Within that space, choose

XL=X1X3,ZL=Z1Z2,XG=A,ZG=C.\begin{aligned} X_L&=X_1X_3,&Z_L&=Z_1Z_2,\\ X_G&=A,&Z_G&=C. \end{aligned}

The logical pair anticommutes, the gauge pair anticommutes, and every logical operator commutes with every gauge operator. This identifies two independent qubit algebras. Since AB=CD=IAB=CD=I on the encoded sector, BB acts as the same gauge XX as AA, and DD as the same gauge ZZ as CC.

A starting encoded state is

∣0L0G⟩=∣0000⟩+∣1111⟩2.|0_L0_G\rangle=\frac{|0000\rangle+|1111\rangle}{\sqrt2}.

Applying XLX_L and XGX_G generates the other three basis states. This gives an explicit tensor-factor identification rather than just a dimension count. Notice that the state of one gauge qubit is spread over all four physical qubits.

Why the order of gauge measurements matters

Section titled “Why the order of gauge measurements matters”

In the SX=+1S_X=+1 sector, measuring AA and then BB gives outcomes a,b∈{+1,−1}a,b\in\{+1,-1\} with b=ab=a. Their product correctly reports SX=+1S_X=+1, even though either individual outcome can be random.

Now measure AA, then CC, then BB. After the first measurement the gauge qubit has a definite XGX_G value. Measuring C=ZGC=Z_G erases that information, so the final B=XGB=X_G result is equally likely to be either sign. The product abab is wrong half the time, despite perfect measurements and no physical errors. Every measurement still commutes with SXS_X and preserves the logical subsystem. The failure is in the inference from results obtained at incompatible times.

Four-qubit gauge square and two measurement sequences showing reliable and randomized stabilizer products

In the common +1+1 stabilizer sector, AA and BB represent the same gauge XX. Measuring the anticommuting gauge operator CC between them destroys their outcome correlation. Both sequences leave the protected logical information intact when the gauge record is ignored; only the first product is a valid measurement of SXS_X.

For a general central stabilizer S=G1⋯GqS=G_1\cdots G_q, a consecutive joint measurement of commuting factors gives its eigenvalue by multiplying their signed outcomes. Interleaving other gauge measurements requires a fresh analysis of the resulting instrument. Suchara, Bravyi, and Terhal (2011) develop conditions for valid syndrome inference from gauge sequences. Even a valid ideal instrument still needs a circuit that controls ancilla fault propagation and readout errors.

Gauge groups, logical operators, and distance

Section titled “Gauge groups, logical operators, and distance”

Let G\mathcal G be the physical Pauli gauge group, including scalar phases Φ=⟨iI⟩\Phi=\langle iI\rangle. For binary ranks write G‾=G/Φ\overline{\mathcal G}=\mathcal G/\Phi. Multiplication modulo phase is abelian; the binary symplectic form retains the information about anticommutation of physical representatives. For a binary Pauli subspace VV, let V⊥V^\perp denote its symplectic orthogonal.

The stabilizer directions are

S‾=G‾∩G‾⊥.\overline{\mathcal S} =\overline{\mathcal G}\cap\overline{\mathcal G}^{\perp}.

Choose consistent Hermitian signs to define a signed stabilizer group S\mathcal S without −I-I. Its +1+1 sector is nonempty. The full group center also includes scalar phases, so it is ΦS\Phi\mathcal S, not the signed stabilizer group alone.

If the stabilizer rank is ss and the gauge algebra has rr independent anticommuting pairs, then

n=s+k+r,dim⁡G‾=s+2r.\begin{aligned} n&=s+k+r,\\ \dim\overline{\mathcal G}&=s+2r. \end{aligned}

The code is written [[n,k,r,d]][[n,k,r,d]]. Its encoded sector has dimension 2k+r2^{k+r}; only kk qubits are protected. Count independent binary directions, not the number of measurements listed in a schedule.

A bare logical commutes with the whole gauge group and acts as L⊗IGL\otimes I_G. A dressed logical may act as L⊗gGL\otimes g_G. Multiplying by a gauge operator changes the gauge action without changing the protected action. The corresponding projective logical classes are

Lbare=G‾⊥/S‾,Ldressed=S‾⊥/G‾.\begin{aligned} \mathcal L_{\rm bare} &=\overline{\mathcal G}^{\perp}/\overline{\mathcal S},\\ \mathcal L_{\rm dressed} &=\overline{\mathcal S}^{\perp}/\overline{\mathcal G}. \end{aligned}

Both have 2k2k binary dimensions. Their representatives need not have the same weights. For example, in the four-qubit code, multiplying XL=X1X3X_L=X_1X_3 by AA gives X2X3X_2X_3. This is the same protected logical XX, but it anticommutes with CC and is therefore dressed rather than bare.

The static Pauli distance minimizes over nontrivial dressed logicals:

d=min⁡v∈S‾⊥∖G‾wt⁡(v).d=\min_{v\in\overline{\mathcal S}^{\perp} \setminus\overline{\mathcal G}}\operatorname{wt}(v).

Poulin’s (2005) subsystem stabilizer formulation makes the recovery criterion especially direct. For every pair of correctable Pauli errors, Ea†EbE_a^\dagger E_b must either anticommute with a stabilizer or belong to the gauge group. In the first case its compression to the encoded sector vanishes; in the second it acts only on GG. A nontrivial dressed logical instead creates an ambiguity that recovery cannot resolve for all logical inputs.

Consequently, distance dd permits correction of all unknown errors on at most ⌊(d−1)/2⌋\lfloor(d-1)/2\rfloor sites, or arbitrary errors on a known set of fewer than dd sites. These are different tasks. The four-qubit code has distance two: it detects every single-qubit Pauli and corrects any one known erasure, but cannot correct an arbitrary unknown single-qubit error. For instance, X1X_1 and X3X_3 differ by logical XLX_L and have the same stabilizer syndrome.

Place qubits at sites (i,j)(i,j) of an m×nm\times n rectangle, with rows increasing downward. Following the convention above, the elementary gauges are horizontal XXXX and vertical ZZZZ bonds:

gi,jX=Xi,jXi,j+1,gi,jZ=Zi,jZi+1,j.g^X_{i,j}=X_{i,j}X_{i,j+1},\qquad g^Z_{i,j}=Z_{i,j}Z_{i+1,j}.

Bacon (2006) introduced this lattice construction. Its stabilizers multiply all parallel bonds across one complete gap:

SjX=∏i=1mgi,jX,SiZ=∏j=1ngi,jZ.S^X_j=\prod_{i=1}^{m}g^X_{i,j},\qquad S^Z_i=\prod_{j=1}^{n}g^Z_{i,j}.

There are n−1n-1 independent XX stabilizers and m−1m-1 independent ZZ stabilizers. Horizontal and vertical bond sets are separately independent, giving gauge rank m(n−1)+n(m−1)m(n-1)+n(m-1). Subtracting the center rank leaves twice the number of gauge qubits:

k=1,r=(m−1)(n−1).k=1,\qquad r=(m-1)(n-1).

A full column of XX and a full row of ZZ are bare logicals. Each commutes with every gauge bond, and they anticommute with each other at their unique crossing. Moving a full column by multiplying an XX stabilizer changes its representative without changing its action on either encoded factor.

Nine-qubit Bacon–Shor lattice with horizontal XX bonds, vertical ZZ bonds, and one logical column and row

The 3×33\times3 Bacon–Shor code has twelve weight-two gauge generators and four weight-six stabilizers. Multiplying the three horizontal bonds across a column gap gives one XX stabilizer. The highlighted column and row support a bare logical XX and ZZ. Four gauge qubits are encoded collective degrees of freedom, not four marked lattice sites.

A dressed logical XX must anticommute with a bare logical ZZ on every row, since those row operators represent the same protected observable. It therefore has an XX or YY on at least one site in every row and has weight at least mm. Similarly, a dressed logical ZZ has weight at least nn. A logical YY satisfies both requirements and cannot evade their lower bounds. The displayed pure strings attain them:

dX=m,dZ=n,d=min⁡(m,n).\begin{aligned} d_X&=m,\qquad d_Z=n,\\ d&=\min(m,n). \end{aligned}

Here the subscripts name the logical operator type, not the error type that an axis checks. The square family is [[L2,1,(L−1)2,L]][[L^2,1,(L-1)^2,L]], giving [[9,1,4,3]][[9,1,4,3]] at L=3L=3.

Quantity 3×33\times3 block 3×53\times5 block
Physical qubits 9 15
Gauge qubits 4 8
Independent stabilizers 4 6
Gauge rank 12 22
(dX,dZ)(d_X,d_Z) (3,3)(3,3) (3,5)(3,5)

For XX errors, a ZZ stabilizer compares the error parities of adjacent rows. Two XX errors in the same row multiply to a horizontal gauge string and are harmless to LL. A single XX can therefore be corrected at any site in the correct row. For ZZ errors the analogous equivalence is within a column. With independent Pauli components and perfect stabilizer measurements, decoding reduces to repetition decoding of row and column parities. Correlated components or nonuniform errors can change the most likely joint logical class.

The input to that decoder is a valid stabilizer syndrome, not an arbitrary product of gauge results. One simple ideal schedule measures all horizontal gauges in a commuting subround and then all vertical gauges. Noisy measurements require further processing and often repeated rounds; native parity measurements, ancilla circuits, routing, and leakage all affect performance. Decoders discusses inference from noisy records.

Growing distance is not enough for an accuracy threshold

Section titled “Growing distance is not enough for an accuracy threshold”

Consider only independent XX errors of probability pp per site and perfect syndrome extraction on an odd square of side LL. A row has odd error parity with probability

qL=1−(1−2p)L2.q_L=\frac{1-(1-2p)^L}{2}.

Majority decoding of the LL independent row parities fails with probability

PX(L)=∑j=(L+1)/2L(Lj)qLj(1−qL)L−j.P_X(L)=\sum_{j=(L+1)/2}^{L} \binom Lj q_L^j(1-q_L)^{L-j}.

At fixed 0<p<1/20<p<1/2, qLq_L approaches 1/21/2 exponentially fast. The growing repetition block is then receiving almost completely random row bits, and PX(L)→1/2P_X(L)\to1/2. The distance grows, but unrestricted growth of this particular block eventually hurts. Optimizing a finite rectangle for the noise can still produce strong protection; Napp and Preskill (2013) analyze that optimization. Aliferis and Cross (2007) instead obtain fault-tolerance results for a specified concatenated Bacon–Shor construction. Concatenation and increasing one square block are different code families.

Measuring an additional commuting gauge observable and choosing its sign reduces gauge freedom. In the four-qubit example, impose C=+1C=+1 alongside SX=SZ=+1S_X=S_Z=+1. The remaining subspace encodes one qubit, with the same bare XL,ZLX_L,Z_L. If the measurement gives C=−1C=-1, applying AA flips that gauge sign without changing either logical observable. The procedure resets GG while preserving LL.

More generally, choose a compatible commuting set of projective gauge directions FF. Then

S‾′=⟨S‾,F⟩,G‾′=G‾∩F⊥.\begin{aligned} \overline{\mathcal S}'&=\langle\overline{\mathcal S},F\rangle,\\ \overline{\mathcal G}'&=\overline{\mathcal G}\cap F^\perp. \end{aligned}

Fixing ff new independent directions changes ss to s+fs+f and rr to r−fr-f, while keeping kk fixed. Consistent measured signs and suitable gauge corrections specify the physical sector. Since FF lies in the original gauge algebra, bare logicals commute with it. Measuring a protected logical instead would change the task rather than fix a gauge.

Different choices can make different logical gates convenient. Vuillot and collaborators (2019) also formulate code deformation and lattice surgery in this language. The algebra explains the preserved logical information; Fault-Tolerant Gates and Lattice Surgery discuss the actual protocols. Endpoint distances alone do not establish the fault distance of a noisy transition.

Finally, low-weight gauge generators need not imply low-weight stabilizers. Square Bacon–Shor has weight-two gauges but weight-2L2L center checks, so it does not meet the stabilizer-based definition of quantum LDPC codes. For two-dimensional Euclidean subsystem codes with bounded-range, bounded-density gauge generators, Bravyi (2011) proves kd=O(n)kd=O(n) and d2=O(n)d^2=O(n). If both gauge and stabilizer groups have spatially local generating sets, a stronger kd2=O(n)kd^2=O(n) tradeoff applies under the stated hypotheses. Sparse long-range interactions do not satisfy these geometric assumptions.

On the encoded factors, compare measuring ZGZ_G on ρL⊗∣+⟩⟨+∣G\rho_L\otimes|+\rangle\langle+|_G with measuring it on (∣0L0G⟩+∣1L1G⟩)/2(|0_L0_G\rangle+|1_L1_G\rangle)/\sqrt2. Does a gauge measurement always preserve every conditional logical state?

Solution

For the product input, both outcomes have probability 1/21/2 and leave ρL\rho_L unchanged. For the entangled input, the initial logical marginal is IL/2I_L/2, but selecting the positive outcome gives ∣0L⟩|0_L\rangle and selecting the negative gives ∣1L⟩|1_L\rangle. Averaging the two returns IL/2I_L/2. Thus a gauge operation preserves the unconditional protected state; branch-by-branch preservation of an arbitrary original logical state additionally uses an uncorrelated input. No logical information can be signaled by an unrecorded local gauge measurement.

A fifteen-qubit subsystem code has stabilizer rank six and gauge rank fourteen. Find kk, rr, and the encoded-sector dimension.

Solution

The noncentral gauge directions come in pairs: 2r=14−6=82r=14-6=8, so r=4r=4. Then k=15−6−4=5k=15-6-4=5 and the sector has dimension 2k+r=5122^{k+r}=512. The number of protected states is 2k=322^k=32; the remaining factor is gauge freedom.

Generate the four-qubit basis from ∣0L0G⟩|0_L0_G\rangle using XLX_L and XGX_G. Check the action of ZLZ_L and ZGZ_G.

Solution

Using physical-bit order 1,2,3,41,2,3,4,

∣0L0G⟩=(∣0000⟩+∣1111⟩)/2,∣0L1G⟩=(∣1100⟩+∣0011⟩)/2,∣1L0G⟩=(∣1010⟩+∣0101⟩)/2,∣1L1G⟩=(∣0110⟩+∣1001⟩)/2.\begin{aligned} |0_L0_G\rangle&=(|0000\rangle+|1111\rangle)/\sqrt2,\\ |0_L1_G\rangle&=(|1100\rangle+|0011\rangle)/\sqrt2,\\ |1_L0_G\rangle&=(|1010\rangle+|0101\rangle)/\sqrt2,\\ |1_L1_G\rangle&=(|0110\rangle+|1001\rangle)/\sqrt2. \end{aligned}

Each is a +1+1 eigenstate of XXXXXXXX and ZZZZZZZZ. The parity of bits 1 and 2 gives the logical label; the parity of bits 1 and 3 gives the gauge label. Thus ZLZ_L and ZGZ_G act as the two independent computational-basis ZZ operators. Equal coefficients ensure the XX operators flip their respective labels without additional phases.

4. A false syndrome with ideal measurements

Section titled “4. A false syndrome with ideal measurements”

Start in ρL⊗IG/2\rho_L\otimes I_G/2 in the four-qubit code. Find the joint outcome distributions for A,BA,B and for A,C,BA,C,B.

Solution

For A,BA,B, only (a,b)=(+,+)(a,b)=(+,+) and (−,−)(-,-) occur, each with probability 1/21/2. For A,C,BA,C,B, the three outcomes are independent fair signs, so each of the eight triples has probability 1/81/8. Four triples have ab=−1ab=-1. The true stabilizer remains SX=+1S_X=+1 throughout. Inserting a gauge ZZ measurement between two gauge XX measurements randomizes the result used in the proposed parity calculation.

In the 3×33\times3 code, compare errors X2,1X_{2,1} and X2,3X_{2,3}. Then compare X1,1X_{1,1} with X2,1X3,1X_{2,1}X_{3,1}.

Solution

The first pair differs by

X2,1X2,3=g2,1Xg2,2X,X_{2,1}X_{2,3}=g^X_{2,1}g^X_{2,2},

so either representative corrects the protected information when either error occurs. The second pair differs by the full-column bare logical X1,1X2,1X3,1X_{1,1}X_{2,1}X_{3,1}. Their stabilizer syndromes also agree, but they have different logical actions. Correcting the two-site error as if it were the one-site error produces a logical failure. Equal syndrome is therefore weaker than equivalence modulo gauge.

6. A rectangular block under independent bit flips

Section titled “6. A rectangular block under independent bit flips”

For a 3×53\times5 block with independent physical XX error probability pp, derive the logical XX failure probability with perfect syndrome measurements and majority decoding. Obtain its leading small-pp behavior.

Solution

Each row contains five sites. The generating function for its parity gives q=(1−(1−2p)5)/2=5p+O(p2)q=(1-(1-2p)^5)/2=5p+O(p^2). At least two of three row parities must be odd for majority decoding to fail:

PX=3q2(1−q)+q3=3q2−2q3=75p2+O(p3).\begin{aligned} P_X&=3q^2(1-q)+q^3\\ &=3q^2-2q^3\\ &=75p^2+O(p^3). \end{aligned}

The distance is still dX=3d_X=3, but the coefficient counts more ways to make two odd rows than in a 3×33\times3 block, whose coefficient is 2727. Lengthening rows improves the logical-ZZ distance while making this logical-XX channel worse at leading order. Geometry must be chosen for the noise, not from the smaller distance alone.

7. Fix a gauge without measuring the logical qubit

Section titled “7. Fix a gauge without measuring the logical qubit”

In the four-qubit code measure CC and, on a negative outcome, apply AA. What are the final stabilizers, logical operators, and distance? What happens to an arbitrary initial gauge state?

Solution

The final independent stabilizers are SX,SZ,CS_X,S_Z,C, all with positive sign. There is one logical qubit and no gauge qubit. The bare XL=X1X3X_L=X_1X_3 and ZL=Z1Z2Z_L=Z_1Z_2 still commute with these checks and anticommute with each other. Every single-site nonidentity Pauli anticommutes with SXS_X or SZS_Z, while the displayed weight-two logicals survive, so the subspace distance is two.

On the gauge factor the two corrected Kraus operators are ∣0⟩⟨0∣|0\rangle\langle0| and ∣0⟩⟨1∣|0\rangle\langle1|. Ignoring the measurement result resets any gauge state to ∣0G⟩|0_G\rangle. For an initially correlated state the complete map is ρLG↦ρL⊗∣0⟩⟨0∣G\rho_{LG}\mapsto\rho_L\otimes|0\rangle\langle0|_G, preserving the original logical marginal.

Could a two-dimensional Euclidean family with bounded-range, bounded-density gauge generators have k=Θ(n2/3)k=\Theta(n^{2/3}) and d=Θ(n1/2)d=\Theta(n^{1/2})? Would bounded check weight alone give the same conclusion?

Solution

The proposed product is kd=Θ(n7/6)kd=\Theta(n^{7/6}), violating kd=O(n)kd=O(n) under the stated geometric hypotheses. Bounded weight alone does not bound the length of an interaction or the density of physical sites in the plane, so the theorem does not rule out an abstract nongeometric family with those exponents. Counting check support and specifying spatial locality answer different questions.