In short

The Pauli group on n qubits, \mathcal P_n, is the set of all tensor products of single-qubit Pauli matrices \{I, X, Y, Z\} with phase factors \pm 1, \pm i. Two Pauli operators either commute or anticommute — never anything in between. A stabilizer is an abelian (commuting) subgroup S \subseteq \mathcal P_n that does not contain -I; it is specified by k independent generators, and its simultaneous +1 eigenspace is a 2^{n-k}-dimensional subspace of the 2^n-dimensional Hilbert space — a code. The bit-flip code is \{I, Z_0Z_1, Z_0Z_2, Z_1Z_2\} (generated by Z_0Z_1, Z_0Z_2), encoding 1 logical qubit into 3 physical qubits. Shor's 9-qubit code has 8 stabilizer generators. The stabilizer formalism unifies every quantum error correcting code into one algebraic framework; encoding becomes "project into the stabilized subspace", syndrome measurement becomes "measure the stabilizer generators", and recovery becomes "apply the Pauli matching the syndrome". And the Gottesman-Knill theorem tells you that circuits built from stabilizer operations can be classically simulated in polynomial time — a quantum advantage appears only when you leave the stabilizer world.

When Daniel Gottesman wrote his 1997 PhD thesis at Caltech, he was looking at Shor's 9-qubit code, Steane's 7-qubit code, and the two 3-qubit codes that preceded them (bit-flip and phase-flip), and noticed something. Every one of these codes defines its "correct" states by demanding that certain Pauli operators leave them unchanged: the bit-flip code demands Z_0Z_1|\psi\rangle = |\psi\rangle and Z_0Z_2|\psi\rangle = |\psi\rangle. The syndrome measurement is the measurement of these Pauli operators. The error detection is reading off their eigenvalues. The recovery is a Pauli correction.

Gottesman's thesis made this observation into a framework. He called it the stabilizer formalism. Instead of writing down the code subspace as a span of specific basis states (which becomes unwieldy for large codes), you describe it by listing the Pauli operators that fix it. A list of k commuting Pauli operators on n qubits fixes a 2^{n-k}-dimensional subspace — one logical qubit worth of code space when k = n-1, more when k < n-1.

This turned out to be not just a notational convenience. The stabilizer formalism is the language in which almost every modern quantum error correcting code is written. The Steane code, the surface code, the colour code, LDPC codes, fracton codes, topological codes in general — all are stabilizer codes. The framework gives you a unified syndrome-measurement procedure, a unified distance calculation, a unified logical-operator analysis, and a classical-simulation algorithm (Gottesman-Knill) that handles circuits built from stabilizer gates in polynomial time.

This chapter builds the formalism from the bottom up. You will meet the Pauli group, the abelian-subgroup condition, the stabilized subspace, and then see the bit-flip code, the phase-flip code, and Shor's 9-qubit code rewritten as stabilizer codes. By the end, you will have a framework that covers essentially every quantum code you will ever need to think about.

The Pauli group on n qubits

Start with one qubit. The Pauli matrices are I, X, Y, Z. Recall the multiplication rules:

X^2 = Y^2 = Z^2 = I, \qquad XY = iZ, \quad YZ = iX, \quad ZX = iY, \qquad YX = -iZ, \ldots

Why the factors of \pm i: these come from the commutation relations [X, Y] = 2iZ etc. Products of two Pauli matrices can pick up a phase of \pm i, so closure of "the group generated by \{X, Y, Z\}" requires including the phase factors \{\pm 1, \pm i\}.

The Pauli group on one qubit is the group generated by \{X, Y, Z\} under matrix multiplication, closed under the multiplication rules above. The elements are:

\mathcal P_1 \;=\; \{\pm I, \pm iI, \pm X, \pm iX, \pm Y, \pm iY, \pm Z, \pm iZ\}.

Sixteen elements total — four Pauli's times four phase factors \{+1, -1, +i, -i\}.

For n qubits, the Pauli group is the set of tensor products of one-qubit Pauli's, with phase factors:

\mathcal P_n \;=\; \{\beta \cdot P_1 \otimes P_2 \otimes \cdots \otimes P_n \;\mid\; P_i \in \{I, X, Y, Z\}, \;\beta \in \{\pm 1, \pm i\}\}.

