- Featured in Physics
- Open Access
Efficient Simulation of Logical Magic State Preparation Protocols
PRX Quantum 7, 020329 – Published 14 May, 2026
DOI: https://doi.org/10.1103/fby6-xjbm
Abstract
Developing space- and time-efficient logical magic state preparation (MSP) protocols will likely be an essential step toward building a large-scale fault-tolerant quantum computer. Motivated by this need, we introduce a scalable method for simulating logical MSP protocols under the standard circuit-level noise model. When applied to protocols based on code-switching, magic state cultivation, and magic state distillation, our method yields a complexity polynomial in (i) the number of qubits and (ii) the nonstabilizerness, e.g., stabilizer rank or Pauli rank, of the target encoded magic state. The efficiency of our simulation method is rooted in a curious fact: every circuit-level Pauli error in these protocols propagates to a Clifford error at the end. This property is satisfied by a large family of protocols, including those that repeatedly measure a transversal Clifford that squares to a Pauli. We provide a proof-of-principle numerical simulation that prepares a magic state using such logical Clifford measurements. Our work enables practical simulation of logical MSP protocols without resorting to approximations or resource-intensive state-vector simulations.
Physics Subject Headings (PhySH)
synopsis
A Magic Trick for Simulating Quantum Computers
A new technique efficiently simulates a crucial process in a fault-tolerant quantum computer: the preparation of so-called logical magic states.
See more in Physics
Popular Summary
Quantum computers are noisy, however, reliable computation is possible with the aid of quantum error correcting (QEC) codes. General-purpose computation on QEC codes requires supporting gates of two types: Clifford and non-Clifford. While Clifford gates are typically cheap to implement, non-Clifford gates are resource-intensive, since they are often realized by consuming high-quality “magic states.” To this end, various magic state preparation (MSP) protocols have been proposed and experimentally demonstrated at small scale; however, larger protocols are beyond current device capabilities. These protocols contain many non-Clifford gates, which cannot be simulated efficiently, even with the best-known simulation techniques. To address this issue, we propose an efficient classical simulation technique applicable to a large class of MSP protocols, which relies on the propagation of errors to the end of the circuit. Our work provides an efficient method to benchmark MSP protocols that will likely influence the development of large-scale quantum computers.
Article Text
References (99)
- P. W. Shor, Scheme for reducing decoherence in quantum computer memory, Phys. Rev. A 52, R2493(R) (1995).
- D. Aharonov and M. Ben-Or, Fault-tolerant quantum computation with constant error rate, SIAM J. Comput. 38, 1207 (2008).
- E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, Topological quantum memory, J. Math. Phys. 43, 4452 (2002).
- D. Horsman, A. G. Fowler, S. Devitt, and R. V. Meter, Surface code quantum computing by lattice surgery, New J. Phys. 14, 123011 (2012).
- H. Bombin and M. A. Martin-Delgado, Topological quantum distillation, Phys. Rev. Lett. 97, 180501 (2006).
- L. Z. Cohen, I. H. Kim, S. D. Bartlett, and B. J. Brown, Low-overhead fault-tolerant quantum computing using long-range connectivity, Sci. Adv. 8, eabn1717 (2022).
- A. O. Quintavalle, P. Webster, and M. Vasmer, Partitioning qubits in hypergraph product codes to implement logical gates, Quantum 7, 1153 (2023).
- S. Bravyi and A. Kitaev, Universal quantum computation with ideal Clifford gates and noisy ancillas, Phys. Rev. A 71, 022316 (2005).
- A. M. Meier, B. Eastin, and E. Knill, Magic-state distillation with the four-qubit code, arXiv:1204.4221 [quant-ph].
- S. Bravyi and J. Haah, Magic-state distillation with low overhead, Phys. Rev. A 86, 052329 (2012).
- C. Jones, Low-overhead constructions for the fault-tolerant Toffoli gate, Phys. Rev. A 87, 022328 (2013).
- A. G. Fowler, S. J. Devitt, and C. Jones, Surface code implementation of block code state distillation, Sci. Rep. 3, 1939 (2013).
- C. Jones, Multilevel distillation of magic states for quantum computing, Phys. Rev. A 87, 042305 (2013).
- G. Duclos-Cianci and K. M. Svore, Distillation of nonstabilizer states for universal quantum computation, Phys. Rev. A 88, 042325 (2013).
- G. Duclos-Cianci and D. Poulin, Reducing the quantum-computing overhead with complex gate distillation, Phys. Rev. A 91, 042315 (2015).
- E. T. Campbell and M. Howard, Unified framework for magic state distillation and multiqubit gate synthesis with reduced resource cost, Phys. Rev. A 95, 022316 (2017).
- J. O’Gorman and E. T. Campbell, Quantum computation with realistic magic-state factories, Phys. Rev. A 95, 032338 (2017).
- J. Haah and M. B. Hastings, Codes and protocols for distilling , controlled-, and Toffoli gates, Quantum 2, 71 (2018).
- C. Gidney and A. G. Fowler, Efficient magic state factories with a catalyzed to transformation, Quantum 3, 135 (2019).
- M. Reiher, N. Wiebe, K. M. Svore, D. Wecker, and M. Troyer, Elucidating reaction mechanisms on quantum computers, Proc. Natl. Acad. Sci. U.S.A. 114, 7555 (2017).
- Y. Li, A magic state’s fidelity can be superior to the operations that created it, New J. Phys. 17, 023037 (2015).
- T. J. Yoder and I. H. Kim, The surface code with a twist, Quantum 1, 2 (2017).
- R. Chao and B. W. Reichardt, Quantum error correction with only two extra qubits, Phys. Rev. Lett. 121, 050502 (2018).
- R. Chao and B. W. Reichardt, Fault-tolerant quantum computation with few qubits, npj Quantum Inf. 4, 42 (2018).
- C. Chamberland and K. Noh, Very low overhead fault-tolerant magic state preparation using redundant ancilla encoding and flag qubits, npj Quantum Inf. 6, 91 (2020).
- T. Itogawa, Y. Takada, Y. Hirano, and K. Fujii, Efficient magic state distillation by zero-level distillation, PRX Quantum 6, 020356 (2025).
- C. Gidney, N. Shutty, and C. Jones, Magic state cultivation: Growing T states as cheap as CNOT gates, arXiv:2409.17595 [quant-ph].
- L. Daguerre and I. H. Kim, Code switching revisited: Low-overhead magic state preparation using color codes, Phys. Rev. Res. 7, 023080 (2025).
- K. Sahay, P.-K. Tsai, K. Chang, Q. Su, T. B. Smith, S. Singh, and S. Puri, Fold-transversal surface code cultivation, arXiv:2509.05212 [quant-ph].
- J. Claes, Cultivating T states on the surface code with only two-qubit gates, arXiv:2509.05232 [quant-ph].
- Y. Vaknin, S. Jacoby, A. Grimsmo, and A. Retzker, Magic State cultivation on the surface code, arXiv:2502.01743 [quant-ph].
- Z.-H. Chen, M.-C. Chen, C.-Y. Lu, and J.-W. Pan, Efficient magic state cultivation on , arXiv:2503.18657 [quant-ph].
- N. Lacroix et al., Scaling and logic in the color code on a superconducting quantum processor, Nature 645, 614 (2025).
- P. S. Rodriguez et al., Experimental demonstration of logical magic state distillation, Nature 645, 620 (2025).
- I. Pogorelov, F. Butt, L. Postler, C. D. Marciniak, P. Schindler, M. Müller, and T. Monz, Experimental fault-tolerant code switching, Nat. Phys. 21, 298 (2025).
- Y. Kim, M. Sevior, and M. Usman, Magic state injection on IBM quantum processors above the distillation threshold, arXiv:2412.01446 [quant-ph].
- Y. Ye et al., Logical magic state preparation with fidelity beyond the distillation threshold on a superconducting quantum processor, Phys. Rev. Lett. 131, 210603 (2023).
- R. S. Gupta et al., Encoding a magic state with beyond break-even fidelity, Nature 625, 259 (2024).
- L. Postler, S. Heuben, I. Pogorelov, M. Rispler, T. Feldker, M. Meth, C. D. Marciniak, R. Stricker, M. Ringbauer, R. Blatt, P. Schindler, M. Müller, and T. Monz, Demonstration of fault-tolerant universal quantum gate operations, Nature 605, 675 (2022).
- C. Ryan-Anderson et al., Realization of real-time fault-tolerant quantum error correction, Phys. Rev. X 11, 041058 (2021).
- S. Dasu, S. Burton, K. Mayer, D. Amaro, J. A. Gerber, K. Gilmore, D. Gresh, D. DelVento, A. C. Potter, and D. Hayes, Breaking even with magic: Demonstration of a high-fidelity logical non-Clifford gate, arXiv:2506.14688 [quant-ph].
- E. Rosenfeld et al., Magic state cultivation on a superconducting quantum processor, arXiv:2512.13908 [quant-ph].
- L. Daguerre, R. Blume-Kohout, N. C. Brown, D. Hayes, and I. H. Kim, Experimental demonstration of high-fidelity logical magic states from code switching, Phys. Rev. X 15, 041008 (2025).
- D. Gottesman, in 22nd International Colloquium on Group Theoretical Methods in Physics (1998), pp. 32–43.
- S. Aaronson and D. Gottesman, Improved simulation of stabilizer circuits, Phys. Rev. A 70, 052328 (2004).
- S. Bravyi and D. Gosset, Improved classical simulation of quantum circuits dominated by Clifford gates, Phys. Rev. Lett. 116, 250501 (2016).
- S. Bravyi, G. Smith, and J. A. Smolin, Trading classical and quantum computational resources, Phys. Rev. X 6, 021043 (2016).
- S. Bravyi, D. Browne, P. Calpin, E. Campbell, D. Gosset, and M. Howard, Simulation of quantum circuits by low-rank stabilizer decompositions, Quantum 3, 181 (2019).
- K. Bu and D. E. Koh, Efficient classical simulation of Clifford circuits with nonstabilizer input states, Phys. Rev. Lett. 123, 170502 (2019).
- S. Masot-Llima and A. Garcia-Saez, stabilizer tensor networks: Universal quantum simulator on a basis of stabilizer states, Phys. Rev. Lett. 133, 230601 (2024).
- Y. Zhang and Y. Zhang, Classical simulability of quantum circuits with shallow magic depth, PRX Quantum 6, 010337 (2025).
- S. Garner, C. Liu, M. Wang, S. Stein, and A. Li, STABSim: A parallelized Clifford simulator with features beyond direct simulation, arXiv:2507.03092 [quant-ph].
- K. Aziz, H. Pan, M. J. Gullans, and J. H. Pixley, Classical simulations of low magic quantum dynamics, arXiv:2508.20252 [quant-ph].
- H. Goto, Minimizing resource overheads for fault-tolerant preparation of encoded states of the Steane code, Sci. Rep. 6, 19578 (2016).
- C. Chamberland and M. E. Beverland, Flag fault-tolerant error correction with arbitrary distance codes, Quantum 2, 53 (2018).
- C. Chamberland and A. W. Cross, Fault-tolerant magic state preparation with flag qubits, Quantum 3, 143 (2019).
- F. Butt, S. Heußen, M. Rispler, and M. Müller, Fault-tolerant code-switching protocols for near-term quantum processors, PRX Quantum 5, 020345 (2024).
- K. H. Wan and Z. Zhong, Cutting stabiliser decompositions of magic state cultivation with ZX-calculus, arXiv:2509.01224 [quant-ph].
- K. H. Wan and Z. Zhong, How to simulate magic state cultivation with around Clifford terms on average, arXiv:2509.08658 [quant-ph].
- M. Sutcliffe and A. Kissinger, Procedurally optimised ZX-diagram cutting for efficient t-decomposition in classical simulation, Electron. Proc. Theor. Comput. Sci. 406, 63 (2024).
- J. T. Anderson, G. Duclos-Cianci, and D. Poulin, Fault-tolerant conversion between the Steane and Reed-Muller quantum codes, Phys. Rev. Lett. 113, 080501 (2014).
- H. Bombín, Dimensional jump in quantum error correction, New J. Phys. 18, 043038 (2016).
- M. E. Beverland, A. Kubica, and K. M. Svore, Cost of universality: A comparative study of the overhead of state distillation and code switching with color codes, PRX Quantum 2, 020341 (2021).
- D. Gottesman and I. L. Chuang, Demonstrating the viability of universal quantum computation using teleportation and single-qubit operations, Nature 402, 390 (1999).
- M. Davydova, A. Bauer, J. C. M. de la Fuente, M. Webster, D. J. Williamson, and B. J. Brown, Universal fault tolerant quantum computation in 2D without getting tied in knots, arXiv:2503.15751 [quant-ph].
- If needed, this issue can be dealt with by using a state ancilla [74].
- H. Bombin and M. A. Martin-Delgado, Topological computation without braiding, Phys. Rev. Lett. 98, 160502 (2007).
- For multiple errors, one can simply propagate each error in reverse order. Because each propagated error is a Clifford, so is their composition.
- J. T. Anderson and M. Weippert, Controlled gates in the Clifford hierarchy, arXiv:2410.04711 [quant-ph].
- J. E. Moussa, Transversal Clifford gates on folded surface codes, Phys. Rev. A 94, 042316 (2016).
- Note that eigenstates of PSCs are not automatically magic states. For instance, the eigenstates of the gate are and . Therefore, checking whether a measurement of a logical PSC yields a magic state must be done on a case-by-case basis.
- However, exceptions do exist, e.g., Ref. [30]. The Clifford being measured in this work is not a PSC.
- Corollary 2 holds similarly for Steane and Knill-type error correction.
- P. W. Shor, in Proceedings of 37th Annual Symposium on Foundations of Computer Science (IEEE Computer Society, USA, 1996), p. 56.
- Y. Zheng and D. E. Liu, From magic state distillation to dynamical systems, Quantum 9, 1858 (2025).
- E. T. Campbell and D. E. Browne, On the structure of protocols for magic state distillation, Lect. Notes Comput. Sci. 5906, 20 (2009).
- H. Bombín, Gauge color codes: Optimal transversal gates and gauge fixing in topological stabilizer codes, New J. Phys. 17, 083002 (2015).
- A. Kubica and M. E. Beverland, Universal transversal gates with color codes: A simplified approach, Phys. Rev. A 91, 032330 (2015).
- M. Vasmer and D. E. Browne, Three-dimensional surface codes: Transversal gates and fault-tolerant architectures, Phys. Rev. A 100, 012312 (2019).
- B. Eastin and E. Knill, Restrictions on transversal encoded quantum gate sets, Phys. Rev. Lett. 102, 110502 (2009).
- S. Bravyi and R. König, Classification of topologically protected gates for local stabilizer codes, Phys. Rev. Lett. 110, 170503 (2013).
- M. Sullivan, Code conversion with the quantum Golay code for a universal transversal gate set, Phys. Rev. A 109, 042416 (2024).
- S. Heußen and J. Hilder, Efficient fault-tolerant code switching via one-way transversal CNOT gates, Quantum 9, 1846 (2025).
- C. Gidney, Stim: A fast stabilizer circuit simulator, Quantum 5, 497 (2021).
- For protocols based on measurements of a logical PSC, the encoded state is equal to the output logical magic state stabilized by the PSC. For code-switching protocols described in this article, which differs from the the output magic state .
- In practice, it is enough to propagate Clifford errors up the last that belongs to .
- A. M. Steane, Active stabilization, quantum computation, and quantum state synthesis, Phys. Rev. Lett. 78, 2252 (1997).
- C. Developers, Cirq. Zenodo, 2025, https://zenodo.org/doi/10.5281/zenodo.4062499.
- D. H. Mahler, L. A. Rozema, A. Darabi, C. Ferrie, R. Blume-Kohout, and A. M. Steinberg, Adaptive quantum state tomography improves accuracy quadratically, Phys. Rev. Lett. 111, 183601 (2013).
- Recently, [43] proposed a method to overcome this constraint by giving a lower bound with quadratic improvement in sampling complexity at the expense of storing two copies of the logical magic state and performing a logical Bell sampling; see also Ref. [99].
- H. Bombin, 2D quantum computation with 3D topological codes, arXiv:1810.09571.
- R. Kobayashi, G. Zhu, and P.-S. Hsin, Clifford hierarchy stabilizer codes: Transversal non-Clifford gates and magic, arXiv:2511.02900.
- A. Bauer and J. C. M. de la Fuente, Planar fault-tolerant circuits for non-Clifford gates on the 2D color code, arXiv:2505.05175.
- A. Wills, M.-H. Hsieh, and H. Yamasaki, Constant-overhead magic state distillation, arXiv:2408.07764.
- L. Golowich and V. Guruswami, Asymptotically good quantum codes with transversal non-Clifford gates, arXiv:2408.09254 [quant-ph].
- Q. T. Nguyen, Good binary quantum codes with transversal CCZ gate, arXiv:2408.10140.
- L. Golowich and T.-C. Lin, Quantum LDPC codes with transversal non-Clifford gates via products of algebraic codes, arXiv:2410.14662.
- In principle, can be chosen as a Clifford correction. However, it is unclear if that leads to an advantage over Pauli correction.
- S.-u. Lee, M. Yuan, S. Chen, K. Tsubouchi, and L. Jiang, Efficient benchmarking of logical magic state, arXiv:2505.09687 [quant-ph].
