Skip to content

A syndrome measurement learns a stabilizer eigenvalue without resolving the encoded state inside its eigenspace. An ancilla can collect this information, but the same interactions can also spread an ancilla fault onto several data qubits. We will derive the ideal measurement, follow faults through an ordered circuit, and explain how changes between repeated outcomes become detectors for error correction.

Required background. Multi-qubit gates introduces CNOT and parity circuits. Stabilizer formalism explains code subspaces, signed checks and logical operators.

The examples use qubit Pauli checks and ideal Clifford gates except at explicitly specified fault locations. Their conclusions concern one measured check; deciding whether a resulting error is correctable requires the surrounding code.

Pauli-check measurements preserve eigenspace coherence

Section titled “Pauli-check measurements preserve eigenspace coherence”

A signed Hermitian Pauli check obeys

g=g†,g2=I.g=g^{\dagger},\qquad g^2=I.

For a nonidentity Pauli string its eigenvalues are ±1\pm1. The special checks +I+I and −I-I have only one possible outcome. A phase ±i\pm i multiplying a Hermitian string instead gives an anti-Hermitian operator, not a binary observable.

Write the eigenvalue as (−1)b(-1)^b, where b∈{0,1}b\in\{0,1\}. The projectors and ideal outcome branches are

Πb=I+(−1)bg2,Ib(ρ)=ΠbρΠb,pb=Tr⁡(ρΠb).\begin{aligned} \Pi_b&=\frac{I+(-1)^b g}{2},\\ \mathcal I_b(\rho)&=\Pi_b\rho\Pi_b,\\ p_b&=\operatorname{Tr}(\rho\Pi_b). \end{aligned}

The trace of Ib\mathcal I_b retains the outcome probability. If pb>0p_b>0, the conditional state is Ib(ρ)/pb\mathcal I_b(\rho)/p_b; a zero-probability branch has no conditional state. Ignoring the outcome gives

∑bIb(ρ)=12(ρ+gρg).\sum_b\mathcal I_b(\rho) =\tfrac12(\rho+g\rho g).

This Lüders measurement removes coherence between the two eigenspaces and preserves coherence within either one. The observable fixes probabilities but does not determine every possible disturbance: a device could additionally rotate a state or measure more finely inside an eigenspace. Quantum instruments describes this distinction.

For example, measuring Z1Z2Z_1Z_2 ideally leaves α∣00⟩+β∣11⟩\alpha|00\rangle+\beta|11\rangle unchanged. Measuring the two individual Z observables and then multiplying their outcomes gives the same parity but destroys the superposition. A parity circuit must avoid storing which of these two strings occurred.

If gg stabilizes the whole code, a fixed Pauli error EE gives

gE∣ψL⟩=sEE∣ψL⟩,sE∈{+1,−1}.gE|\psi_L\rangle=s_E E|\psi_L\rangle, \qquad s_E\in\{+1,-1\}.

Here sEs_E is the commutation sign of EE with gg, independent of the encoded amplitudes. This is why a stabilizer check can reveal an error syndrome without revealing the logical state. Merely commuting with the stabilizer is insufficient: a logical Pauli can commute with every check and still measure encoded information. Gottesman (1997) develops these stabilizer and measurement rules. General coherent noise may populate several syndrome sectors; ideal measurement can remove the coherence between those sectors.

To measure PZ=∏j∈SZjP_Z=\prod_{j\in S}Z_j, prepare an ancilla in ∣0⟩a|0\rangle_a, apply data-control/ancilla-target CNOTs, and measure the ancilla in Z. On a basis string,

∣x⟩∣0⟩a⟼∣x⟩∣⨁j∈Sxj⟩a.|x\rangle|0\rangle_a \longmapsto|x\rangle \left|\bigoplus_{j\in S}x_j\right\rangle_a.

Every even string gives the same pointer ∣0⟩a|0\rangle_a, and every odd string gives ∣1⟩a|1\rangle_a. For arbitrary data the final joint state is

Π0∣ψ⟩∣0⟩a+Π1∣ψ⟩∣1⟩a.\Pi_0|\psi\rangle|0\rangle_a +\Pi_1|\psi\rangle|1\rangle_a.

