research30 min studyLesson 435 in Physics

CSS codes and classical-code relations

Construct complementary bit and phase checks from binary parity matrices and verify their compatibility.

On this page

What you’ll understand

  • Derive the CSS orthogonality condition over the binary field.
  • Calculate X and Z syndromes separately, including a Y error.
  • Count encoded qubits and identify a weight-three logical operator in the seven-qubit code.

Classical linear codes provide a systematic way to choose quantum parity checks, but two arbitrary good classical codes cannot simply be combined. Quantum X and Z checks must commute so that the code has a common check sector. Calderbank–Shor–Steane constructions impose exactly that compatibility condition. Their separate treatment of bit and phase components simplifies diagnosis, while a physical Y error reminds us that the two components can occur together and may be statistically correlated.

Translate binary rows into Pauli checks

For a binary row h, form X(h)X(h) by placing X on each position containing one, and identity elsewhere; define Z(h)Z(h) similarly. Rows of a matrix HXH_X specify X-type checks, and rows of HZH_Z specify Z-type checks. Checks of the same type automatically commute. A mixed pair commutes exactly when its two rows overlap in an even number of positions. Matrix multiplication over the binary field packages all these requirements at once.

In this convention the classical bit patterns obeying Z checks form ker⁡HZ\ker H_Z, while the supports of X stabilizers lie in row⁡HX\operatorname{row}H_X. Compatibility means that the latter space is contained in the former. Exchanging X and Z gives the complementary inclusion. This specifies conventions explicitly because textbooks may name the two classical codes differently. Counting independent rows, rather than printed rows, gives the quantum dimension and avoids mistaking a redundant parity for another protected degree of freedom.

HXHZT=0(mod2),k=n−rank⁡2HX−rank⁡2HZH_XH_Z^{\mathsf T}=0\pmod2,\qquad k=n-\operatorname{rank}_2H_X-\operatorname{rank}_2H_Z
Both ranks and the product use binary arithmetic. The formula assumes only X-type and Z-type independent stabilizers and compatible positive check signs.↔ Scroll wide equations horizontally.

One seven-column construction

Choose the same three-row matrix H for both types, with rows 1111000, 1100110, and 1010101. Each row has weight four and any two rows overlap twice. Thus even self-overlaps and pairwise overlaps give HHT=0HH^{\mathsf T}=0. The three rows are independent, so six independent quantum checks on seven physical qubits leave one logical qubit. The seven columns are precisely the seven distinct nonzero binary triples.

For an error represented by binary vectors x and z, the Z checks report HZxH_Zx and the X checks report HXzH_Xz. A single X error is located by its nonzero column in the first syndrome; a single Z is located in the second. A Y error has both components at the same site and triggers both sets. Treating these syndromes separately is algebraically valid, but multiplying their likelihoods requires an additional independence assumption about the physical noise.

H=(111100011001101010101),sZ=HZx,sX=HXzH=\begin{pmatrix}1&1&1&1&0&0&0\\1&1&0&0&1&1&0\\1&0&1&0&1&0&1\end{pmatrix},\qquad \mathbf s_Z=H_Z\mathbf x,\quad\mathbf s_X=H_X\mathbf z
This particular row and column ordering fixes the numerical syndromes below. All entries and syndrome bits are dimensionless binary values.↔ Scroll wide equations horizontally.

Find what the checks cannot see

The all-seven X and all-seven Z strings commute with every weight-four check and anticommute with each other, so they furnish logical representatives. Smaller representatives can be obtained by multiplying stabilizers. No weight-one or weight-two nonidentity Pauli has zero syndrome: distinct nonzero columns cannot sum to zero. In contrast, columns two, three, and five sum to zero, giving a weight-three Z normalizer element outside the Z stabilizer row space.

Every nonzero row-space word of H has weight four, so that weight-three string is nontrivial on the code. The distance is therefore three, establishing ideal correction of one arbitrary physical-qubit error. This conclusion uses both complementary checks, unlike the three-qubit repetition construction. It still assumes correct initialization, compatible syndrome measurements, and a suitable recovery. Separability of the check matrices helps implementation, but does not automatically make a parity-extraction circuit fault tolerant.