The group has |\mathcal P_n| = 4 \cdot 4^n = 4^{n+1} elements. For n = 3 qubits (the bit-flip code), this is 4^4 = 256 elements.

Example two-qubit Pauli operators (with identity phase):

The weight of a Pauli operator is the number of non-identity factors. X_0 \otimes I has weight 1; X_0 X_1 Z_2 has weight 3; identity has weight 0.

The Pauli group on n qubitsA diagram showing tensor products of Pauli matrices with phase factors. Top row shows a single qubit with four Pauli's and four phases. Below, a three-qubit example: X on qubit 0, Z on qubit 1, identity on qubit 2, with overall phase.Elements of 𝒫ₙ — tensor products with phase factorsSingle qubit 𝒫₁ (16 elements):±I, ±iI±X, ±iX±Y, ±iY±Z, ±iZThree-qubit example: X₀Z₁I₂ =XZIweight 2 (two non-identity factors)Group size:|𝒫ₙ| = 4 · 4ⁿ = 4ⁿ⁺¹— 4 Pauli's per qubit × 4 phase factorsCommutation:always ±1 — never in between
The Pauli group on $n$ qubits. Each element is a tensor product of single-qubit Pauli's (each in $\{I, X, Y, Z\}$), multiplied by a global phase in $\{+1, -1, +i, -i\}$. The group has $4^{n+1}$ elements. The weight of an element is the number of non-identity tensor factors.

Commutation — the defining structural fact

Here is the single most important fact about the Pauli group: any two Pauli operators either commute or anticommute — there is no middle ground.

To see why, take two Pauli operators P = P_1 \otimes \cdots \otimes P_n and Q = Q_1 \otimes \cdots \otimes Q_n. On each qubit i, the single-qubit Pauli's P_i and Q_i either commute ([P_i, Q_i] = 0, which happens when either is I or they are equal) or anticommute (\{P_i, Q_i\} = 0, which happens when they are different non-identity Pauli's, like X_i and Z_i).

For the tensor products, PQ = \prod_i P_i Q_i and QP = \prod_i Q_i P_i, so the ratio is

PQ\,(QP)^{-1} \;=\; \prod_i (P_i Q_i)(Q_i P_i)^{-1} \;=\; \prod_i (\pm 1).

Why this product is always \pm 1: each factor is either +1 (if P_i, Q_i commute) or -1 (if they anticommute). The product of \pm 1's is \pm 1.

So PQ = \pm QP. If the number of qubits where P and Q anticommute is even, the overall ratio is +1 (they commute). If odd, the ratio is -1 (they anticommute).

Example. X_0 X_1 and Z_0 Z_1: on qubit 0, X and Z anticommute. On qubit 1, same. Two anticommutations, product is +1 → the two operators commute. Check: (X_0 X_1)(Z_0 Z_1) = X Z \otimes X Z = (-iY)(-iY) = -Y \otimes Y = -Y_0 Y_1, and (Z_0 Z_1)(X_0 X_1) = Z X \otimes Z X = (iY)(iY) = -Y_0 Y_1 — same thing. They commute.

Example. X_0 and Z_0: on qubit 0, X and Z anticommute. On all other qubits, both are identity (commute). One anticommutation → overall anticommutation. X_0 Z_0 = -Z_0 X_0. Consistent.

This "commute-or-anticommute dichotomy" is what makes the Pauli group the right setting for error correction. Measurements of Pauli operators produce \pm 1 outcomes (the eigenvalues); the syndrome eigenvalues factor cleanly into "this stabiliser commuted with the error, eigenvalue +1" or "this stabiliser anticommuted with the error, eigenvalue -1". No intermediate eigenvalues to worry about; the error detection is binary.

Pauli commutation — every pair is ±1A table showing the products P Q versus Q P for two Pauli operators. Both factor as a product over qubits, each factor being plus or minus 1. Total sign is even or odd parity of anticommutations.Commutation is binary: +1 (commute) or −1 (anticommute)PQ = +QPeven number of anticommutationsPQ = −QPodd number of anticommutationsSingle-qubit table:I with anycommuteX,Y samecommuteX,Y diffanticommuteX,Z diffanticommute
Commutation of Pauli operators is binary. Two multi-qubit Pauli's $P$ and $Q$ either commute ($PQ = QP$) or anticommute ($PQ = -QP$). Which of the two is determined by the parity (even/odd) of the number of qubits on which the single-qubit factors anticommute.