Selecting ancilla outcome bb leaves Πb∣ψ⟩\Pi_b|\psi\rangle, proving the ideal branch map above. The ancilla stores the parity, not the individual data bits. An unknown initial XaX_a reverses the reported parity, so preparation or reset is part of the measurement itself.

To measure PX=∏j∈SXjP_X=\prod_{j\in S}X_j, prepare ∣+⟩a|+\rangle_a, let the ancilla control each CNOT, and measure it in X. For a product eigenstate PX∣ϕλ⟩=λ∣ϕλ⟩P_X|\phi_\lambda\rangle=\lambda|\phi_\lambda\rangle,

∣+⟩a∣ϕλ⟩⟼∣0⟩a+λ∣1⟩a2∣ϕλ⟩.|+\rangle_a|\phi_\lambda\rangle \longmapsto \frac{|0\rangle_a+\lambda|1\rangle_a}{\sqrt2} |\phi_\lambda\rangle.

The two pointer states are ∣+⟩a|+\rangle_a and ∣−⟩a|-\rangle_a. The data remain in their original eigenstate. Superpositions within a fixed product eigenspace remain coherent by linearity.

Mixed Pauli products can use local basis changes. With gates acting right to left, BX=HB_X=H and BY=HS†B_Y=HS^{\dagger} obey

BXXBX†=Z,BYYBY†=Z.B_X X B_X^{\dagger}=Z, \qquad B_Y Y B_Y^{\dagger}=Z.

Apply these changes before a Z-parity circuit and their inverses afterward. They add physical gate locations at which faults can occur. Two implementations of the same ideal check need not propagate faults in the same way.

Let the circuit measure a phase-free product PP, reporting r=0r=0 for its +1+1 eigenvalue and r=1r=1 for −1-1. If the desired check is g=(−1)σPg=(-1)^\sigma P, the signed check bit is

m=r⊕σ,λg=(−1)m.m=r\oplus\sigma, \qquad \lambda_g=(-1)^m.

For example, g=−Pg=-P converts raw r=0r=0 into m=1m=1: the state has P=+1P=+1 but g=−1g=-1. No gates need change for this relabeling. Any known Pauli-frame or hardware-discriminator offset must be included consistently as well.

A round’s syndrome collects the check outcomes. A detector is a parity of outcomes whose value is predictable in the ideal circuit. A decoder uses many such values and a noise model to choose a recovery. These are successive pieces of the calculation, not different names for one bit string.

Keep the raw outcomes and known offsets distinguishable when analyzing experiments. A missing outcome or flagged leakage event is not a binary zero. For reset, timing and conditional operations between rounds, see mid-circuit measurement and feedforward.

An ancilla fault can spread to later data qubits

Section titled “An ancilla fault can spread to later data qubits”

Forward propagation through CNOT with control cc and target tt obeys

Xc⟼XcXt,Zc⟼Zc,Xt⟼Xt,Zt⟼ZcZt.\begin{aligned} X_c&\longmapsto X_cX_t,& Z_c&\longmapsto Z_c,\\ X_t&\longmapsto X_t,& Z_t&\longmapsto Z_cZ_t. \end{aligned}

Only gates after the insertion act on a fault. In a Z-check circuit, ancilla ZaZ_a spreads to every later data control. Ancilla XaX_a remains on the target and flips its eventual Z readout. In an X-check circuit the roles exchange: XaX_a spreads to later data targets, while ZaZ_a flips the X readout without that spreading.

For Z1Z2Z3Z4Z_1Z_2Z_3Z_4 with interaction order 1,2,3,41,2,3,4, insert ZaZ_a after the second CNOT. The remaining interactions give

Za⟼Z3Za⟼Z3Z4Za.Z_a\longmapsto Z_3Z_a\longmapsto Z_3Z_4Z_a.

The final data error is Z3Z4Z_3Z_4. The remaining ZaZ_a commutes with ancilla Z readout, so the bit is unchanged. A single fault has affected two data qubits.

Four ordered data-to-ancilla CNOTs, with an ancilla Z fault after the second gate spreading only to data qubits three and four

Time runs left to right. A target-ancilla ZaZ_a fault after the second interaction produces Z3Z4Z_3Z_4 on the data. It does not change the ancilla’s Z-basis readout. The first two data qubits have already interacted and receive no error from this later fault.

