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:2310.12106

Advances in compilation for quantum hardware -- A demonstration of magic state distillation and repeat-until-success protocols

Natalie C. Brown, John Peter Campora, Cassandra Granade, Bettina Heim, Stefan Wernli, Ciarán Ryan-Anderson, Dominic Lucchetti, Adam Paetznick, Martin Roetteler, Krysta M. Svore, Alex Chernoguzov

Published Oct 18, 2023• 4 citations
arXivHTMLPDF

Abstract

Fault-tolerant protocols enable large and precise quantum algorithms. Many such protocols rely on a feed-forward processing of data, enabled by a hybrid of quantum and classical logic. Representing the control structure of such programs can be a challenge. Here we explore two such fault-tolerant subroutines and analyze the performance of the subroutines using Quantum Intermediate Representation (QIR) as their underlying intermediate representation. First, we look at QIR's ability to leverage the LLVM compiler toolchain to unroll the quantum iteration logic required to perform magic state distillation on the $[[5,1,3]]$ quantum error-correcting code as originally introduced by Bravyi and Kitaev [Phys. Rev. A 71, 022316 (2005)]. This allows us to not only realize the first implementation of a real-time magic state distillation protocol on quantum hardware, but also demonstrate QIR's ability to optimize complex program structures without degrading machine performance. Next, we investigate a different fault-tolerant protocol that was first introduced by Paetznick and Svore [arXiv:1311.1074 (2013)], that reduces the amount of non-Clifford gates needed for a particular algorithm. We look at four different implementations of this two-stage repeat-until-success algorithm to analyze the performance changes as the results of programming choices. We find the QIR offers a viable representation for a compiled high-level program that performs nearly as well as a hand-optimized version written directly in quantum assembly. Both of these results demonstrate QIR's ability to accurately and efficiently expand the complexity of fault-tolerant protocols that can be realized today on quantum hardware.

DOI
10.48550/arxiv.2310.12106

Related papers

Quantum Compiler Design for Fault-Tolerant Quantum Computing

Chenghong Zhu, Jiahan Chen, Keming He +9 more

Scalable quantum computation is expected to rely on fault-tolerant quantum computation (FTQC), in which quantum error correction (QEC) suppresses physical errors sufficiently to support reliable logical operations. This requires quantum compilation to move beyond general-purpose circuit optimization toward encoding-aware and protocol-structured compilation across the full stack of fault-tolerant quantum computers. Beyond circuit synthesis and hardware mapping, an FTQC compiler must lower algorithm-level operations into the logical gate set supported by the chosen code, coordinate encoded data and ancilla resources, realize logical operations together with repeated syndrome extraction under hardware constraints, and provide the resulting measurement stream to real-time decoding. This survey presents a full-stack view of compiler design for QEC-protected quantum computation. We organize existing work into three interacting layers: logical-level QEC compilation, physical-level QEC realization, and decoder runtime integration. At the logical level, we review surface-code lattice-surgery compilers, beyond-surface-code code-surgery frameworks including emerging qLDPC approaches, and compilation support for non-Clifford operations such as magic-state distillation and code switching. At the physical level, we survey hardware-aware QEC realization on superconducting, trapped-ion, and neutral-atom platforms. We further examine decoder models, real-time decoding systems, and frame-management mechanisms that close the feedback loop during fault-tolerant execution. Finally, we identify open challenges in cross-layer optimization, qLDPC compilation, compiler-decoder co-design, runtime adaptivity, and the development of integrated and benchmarkable FTQC compilation stacks. An actively maintained paper list is available at: github.com/chenghongz/QEC-compiler-design.

quant-pharXiv:2609.17465•Sep 16, 2026•0 citations

アヤマリタイセイリョウシケイサンノジツゲンニムケタコウリツテキナマホウジョウタイノセイセイトショウヒ

裕 平野, Yutaka Hirano