Stabilizer — an abelian subgroup

Stabilizer

A stabilizer is a subgroup S \subseteq \mathcal P_n of the n-qubit Pauli group satisfying two conditions:

  1. Abelian: every pair of elements in S commutes. (Recall: since every Pauli pair either commutes or anticommutes, the abelian condition is that no two elements anticommute.)
  2. Does not contain -I: the element -I \otimes I \otimes \cdots \otimes I (the negative identity on all qubits) is not in S.

A stabilizer is typically specified by a small set of generators g_1, \ldots, g_k \in \mathcal P_n. These are Pauli operators such that every element of S is a product of them (with some sign):

S \;=\; \{\text{products of } g_1, \ldots, g_k\}.

An abelian group generated by k mutually commuting, independent generators has 2^k elements.

The abelian condition is needed because the simultaneous eigenspaces of non-commuting operators are in general empty — you cannot be in a definite eigenstate of two Pauli's that anticommute. The -I exclusion is needed because -I has no +1 eigenvector (its eigenvalues are both -1), and a stabilizer's whole point is to define states fixed with eigenvalue +1.

What a stabilizer stabilizes

Given a stabilizer S with generators g_1, \ldots, g_k, the code subspace \mathcal C is the set of states fixed by every generator:

\mathcal C \;=\; \{|\psi\rangle \in (\mathbb C^2)^{\otimes n} \;\mid\; g_i|\psi\rangle = |\psi\rangle \text{ for all } i\}.

Equivalently, \mathcal C is the simultaneous +1-eigenspace of all the generators, which (because they commute and are each involutions with eigenvalues \pm 1) has dimension exactly 2^{n-k}:

\dim \mathcal C \;=\; 2^{n-k}.

Why the dimension is 2^{n-k}: each generator splits the 2^n-dimensional Hilbert space into two equal-dimensional eigenspaces (+1 and -1). The intersection of k such splits is 2^n / 2^k = 2^{n-k}. This assumes the generators are independent (no one generator is a product of the others), which is the natural case.

When k = n-1: code dimension is 2^1 = 2, which encodes exactly 1 logical qubit. This is the typical case for the small codes (bit-flip, phase-flip, Shor 9-qubit — n-k = 1 in all of them). When k = n-2: code dimension is 2^2 = 4, encoding 2 logical qubits. Larger codes, like the surface code with many logical qubits, use k < n.

The bit-flip code as a stabilizer code

Now rewrite the 3-qubit bit-flip code in the new language.

Setup. n = 3 physical qubits. Generators of the stabilizer:

g_1 \;=\; Z_0 Z_1 \;=\; Z \otimes Z \otimes I, \qquad g_2 \;=\; Z_0 Z_2 \;=\; Z \otimes I \otimes Z.

Check the stabilizer conditions.

Abelian. Commutator g_1 g_2: on qubit 0, Z \cdot Z = I; on qubit 1, Z \cdot I = Z; on qubit 2, I \cdot Z = Z. So g_1 g_2 = I \otimes Z \otimes Z = Z_1 Z_2. And g_2 g_1: on qubit 0, Z \cdot Z = I; qubit 1, I \cdot Z = Z; qubit 2, Z \cdot I = Z. Same result. Commute. ✓

Does not contain -I. The generators and their products (g_1, g_2, g_1 g_2 = Z_1 Z_2, I) are all ordinary Pauli's with positive phase. No -I. ✓

The stabilizer S = \{I, Z_0Z_1, Z_0Z_2, Z_1Z_2\} has 4 = 2^2 elements.

Identify the code subspace. The code space has dimension 2^{n-k} = 2^{3-2} = 2, so it encodes one logical qubit.

Explicitly: which two-dimensional subspace of the eight-dimensional 3-qubit Hilbert space is simultaneously fixed by Z_0Z_1 and Z_0Z_2?

Apply Z_0 Z_1 to a basis state |abc\rangle (with a, b, c \in \{0, 1\}): eigenvalue is (-1)^{a+b}. For eigenvalue +1, need a = b. Similarly Z_0 Z_2 gives eigenvalue (-1)^{a+c} and requires a = c. Both together: a = b = c. So |000\rangle and |111\rangle are the two computational-basis states in the code subspace.

