# Transversal logical gate for Stabilizer (or at least Steane code)

I know that for Steane code, we can implement transversally some gates like cNOT, Hadamard and Pauli.

What I am looking for is a resource in which it is explained why implementing those gate give rise to the good logical operation.

If this is a result more general than Steane I would be interested in a "general enough" approach showing it.

Let $$\mathcal{H}$$ be the Hilbert space of a set of physical qubits and let $$S$$ be the stabilizer group of a stabilizer code $$\mathcal{G} \subset \mathcal{H}$$.

A transversal operator $$U$$ on $$\mathcal{H}$$ implements a logical operator on $$\mathcal{G}$$ if it maps $$\mathcal{G}$$ back to itself. This can be established by showing that $$U$$ does not change the stabilizer group $$S$$ of $$\mathcal{G}$$. In order to do this, we need to know how stabilizers transform under unitary gates. Suppose that $$g$$ is an operator that stabilizes $$|\psi\rangle$$, i.e. $$g|\psi\rangle = |\psi\rangle$$. Then

$$UgU^\dagger U|\psi\rangle = Ug|\psi\rangle = U|\psi\rangle\tag1$$

and we see that $$UgU^\dagger$$ stabilizes $$U|\psi\rangle$$. We will use this fact to demonstrate that certain transversal operators do not change the stabilizer group of stabilizer codes that meet certain criteria. We will also use $$(1)$$ to determine the action of those transversal operators within the code subspace by analyzing their effect on the logical Pauli operators.

## Controlled-NOT

Claim: If $$\mathcal{G}=CSS(C_1, C_2)$$ is a Calderbank-Shor-Steane code for classical linear codes $$C_1$$ and $$C_2$$, $$C_2^\perp \subset C_1$$ then transversal CNOT is a logical CNOT on $$\mathcal{G}$$.

Remark 1: There is ambiguity in the use of the $$CSS(C_1, C_2)$$ notation in the literature. For example, Wikipedia and Nielsen & Chuang put $$C_2^\perp$$ in the second position rather than $$C_2$$.

Remark 2: The condition $$C_2^\perp \subset C_1$$ is not an additional restriction on $$\mathcal{G}$$. It is part of the definition of a CSS code necessary to make sure that the $$X$$ type and $$Z$$ type stabilizer generators commute. Consequently, the claim says that CNOT admits transversal implementation for any CSS code.

Proof sketch: Let $$g_x$$ be a tensor product of identity $$I$$ and Pauli $$X$$ operators and similarly for $$g_z$$. Since $$\mathcal{G}$$ is a CSS code, we can choose stabilizer generators that are either of the form $$g_x$$ or of the form $$g_z$$. Calculate that

$$\mathrm{CNOT} \circ (g_x \otimes I) \circ \mathrm{CNOT} = g_x \otimes g_x \\ \mathrm{CNOT} \circ (I \otimes g_x) \circ \mathrm{CNOT} = I \otimes g_x \\ \mathrm{CNOT} \circ (g_z \otimes I) \circ \mathrm{CNOT} = g_z \otimes I \\ \mathrm{CNOT} \circ (I \otimes g_z) \circ \mathrm{CNOT} = g_z \otimes g_z.$$

Note that if $$g_x, g_z \in S$$ then all operators on the right hand sides of the four equations above are in $$S \times S$$. Moreover, every operator in $$S \times S$$ can be obtained as a composition of operators of the form $$g_x \otimes I$$, $$g_z \otimes I$$, $$I \otimes g_x$$ and $$I \otimes g_z$$. We conclude that transversal CNOT preserves $$S \times S$$.

By analyzing the action of transversal CNOT on the logical $$X$$ and $$Z$$ operators along the same lines as above, we see that the logical operator effected by performing transversal CNOT on the physical qubits is in fact the logical CNOT. $$\square$$

Claim: If $$\mathcal{G}=CSS(C_1, C_2)$$ is a Calderbank-Shor-Steane code where the two classical linear codes are the same $$C_1 = C_2$$ then transversal Hadamard is a logical Hadamard on $$\mathcal{G}$$.

Remark: The definition of the CSS code requires that $$C_2^\perp \subset C_1$$, so $$C_1$$ cannot be arbitrary. It necessarily contains its own dual.

Proof sketch: As before, let $$g_x$$ be a tensor product of identity $$I$$ and Pauli $$X$$ operators. We see that

$$H g_x H = g_z \\ H g_z H = g_x.$$

where $$g_z$$ is obtained from $$g_x$$ by replacing $$X$$ operators in the tensor product with $$Z$$ operators. Note that since $$\mathcal{G}$$ is a CSS code, we can choose stabilizer generators that are either of the form $$g_x$$ or of the form $$g_z$$. Moreover, since $$C_1 = C_2$$, $$g_x \in S$$ if and only if $$g_z \in S$$. Consequently, transversal Hadamard preserves the stabilizer.

As before, the analysis extends to logical $$X$$ and $$Z$$ operators and therefore transversal $$H$$ on physical qubits implements the logical Hadamard gate. $$\square$$

## Phase gate

(For completeness we include the phase gate even though it is not mentioned in the question.)

