Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2410.07327 · Physical Review Research

Code switching revisited: Low-overhead magic state preparation using color codes

Lucas Daguerre, Isaac H. Kim

Published Apr 23, 2025• 9 citations
arXivHTMLPDF

Abstract

We propose a protocol to prepare a high-fidelity magic state on a two-dimensional (2D) color code using a three-dimensional (3D) color code. Our method modifies the known code-switching protocol with (1) a recently discovered transversal gate between the 2D and the 3D code and (2) a judicious use of flag-based postselection. We numerically demonstrate that these modifications lead to a significant improvement in the fidelity of the magic state. For instance, subjected to a uniform circuit-level noise of 10 − 3 (excluding idling noise), our code-switching protocol yields a magic state encoded in the distance-3 2D color code with a logical infidelity of 4.6 × 10 − 5 ± 1.6 × 10 − 5 (quantified by an error-corrected logical state tomography) with an 84 % of acceptance rate. Used in conjunction with a postselection approach, extrapolation from a polynomial fit suggests a fidelity improvement to 5.1 × 10 − 7 for the same code. Our protocol is aimed for architectures that allow nonlocal connectivity and should be readily implementable in near-term devices. Finally, we also present a simulation technique akin to an extended stabilizer simulator which effectively incorporates the non-Clifford T gate, that permits to simulate the protocol without resorting to a resource intensive state-vector simulation.

DOI
10.1103/physrevresearch.7.023080

Related papers

Experimental Demonstration of High-Fidelity Logical Magic States from Code Switching

Lucas Daguerre, Robin Blume-Kohout, Natalie C. Brown +2 more

Preparation of high-fidelity logical magic states has remained as a necessary but daunting step towards building a large-scale fault-tolerant quantum computer. One approach is to fault-tolerantly prepare a magic state in one code and then switch to another, a method known as code switching. We experimentally demonstrate this protocol on an ion-trap quantum processor, yielding a logical magic state encoded in an error-correcting code with state-of-the-art logical fidelity. Our experiment is based on the first demonstration of code switching between color codes, from the fifteen-qubit quantum Reed-Muller code to the seven-qubit Steane code. We prepare an encoded magic state in the Steane code with 82.58% probability, with an infidelity of at most 5.1 ( 2.7 ) × 10 − 4 . The reported infidelity is lower than the leading infidelity of the physical operations utilized in the protocol by a factor of at least 2.7, indicating the quantum processor is below the pseudothreshold. Furthermore, we create two copies of the magic state in the same quantum processor and perform a logical Bell basis measurement for a sample-efficient certification of the encoded magic state. The high-fidelity magic state can be combined with the already-demonstrated fault-tolerant Clifford gates, state preparation, and measurement of the 2D color code, completing a universal set of fault-tolerant computational primitives with logical error rates equal or better than the physical two-qubit error rate.

arXiv:2506.14169•Physical Review X•Sep 18, 2025•13 citations

Efficient simulation of logical magic state preparation protocols

Samyak Surti, Lucas Daguerre, Isaac H. Kim

Developing space- and time-efficient logical magic state preparation protocols will likely be an essential step towards building a large-scale fault-tolerant quantum computer. Motivated by this need, we introduce a scalable method for simulating logical magic state preparation 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 non-stabilizerness, 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 magic state preparation protocols without resorting to approximations or resource-intensive state-vector simulations.

quant-pharXiv:2512.23799•PRX Quantum•Dec 31, 2025•1 citation

Efficient Magic State Factory Via Transversal Non-Clifford Gate

I-Chi Chen, Hrushikesh Pramod Patil, Huiyang Zhou +1 more

Magic-state preparation is a central component of fault-tolerant quantum computing. Recent theoretical and experimental successes in code-switch-based magic-state preparation have underscored the promise of these methods for quantum error correction. Similarly, magic-state cultivation has likewise been demonstrated in both numerical and experimental settings. However, a thorough comparison between magic-state cultivation and code-switch-based magic-state factories is still missing. In this work, we carry out end-to-end simulations of magic-state preparation using code switching and compare its resource requirements and performance against magic-state cultivation. As part of this analysis, we develop a lattice-surgery protocol for transfer between the doubled color code and the rotated surface code. We extend the complete code-switching protocol to the $d=5$ doubled color code and perform the corresponding end-to-end simulations. Finally, we propose two fault-tolerant magic-state preparation protocols that combine phase-kickback checks with a transversal non-Clifford gate.