\mathcal C_{\text{bit-flip}} \;=\; \text{span}\{|000\rangle, |111\rangle\}.

Exactly the encoded logical basis of the bit-flip code. The stabilizer formalism recovers the same code.

Bit-flip code as a stabilizer codeThree qubits with two stabilizer generators Z0Z1 and Z0Z2 shown. The code subspace spanned by |000⟩ and |111⟩ is highlighted.Bit-flip code as stabilizer: S = ⟨Z₀Z₁, Z₀Z₂⟩generatorsg₁ = Z₀Z₁g₂ = Z₀Z₂(they commute ✓)code subspace 𝒞|0⟩_L = |000⟩|1⟩_L = |111⟩dim 2 = 2³⁻²logical operators (commute with S, not in S):Z_L = Z₀ (or Z₁ or Z₂ — equivalent modulo stabilizers)X_L = X₀X₁X₂ — flips all three qubits, |000⟩ ↔ |111⟩
The bit-flip code as a stabilizer code. Two generators $Z_0Z_1$ and $Z_0Z_2$ define the simultaneous $+1$-eigenspace, which is $\text{span}\{|000\rangle, |111\rangle\}$ — exactly the encoded basis. The logical operators $Z_L = Z_0$ and $X_L = X_0X_1X_2$ are Pauli's that commute with the stabilizer but are not themselves in it; they act non-trivially on the code subspace.

Logical operators

Once you have a stabilizer code, you need operations that act on the logical qubits — things that take the encoded |0\rangle_L to |1\rangle_L and back. These are the logical operators.

A logical Pauli operator \bar P is a Pauli operator on the physical qubits that:

  1. Commutes with every stabilizer generator (otherwise it would map the code subspace out of itself).
  2. Is not itself in the stabilizer (otherwise it would act as the identity on the code subspace).

For the bit-flip code:

Logical operators are not unique. Z_L = Z_1 and Z_L = Z_2 would also work (check: they commute with g_1, g_2 and act as logical Z on the code). Two different physical Pauli's are "the same logical operator" if they differ by a stabilizer element — and indeed, Z_0 \cdot Z_0 Z_1 = Z_1, so Z_0 and Z_1 are equivalent up to the stabilizer Z_0 Z_1.

The weight of a logical operator (minimum over all equivalent choices) is connected to the code's distance. The bit-flip code's logical Z has minimum weight 1 (just Z_0), so the code has distance 1 in the Z direction — it can detect zero Z errors. The logical X has minimum weight 3 (X_0X_1X_2), so it can handle two X errors before the logical operator is triggered by accident. The distance of the code is the minimum of these two, which is 1 — consistent with the bit-flip code being blind to Z errors (hence why Shor concatenated it with a phase-flip code).

The phase-flip code as a stabilizer code

Run the same exercise for the phase-flip code.

Generators. g_1 = X_0 X_1, g_2 = X_0 X_2.

Check. Both are products of X's; they commute with each other because the number of qubits on which X appears in both is 1, but X commutes with X, so the count of anticommutations is zero (even). ✓. Not -I. ✓.

Code subspace. Simultaneous +1-eigenspace of X_0X_1 and X_0X_2. Recall X|+\rangle = |+\rangle, X|-\rangle = -|-\rangle. Eigenvalue of X_0X_1 on |s_0 s_1 s_2\rangle (where each s_i \in \{+, -\}) is (-1)^{[s_0 = -] + [s_1 = -]}. For eigenvalue +1, parity must be even: s_0 = s_1. Similarly s_0 = s_2. So s_0 = s_1 = s_2, and the code states are |{+}{+}{+}\rangle and |{-}{-}{-}\rangle.

\mathcal C_{\text{phase-flip}} \;=\; \text{span}\{|{+}{+}{+}\rangle, |{-}{-}{-}\rangle\}.

Exact match with the phase-flip code's encoded basis.

Logical operators. X_L = X_0 (commutes with both generators because X_0^2 = I in each product; not in S). Z_L = Z_0 Z_1 Z_2 (commutes because three anticommutations with X_0X_1 = odd... wait, let me recount: Z_0 Z_1 Z_2 anticommutes with X_0 X_1 on qubits 0 and 1, which is two anticommutations, even → commute ✓). The roles of X and Z are swapped compared to the bit-flip code, as expected — phase-flip is the Hadamard-conjugate of bit-flip.