Quantum computation promises exponential or polynomial speedups over classical computation for a wide range of problems, including integer factoring, quantum chemistry, and linear-system solving.However, current quantum devices remain too noisy to execute complex algorithms reliably.Overcoming this noise and achieving quantum advantage require a fault-tolerant quantum computer (FTQC).The resource overhead associated with fault-tolerant operation is substantial, and reducing this overhead remains one of the central challenges.A major source of this overhead arises from the implementation of non-Clifford gates, which are essential for universal quantum computation.A non-Clifford gate such as the T gate is implemented using a special quantum state known as a magic state, which is prepared via a process called magic state distillation.Magic state distillation is resource-intensive and remains a major bottleneck in FTQC.Hence, reducing the distillation overhead is necessary to lower the overall FTQC overhead.The large overhead of magic state distillation has significantly influenced FTQC architectures.In particular, it has motivated compilation schemes optimized under the constraint of expensive magic state distillation.While reducing the distillation overhead is crucial, it is not sufficient; lowering the overall FTQC overhead also requires revisiting design choices guided by this constraint.Therefore, efficient methods are required not only for preparing magic states but also for consuming them.In this thesis, we reduce the overhead of fault-tolerant quantum computation by focusing on the preparation and consumption of magic states.In contrast to traditional logical-level distillation, physical-level distillation allows direct implementation with physical gates and has the potential to drastically reduce the distillation overhead.However, existing physical-level distillation protocols, such as zero-level distillation, cannot directly yield high-fidelity magic states.We propose two magic state distillation protocols that use physical-level distillation techniques to efficiently prepare high-fidelity magic states.The first protocol is a two-level distillation protocol using physical-level distillation as the first-level stage.The second protocol utilizes lattice surgery to reduce the spacetime overhead of a physical-level distillation protocol.The former targets a high-fidelity regime, whereas the latter targets an intermediate-fidelity regime-lower than the former, but higher than zero-level distillation.Next, we investigate FTQC architectures that can efficiently consume the magic states prepared by these protocols.Because magic state distillation is probabilistic, occasional failures can delay computation.Moreover, physical-level distillation protocols generally exhibit higher failure probabilities than logical-level ones.This delay is amplified by parallel execution, making it an i ii important consideration for FTQC using physical-level distillation protocols.We therefore propose a scheme to mitigate the negative performance impact caused by magic state distillation failures by introducing a pool of magic states for each distillation factory.The proposed distillation protocols allow the simultaneous preparation of many magic states.Leveraging this capability, we propose an FTQC compilation scheme optimized for highly parallel quantum algorithms.By performing magic state distillation locally and consuming magic states in parallel, the scheme enables highly parallel execution and consequently reduces the computational time overhead.Overall, this thesis presents a unified approach to reducing the overhead of fault-tolerant quantum computation.By improving both the preparation and consumption of magic states, it advances the design of resource-efficient FTQC architectures.These results demonstrate that efficient magic state preparation motivates efficient magic state consumption, and vice versa.Together, they bring us closer to the practical realization of fault-tolerant quantum computers.

•Jan 1, 2026•0 citations

qstack: Compositional End-to-End Compilation for Fault-Tolerant Quantum Programs

Andres Paz, Dan Grossman

Compiling quantum programs for fault-tolerant execution requires transforming high-level operations through multiple abstraction layers: from logical gates to error-corrected encodings to hardware-native instructions. A key challenge is that quantum error correction turns purely quantum programs into hybrid quantum-classical programs, where classical feedback from syndrome measurements drives quantum corrections at runtime. Existing compilation frameworks handle these quantum and classical components separately, requiring manual adaptation of classical logic at each compilation stage, all while preserving program semantics. We present qstack, a compiler framework built around a purely quantum intermediate representation in which classical logic is accessed only through opaque callbacks, written in any classical language. The framework's central mechanism, callback wrapping, enables compositional compilation: each compiler pass automatically adapts both quantum operations and their associated classical callbacks, and any kernel dynamically generated by a callback is compiled through the full pipeline. This allows ISA translation and quantum error correction to be expressed as composable compiler passes, including concatenation of error-correcting codes, without manual intervention. We demonstrate end-to-end compilation from a high-level gate set through Clifford gates to trapped-ion native operations, with bit-flip and phase-flip repetition codes, the Steane code, and the Shor code obtained by composing two repetition passes.