Z2Z3Z5∈N(S)∖S,[[n,k,d]]=[[7,1,3]]Z_2Z_3Z_5\in N(S)\setminus S,\qquad [[n,k,d]]=[[7,1,3]]
The bracket notation gives physical qubits, logical qubits, and unrestricted Pauli distance for the explicit code. It is a data-code property, not a measurement-fault threshold.↔ Scroll wide equations horizontally.

Decode both components of a single Y

Using the displayed H and syndrome order (sZ,sX)(\mathbf s_Z,\mathbf s_X), compute the syndrome for Y5Y_5 and give an ideal recovery. Verify one mixed-check commutator directly.

  1. A Y on site five has x=z=e5\mathbf x=\mathbf z=\mathbf e_5 up to overall phase. Column five of H is (0,1,1)T(0,1,1)^{\mathsf T}, so both three-bit syndrome vectors equal 011.

  2. Unique nonzero columns locate both components at site five. Recovery Y5Y_5 squares to identity and restores the code state. Equivalently X-five followed by Z-five works up to an irrelevant overall phase.

  3. The first X row occupies sites 1,2,3,4, while the second Z row occupies 1,2,5,6. Their two shared sites supply two minus signs, whose product is plus one. Hence these complementary checks can share a code sector.

The result

The ordered syndrome is (011, 011); ideal Y-five recovery reverses both components without measuring the encoded amplitudes.

Explore the model

Interactive lab

Interactive lab · quantum

Complementary sensitivity of one qubit

Reset and set mixing angle 90∘90^\circ, phase 0∘0^\circ. Compare with a fresh Reset run at 90∘,180∘90^\circ,180^\circ. Predict basis probabilities one half in both runs, but opposite Bloch x. This illustrates why complementary information matters. The pure-qubit instrument has no CSS matrices, seven-qubit encoding, noisy checks, or decoder.

Complementary sensitivity of one qubitA normalized two-level pure state, not an interacting field simulation. Playback adds one radian per second to the relative phase; basis probabilities stay fixed. Current readings: Probability |0⟩: 71.1%; Probability |1⟩: 28.9%; Bloch (x, y, z): 0.78, 0.45, 0.42. All parameters are adjustable with the labeled controls below.xyz|0⟩|1⟩Basis probabilitiesP(0)71.1%P(1)28.9%
Bloch vector / P(0)P(1)Phase latitude
Probability |0⟩
71.1%
Probability |1⟩
28.9%
Bloch (x, y, z)
0.78, 0.45, 0.42
t = 0 s

A normalized two-level pure state, not an interacting field simulation. Playback adds one radian per second to the relative phase; basis probabilities stay fixed. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forChecks sensitive only to populations cannot protect every phase relation; CSS structure supplies compatible complementary checks.

Check your understanding

Which binary condition makes every X-type CSS check commute with every Z-type check?

Try it yourself

With the same H, a single X7X_7 occurs. Find both syndromes and recovery. Then use the row ranks and columns to justify the number of logical qubits and exclusion of weight-two logical errors.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Only the x component is nonzero. Distinct single-site columns cannot cancel in a binary sum of two columns.

Compare with the solution

Column seven is 001, so sZ=001\mathbf s_Z=001 and sX=000\mathbf s_X=000. Apply X7X_7. The two matrices have rank three, leaving 7−3−3=17-3-3=1 logical qubit. Any nonzero x or z component with support at most two has a syndrome equal to one nonzero column or two distinct columns; neither is zero. Thus no weight-two Pauli is logical. The displayed weight-three Z string completes the distance-three argument.

Take it with you

  • CSS commutation is a binary orthogonality requirement.
  • Y errors contribute both bit and phase syndrome components.
  • Classical parity structure helps construct codes but does not replace a circuit fault analysis.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.