Shor's 9-qubit code as a stabilizer code

Now the main event. Shor's 9-qubit code has n = 9 physical qubits encoding k = 1 logical qubit, so n - k = 8 stabilizer generators.

From the analysis in shor-9-qubit-code, the generators are:

Six inner stabilizers (bit-flip-type, one pair per block of three):

g_1 = Z_1 Z_2, \quad g_2 = Z_2 Z_3, \quad g_3 = Z_4 Z_5, \quad g_4 = Z_5 Z_6, \quad g_5 = Z_7 Z_8, \quad g_6 = Z_8 Z_9.

Two outer stabilizers (phase-flip-type, spanning blocks):

g_7 = X_1 X_2 X_3 X_4 X_5 X_6, \qquad g_8 = X_4 X_5 X_6 X_7 X_8 X_9.

Check abelian. The inner generators all commute among themselves (pairs of ZZ factors always commute with each other, since Z's commute with each other and with I). The outer generators commute with each other (both are products of X's; X's commute with X's).

The interesting check is inner-outer commutation. Take g_1 = Z_1 Z_2 and g_7 = X_1 X_2 X_3 X_4 X_5 X_6. On qubit 1, Z vs X — anticommute. On qubit 2, Z vs X — anticommute. On qubit 3, I vs X — commute. On qubits 4-9, I vs X — commute. Total anticommutations: 2, even. They commute. ✓

Every g_i (inner ZZ) vs every g_j (outer XXXXXX) has exactly 2 qubits on which both act non-trivially, and those 2 qubits give 2 anticommutations (even). So inner-outer pairs always commute.

The 8 generators are all mutually commuting — a valid stabilizer.

Code dimension. 2^{9-8} = 2, one logical qubit. ✓

Logical operators.

Z_L \;=\; Z_1 Z_2 Z_3 \;=\; Z_4 Z_5 Z_6 \;=\; Z_7 Z_8 Z_9 \;\; (\text{equivalent modulo the inner stabilizers}),
X_L \;=\; X_1 X_4 X_7 \;=\; X_2 X_5 X_8 \;=\; X_3 X_6 X_9 \;\; (\text{equivalent modulo the outer stabilizers}).

Both have minimum weight 3 (taking one choice out of the equivalent options). The distance of Shor's code is 3: it can detect up to 2 errors and correct 1 error in any Pauli direction. This matches the original analysis of Shor's code as a single-error-correcting code.

Worked examples

Example 1: Verify the bit-flip code's stabilizer

Show explicitly that g_1 = Z_0Z_1 and g_2 = Z_0Z_2 commute, and that their simultaneous +1-eigenspace is spanned by |000\rangle and |111\rangle.

Step 1. Commutation. Compute g_1 g_2 and g_2 g_1.

g_1 g_2 \;=\; (Z_0 Z_1)(Z_0 Z_2) \;=\; Z_0^2 \otimes Z_1 \otimes Z_2 \;=\; I_0 \otimes Z_1 \otimes Z_2 \;=\; Z_1 Z_2.

Why the tensor rearrangement works: tensor products on different qubits commute. Z_0 on qubit 0 commutes with Z_1 on qubit 1 (they act on different subsystems). So Z_0 Z_1 Z_0 Z_2 = Z_0 Z_0 Z_1 Z_2 = I Z_1 Z_2 = Z_1 Z_2.

g_2 g_1 \;=\; (Z_0 Z_2)(Z_0 Z_1) \;=\; Z_0^2 \otimes Z_1 \otimes Z_2 \;=\; Z_1 Z_2.

Same. g_1 g_2 = g_2 g_1 = Z_1 Z_2. Commute. ✓

Step 2. Apply g_1 to each computational basis state. For |abc\rangle, g_1|abc\rangle = (-1)^{a+b}|abc\rangle.

state a+b eigenvalue of g_1
|000\rangle 0 +1
|001\rangle 0 +1
|010\rangle 1 −1
|011\rangle 1 −1
|100\rangle 1 −1
|101\rangle 1 −1
|110\rangle 2 +1
|111\rangle 2 +1

So the +1-eigenspace of g_1 is \text{span}\{|000\rangle, |001\rangle, |110\rangle, |111\rangle\} — four states where a = b.

