# What's so bad about preparing magic states by measuring Clifford gates?

Suppose we want to perform a gate from the third level of the Clifford hierarchy for example $$T,CS, CCZ, CCX$$. To implement such a gate using gate teleportation we need to take as an input certain ancilla states. For example, a $$|T\rangle$$ state for implementing the $$T$$ gate is $$T | + \rangle = \frac{1}{\sqrt{2}}(|0\rangle + e^{i\pi/4}|1\rangle)$$

A $$|\text{CS}\rangle$$ state for implementing the $$CS$$ gate is $$CS | + \rangle^{\otimes 2} = \frac{1}{2} (|00\rangle + |01\rangle + |10\rangle +i |11\rangle)$$

A $$|\text{CCZ}\rangle$$ state for implementing the $$CCZ$$ gate is $$CCZ | + \rangle^{\otimes 3}= \frac{1}{\sqrt{8}}(|000\rangle + |001\rangle + |010\rangle + |011\rangle + |100\rangle + |101\rangle + |110\rangle - |111\rangle )$$

A $$|\text{Toffoli}\rangle$$ state for implementing the Toffoli (also known as $$CCX$$) gate is $$CCX | + \rangle^{\otimes 2} | 0 \rangle = \frac{1}{2} (|000\rangle + |100\rangle + |010\rangle + |111\rangle)$$

These states are known as magic states.

Each of these magic states is a third level gate applied to a stabilizer state. A stabilizer state is the unique simultaneous $$+1$$ eigenvector of a collection of commuting Pauli operators $$g_1, \dots, g_r$$, so the image of a stabilizer state under any gate $$U$$ is the unique simultaneous $$+1$$ eigenvector of the commuting operators $$Ug_1U^\dagger, \dots, Ug_rU^\dagger$$. If $$U$$ is from the 3rd level of the Clifford hierarchy then the conjugated Pauli gates will all be Clifford gates. In other words, the image of a stabilizer state under a gate from the 3rd level of the Clifford hierarchy will always be the unique simultaneous $$+1$$ eigenvector of a collection of commuting Clifford gates.

So it seems like the easiest way to prepare these magic states would be to simply measure these commuting Clifford gates (essentially you have replaced the Pauli gate stabilizers of your state with Clifford gate stabilizers).

If your code has fault tolerant gate gadgets for all Clifford gates it seems like all these measurements could (probably) be done fault tolerantly. So this seems like a very intuitive (and easy?) way to do fault tolerant magic state preparation.

However in chapter 13 of his book https://www.cs.umd.edu/class/spring2024/cmsc858G/QECCbook-2024-ch1-15.pdf Gottesman calls this approach "rather ugly and inefficient in practice" and later says this method of magic state preparation is "rather awkward," and so he claims that magic state distillation is generally preferable. A quick perusal of the literature seems to confirm that there is much more interest in magic state distillation than there is in preparing magic states by measuring collections of commuting Clifford gates.

So my question is: what is so bad about fault tolerantly preparing magic states by measuring Clifford gates? Why does there seem to be such a strong preference for fault tolerantly preparing magic states using magic state distillation?

I ask a lot of questions on this site, and I love all of them in their own way. But I think a good thorough answer to this question (or even multiple answers with different perspectives!) would be especially beneficial to the community.

I would say the main "bad" things about these papers are that the first used a very weird connectivity graph and required a noise strength of $$10^{-4}$$, while the second didn't properly consider the problem of growing the state from the initially small distance to a usable large distance.