Data-fault timing also matters. An XjX_j occurring before data qubit jj controls its CNOT changes the current parity outcome. If it occurs afterward, its first effect on this repeated check can appear in the next round. A ZjZ_j commutes with this particular Z check, so it is invisible to that check.

DiVincenzo and Shor (1996) analyze the danger of ancilla faults spreading in syndrome extraction. Verified ancillas and flag circuits address it with additional resources and code-specific recovery rules; Chamberland and Beverland (2018) develop flag constructions. Fault-free parity correctness alone does not prove fault tolerance. Conversely, a weight-two error is not automatically a logical error: its significance depends on the code and available diagnostic outcomes. See fault-tolerant gates for those criteria.

For an unchanged check, with no ideal operation changing its eigenvalue, successive ideal outcomes agree. A useful bulk detector is therefore

dt=mt⊕mt−1.d_t=m_t\oplus m_{t-1}.

A persistent data error that flips the check produces an event at its onset. A single incorrectly reported round produces events in both neighboring comparisons. These patterns are useful but do not identify a unique microscopic cause.

The first comparison needs a prepared reference m0m_0. If the initial check eigenvalue is unknown, its first measurement can be intrinsically random; comparing it to an invented zero would not give an ideal deterministic detector. Likewise, a terminal comparison needs a compatible final measurement. For a Z product, destructive Z measurements of its data qubits supply a final parity qfq_f, including the same sign and frame offsets as the check.

For three rounds, a known initial value and compatible final parity give

d1=m1⊕m0,d2=m2⊕m1,d3=m3⊕m2,d4=qf⊕m3.\begin{aligned} d_1&=m_1\oplus m_0,\\ d_2&=m_2\oplus m_1,\\ d_3&=m_3\oplus m_2,\\ d_4&=q_f\oplus m_3. \end{aligned}

Final individual-qubit measurements end the quantum memory experiment. They need not be nondestructive merely because their product reconstructs a stabilizer check.

More generally, a detector has the form

dα=⨁(j,t)∈Rαmj,t⊕cα,d_\alpha=\bigoplus_{(j,t)\in R_\alpha}m_{j,t} \oplus c_\alpha,

where the set RαR_\alpha and known offset cαc_\alpha make this parity zero in the ideal circuit. This is the detector convention used by Gidney (2021) and the Stim detector documentation. An intentional sign change or intervening gate can change the offset or which outcomes belong in the relation. Adjacent times alone do not establish the relation.

If m2m_2 is missing, the displayed d2d_2 and d3d_3 are unavailable. An appropriate protocol may instead compare m3m_3 to m1m_1, but must account for the longer interval. Detectors can share outcomes and be correlated; their definition does not imply statistical independence. Decoders explains how to combine the available outcomes with a noise model.

Measure g=Z1Z2Z3Z4g=Z_1Z_2Z_3Z_4 for three rounds, using a fresh target ancilla and interaction order 1,2,3,41,2,3,4 each time. Prepare any state in the +1+1 eigenspace, so m0=0m_0=0. After the last round, read the data in Z and form qf=z1⊕z2⊕z3⊕z4q_f=z_1\oplus z_2\oplus z_3\oplus z_4. Each case below inserts only the named fault; all other operations are ideal.

  • A: no fault.
  • B: X2X_2 before round 1.
  • C: X2X_2 between rounds 1 and 2.
  • D: reverse only the reported bit in round 2.
  • E: insert XaX_a after the second CNOT of round 2.
  • F: insert ZaZ_a at that same location.
Case Final data Pauli Outcomes m1m2m3m_1m_2m_3 qfq_f Detectors d1d2d3d4d_1d_2d_3d_4
A II 000 0 0000
B X2X_2 111 1 1000
C X2X_2 011 1 0100
D II 010 0 0110
E II 010 0 0110
F Z3Z4Z_3Z_4 000 0 0000

Cases B and C change the check persistently, with one detector marking when the change begins. Cases D and E give the same outcomes even though their physical mechanisms differ. A decoder needs other checks or a noise prior to distinguish possible explanations; the local record alone cannot do so.

Case F is more revealing: the data carry Z3Z4Z_3Z_4, yet every displayed detector is zero. The error commutes with this check and does not affect terminal Z parity. Other checks may detect it. Without specifying a complete code, one cannot decide whether it is a stabilizer, a correctable error or a logical operation. Thus a zero local detector pattern is compatible with a nontrivial change to the data.

