# Magic state distillation: why is it harder to prepare the encoded $|A_{\pi/4}\rangle$ than $|0 \rangle$

My question is the following

Let's assume I am using Steane concatenated code to do error correction. This code admits transversal Clifford operations but not the $$T$$-gate.

In order to implement this gate one method is to prepare an ancilla in a state:

$$|A_{\pi/4}\rangle = T |+ \rangle$$

and to then use quantum teleportation to implement the $$T$$ gate on the logical data qubit.

The preparation of such state will usually fail with a high probability and to increase its probability of success we use the so called magic state distillation procedure.

## My question

Taking a step back I am not sure to understand why preparing $$|A_{\pi/4}\rangle$$ is more complicated than to prepare the logical $$|0\rangle$$ for Steane code for instance. Indeed in both case I need to make different qubits within the same codeblock interact. And we need a lot of $$|0\rangle$$ to prepare for the ancilla used in error correction.

Thus: why is it "that" more complicated to prepare $$|A_{\pi/4}\rangle$$ than $$|0\rangle$$ or $$+\rangle$$ ? Is it that if we simply look at the circuit we will realize that "in practice" you need a lot more gates to make $$|A_{\pi/4}\rangle$$ ? Is there some "fundamental" reason for this ?

## Edit

As suggested in the answer, it might be easier to prepare the logical $$|0_L\rangle$$ and $$|+_L\rangle$$ because they can be prepared by measuring the stabilizers. However it requires additional ancilla qubits to do those measurements. And those ancilla must be prepared in the $$|0_L\rangle$$ or $$|+_L\rangle$$, so you would need other ancilla already initialized etc... So I am not sure to see how to implement this method "in practice".

This is why they are usually prepared with this circuit (taken from page 33 of this paper). Here it is the preparation of the logical $$|0_L\rangle$$.

We see from this image that the physical qubits composing the logical one are interacting between each other (which then lead to error propagation). Because of that this process has a "high" probability to fail. Thus we repeat the procedure until it succeeds (there is a full way to check if the ancilla have been correctly prepared in a fault-tolerant manner that I won't explain here but it exists).

Why would it be much more complicated to prepare $$|A_{\pi/4}\rangle$$. Do we really need "intrinsically" much more gates ? Is there a fundamental reason why ?

The point is the logical $$|0\rangle$$ and $$|+\rangle$$ are (relatively) easy to prepare. You start with any bunch of qubits, it doesn't matter what state. You simply measure the stabilizers of the code and one of the logical operators. Whatever answers you get, you can correct for the outcomes.

For a stabilizer code, you know what the logical operators are for $$Z_L$$ and $$X_L$$ - they're just strings of Pauli operators, and so the measurement is just as easy to implement as any of the stabilizer measurements. For $$|A_{\pi/4}\rangle$$, there isn't a corresponding logical operator to directly measure.

• Thank you for your answer. I edited my question accordingly to your answer (I am still disturbed). Nov 4 '21 at 11:31

To prepare $$|0_L\rangle$$ in a CSS code, all you have to do is separately initialize all the data qubits into $$|0\rangle$$ and then start measuring the stabilizers of the code. The reason this works is because the stabilizers that protect $$|0_L\rangle$$ have a known value when all the data qubits are $$|0\rangle$$ (because they are Z type stabilizers). It's important that you know the stabilizers right from the start, since otherwise there would be a small moment of time where undetectable errors could sneak in before the first round of stabilizer measurements.

The same logic works for the $$|+_L\rangle$$ state, initializing data qubits into $$|+\rangle$$, and thereby knowing the X type stabilizers so you can detect any errors right from the start.

But initializing all the data qubits into $$|i\rangle$$ is not a fault tolerant way to prepare $$|i_L\rangle$$, even though $$|i\rangle$$ is a stabilizer state, because that initialization tells you none of the stabilizers' initial values. So you have no way of telling if there were errors affecting the logical observable between the initialization and the first round of stabilizer measurements. And actually, because $$|i_L\rangle$$ is vulnerable to both X and Z type logical errors, it needs all stabilizers to be deterministic instead of just the X types or the Z types. So it's even starting with a vulnerability penalty (in the context of a CSS code).

The same is true of the $$|T\rangle = T|+\rangle$$ state. Initializing all the data qubits into $$|T\rangle$$ randomizes all the stabilizers, so there's no foothold. In order for an initialization to be fault tolerant, it has to make deterministic all the stabilizers relevant to protecting that state. Otherwise you have no way of checking if an error happened between initialization and the first round of measurements. And the "easy" strategy of transversally initializing just doesn't work for non-trivial states like $$|T\rangle = T|+\rangle$$.

It's not that this is literally impossible. There are codes with fault tolerant T state initialization. It's just that the most obvious thing, transversal initialization in a CSS code, only works for $$|0\rangle$$ and $$|+\rangle$$.

• Thank you for your answer. I will need a few days to go back with further details, but a thing that still disturbs me is the following. I am familiar with concatenated FT construction associated to Steane method. If I am not wrong, in this framework we do not prepare the logical states the way you prescribe (see edit in my main text). We typically do a non FT preparation and we use a verifier to check if the ancilla have been properly prepared. By repeating the procedure in case of failure, the overall process is FT. Dec 10 '21 at 14:46
• For this reason, I guess that you have in mind another way to prepare fault-tolerantly the logical computational states. More precisely, which method do you use to measure fault-tolerantly the stabilizer? Because to do it in Steane method we would need an ancilla in the state $|0_L\rangle$. And if to prepare this state I also need an ancilla prepared in the $|0_L\rangle$: we would end up in some "infinite loop" making your suggestion not applicable in this context if I am not wrong. This is why I am wondering which framework you are thinking of? Dec 10 '21 at 14:47
• @StarBucK It's okay for the individual stabilizer measurements can be faulty. You account for that by simply repeating them multiple times. You do need the error introduced onto the data qubits by doing the measurements to be below some threshold, so that you're learning (and correcting) errors faster than you're introducing errors. Dec 16 '21 at 19:10