quant-pharXiv:2606.16199•Jun 16, 2026•0 citations

Fault-Tolerant Code-Switching Protocols for Near-Term Quantum Processors

Friederike Butt, Sascha Heußen, Manuel Rispler +1 more

Topological color codes are widely acknowledged as promising candidates for fault-tolerant quantum computing. Neither a two-dimensional nor a three-dimensional topology, however, can provide a universal gate set {, , }, with the gate missing in the two-dimensional and the gate in the three-dimensional case. These complementary shortcomings of the isolated topologies may be overcome in a combined approach, by switching between a two- and a three-dimensional code while maintaining the logical state. In this work, we construct resource-optimized deterministic and nondeterministic code-switching protocols for two- and three-dimensional distance-three color codes using fault-tolerant quantum circuits based on flag qubits. Deterministic protocols allow for the fault-tolerant implementation of logical gates on an encoded quantum state, while nondeterministic protocols may be used for the fault-tolerant preparation of magic states. Taking the error rates of state-of-the-art trapped-ion quantum processors as a reference, we find a logical failure probability of 3% for deterministic logical gates, which cannot be realized transversally in the respective code. By replacing the three-dimensional distance-three color code in the protocol for magic state preparation with the morphed code introduced in Vasmer and Kubica [PRX Quantum 3, 030319 (2022)], we reduce the logical failure rates by 2 orders of magnitude, thus rendering it a viable method for magic state preparation on near-term quantum processors. Our results demonstrate that code switching enables the fault-tolerant and deterministic implementation of a universal gate set under realistic conditions, and thereby provide a practical avenue to advance universal, fault-tolerant quantum computing and enable quantum algorithms on first, error-corrected logical qubits. Published by the American Physical Society 2024

PRX Quantum•May 28, 2024•28 citations

Fault-Tolerant Code Switching Protocols for Near-Term Quantum Processors

Friederike Butt, Sascha Heußen, Manuel Rispler +1 more

Topological color codes are widely acknowledged as promising candidates for fault-tolerant quantum computing. Neither a two-dimensional nor a three-dimensional topology, however, can provide a universal gate set $\{$H, T, CNOT$\}$, with the T-gate missing in the two-dimensional and the H-gate in the three-dimensional case. These complementary shortcomings of the isolated topologies may be overcome in a combined approach, by switching between a two- and a three-dimensional code while maintaining the logical state. In this work, we construct resource-optimized deterministic and non-deterministic code switching protocols for two- and three-dimensional distance-three color codes using fault-tolerant quantum circuits based on flag-qubits. Deterministic protocols allow for the fault-tolerant implementation of logical gates on an encoded quantum state, while non-deterministic protocols may be used for the fault-tolerant preparation of magic states. Taking the error rates of state-of-the-art trapped-ion quantum processors as a reference, we find a logical failure probability of $3\%$ for deterministic logical gates, which cannot be realized transversally in the respective code. By replacing the three-dimensional distance-three color code in the protocol for magic state preparation with the morphed code introduced in [1], we reduce the logical failure rates by two orders of magnitude, thus rendering it a viable method for magic state preparation on near-term quantum processors. Our results demonstrate that code switching enables the fault-tolerant and deterministic implementation of a universal gate set under realistic conditions, and thereby provide a practical avenue to advance universal, fault-tolerant quantum computing and enable quantum algorithms on first, error-corrected logical qubits.

arXiv:2306.17686•Jun 30, 2023•0 citations

Extremely Low-Cost Magic State Preparation toward Fault-Tolerant Quantum Computing

Jianshuo Gao, Xiao Yuan, Yuan Yao