Step 3. Apply g_2. Similarly, g_2|abc\rangle = (-1)^{a+c}|abc\rangle. The +1-eigenspace of g_2 is \text{span}\{|000\rangle, |010\rangle, |101\rangle, |111\rangle\} — four states where a = c.

Step 4. Intersect. Both a = b and a = c, so a = b = c. Two states survive: |000\rangle and |111\rangle.

\mathcal C_{\text{bit-flip}} \;=\; \text{span}\{|000\rangle, |111\rangle\}.

Result. The stabilizer \langle Z_0Z_1, Z_0Z_2\rangle defines a 2-dimensional code subspace spanned by the states with all three bits equal — exactly the original bit-flip-code logical basis. The stabilizer formalism recovers the code by algebra rather than by explicit construction.

What this shows. A stabilizer is not a different object from a code — it is the same code, described algebraically by the Pauli operators it demands be +1. The 8-dimensional 3-qubit Hilbert space is carved down to 2 dimensions by two commuting-constraint equations. Each stabilizer generator halves the dimension.

Example 2: Derive the 8 stabilizer generators of Shor's code

Starting from the structure of Shor's 9-qubit code (three blocks of three qubits, each encoded as a bit-flip block within an outer phase-flip code), enumerate the 8 generators that define the code subspace.

Setup. Shor's code has n = 9 physical qubits encoding k = 1 logical qubit, so there are n - k = 8 stabilizer generators. The encoded logical basis is

|0\rangle_L \;\propto\; (|000\rangle + |111\rangle)^{\otimes 3}, \qquad |1\rangle_L \;\propto\; (|000\rangle - |111\rangle)^{\otimes 3}.

Need 8 Pauli operators that fix both logical states.

Step 1. Inner bit-flip generators (block A). Block A contains qubits 1, 2, 3, and is in the state (|000\rangle \pm |111\rangle)/\sqrt 2. The bit-flip-code stabilizers for three qubits are Z_1Z_2 and Z_2Z_3 (or equivalently Z_1Z_2 and Z_1Z_3 — the two are related by a stabilizer multiplication). Each acts as (-1)^{\text{bit difference}} on a computational basis state. On |000\rangle: eigenvalue +1. On |111\rangle: also +1 (because (-1)^{1+1} = +1). So the superposition (|000\rangle \pm |111\rangle) is a +1-eigenstate of both Z_1Z_2 and Z_2Z_3. ✓

g_1 = Z_1 Z_2, \qquad g_2 = Z_2 Z_3.

Step 2. Inner bit-flip generators (blocks B and C). By symmetry, the same pair of inner stabilizers lives in block B (qubits 4, 5, 6) and block C (qubits 7, 8, 9):

g_3 = Z_4 Z_5, \quad g_4 = Z_5 Z_6, \quad g_5 = Z_7 Z_8, \quad g_6 = Z_8 Z_9.

Step 3. Outer phase-flip generators. The outer code treats each block as a single "qubit" in the phase-flip code. The phase-flip code on three qubits has stabilizers X_0 X_1 and X_0 X_2. Lifting through the bit-flip encoding: each outer "X" becomes the bit-flip-code logical X, which is X \otimes X \otimes X on the three physical qubits of the block. So outer X_0 X_1 (comparing block A and block B) becomes (X_1 X_2 X_3)(X_4 X_5 X_6):

g_7 \;=\; X_1 X_2 X_3 X_4 X_5 X_6.

And outer X_0 X_2 (comparing block A and block C) becomes (X_1 X_2 X_3)(X_7 X_8 X_9):

g_8 \;=\; X_1 X_2 X_3 X_7 X_8 X_9.

(Equivalently, you could use X_4 X_5 X_6 X_7 X_8 X_9 as the second outer generator, since g_7 \cdot this = g_8 modulo the inner stabilizers. Either choice is fine.)

Step 4. Verify the counts and the code dimension. Eight generators, nine qubits, code dimension 2^{9-8} = 2. One logical qubit, as expected. Why this count is consistent: Shor's code encodes one logical qubit in 9 physical ones. The stabilizer must have 8 independent generators to carve a 2-dimensional subspace out of the 512-dimensional (2^9) total Hilbert space.

