Learning goals. After this module you should be able to

  1. Translate any Pauli operator into a binary vector and back, and say exactly which information (the phase) the translation forgets.
  2. Decide whether two Paulis commute by computing a symplectic inner product, and check a whole set of stabilizer generators at once with .
  3. Read off syndromes, the normalizer, and the distance of a stabilizer code from its check matrix.
  4. Build a CSS code from two classical codes, verify , and compute .
  5. Find logical operators as the quotient (and its partner), and explain why the quantum distance can be larger than the classical one.

In Module 3 we described codes by listing Pauli strings like . That works for five qubits. For the hundreds or thousands of qubits in a surface code or a quantum LDPC code, we need something a computer can handle: matrices of bits. This module builds that translation. Once it is in place, almost every question about a stabilizer code turns into linear algebra over the two-element field , with addition done mod 2.

1. From Pauli strings to bit strings

A single-qubit Pauli is determined, up to a phase, by two yes/no questions: does it contain an part? and does it contain a part? Write the answers as bits and :

Pauli

The last column is because contains both parts. For qubits we stack the bits of all qubits first and then the bits.

Definition 4.1 (Binary representation of Paulis).

For let and . Every element of the Pauli group can be written uniquely as with . The binary representation of the Pauli is the vector

The symplectic weight is the number of qubits with , i.e. the usual weight of the Pauli string.

Some examples, with qubits numbered from 1:

Pauli

and for five qubits .

What the map forgets. The map throws away the phase . It turns multiplication of Paulis into addition of bit vectors: . In group language, the map is a homomorphism from onto whose kernel is the four phases , so . For example while , yet both products map to . The bits tell you which Pauli you get; the phase must be tracked separately. In Module 5 we will add one extra sign bit per row to do exactly that.

When we need a definite Hermitian operator for a vector , the standard choice is

where counts the qubits carrying a and the exponent is taken mod 4 (not mod 2). For example, , and for we have , so and .

2. Commutation as a bit count

Two Pauli strings either commute or anticommute. On a single qubit, two Paulis anticommute exactly when they are different and neither is . In bits, and anticommute on that qubit iff : for instance and give . For a string, every anticommuting position contributes a factor , so the strings anticommute iff the number of such positions is odd.

Definition 4.2 (Symplectic inner product).

For and in , the symplectic inner product is

Proposition 4.1 (Commutation rule).

Paulis and with binary vectors and satisfy . In particular and commute iff .

Using the table above, , so and commute, while , so they anticommute. (Written as Pauli strings: vs clashes on qubit 2 only.)

Three properties of do a lot of work later:

  • bilinear: , so commuting with a set of generators means commuting with the whole group they generate;
  • alternating: for every , matching “every operator commutes with itself”;
  • non-degenerate: if for all then (test against each single-qubit and ).

A form with these three properties is called symplectic, which is where the name of the module comes from. Note that it is not the ordinary dot product: a vector is always orthogonal to itself (under the dot product, ), and and , which are and on the same qubit, are not orthogonal even though, as -bit strings, they have disjoint supports.

3. Check matrices

A stabilizer group becomes a matrix whose rows are the binary vectors of the generators.

Definition 4.3 (Check matrix).

The check matrix of generators is the binary matrix

whose -th row is the binary vector of . The generators are independent iff the rows are linearly independent over , i.e. .

Proposition 4.2 (Validity and syndromes from the check matrix).

Let be a check matrix with independent rows.

  1. The generators pairwise commute iff , equivalently .
  2. For an error with binary vector , the syndrome is ; bit is 1 iff anticommutes with .
  3. The columns of are the syndromes of single-qubit errors: column is and column is . The syndrome of is their sum.

Commutation is only half of “is a valid stabilizer group”: the signs must also be chosen so that . With independent, commuting, Hermitian generators any choice of signs works, but the binary picture cannot see signs, so this is an extra layer of bookkeeping.

Example 4.1 (The five-qubit code).

The code has generators , , , (cyclic shifts). Its check matrix is

A direct computation gives (all six pairs commute) and , so . Reading the columns of gives the full syndrome table below. All 15 single-qubit errors have different, nonzero syndromes, and uses up every nonzero syndrome: the code is perfect. It is also not CSS: none of its 15 non-identity stabilizers is purely -type or purely -type (all have weight 4 and mix the two), so no generating set can be split into -checks and -checks.