Fault-tolerant preparation of non-Clifford resource states is a major contributor to the overhead of quantum computation, motivating protocols that achieve high output fidelity with minimal qubit and circuit costs. We introduce a low-cost magic-state preparation protocol in which the choice of stabilizer generators is co-designed with the flag gadgets, allowing the syndrome-extraction circuit itself to filter correlated faults across a non-Clifford layer. The protocol prepares a logical plus state in the 15-qubit quantum Reed-Muller code, applies a transversal T gate, and gauge-fixes the same register into the seven-qubit Steane code. By reorganizing equivalent Z-type stabilizer generators into jointly flagged measurement groups, the protocol eliminates all accepted logical-error contributions arising from one or two circuit faults under destructive error detection. Under a uniform circuit-level depolarizing noise model, the postselected infidelity is $210.2p^3+O(p^4)$. At $p=10^{-3}$, exact low-order enumeration combined with stratified sampling bounds the infidelity by $2.2\times10^{-7}$ at 99.9% joint confidence, while retaining an acceptance probability of 86.9%. The complete circuit requires only 19 qubits and 82 CNOT gates. These results demonstrate that stabilizer-generator design can substantially reduce the cost of postselected magic-state preparation, although corrected operation and the fidelity of an unmeasured output block require separate analysis.