Step 5. Verify abelian-ness. The six inner ZZ generators obviously commute (all products of Z's). The two outer XXXXXX generators commute with each other (X with X, no anticommutation issues). Inner vs outer: each inner Z_iZ_j shares two qubits with the outer X\otimes X\otimes\cdots\otimes X on its block, giving two anticommutations (even) — commute. ✓ All 28 pairs commute.

Result. The 8 stabilizer generators of Shor's code are

\{Z_1Z_2, Z_2Z_3, Z_4Z_5, Z_5Z_6, Z_7Z_8, Z_8Z_9, X_1X_2X_3X_4X_5X_6, X_1X_2X_3X_7X_8X_9\}.

What this shows. Concatenation in Shor's code corresponds to a direct-sum-like construction in the stabilizer formalism: the inner code contributes 2 \times 3 = 6 generators (two per block), and the outer code contributes 2 generators (lifted through the inner encoding). Total: 8 generators. This is the general rule for concatenation — if the inner code has n_1 - k_1 generators and the outer code has n_2 - k_2 generators, the concatenated code on n_1 n_2 qubits has (n_1 - k_1) \cdot k_2 (from the inner codes, one per outer block) plus (n_2 - k_2) (from the outer code, lifted) total generators — confirming the expected reduction of logical qubits.

Shor's 9-qubit code — 8 stabilizer generatorsA table showing 8 stabilizer generators for Shor's 9-qubit code, organized into 6 inner (bit-flip within each block) and 2 outer (phase-flip between blocks).Shor's 9-qubit code: 8 stabilizer generatorsInner bit-flip stabilizers (6)Block Ag₁ = Z₁Z₂g₂ = Z₂Z₃Block Bg₃ = Z₄Z₅g₄ = Z₅Z₆Block Cg₅ = Z₇Z₈g₆ = Z₈Z₉Outer phase-flip (2)g₇ = X₁X₂X₃·X₄X₅X₆g₈ = X₁X₂X₃·X₇X₈X₉(span two blocks)Logical operators:Z_L = Z₁Z₂Z₃ (or any block's Z_L)X_L = X₁X₄X₇ (one qubit per block)Code: n=9, k=1, d=3 (detects 2, corrects 1)
The 8 stabilizer generators of Shor's 9-qubit code. Six inner $ZZ$ stabilizers catch $X$ errors within each block. Two outer $XXXXXX$ stabilizers catch $Z$ errors between blocks. Logical operators (minimum weight 3 each) determine the code's distance $d = 3$.

Common confusions

Going deeper

If you have the key ideas — Pauli group, commuting subgroup, code subspace, logical operators — you can read almost any modern QEC paper. This section develops the binary (symplectic) representation that makes stabilizer computations algorithmic, the Gottesman-Knill theorem, and the connection to universal fault-tolerant computation.

The symplectic vector space structure

Pauli operators on n qubits have a beautiful binary-vector representation. Encode each single-qubit Pauli as a pair of bits:

I \to (0, 0), \quad X \to (1, 0), \quad Z \to (0, 1), \quad Y \to (1, 1).

A multi-qubit Pauli is a 2n-bit vector: the first n bits encode "does qubit i have an X-part?" and the next n encode "Z-part?". Example: X_0 Z_1 = X \otimes Z on 2 qubits becomes (1, 0 \,|\, 0, 1) \in \mathbb F_2^4.

Multiplication of Pauli's corresponds to addition mod 2 of their binary vectors. Commutation of two Pauli's P, Q with binary vectors (a, b) and (c, d) is given by the symplectic inner product:

\omega((a,b), (c,d)) \;=\; a \cdot d + b \cdot c \pmod 2.

If \omega = 0, they commute; if \omega = 1, they anticommute.

The stabilizer's condition "every pair of generators commutes" becomes "every pair of binary vectors has symplectic inner product 0", which is a linear condition in binary linear algebra. This turns the whole stabilizer-code theory into binary-code theory — the same algebra you might have encountered for classical error-correcting codes, specifically self-orthogonal codes over \mathbb F_2 with respect to the symplectic form.

The Gottesman-Knill theorem (below) is a direct consequence: stabilizer operations correspond to linear algebra over \mathbb F_2, which is solvable in polynomial time on a classical computer.

The Gottesman-Knill theorem — classical simulation of stabilizer circuits

Theorem. A quantum circuit composed of:

can be simulated on a classical computer in polynomial time in the number of qubits.

