Principle. A unitary U that maps the stabilizer group to itself under
conjugation maps the code space to itself. Its action on the encoded qubit is then
fixed, up to a phase, by the images of Xˉ and Zˉ, because these two
operators generate all operators on the encoded qubit.
Preliminaries. Xˉ=X⊗n commutes with every Zf because
∣f∣ is even, and XˉZˉ=(−1)nZˉXˉ=−ZˉXˉ because n is
odd. The single-qubit identities used are HXH=Z, SXS†=Y=iXZ,
S†XS=−Y=−iXZ, and SZS†=Z.
1. Hadamard. H⊗nXfH⊗n=Zf and
H⊗nZfH⊗n=Xf, so the set of generators is mapped to itself.
Also H⊗nXˉH⊗n=Zˉ and conversely, which is the
action of a logical Hadamard.
2. Alternating phase gate. UT commutes with every Zf. For an X check,
UTXfUT†=v∈f∩T∏(iXvZv)v∈f∩Tc∏(−iXvZv)=i∣f∩T∣(−i)∣f∩Tc∣XfZf,
where the last step uses that Pauli operators on different qubits commute, so
∏v∈fXvZv=XfZf. By assumption
∣f∩T∣=∣f∩Tc∣, so the prefactor is
(i⋅(−i))∣f∩T∣=1 and UTXfUT†=XfZf, a product of
generators. Hence UT preserves the stabilizer group. On the logical operators,
UTZˉUT†=Zˉ and
UTXˉUT†=i∣T∣(−i)∣Tc∣X⊗nZ⊗n=i∣T∣−∣Tc∣XˉZˉ.
The exponent is odd because n=∣T∣+∣Tc∣ is odd. A logical S gate
maps Xˉ↦iXˉZˉ and a logical S† maps
Xˉ↦−iXˉZˉ; both fix Zˉ. So UT is the logical S
when ∣T∣−∣Tc∣≡1(mod4) and the logical S† when it is
≡3(mod4).
3. Uniform phase gate. The same computation with T the set of all qubits
gives S⊗nXfS†⊗n=i∣f∣XfZf, which is
XfZf exactly when ∣f∣≡0(mod4), and
S⊗nXˉS†⊗n=inXˉZˉ.
4. Controlled-NOT. A controlled-NOT with control c and target t maps
Xc↦XcXt, Zt↦ZcZt and fixes Xt and Zc. Applied
qubit-wise to two blocks it maps Xf⊗I↦Xf⊗Xf,
I⊗Zf↦Zf⊗Zf and fixes I⊗Xf and Zf⊗I, so
the stabilizer group of the pair of blocks is preserved. The same rule applied to
the logical operators gives Xˉ⊗I↦Xˉ⊗Xˉ and
I⊗Zˉ↦Zˉ⊗Zˉ, the action of a logical
controlled-NOT. This step holds for every CSS code.
The assumptions hold for triangular color codes. Faces are even and overlap
evenly by the definition of the lattice, n is odd and k=1. The lattice of a
triangular code is a subgraph of a three-valent lattice on the sphere all of whose
faces are even; a graph drawn on the sphere with all faces even is bipartite, so
its vertices split into two classes with every edge joining different classes.
Going around a face, the vertices alternate between the classes, so every face is
split evenly.
Check on the Steane code. Label the qubits so that the faces are
{1,3,5,7}, {2,3,6,7}, {4,5,6,7}. The two classes are
T={1,2,4,7} and Tc={3,5,6}, each face having two qubits in
each. Then ∣T∣−∣Tc∣=1, so S on qubits 1,2,4,7 and S† on
3,5,6 is the logical S. All faces have 4 qubits and n=7≡3(mod4),
so by item 3 the uniform S⊗7 is the logical S†. The two statements
agree: S⊗7=UT⋅Z3Z5Z6, and Z3Z5Z6 times the three
Z checks is Z⊗7=Zˉ, while SZ=S†.