quant-pharXiv:2609.12698•Sep 14, 2026•0 citations
We propose a protocol to prepare a high-fidelity magic state on a two-dimensional (2D) color code using a three-dimensional (3D) color code. Our method modifies the known code-switching protocol with (1) a recently discovered transversal gate between the 2D and the 3D code and (2) a judicious use of flag-based postselection. We numerically demonstrate that these modifications lead to a significant improvement in the fidelity of the magic state. For instance, subjected to a uniform circuit-level noise of 10 − 3 (excluding idling noise), our code-switching protocol yields a magic state encoded in the distance-3 2D color code with a logical infidelity of 4.6 × 10 − 5 ± 1.6 × 10 − 5 (quantified by an error-corrected logical state tomography) with an 84 % of acceptance rate. Used in conjunction with a postselection approach, extrapolation from a polynomial fit suggests a fidelity improvement to 5.1 × 10 − 7 for the same code. Our protocol is aimed for architectures that allow nonlocal connectivity and should be readily implementable in near-term devices. Finally, we also present a simulation technique akin to an extended stabilizer simulator which effectively incorporates the non-Clifford T gate, that permits to simulate the protocol without resorting to a resource intensive state-vector simulation.
Preparation of high-fidelity logical magic states has remained as a necessary but daunting step towards building a large-scale fault-tolerant quantum computer. One approach is to fault-tolerantly prepare a magic state in one code and then switch to another, a method known as code switching. We experimentally demonstrate this protocol on an ion-trap quantum processor, yielding a logical magic state encoded in an error-correcting code with state-of-the-art logical fidelity. Our experiment is based on the first demonstration of code switching between color codes, from the fifteen-qubit quantum Reed-Muller code to the seven-qubit Steane code. We prepare an encoded magic state in the Steane code with 82.58% probability, with an infidelity of at most 5.1 ( 2.7 ) × 10 − 4 . The reported infidelity is lower than the leading infidelity of the physical operations utilized in the protocol by a factor of at least 2.7, indicating the quantum processor is below the pseudothreshold. Furthermore, we create two copies of the magic state in the same quantum processor and perform a logical Bell basis measurement for a sample-efficient certification of the encoded magic state. The high-fidelity magic state can be combined with the already-demonstrated fault-tolerant Clifford gates, state preparation, and measurement of the 2D color code, completing a universal set of fault-tolerant computational primitives with logical error rates equal or better than the physical two-qubit error rate.
Developing space- and time-efficient logical magic state preparation protocols will likely be an essential step towards building a large-scale fault-tolerant quantum computer. Motivated by this need, we introduce a scalable method for simulating logical magic state preparation 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 non-stabilizerness, 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 magic state preparation protocols without resorting to approximations or resource-intensive state-vector simulations.
Magic-state preparation is a central component of fault-tolerant quantum computing. Recent theoretical and experimental successes in code-switch-based magic-state preparation have underscored the promise of these methods for quantum error correction. Similarly, magic-state cultivation has likewise been demonstrated in both numerical and experimental settings. However, a thorough comparison between magic-state cultivation and code-switch-based magic-state factories is still missing. In this work, we carry out end-to-end simulations of magic-state preparation using code switching and compare its resource requirements and performance against magic-state cultivation. As part of this analysis, we develop a lattice-surgery protocol for transfer between the doubled color code and the rotated surface code. We extend the complete code-switching protocol to the d=5d=5d=5 doubled color code and perform the corresponding end-to-end simulations. Finally, we propose two fault-tolerant magic-state preparation protocols that combine phase-kickback checks with a transversal non-Clifford gate.
Topological color codes are widely acknowledged as promising candidates for fault-tolerant quantum computing. Neither a two-dimensional nor a three-dimensional topology, however, can provide a universal gate set {, , }, with the gate missing in the two-dimensional and the gate in the three-dimensional case. These complementary shortcomings of the isolated topologies may be overcome in a combined approach, by switching between a two- and a three-dimensional code while maintaining the logical state. In this work, we construct resource-optimized deterministic and nondeterministic code-switching protocols for two- and three-dimensional distance-three color codes using fault-tolerant quantum circuits based on flag qubits. Deterministic protocols allow for the fault-tolerant implementation of logical gates on an encoded quantum state, while nondeterministic protocols may be used for the fault-tolerant preparation of magic states. Taking the error rates of state-of-the-art trapped-ion quantum processors as a reference, we find a logical failure probability of 3% for deterministic logical gates, which cannot be realized transversally in the respective code. By replacing the three-dimensional distance-three color code in the protocol for magic state preparation with the morphed code introduced in Vasmer and Kubica [PRX Quantum 3, 030319 (2022)], we reduce the logical failure rates by 2 orders of magnitude, thus rendering it a viable method for magic state preparation on near-term quantum processors. Our results demonstrate that code switching enables the fault-tolerant and deterministic implementation of a universal gate set under realistic conditions, and thereby provide a practical avenue to advance universal, fault-tolerant quantum computing and enable quantum algorithms on first, error-corrected logical qubits. Published by the American Physical Society 2024
Topological color codes are widely acknowledged as promising candidates for fault-tolerant quantum computing. Neither a two-dimensional nor a three-dimensional topology, however, can provide a universal gate set {\{{H, T, CNOT}\}}, with the T-gate missing in the two-dimensional and the H-gate in the three-dimensional case. These complementary shortcomings of the isolated topologies may be overcome in a combined approach, by switching between a two- and a three-dimensional code while maintaining the logical state. In this work, we construct resource-optimized deterministic and non-deterministic code switching protocols for two- and three-dimensional distance-three color codes using fault-tolerant quantum circuits based on flag-qubits. Deterministic protocols allow for the fault-tolerant implementation of logical gates on an encoded quantum state, while non-deterministic protocols may be used for the fault-tolerant preparation of magic states. Taking the error rates of state-of-the-art trapped-ion quantum processors as a reference, we find a logical failure probability of 3%3\%3% for deterministic logical gates, which cannot be realized transversally in the respective code. By replacing the three-dimensional distance-three color code in the protocol for magic state preparation with the morphed code introduced in [1], we reduce the logical failure rates by two orders of magnitude, thus rendering it a viable method for magic state preparation on near-term quantum processors. Our results demonstrate that code switching enables the fault-tolerant and deterministic implementation of a universal gate set under realistic conditions, and thereby provide a practical avenue to advance universal, fault-tolerant quantum computing and enable quantum algorithms on first, error-corrected logical qubits.
Fault-tolerant preparation of non-Clifford resource states is a major contributor to the overhead of quantum computation, motivating protocols that achieve high output fidelity with minimal qubit and circuit costs. We introduce a low-cost magic-state preparation protocol in which the choice of stabilizer generators is co-designed with the flag gadgets, allowing the syndrome-extraction circuit itself to filter correlated faults across a non-Clifford layer. The protocol prepares a logical plus state in the 15-qubit quantum Reed-Muller code, applies a transversal T gate, and gauge-fixes the same register into the seven-qubit Steane code. By reorganizing equivalent Z-type stabilizer generators into jointly flagged measurement groups, the protocol eliminates all accepted logical-error contributions arising from one or two circuit faults under destructive error detection. Under a uniform circuit-level depolarizing noise model, the postselected infidelity is 210.2p3+O(p4)210.2p^3+O(p^4)210.2p3+O(p4). At p=10−3p=10^{-3}p=10−3, exact low-order enumeration combined with stratified sampling bounds the infidelity by 2.2×10−72.2\times10^{-7}2.2×10−7 at 99.9% joint confidence, while retaining an acceptance probability of 86.9%. The complete circuit requires only 19 qubits and 82 CNOT gates. These results demonstrate that stabilizer-generator design can substantially reduce the cost of postselected magic-state preparation, although corrected operation and the fidelity of an unmeasured output block require separate analysis.