1. Verify the Projector and Instrument Identities

Section titled “1. Verify the Projector and Instrument Identities”

Let g=g†g=g^\dagger and g2=Ig^2=I. For Πb=[I+(−1)bg]/2\Pi_b=[I+(-1)^b g]/2, prove orthogonality, completeness, and positivity. For a density operator ρ\rho, show that Tr⁡(ΠbρΠb)\operatorname{Tr}(\Pi_b\rho\Pi_b) is the Born probability and that the unread Lüders map is trace preserving.

Solution

Using g2=Ig^2=I,

Πb2=I+2(−1)bg+g24=Πb.\Pi_b^2 = \frac{I+2(-1)^b g+g^2}{4} = \Pi_b.

Hermiticity of gg gives Πb†=Πb\Pi_b^\dagger=\Pi_b, so each idempotent is an orthogonal projector and therefore positive. Direct addition gives Π0+Π1=I\Pi_0+\Pi_1=I, while

Π0Π1=(I+g)(I−g)4=I−g24=0.\Pi_0\Pi_1 = \frac{(I+g)(I-g)}{4} = \frac{I-g^2}{4} =0.

Cyclicity of trace and idempotence give

Tr⁡(ΠbρΠb)=Tr⁡(ρΠb),\operatorname{Tr}(\Pi_b\rho\Pi_b) = \operatorname{Tr}(\rho\Pi_b),

the Born probability. Positivity follows because ΠbρΠb\Pi_b\rho\Pi_b is positive. Finally,

Tr⁡ ⁣[∑bΠbρΠb]=Tr⁡ ⁣[ρ∑bΠb]=Tr⁡(ρ).\begin{aligned} \operatorname{Tr}\!\left[\sum_b\Pi_b\rho\Pi_b\right] &=\operatorname{Tr}\!\left[\rho\sum_b\Pi_b\right]\\ &=\operatorname{Tr}(\rho). \end{aligned}

Thus each branch is CP and trace-nonincreasing, while their sum is trace preserving.

2. Test Why a Stabilizer Hides Logical Information

Section titled “2. Test Why a Stabilizer Hides Logical Information”

Let every code state obey g∣ψL⟩=∣ψL⟩g\lvert\psi_L\rangle=\lvert\psi_L\rangle. Show that for a fixed Pauli EE, measuring gg on E∣ψL⟩E\lvert\psi_L\rangle reveals only whether EE commutes or anticommutes with gg. Then explain why replacing gg by a logical Pauli Z‾\overline Z can reveal logical amplitudes.

Solution

If Eg=s gEEg=s\,gE with s∈{+1,−1}s\in\{+1,-1\}, then

gE∣ψL⟩=sEg∣ψL⟩=sE∣ψL⟩.gE\lvert\psi_L\rangle = sE g\lvert\psi_L\rangle = sE\lvert\psi_L\rangle.

The outcome is fixed by ss and is independent of the coefficients of the encoded state. This conclusion uses that gg acts as one scalar on the entire code space.

By contrast, suppose Z‾∣0L⟩=∣0L⟩\overline Z\lvert0_L\rangle=\lvert0_L\rangle and Z‾∣1L⟩=−∣1L⟩\overline Z\lvert1_L\rangle=-\lvert1_L\rangle. On α∣0L⟩+β∣1L⟩\alpha\lvert0_L\rangle+\beta\lvert1_L\rangle, its measurement has probabilities ∣α∣2|\alpha|^2 and ∣β∣2|\beta|^2 and removes coherence between the two logical eigenstates when unread. Although Z‾\overline Z commutes with the stabilizer, it is not itself a stabilizer and is not independent of the logical state.

An unsigned circuit measures PP and reports r=0r=0. Compute the stored bit and signed eigenvalue first for g=Pg=P, then for the negative check g=−Pg=-P. Repeat for r=1r=1, keeping rr, σ\sigma, and mm explicit.

Solution

For g=Pg=P, σ=0\sigma=0, so m=rm=r. If r=0r=0, then m=0m=0 and λP=λg=+1\lambda_P=\lambda_g=+1. If r=1r=1, then m=1m=1 and both eigenvalues are −1-1.

