|q⟩ Bad Qubits

advanced · Physics · Stabilizer Formalism & CSS Codes

Logical Operators in Stabilizer Codes

A stabilizer code reserves some of its Hilbert space for logical information. The operators that act on that protected qubit — the logical Xˉ\bar X and Zˉ\bar Z — are themselves Pauli strings, but special ones. This lesson shows how to find them directly from the stabilizer, using the same symplectic algebra we have been building.

Three nested groups

The structure rests on three subgroups of Pn\mathcal{P}_n:

  1. The stabilizer S=g1,,gnkS = \langle g_1, \dots, g_{n-k}\rangle, the operators that act as identity on the codespace.
  2. The normalizer N(S)N(S) — the Paulis that commute with every element of SS. (For Pauli subgroups the normalizer equals the centralizer, since two Paulis either commute or anticommute.)
  3. Inside N(S)N(S), the stabilizer SS itself.

An operator in N(S)N(S) commutes with all stabilizers, so it maps the codespace to itself. If it also lies in SS, it acts trivially (as +1+1). The interesting operators are therefore those in N(S)N(S) but not in SS.

Definition of logical operators

A logical operator is a Pauli LN(S)SL \in N(S) \setminus S: it commutes with every stabilizer generator (preserving the codespace) but is not itself a product of stabilizers (so it acts non-trivially on the logical qubits).

Counting dimensions: SS has nkn-k independent generators, N(S)N(S) has n+kn+k, so the quotient N(S)/SN(S)/S has 2k2k independent generators. These pair up into kk logical Xˉ\bar X's and kk logical Zˉ\bar Z's. They must satisfy the same Pauli algebra as bare qubits:

{Xˉi,Zˉi}=0,[Xˉi,Zˉj]=0 (ij),\{\bar X_i, \bar Z_i\} = 0, \qquad [\bar X_i, \bar Z_j] = 0 \ (i \neq j),

i.e. Xˉi\bar X_i anticommutes with its partner Zˉi\bar Z_i and commutes with all other logical operators and all stabilizers.

Finding them in practice

To construct logical operators from the check matrix:

  1. Find Paulis whose binary vectors are symplectically orthogonal to every stabilizer row — these span N(S)N(S).
  2. Discard those already in the row space of the check matrix — these are in SS.
  3. From the remainder, choose representatives Xˉi,Zˉi\bar X_i, \bar Z_i obeying the canonical (anti)commutation relations. This is a linear-algebra problem over F2\mathbb{F}_2.

Logical operators are defined only up to multiplication by a stabilizer: LL and LgLg (for gSg \in S) act identically on the codespace, so we are free to pick the lowest-weight representative. The minimum weight over all logical operators is the code distance dd.

Example: the bit-flip code

The three-qubit bit-flip code has S=Z0Z1, Z1Z2S = \langle Z_0 Z_1,\ Z_1 Z_2\rangle, so n=3n=3, k=1k=1. Candidate logical operators:

These two anticommute (they overlap only at qubit 00, an XX-meets-ZZ position), realizing the logical qubit's Xˉ\bar X, Zˉ\bar Z algebra. The distance is d=1d = 1 here (Zˉ=Z0\bar Z = Z_0 has weight 1) — this code corrects bit flips but not phase flips, as expected.

Try it

Using the symplectic inner product, verify that Xˉ=X0X1X2\bar X = X_0 X_1 X_2 and Zˉ=Z0\bar Z = Z_0 are valid logical operators of the bit-flip code: both commute with the stabilizers Z0Z1Z_0 Z_1 and Z1Z2Z_1 Z_2, and they anticommute with each other.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.