|q⟩ Bad Qubits

advanced · Programming · Implementing the Surface Code

Logical Qubits from Boundaries

The stabilizers tell us what is not a logical operation — anything in the group they generate acts trivially on the encoded state. So where does the logical qubit actually live? The answer is in the boundaries of the patch and the operators that stretch between them.

Counting the logical degree of freedom

A distance-dd patch has d2d^2 data qubits and, with appropriate boundaries, d21d^2 - 1 independent stabilizer generators. Each independent stabilizer halves the dimension of the allowed state space, so the protected code space has dimension

2d2(d21)=21=2,2^{\,d^2 - (d^2 - 1)} = 2^1 = 2,

exactly one logical qubit. The single leftover degree of freedom is the logical qubit; choosing its Xˉ\bar X and Zˉ\bar Z operators is choosing how to address it.

Logical operators are strings across the patch

The boundaries of a surface-code patch come in two types — call them "rough" and "smooth." A logical Zˉ\bar Z is a chain of ZZ operators running between the two opposite boundaries of one type; a logical Xˉ\bar X is a chain of XX operators running between the two boundaries of the other type. Because these strings connect opposite edges, they cannot be contracted to a point and absorbed into the stabilizer group: there is no product of plaquette and vertex checks that equals such a spanning string.

Two properties make these legitimate logical operators:

  1. They commute with every stabilizer. A logical Zˉ\bar Z string crosses each XX-type check it meets in an even number of qubits, so the anticommutations cancel.
  2. Xˉ\bar X and Zˉ\bar Z anticommute with each other, just like single-qubit XX and ZZ. Their two crossing strings overlap on exactly one data qubit, where XX and ZZ anticommute once — giving XˉZˉ=ZˉXˉ\bar X \bar Z = -\bar Z \bar X.

That single crossing point is the whole reason the encoded qubit behaves like a qubit: the algebra of Xˉ\bar X and Zˉ\bar Z on the lattice is identical to the Pauli algebra of one physical qubit.

Deformability and distance

A logical string is not unique. Multiplying it by a stabilizer slides and bends it into an equivalent string — the same logical operator realized on different qubits. What is invariant is the shortest representative: its length is the code distance dd, the minimum number of single-qubit errors that can implement a logical operation undetected.

The next lesson turns this picture into a number: how distance dd sets exactly how many errors the code can correct.

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