Syndromes of the five-qubit code, bits ordered :

qubit 12345
00011000110001100011
10100101001010010100
10111101111011110111

4. The normalizer as a symplectic complement

The binary picture makes the structure of a code into a picture of nested subspaces. Identify with the row space , a subspace of dimension .

  • The normalizer. A Pauli commutes with every element of iff its vector satisfies . This set is the symplectic complement

which is the normalizer of Module 3 with phases stripped. Because the form is non-degenerate, .

  • Isotropy. Since the generators commute, . A subspace with this property is called isotropic.
  • Logical operators. The quotient has dimension : exactly enough room for .
  • Distance. , the lightest Pauli that commutes with all checks without being a check itself.
all Paulis mod phase: F_2^(2n), dim 2n normalizer S-perp: commutes with every check, dim 2n - r = n + k stabilizer S dim r = n - k logical classes S-perp / S, dim 2k

For the Steane code below, , , : the normalizer has dimension 8 and the logical quotient dimension 2.

A special case is worth naming. When the subspace is as large as an isotropic subspace can be ( forces ), and then . Such a subspace is called Lagrangian, and it describes a stabilizer state (). The Bell state with is the smallest example: and have and span a 2-dimensional, hence Lagrangian, subspace of .

5. A quick recap of classical linear codes

CSS codes are built from classical linear codes, so we recall the vocabulary.

  • A linear code is a subspace. If and the minimum weight of a nonzero codeword is , we write .
  • It can be given by a parity-check matrix with ; the syndrome of an error is .
  • The dual code is . If then .
  • The Hamming code has the parity-check matrix whose column is the binary expansion of (top row = least significant bit):

A single bit flip on bit produces syndrome binary(), which points straight at the error. Its dual is the simplex code; its 8 words all have weight 0 or 4, and it is contained in the Hamming code itself.

6. CSS codes

Here is the idea in plain words. A bit-flip () error is caught by -type checks, exactly like a classical code catches bit flips. A phase-flip () error is caught by -type checks, which is a classical code in the Hadamard-rotated basis. So take two classical codes, one for each job, and use them side by side. The only thing that can go wrong is that an -check and a -check fail to commute, and that turns into a simple orthogonality condition.

Definition 4.4 (CSS code).

A stabilizer code is CSS (Calderbank-Shor-Steane) if it has a generating set in which every generator is either a product of ‘s only or a product of ‘s only. Collecting the supports into binary matrices () and (), the check matrix has block form

In terms of classical codes, write (the bit strings that pass all -checks) and . Then the -checks span .

x part (n columns) z part (n columns) X checks Z checks H_X 0 0 H_Z commute iff H_X H_Z^T = 0
Theorem 4.1 (CSS commutation and dimension).

Let and be binary matrices with columns.

  1. The -type and -type generators commute iff

    equivalently (and, symmetrically, ).

  2. When this holds, the code encodes

    logical qubits.

Note that and are allowed to have redundant rows; only their ranks enter the count. This matters later: for the toric code in Module 7, the product of all star checks is the identity, and a torus () has 9 star checks of rank 8 and 9 plaquette checks of rank 8, so .

Decoding splits in two. For an error with binary vector , the syndrome of a CSS code is

The -checks see only the bit-flip part , and the -checks see only the phase-flip part . A decoder can therefore treat the two halves as two independent classical decoding problems (ignoring, at first, the correlation that a error flips both). This is exactly how matching decoders treat the surface code in Module 10.

7. Logical operators and distance of CSS codes

For CSS codes the logical operators can be chosen to be pure -type or pure -type, and they have a neat description as a quotient of two subspaces.

Proposition 4.3 (CSS logicals as a quotient).

For a CSS code with :

  1. An -type operator commutes with all checks iff ; it is itself a stabilizer iff . So -type logical classes are

  2. Likewise -type logical classes are , also of dimension .

  3. The distance is , where is the weight of the lightest -logical and .

If you have seen algebraic topology, this is homology. The two conditions and “logicals ” are the statements and for the chain complex

whose first homology is the space of -type logical classes. The -type classes come from the same complex read backwards (transpose every map), which swaps the roles of and ; both quotients have dimension . For the toric code of Module 7, which uses exactly this convention (, ), this is the homology of a torus, and the logical operators are the non-contractible loops.

