# Is Toffoli a fault tolerant transversal gate of the repetition code on bit-flip-error-only qubits?

Suppose you have physical qubits that only have bit flip noise (no phase flip noise, no unwanted measurements, no leakage, no amplitude decay, etc; just unwanted X rotations). Such qubits can be kept alive, protected from the bit flip noise, using just the repetition code. And you are doing so.

A transversal Toffoli between logical qubits A, B, C works by applying physical Toffoli gates pairwise (tripletwise?) across the physical qubits making up A, B, and C.

You attempt to apply a logical Toffoli between your repetition code qubits by applying transversal Toffolis across them. Is this correct? Is the transversal Toffoli a fault tolerant logical Toffoli, when applied to repetition codes, given that the only type of noise present is bit flip noise?

The rep code transversal Toffoli is not fault tolerant in this context. For example, here is a circuit which encodes 3 qubits $$|+\rangle|0\rangle|0\rangle$$ into separate distance 3 rep codes, then applies the transversal Toffoli with one X error, then decodes. Note that by the end the $$|+\rangle$$ qubit's state has been destroyed. Specifically it was unintentionally measured by the decoding process, causing it to decay to the center of the Bloch sphere:

A potential point of confusion here is that, normally, transversal gates are trivially fault tolerant. But that assumes we're using a "proper" quantum error correcting code that protects against both X and Z errors, which is not the case here. The rep code is protecting against X error, but it is vulnerable to Z error. Unfortunately, the Toffoli gate can turn X error into Z error. An $$X_1$$ error before $$\text{Toffoli}_{1,2,3}$$ is equivalent to a $$X_1 \cdot \text{CNOT}_{2,3}$$ error afterward. The Pauli sum decomposition of the CNOT error includes Z Pauli terms, and these terms are not corrected by the code.

Another potential point of confusion is that classically the rep code transversal Toffoli is fault tolerant. But that's only because the uncorrected Z errors are irrelevant classically.

Yet another potential point of confusion is that the transversal CNOT is fault tolerant in this context, so why shouldn't the Toffoli be? But note that $$X_1$$ before $$\text{CNOT}_{1,2}$$ is equivalent to $$X_1 \cdot X_2$$ after. In the Toffoli case an X error on the control propagated into an error that had Z terms in its decomposition, but in the CNOT case it propagates into an error that still only has X terms. Everything ends up working out because the CNOT "preserves noise bias" (X begets X, Z begets Z, but never do they cross). The Toffoli doesn't preserve noise bias.

And even yet another point of possible confusion is that if our only error mechanism was phase flips, instead of bit flips, then the transversal Toffoli would be fault tolerant. Because Z-basis errors before a Toffoli only turn into Z-basis errors after the Toffoli. This means that the transversal Hadamard-conjugated-Toffoli would be fault tolerant in the context of the question, which is basically as good as having a Toffoli.

• Presumably this is also a feature of transversal c-NOT, not just toffoli? (Just for the sake of having the simplest possible case) Nov 26, 2021 at 11:46
• @DaftWullie I'll add a note about that. The transversal CNOT is fault tolerant in this context, because it can't propagate X error terms into Z error terms. Nov 26, 2021 at 11:48
• Ah yes! fair enough. Nov 26, 2021 at 11:49
• Sorry - I mean that (to my understanding) the answer to "Is Toffoli a transversal gate of the repetition code on qubits?" is 'yes', insofar as a transversal gate is defined as a logical gate that decomposes as a product of physical gates. However the answer to "is the transversal Toffoli gate fault-tolerant on the quantum repetition code" is 'no', which is precisely the misstep (namely, assuming transversal gates are trivially FT) that this question highlights. Nov 26, 2021 at 19:05
• @mgn Oh you're objecting to the question title not saying "fault tolerant". Yeah that makes sense; done. Nov 26, 2021 at 19:07