Magic state distillation

Magic state distillation is a method for creating more accurate quantum states from multiple noisy ones, which is important for building fault tolerant quantum computers. It has also been linked to quantum contextuality, a concept thought to contribute to quantum computers' power.

The technique was first proposed by Emanuel Knill in 2004, and further analyzed by Sergey Bravyi and Alexei Kitaev the same year.

Thanks to the Gottesman–Knill theorem, it is known that some quantum operations (operations in the Clifford group) can be perfectly simulated in polynomial time on a classical computer. In order to achieve universal quantum computation, a quantum computer must be able to perform operations outside this set. Magic state distillation achieves this, in principle, by concentrating the usefulness of imperfect resources, represented by mixed states, into states that are conducive for performing operations that are difficult to simulate classically.

A variety of qubit magic state distillation routines and distillation routines for qubits  with various advantages have been proposed.

Stabilizer formalism
The Clifford group consists of a set of $$n$$-qubit operations generated by the gates ${H, S, CNOT}$ (where H is Hadamard and S is $$\begin{bmatrix} 1 & 0 \\ 0 & i \end{bmatrix} $$) called Clifford gates. The Clifford group generates stabilizer states which can be efficiently simulated classically, as shown by the Gottesman–Knill theorem. This set of gates with a non-Clifford operation is universal for quantum computation.

Magic states
Magic states are purified from $$n$$ copies of a mixed state $$\rho$$. These states are typically provided via an ancilla to the circuit. A magic state for the $$T$$ gate is $$|M\rangle = \cos(\beta/2)|0\rangle + e^{i\frac{\pi}{4}}\sin(\beta/2)|1\rangle$$ where $$\beta = \arccos\left(\frac{1}{\sqrt 3}\right)$$. By combining (copies of) magic states with Clifford gates, can be used to make a non-Clifford gate. Since Clifford gates combined with a non-Clifford gate are universal for quantum computation, magic states combined with Clifford gates are also universal.

Purification algorithm for distilling |M〉
The first magic state distillation algorithm, invented by Sergey Bravyi and Alexei Kitaev, is a follows.
 * Input: Prepare 5 imperfect states.
 * Output: An almost pure state having a small error probability.
 * repeat
 * Apply the decoding operation of the five-qubit error correcting code and measure the syndrome.
 * If the measured syndrome is $$|0000\rangle$$, the distillation attempt is successful.
 * else Get rid of the resulting state and restart the algorithm.
 * until The states have been distilled to the desired purity.