Classical distance is only a lower bound. Since , we always have , and similarly . The inequality can be strict when low-weight classical codewords happen to be stabilizers. This is degeneracy, seen through the binary lens; the Shor code below is the standard example.

8. Worked examples

Example 4.2 (The repetition code as a quantum code).

Take (checks , ) and no -checks. Then .

  • -logicals: and , so .
  • -logicals: (no -checks) modulo . The nontrivial class contains , so .

The lightest logical has weight 1, so as a quantum code this is : it corrects bit flips but not a single phase flip. The binary picture makes the reason transparent: with no -checks, every error commutes with the checks.

Example 4.3 (The Steane code from the Hamming code).

Set . The generators are

Commutation. . Each row has weight 4 and any two rows overlap in exactly 2 positions, so every entry is even and the product is the zero matrix. In code language, the simplex code sits inside the Hamming code .

Dimension. .

Logicals. is the 16-word Hamming code and is its 8-word even-weight subcode, so the quotient has two classes: even-weight words (trivial) and odd-weight words (logical). Representatives are or the weight-3 word , giving . There are exactly 7 weight-3 representatives, and none of weight 1 or 2 (the Hamming code has distance 3). By symmetry (or ), and the code is .

Codewords. is the uniform superposition of the 8 even-weight Hamming codewords,

and is the superposition of the 8 odd-weight codewords.

The Tanner graph below is a compact way to draw : one circle per qubit, one square per row, and an edge wherever the matrix has a 1. In the Steane code each square stands for two checks, an -check and a -check on the same four qubits. We will use Tanner graphs again for belief propagation in Module 11 and for quantum LDPC codes in Module 12.

c1 c2 c3 1 2 3 4 5 6 7 checks qubits
Example 4.4 (The Shor code as a CSS code).

The Shor code from Module 1 has six -checks , , , , , and two -checks and :

Each -check overlaps each -check in 0 or 2 qubits, so , and .

Now look at . It contains the weight-2 word , so the classical code has distance only 2. But is a stabilizer: . Every weight-2 word in is of this kind, and the lightest nontrivial -logical has weight 3 (for example ). Similarly the lightest -logical has weight 3 (). So even though : the low-weight classical codewords are harmless because they act trivially on the code. This is the binary face of degeneracy from Module 3.

(Watch out: with , the operator acts as logical and as logical . Which representative is called is a convention; the distance does not care.)

One more small example that will reappear in the homework: gives the code with checks and . The overlap is 4, which is even, and .

9. How this connects to what comes next

The binary picture is not just notation. Three things in later modules depend on it directly.

  1. Simulation. A stabilizer state on qubits is an bit matrix plus sign bits, instead of complex amplitudes. Clifford gates act on it by column operations (Module 5) and measurements by row operations (Module 6).
  2. Topological codes. The toric and surface codes are CSS codes whose and are the incidence matrices of a lattice (Module 7, Module 8).
  3. Quantum LDPC codes. The hypergraph-product and bivariate-bicycle constructions in Module 12 are recipes for producing sparse pairs with .

Summary

Further reading

  • A. R. Calderbank and P. W. Shor, “Good quantum error-correcting codes exist,” Phys. Rev. A 54, 1098 (1996), arXiv:quant-ph/9512032.
  • A. M. Steane, “Multiple particle interference and quantum error correction,” Proc. R. Soc. A 452, 2551 (1996), arXiv:quant-ph/9601029.
  • D. Gottesman, Stabilizer Codes and Quantum Error Correction, PhD thesis, Caltech (1997), arXiv:quant-ph/9705052.
  • A. R. Calderbank, E. M. Rains, P. W. Shor, N. J. A. Sloane, “Quantum error correction via codes over GF(4),” IEEE Trans. Inf. Theory 44, 1369 (1998), arXiv:quant-ph/9608006.
  • J. Preskill, Lecture Notes for Physics 219, Chapter 7 “Quantum Error Correction”, sections 7.5-7.9. (Careful: Preskill orders the binary vector as and uses a real , so signs of products differ from these notes.)
  • P. Faist, Quantum Error Correction lecture notes (FU Berlin), sections 4.5-4.6.

Homework

Homework 4: Binary Symplectic Picture and CSS Codes