For g=−Pg=-P, σ=1\sigma=1, so m=r⊕1m=r\oplus1. At r=0r=0, m=1m=1: λP=+1\lambda_P=+1 but λg=−1\lambda_g=-1. At r=1r=1, m=0m=0: λP=−1\lambda_P=-1 but λg=+1\lambda_g=+1. The raw hardware result has not changed; the signed check changes how it must be interpreted and stored.

In chronological order 1,2,3,41,2,3,4, insert ZaZ_a after the second CNOT of a Z-check target-ancilla circuit. Derive the data error. Then perform the dual calculation for XaX_a at the same location in an X-check control-ancilla circuit, and state what happens to the ancilla readout in each case.

Solution

In the Z-check circuit, the first two CNOTs precede the fault and cannot receive propagated errors from it. At the CNOT involving data 3, target ZaZ_a maps to Z3ZaZ_3Z_a; at the next it maps to Z4ZaZ_4Z_a. The final operator is therefore

Z3Z4Za.Z_3Z_4Z_a.

The data error is Z3Z4Z_3Z_4. The remaining ZaZ_a commutes with Z-basis readout and does not flip its bit.

In the X-check circuit, the ancilla is the control. Control XaX_a copies to each later target, producing

XaX3X4.X_aX_3X_4.

The data error is X3X4X_3X_4. The remaining XaX_a commutes with X-basis readout and does not flip that bit. The complementary ancilla Paulis, XaX_a for the Z check and ZaZ_a for the X check, flip their respective readouts without this data fanout.

A check has signed outcomes m1,m2,m3m_1,m_2,m_3. Preparation fixes m0=0m_0=0, and compatible final readout gives qfq_f. Write the initial, bulk, and terminal detectors. Then generalize to a relation supported on an arbitrary set RαR_\alpha with a known offset cαc_\alpha. What changes if m2m_2 is invalid?

Solution

The initial detector is d1=m1⊕m0=m1d_1=m_1\oplus m_0=m_1. The two bulk detectors are

d2=m2⊕m1,d3=m3⊕m2,d_2=m_2\oplus m_1, \qquad d_3=m_3\oplus m_2,

and the terminal detector is d4=qf⊕m3d_4=q_f\oplus m_3. More generally,

dα=⨁(j,t)∈Rαmj,t⊕cα,d_\alpha = \bigoplus_{(j,t)\in R_\alpha}m_{j,t} \oplus c_\alpha,

provided the entire parity is deterministic in the ideal circuit. If m2m_2 is invalid, both d2d_2 and d3d_3 are unavailable. They may not be computed by replacing m2m_2 with zero. A separately justified relation such as a gap-spanning parity between m1m_1 and m3m_3 could be used, but only if the protocol establishes its no-fault determinism.

After the Z-parity interaction, the joint state is Π0∣ψ⟩∣0⟩a+Π1∣ψ⟩∣1⟩a\Pi_0|\psi\rangle|0\rangle_a+\Pi_1|\psi\rangle|1\rangle_a. Instead of reading the ancilla in Z, read it in X. Find the data Kraus operators and outcome probabilities. Compare this instrument with the correct parity measurement when outcomes are ignored.

Solution

Using ⟨±∣0⟩=1/2\langle\pm|0\rangle=1/\sqrt2 and ⟨±∣1⟩=±1/2\langle\pm|1\rangle=\pm1/\sqrt2 gives

K+=(Π0+Π1)/2=I/2,K−=(Π0−Π1)/2=g/2.\begin{aligned} K_+&=(\Pi_0+\Pi_1)/\sqrt2=I/\sqrt2,\\ K_-&=(\Pi_0-\Pi_1)/\sqrt2=g/\sqrt2. \end{aligned}

Both outcomes have probability 1/21/2, independent of the data. They reveal no parity information. Conditioned on the outcome, the data undergo either II or gg, so applying gg after the minus outcome restores the original state.

Ignoring the outcome gives 12(ρ+gρg)\tfrac12(\rho+g\rho g), exactly the unread channel of the correct Z readout. Thus equal unread channels do not imply equal instruments: one readout learns the parity and projects the data, while the other gives a known reversible unitary and an uninformative random bit.