Claim: If $$\mathcal{G}=CSS(C_1, C_2)$$ is a Calderbank-Shor-Steane code where the two classical linear codes are the same $$C_1 = C_2$$ and $$C_2^\perp\subset C_1$$ is doubly-even (i.e. all codewords in $$C_2^\perp$$ have Hamming weight divisible by four) then transversal phase gate $$P$$ preserves the stabilizer $$S$$.

Proof sketch: Since the phase gate commutes with the Pauli $$Z$$ operator it is clear that all $$g_z$$ stabilizers are preserved. For any $$g_x$$, we have

$$P g_x P^\dagger = i^{w(g_x)} g_x g_z$$

where $$w(g_x)$$ is the weight of stabilizer $$g_x$$, i.e. the number of non-identity factors in it. Since $$C_2^\perp$$ is doubly-even, we see that

$$P g_x P^\dagger = g_x g_z.$$

Finally, since $$C_1=C_2$$ we have $$g_z\in S$$ and thus $$P g_x P^\dagger\in S$$. $$\square$$

Note that the transversal phase operator is not necessarily the logical phase gate. However, $$C_2^\perp$$ is an even code so the transversal $$Z$$ belongs to the normalizer $$N(S)$$. Thus, as long as transversal $$Z$$ is not in the stabilizer we can choose it to play the role of the logical $$Z$$. Under this choice transversal phase operator commutes with the logical $$Z$$ and therefore its action on $$\mathcal{G}$$ is a diagonal gate. Moreover, applying transversal phase operator twice yields the logical $$Z$$. We conclude that in this case the transversal phase operator is either a logical phase gate or its inverse.

## Pauli operators

Claim: If $$\mathcal{G}$$ is a stabilizer code, then logical Pauli operators are transversal.

Proof sketch: This follows immediately from the fact that logical Pauli operators are chosen from the normalizer $$N(S)$$ of the stabilizer group $$S$$ in the $$n$$-qubit Pauli group $$\mathcal{P}_n$$ since all operators in $$\mathcal{P}_n$$ are transversal by definition. $$\square$$

## Steane code

Steane code is $$CSS(C_1, C_2)$$ where $$C_1 = C_2$$ is the Hamming $$[7, 4, 3]$$ code.

Since it is a stabilizer code, Pauli operators are transversal. Since it is a CSS code, CNOT is transversal. Since $$C_1 = C_2$$, Hadamard is transversal. Since $$C_1$$ is also doubly-even, the phase gate is transversal.

Thus, the entire Clifford group admits a transversal implementation in the Steane code. By Eastin-Knill theorem, we cannot extend the set of transversal gates to a universal gateset. In particular, the $$T$$ gate does not have a transversal implementation in the Steane code.

## References

• Re your first comment: Yes, I agree with what you said. Note that there is a minor caveat in the CNOT case: since we're dealing with two logical qubits the stabilizers that must be preserved by the gate are of the form $g_1 \otimes g_2$ where $g_1, g_2 \in S$. Then $U$ is a logical operation on two logical qubits iff $\{U(g_1\otimes g_2)U^\dagger, g_1, g_2 \in S\} = S \otimes S$ where the tensor product of sets of operators is defined elementwise, i.e. $A \otimes B = \{a\otimes b | a\in A, b\in B\}$. You can convince yourself of this by writing equation $(1)$ in two-logical-qubit case. Dec 28, 2020 at 18:50
• Re your second and third comments: Yes. Logical operators are elements of $N(S)$. Among them, those that are also in $S$ are the logical identity (IOW, their restriction to the code subspace is the logical identity). So you are correct that non-trivial logical operators live in $N(S) - S$. And finally any two operators $a, b \in N(S)$ such that $a^\dagger b \in S$ agree on the code subspace and therefore we can treat them as the same logical operator. This corresponds to taking the quotient $N(S)/S$. Thus, we identify different logical operators with the cosets of $S$ in $N(S)$. Dec 28, 2020 at 18:58
• Your answer is really nice, but I need some time to go through all the details (and checking some aspect with litterature to really understand). Once I will agree with everything I will validate it ! Dec 29, 2020 at 18:13
• I have a question about the phase gate part of your answer. I understand that for $g_x$ an $X$ type Pauli operator in the stabilizer then $$P g_x P^\dagger = i^{w(g_x)} g_x g_z$$ and so, since the code is doubly even $$i^{w(g_x)} g_x g_z= g_x g_z$$ where here $g_z$ is a $Z$ type Pauli operator obtained from $g_x$ by switching every $X$ to a $Z$. Although $g_z$ is certainly a $Z$ type Pauli operator it is not clear to me that $g_z$ is in the stabilizer. So it does not seem clear to me that performing $P$ on each physical qubit actually preserves the stabilizer. Jul 3, 2022 at 17:07
• For example consider the code with stabilizer $HSH$ where $S$ is the stabilizer of the $[[15,1,3]]$ code. In other words the same stabilizer as the $[[15,1,3]]$ code but all $X$s and $Z$s are swapped. Equivalently it is just the image of the $[[15,1,3]]$ code under $H^{\otimes15}$. It is certainly not the case that $P$ preserves the stabilizer of this code. And it seems to me that this code is still a doubly-even CSS code. Jul 3, 2022 at 17:18