quant-pharXiv:2605.16595•May 19, 2026•0 citations

MagicPool: Dealing with Magic State Distillation Failures on Large-Scale Fault-Tolerant Quantum Computer

Yutaka Hirano, Yasunari Suzuki, Keisuke Fujii

Magic state distillation, which is a probabilistic process used to generate magic states, plays an important role in universal fault-tolerant quantum computers. On the other hand, to solve interesting problems, we need to run complex programs on fault-tolerant quantum computers, and hence, the system needs to use hardware resources efficiently. Taking advantage of parallelism is a major optimization strategy and compilers are responsible for performing optimizations to allow parallel processing. However, the probabilistic nature of magic state distillation is not compatible with compile-time optimizations and results in an additional run-time delay. To reduce the additional run-time delay, we propose introducing a pool of magic states. We run simulations of quantum circuits to verify the magnitude of the run-time delay and the usefulness of the mitigation approach. The experimental results show that the run-time delay is amplified by parallel processing, and pooling effectively reduces the run-time delay with a small spatial cost.

arXiv:2407.07394•Jul 10, 2024•1 citation

Zero-level $CCZ$ Distillation

Tomohiro Itogawa, Yutaka Hirano, Yutaro Akahoshi +1 more

Magic state distillation is a key component of fault-tolerant quantum computation, as it enables the implementation of non-Clifford gates such as the $T$ gate and the $CCZ$ gate via gate teleportation. However, conventional distillation protocols require a large number of logical qubits and introduce substantial spatial and temporal overhead, posing a significant bottleneck for scalable fault-tolerant quantum computation. In this work, we propose a zero-level distillation protocol that efficiently generates a high-fidelity logical $CCZ$ magic state using only physical qubits on a two-dimensional square lattice with nearest-neighbor interactions. Our method leverages the transversal $T/T^\dagger$ operation of the $[[ 8,3,2 ]]$ code to fault-tolerantly encode the state $\overline{CCZ}|+++\rangle$, which is subsequently teleported to three surface-code logical qubits via lattice surgery. To enable teleportation between codes with different distances, we introduce adaptively initialized teleportation (AIT), a tailored initialization procedure for the surface code. Numerical simulations demonstrate that the logical error rate scales as $p_L \simeq 300 \times p^2$ with respect to the physical error rate $p$. For example, the proposed method improves the logical error rate by approximately one and two orders of magnitude at $p = 10^{-3}$ and $p = 10^{-4}$, respectively, compared to conventional seven-$T$-gate approaches. The distillation circuit requires only 22 physical qubits, 3 logical qubits, and a circuit depth of 24, reducing the space-time overhead by a factor of approximately 5-10 compared to previous methods. This result highlights the practicality of $CCZ$-state distillation in early fault-tolerant quantum computation and offers a new direction toward resource-efficient physical-level magic state distillation beyond conventional $T$-state generation.

quant-pharXiv:2605.21867•May 22, 2026•0 citations

A study of the robustness of magic state distillation against Clifford gate faults

Tomas Jochym-O’Connor

