Magic states, by allowing non-Clifford gates through gate teleportation, are important building blocks of fault-tolerant quantum computation. Magic state distillation protocols aim to create clean copies of magic states from many noisier copies. However, the prevailing protocols require substantial qubit overhead. We present a distillation protocol based on permutation-invariant gnu codes, as small as two qubits. The two-qubit protocol achieves a 0.5 error threshold and 1/2 distillation rate, surpassing prior schemes for comparable codes. Our protocol furthermore distils magic states with arbitrary magic by varying the position of the ideal input states on the Bloch sphere. We achieve this by departing from the usual magic state distillation formalism, allowing the use of non-Clifford gates in the distillation protocol, and allowing the form of the output state to differ from the input state. Our protocol is compatible for use in tandem with existing magic state distillation protocols to enhance their performance.
Magic state distillation is a crucial yet resource-intensive process in fault-tolerant quantum computation. The protocol's overhead, defined as the number of input magic states required per output magic state with an error rate below
ε, typically grows as
O(logγ(1/ε)). Achieving smaller overheads, i.e., smaller exponents
γ, is highly desirable; however, all existing protocols require polylogarithmically growing overheads with some
γ>0, and identifying the smallest achievable exponent
γ for distilling magic states of qubits has remained challenging. To address this issue, we develop magic state distillation protocols for qubits with efficient, polynomial-time decoding that achieve an
O(1) overhead, meaning the optimal exponent
γ=0; this improves over the previous best of
γ≈0.678 due to Hastings and Haah. In our construction, we employ algebraic geometry codes to explicitly present asymptotically good quantum codes for
210-dimensional qudits that support transversally implementable logical gates in the third level of the Clifford hierarchy. The use of asymptotically good codes with non-vanishing rate and relative distance leads to the constant overhead. These codes can be realised by representing each
210-dimensional qudit as a set of
10 qubits, using stabiliser operations on qubits. The
10-qubit magic states distilled with these codes can be converted to and from conventional magic states for the controlled-controlled-
Z (
CCZ) and
T gates on qubits with only a constant overhead loss, making it possible to achieve constant-overhead distillation of such standard magic states for qubits. These results resolve the fundamental open problem in quantum information theory concerning the construction of magic state distillation protocols with the optimal exponent.
Magic state distillation (MSD) is a cornerstone of fault-tolerant quantum computing, enabling non-Clifford gates via state injection into stabilizer circuits. However, the substantial overhead of current MSD protocols remains a major obstacle to scalable implementations. We propose a general framework for pre-distillation, based on composite pulse sequences that suppress systematic errors in the generation of magic states. While most composite designs target simple gates such as X, Z, or Hadamard, our schemes directly implement the non-Clifford T gate with enhanced robustness to the targeted systematic errors. We develop composite sequences tailored to the dominant control imperfections in superconducting, trapped-ion, neutral-atom, and integrated photonic platforms. To quantify improvement in the implementation, we introduce an operationally motivated fidelity measure specifically tailored to the T gate: the T-magic error, which captures the gate's effectiveness in preparing high-fidelity magic states. We further show that the error in the channel arising from the injection of faulty magic states scales linearly with the leading-order error of the states. Within the systematic-error-dominated regimes considered, this approach lowers the number of required distillation levels by up to three across the platforms we study, translating to substantial qubit-overhead savings and offering a practical route toward more resource-efficient universal quantum computation.
We propose a family of error-detecting stabilizer codes with an encoding rate of
1/3 that permit a transversal implementation of the gate $T=\mathrm{exp}(\ensuremath{-}i\ensuremath{\pi}Z/8)$ on all logical qubits. These codes are used to construct protocols for distilling high-quality ``magic'' states $T\left|+\right\ensuremath{\rangle}$ by Clifford group gates and Pauli measurements. The distillation overhead scales as $O({\mathrm{log}}^{\ensuremath{\gamma}}(1/\ensuremath{\epsilon}))$, where $\ensuremath{\epsilon}$ is the output accuracy and $\ensuremath{\gamma}={\mathrm{log}}_{2}(3)\ensuremath{\approx}1.6$. To construct the desired family of codes, we introduce the notion of a triorthogonal matrix, a binary matrix in which any pair and any triple of rows have even overlap. Any triorthogonal matrix gives rise to a stabilizer code with a transversal
T gate on all logical qubits, possibly augmented by Clifford gates. A powerful numerical method for generating triorthogonal matrices is proposed. Our techniques lead to a twofold overhead reduction for distilling magic states with accuracy $\ensuremath{\epsilon}\ensuremath{\sim}{10}^{\ensuremath{-}12}$ compared with previously known protocols.
We present an infinite family of protocols to distill magic states for T -gates that has a low space overhead and uses an asymptotic number of input magic states to achieve a given target error that is conjectured to be optimal. The space overhead, defined as the ratio between the physical qubits to the number of output magic states, is asymptotically constant, while both the number of input magic states used per output state and the T -gate depth of the circuit scale linearly in the logarithm of the target error δ (up to log log 1 / δ ). Unlike other distillation protocols, this protocol achieves this performance without concatenation and the input magic states are injected at various steps in the circuit rather than all at the start of the circuit. The protocol can be modified to distill magic states for other gates at the third level of the Clifford hierarchy, with the same asymptotic performance. The protocol relies on the construction of weakly self-dual CSS codes with many logical qubits and large distance, allowing us to implement control-SWAPs on multiple qubits. We call this code the "inner code". The control-SWAPs are then used to measure properties of the magic state and detect errors, using another code that we call the "outer code". Alternatively, we use weakly-self dual CSS codes which implement controlled Hadamards for the inner code, reducing circuit depth. We present several specific small examples of this protocol.
Magic states are a scarce resource for two-dimensional qubit stabilizer codes. Magic state cultivation was recently proposed to reduce the cost of magic state preparation by measuring the transversal Clifford operator of the color code. Cultivation achieves
∼10−9 logical error rates for the
d=5 color code, with substantially lower space-time overhead than magic state distillation. However, due to the
O(d) depth of the Clifford measurement circuit, magic state cultivation becomes impractical for
d>5. Here, we perform logical
XS† measurements on the color code by gauging a transversal Clifford gate, resulting in a constant-depth logical measurement circuit. We employ repeated gauging measurements with post-selection rather than performing error correction on the Clifford stabilizer code that emerges during the gauging protocol, thus gaining simplicity at the cost of scalability. Our protocol requires a regular square grid connectivity and yields logical error rates comparable to magic state cultivation. The
d=7 version of our protocol gives access to the
10−12 logical error rate regime at
0.05% physical error rate while retaining more than
1% of the shots after the equivalent of the cultivation stage.