The proof uses the symplectic representation. The Clifford group is exactly the group of unitaries that map Pauli's to Pauli's under conjugation: U P U^\dagger is another Pauli operator (possibly with a sign) for every Pauli P and every Clifford U. Starting from a stabilizer state (a +1-eigenstate of some stabilizer), applying a Clifford, and measuring a Pauli — all three steps can be tracked by updating the binary-vector representation of the stabilizer.

Cost of simulation. Updating the stabilizer for a single Clifford gate is O(n) (modify O(n) generator vectors with O(n) binary operations each). A measurement is O(n^2) (solve a linear system). A full circuit with T Clifford gates and M measurements costs O(Tn + Mn^2) classically — polynomial, fast.

Going beyond stabilizer — T gates, magic states, and universality

The Clifford group is not universal for quantum computation. You can compute everything within the Clifford set classically. The set becomes universal only when you add a non-Clifford gate — the most common choice being the T gate (the \pi/8 gate):

T \;=\; \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}.

T does not map Pauli's to Pauli's; it takes X \to e^{i\pi/4}(I + X)/2 \cdot \text{something}, which is not in the stabilizer formalism. Adding T gates to Clifford gates gives you universal quantum computation — with the cost that simulation becomes exponentially hard (in the number of T gates).

For fault-tolerant quantum computing, the leading technique is magic-state distillation: prepare high-fidelity copies of the T-gate "magic state" |T\rangle = (|0\rangle + e^{i\pi/4}|1\rangle)/\sqrt 2 using only Clifford operations (which the stabilizer codes can do transversally), then "inject" the magic state to execute a logical T gate. This keeps the computation fault-tolerant because every step except the magic-state preparation (which is done separately and heavily protected) stays within the Clifford-plus-stabilizer framework.

Quotient group and the physical meaning of \mathcal P_n / \text{center}

The center of the Pauli group is \{\pm I, \pm iI\} — the phase factors themselves. These multiply every Pauli by a global phase and do not affect its action on states. Modding out by the center gives the quotient group \mathcal P_n / Z(\mathcal P_n), which has 4^n elements — one per "physically distinct" multi-qubit Pauli operator.

This quotient is an abelian group (actually \mathbb F_2^{2n}, the binary symplectic space of the previous section). The stabilizer is a subspace of this quotient, and its commutation condition becomes the symplectic self-orthogonality we wrote above.

The quotient structure is why stabilizer codes have such clean algebraic properties. All of Gottesman's results, including the Gottesman-Knill theorem, flow from the fact that the symplectic space is a finite-dimensional vector space over \mathbb F_2 — a setting where linear algebra does the work.

Stabilizer codes in Indian quantum research

The National Quantum Mission (2023, ₹6000 crore) has fault-tolerant quantum computing as one of four major thrust areas. Indian research on stabilizer codes and their applications:

The stabilizer formalism is the common language; almost every quantum computing research group globally and in India speaks it. Understanding the material in this chapter is enough to read the current fault-tolerance literature, including the proposals for logical-qubit benchmarks that several Indian groups are pursuing in collaboration with international partners.

Beyond stabilizer — subsystem codes, bosonic codes, fracton codes

The stabilizer formalism covers the vast majority of quantum codes, but there are generalisations:

These are all stabilizer codes in a suitable generalised sense, and all of them inherit the commute-or-anticommute algebra that is the foundation of this chapter.

Where this leads next

References

  1. Daniel Gottesman, Stabilizer codes and quantum error correction (PhD thesis, 1997) — arXiv:quant-ph/9705052. The thesis that introduced the stabilizer formalism and the Gottesman-Knill theorem. The primary reference for this chapter.
  2. Nielsen and Chuang, Quantum Computation and Quantum Information (2010), §10.5 (stabilizer codes) — Cambridge University Press. Standard textbook presentation.
  3. John Preskill, Lecture Notes on Quantum Computation, Chapter 7 — theory.caltech.edu/~preskill/ph229. Pedagogical derivation of the stabilizer formalism and its use in QEC.
  4. Wikipedia, Stabilizer code — accessible overview with the binary symplectic representation and examples.
  5. Wikipedia, Pauli group — formal definition of the Pauli group on n qubits and its structure.
  6. Wikipedia, Gottesman–Knill theorem — classical simulation of stabilizer circuits in polynomial time.