Quantum error correction and fault-tolerance are at the heart of any scalable quantum computation architecture. Developing a set of tools that satisfy the requirements of fault- tolerant schemes is thus of prime importance for future quantum information processing implementations. The Clifford gate set has the desired fault-tolerant properties, preventing bad propagation of errors within encoded qubits, for many quantum error correcting codes, yet does not provide full universal quantum computation. Preparation of magic states can enable universal quantum computation in conjunction with Clifford operations, however preparing magic states experimentally will be imperfect due to implementation errors. Thankfully, there exists a scheme to distill pure magic states from prepared noisy magic states using only operations from the Clifford group and measurement in the Z-basis, such a scheme is called magic state distillation [1]. This work investigates the robustness of magic state distillation to faults in state preparation and the application of the Clifford gates in the protocol. We establish that the distillation scheme is robust to perturbations in the initial state preparation and characterize the set of states in the Bloch sphere that converge to the T-type magic state in different fidelity regimes. Additionally, we show that magic state distillation is robust to low levels of gate noise and that performing the distillation scheme using noisy Clifford gates is a more efficient than using encoded fault-tolerant gates due to the large overhead in fault-tolerant quantum computing architectures.

•Sep 4, 2012•0 citations
Fault-tolerant protocols enable large and precise quantum algorithms. Many such protocols rely on a feed-forward processing of data, enabled by a hybrid of quantum and classical logic. Representing the control structure of such programs can be a challenge. Here we explore two such fault-tolerant subroutines and analyze the performance of the subroutines using Quantum Intermediate Representation (QIR) as their underlying intermediate representation. First, we look at QIR's ability to leverage the LLVM compiler toolchain to unroll the quantum iteration logic required to perform magic state distillation on the [[5,1,3]][[5,1,3]][[5,1,3]] quantum error-correcting code as originally introduced by Bravyi and Kitaev [Phys. Rev. A 71, 022316 (2005)]. This allows us to not only realize the first implementation of a real-time magic state distillation protocol on quantum hardware, but also demonstrate QIR's ability to optimize complex program structures without degrading machine performance. Next, we investigate a different fault-tolerant protocol that was first introduced by Paetznick and Svore [arXiv:1311.1074 (2013)], that reduces the amount of non-Clifford gates needed for a particular algorithm. We look at four different implementations of this two-stage repeat-until-success algorithm to analyze the performance changes as the results of programming choices. We find the QIR offers a viable representation for a compiled high-level program that performs nearly as well as a hand-optimized version written directly in quantum assembly. Both of these results demonstrate QIR's ability to accurately and efficiently expand the complexity of fault-tolerant protocols that can be realized today on quantum hardware.
Scalable quantum computation is expected to rely on fault-tolerant quantum computation (FTQC), in which quantum error correction (QEC) suppresses physical errors sufficiently to support reliable logical operations. This requires quantum compilation to move beyond general-purpose circuit optimization toward encoding-aware and protocol-structured compilation across the full stack of fault-tolerant quantum computers. Beyond circuit synthesis and hardware mapping, an FTQC compiler must lower algorithm-level operations into the logical gate set supported by the chosen code, coordinate encoded data and ancilla resources, realize logical operations together with repeated syndrome extraction under hardware constraints, and provide the resulting measurement stream to real-time decoding. This survey presents a full-stack view of compiler design for QEC-protected quantum computation. We organize existing work into three interacting layers: logical-level QEC compilation, physical-level QEC realization, and decoder runtime integration. At the logical level, we review surface-code lattice-surgery compilers, beyond-surface-code code-surgery frameworks including emerging qLDPC approaches, and compilation support for non-Clifford operations such as magic-state distillation and code switching. At the physical level, we survey hardware-aware QEC realization on superconducting, trapped-ion, and neutral-atom platforms. We further examine decoder models, real-time decoding systems, and frame-management mechanisms that close the feedback loop during fault-tolerant execution. Finally, we identify open challenges in cross-layer optimization, qLDPC compilation, compiler-decoder co-design, runtime adaptivity, and the development of integrated and benchmarkable FTQC compilation stacks. An actively maintained paper list is available at: github.com/chenghongz/QEC-compiler-design.
Quantum computation promises exponential or polynomial speedups over classical computation for a wide range of problems, including integer factoring, quantum chemistry, and linear-system solving.However, current quantum devices remain too noisy to execute complex algorithms reliably.Overcoming this noise and achieving quantum advantage require a fault-tolerant quantum computer (FTQC).The resource overhead associated with fault-tolerant operation is substantial, and reducing this overhead remains one of the central challenges.A major source of this overhead arises from the implementation of non-Clifford gates, which are essential for universal quantum computation.A non-Clifford gate such as the T gate is implemented using a special quantum state known as a magic state, which is prepared via a process called magic state distillation.Magic state distillation is resource-intensive and remains a major bottleneck in FTQC.Hence, reducing the distillation overhead is necessary to lower the overall FTQC overhead.The large overhead of magic state distillation has significantly influenced FTQC architectures.In particular, it has motivated compilation schemes optimized under the constraint of expensive magic state distillation.While reducing the distillation overhead is crucial, it is not sufficient; lowering the overall FTQC overhead also requires revisiting design choices guided by this constraint.Therefore, efficient methods are required not only for preparing magic states but also for consuming them.In this thesis, we reduce the overhead of fault-tolerant quantum computation by focusing on the preparation and consumption of magic states.In contrast to traditional logical-level distillation, physical-level distillation allows direct implementation with physical gates and has the potential to drastically reduce the distillation overhead.However, existing physical-level distillation protocols, such as zero-level distillation, cannot directly yield high-fidelity magic states.We propose two magic state distillation protocols that use physical-level distillation techniques to efficiently prepare high-fidelity magic states.The first protocol is a two-level distillation protocol using physical-level distillation as the first-level stage.The second protocol utilizes lattice surgery to reduce the spacetime overhead of a physical-level distillation protocol.The former targets a high-fidelity regime, whereas the latter targets an intermediate-fidelity regime-lower than the former, but higher than zero-level distillation.Next, we investigate FTQC architectures that can efficiently consume the magic states prepared by these protocols.Because magic state distillation is probabilistic, occasional failures can delay computation.Moreover, physical-level distillation protocols generally exhibit higher failure probabilities than logical-level ones.This delay is amplified by parallel execution, making it an i ii important consideration for FTQC using physical-level distillation protocols.We therefore propose a scheme to mitigate the negative performance impact caused by magic state distillation failures by introducing a pool of magic states for each distillation factory.The proposed distillation protocols allow the simultaneous preparation of many magic states.Leveraging this capability, we propose an FTQC compilation scheme optimized for highly parallel quantum algorithms.By performing magic state distillation locally and consuming magic states in parallel, the scheme enables highly parallel execution and consequently reduces the computational time overhead.Overall, this thesis presents a unified approach to reducing the overhead of fault-tolerant quantum computation.By improving both the preparation and consumption of magic states, it advances the design of resource-efficient FTQC architectures.These results demonstrate that efficient magic state preparation motivates efficient magic state consumption, and vice versa.Together, they bring us closer to the practical realization of fault-tolerant quantum computers.
Compiling quantum programs for fault-tolerant execution requires transforming high-level operations through multiple abstraction layers: from logical gates to error-corrected encodings to hardware-native instructions. A key challenge is that quantum error correction turns purely quantum programs into hybrid quantum-classical programs, where classical feedback from syndrome measurements drives quantum corrections at runtime. Existing compilation frameworks handle these quantum and classical components separately, requiring manual adaptation of classical logic at each compilation stage, all while preserving program semantics. We present qstack, a compiler framework built around a purely quantum intermediate representation in which classical logic is accessed only through opaque callbacks, written in any classical language. The framework's central mechanism, callback wrapping, enables compositional compilation: each compiler pass automatically adapts both quantum operations and their associated classical callbacks, and any kernel dynamically generated by a callback is compiled through the full pipeline. This allows ISA translation and quantum error correction to be expressed as composable compiler passes, including concatenation of error-correcting codes, without manual intervention. We demonstrate end-to-end compilation from a high-level gate set through Clifford gates to trapped-ion native operations, with bit-flip and phase-flip repetition codes, the Steane code, and the Shor code obtained by composing two repetition passes.
Magic state distillation, which is a probabilistic process used to generate magic states, plays an important role in universal fault-tolerant quantum computers. On the other hand, to solve interesting problems, we need to run complex programs on fault-tolerant quantum computers, and hence, the system needs to use hardware resources efficiently. Taking advantage of parallelism is a major optimization strategy and compilers are responsible for performing optimizations to allow parallel processing. However, the probabilistic nature of magic state distillation is not compatible with compile-time optimizations and results in an additional run-time delay. To reduce the additional run-time delay, we propose introducing a pool of magic states. We run simulations of quantum circuits to verify the magnitude of the run-time delay and the usefulness of the mitigation approach. The experimental results show that the run-time delay is amplified by parallel processing, and pooling effectively reduces the run-time delay with a small spatial cost.
Zero-level CCZCCZCCZ Distillation
Magic state distillation is a key component of fault-tolerant quantum computation, as it enables the implementation of non-Clifford gates such as the TTT gate and the CCZCCZCCZ gate via gate teleportation. However, conventional distillation protocols require a large number of logical qubits and introduce substantial spatial and temporal overhead, posing a significant bottleneck for scalable fault-tolerant quantum computation. In this work, we propose a zero-level distillation protocol that efficiently generates a high-fidelity logical CCZCCZCCZ magic state using only physical qubits on a two-dimensional square lattice with nearest-neighbor interactions. Our method leverages the transversal T/T†T/T^\daggerT/T† operation of the [[8,3,2]][[ 8,3,2 ]][[8,3,2]] code to fault-tolerantly encode the state CCZ‾∣+++⟩\overline{CCZ}|+++\rangleCCZ∣+++⟩, which is subsequently teleported to three surface-code logical qubits via lattice surgery. To enable teleportation between codes with different distances, we introduce adaptively initialized teleportation (AIT), a tailored initialization procedure for the surface code. Numerical simulations demonstrate that the logical error rate scales as pL≃300×p2p_L \simeq 300 \times p^2pL​≃300×p2 with respect to the physical error rate ppp. For example, the proposed method improves the logical error rate by approximately one and two orders of magnitude at p=10−3p = 10^{-3}p=10−3 and p=10−4p = 10^{-4}p=10−4, respectively, compared to conventional seven-TTT-gate approaches. The distillation circuit requires only 22 physical qubits, 3 logical qubits, and a circuit depth of 24, reducing the space-time overhead by a factor of approximately 5-10 compared to previous methods. This result highlights the practicality of CCZCCZCCZ-state distillation in early fault-tolerant quantum computation and offers a new direction toward resource-efficient physical-level magic state distillation beyond conventional TTT-state generation.
Quantum error correction and fault-tolerance are at the heart of any scalable quantum computation architecture. Developing a set of tools that satisfy the requirements of fault- tolerant schemes is thus of prime importance for future quantum information processing implementations. The Clifford gate set has the desired fault-tolerant properties, preventing bad propagation of errors within encoded qubits, for many quantum error correcting codes, yet does not provide full universal quantum computation. Preparation of magic states can enable universal quantum computation in conjunction with Clifford operations, however preparing magic states experimentally will be imperfect due to implementation errors. Thankfully, there exists a scheme to distill pure magic states from prepared noisy magic states using only operations from the Clifford group and measurement in the Z-basis, such a scheme is called magic state distillation [1]. This work investigates the robustness of magic state distillation to faults in state preparation and the application of the Clifford gates in the protocol. We establish that the distillation scheme is robust to perturbations in the initial state preparation and characterize the set of states in the Bloch sphere that converge to the T-type magic state in different fidelity regimes. Additionally, we show that magic state distillation is robust to low levels of gate noise and that performing the distillation scheme using noisy Clifford gates is a more efficient than using encoded fault-tolerant gates due to the large overhead in fault-tolerant quantum computing architectures.