Quantum compiling fills the gap between the computing layer of high-level
quantum algorithms and the layer of physical qubits with their specific
properties and constraints. Quantum compiling is a hybrid between the
general-purpose compilers of computers, transforming high-level language to
assembly language and hardware synthesis by hardware description language,
where functions are automatically synthesized into customized hardware. Here we
review the quantum compiling stack of both gate model quantum computers and the
adiabatic quantum computers, respectively. The former involves low level qubit
control, quantum error correction, synthesis of short quantum circuits,
transpiling, while the latter involves the virtualization of qubits by
embedding of QUBO and HUBO problems on constrained graphs of physical qubits
and both quantum error suppression and correction. Commercial initiatives and
quantum compiling products are reviewed, including explicit programming
examples.
Quantum compiling fills the gap between the computing layer of high-level
quantum algorithms and the layer of physical qubits with their specific
properties and constraints. Quantum compiling is a hybrid between the
general-purpose compilers of computers, transforming high-level language to
assembly language and hardware synthesis by hardware description language,
where functions are automatically synthesized into customized hardware. Here we
review the quantum compiling stack of both gate model quantum computers and the
adiabatic quantum computers, respectively. The former involves low level qubit
control, quantum error correction, synthesis of short quantum circuits,
transpiling, while the latter involves the virtualization of qubits by
embedding of QUBO and HUBO problems on constrained graphs of physical qubits
and both quantum error suppression and correction. Commercial initiatives and
quantum compiling products are reviewed, including explicit programming
examples.
Quantum compiling fills the gap between the computing layer of high-level quantum algorithms and the layer of physical qubits with their specific properties and constraints. Quantum compiling is a hybrid between the general-purpose compilers of computers, transforming high-level language to assembly language and hardware synthesis by hardware description language, where functions are automatically synthesized into customized hardware. Here we review the quantum compiling stack of both gate model quantum computers and the adiabatic quantum computers, respectively. The former involves low level qubit control, quantum error correction, synthesis of short quantum circuits, transpiling, while the latter involves the virtualization of qubits by embedding of QUBO and HUBO problems on constrained graphs of physical qubits and both quantum error suppression and correction. Commercial initiatives and quantum compiling products are reviewed, including explicit programming examples.
Quantum programming languages and their compilers form the critical software layer between abstract quantum algorithm specifications and physical hardware execution -- yet compiler quality varies enormously across the quantum software ecosystem, with suboptimal compilation directly increasing circuit depth, gate count, and consequently error rates on NISQ hardware. This paper proposes the Quantum Compiler Design and Evaluation (QCDE) framework, a systematic methodology for quantum compiler optimisation across four compilation stages: gate synthesis (decomposing abstract gates to hardware-native gate sets), routing (mapping virtual qubits to physical qubits under connectivity constraints), scheduling (ordering gates to minimise decoherence), and cross-layer optimisation (combining all stages with error mitigation awareness). QCDE evaluates six quantum compilers (Qiskit transpiler L1-L3, TKET, BQSKit, Cirq, Quilc, and a novel QCDE-Opt compiler) on 48 benchmark circuits from the QOAS, HQCAD, and QNNDE algorithm ecosystems. QCDE-Opt achieves 18.4% lower CX gate count vs. Qiskit L3 (best existing compiler) through a novel error-aware peephole optimisation pass. BQSKit provides the best synthesis quality at 28.4% CX reduction but 12.4x compilation overhead. TKET achieves the best balance of quality and speed (8.4% CX reduction, 1.8x overhead). QCDE provides a compiler selection guide and the QCDE-Opt compiler as an open-source contribution.
At this point, we understand the principles of quantum computing, the important foundational algorithms, and the basics of quantum error correction. We have developed a compact infrastructure for exploration and experimentation, but it is at the gate level. Higher levels of abstraction are needed to scale to much larger programs. The chapter discusses several quantum programming languages, including their specific tooling, such as hierarchical program representations or entanglement analysis. General challenges for compilation are discussed, as well as compiler optimization techniques. The chapter finishes with transpilation, a powerful compilation-based technique. It allows seamless porting of circuits to other frameworks, enabling the use of their advanced error models or distributed simulation capabilities. The underlying (simple) compiler technology would further enable implementation of several of the features found in programming languages, such as automatic uncomputation, entanglement analysis, and conditional blocks.
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.
Abstract Quantum computers promise to transform our notions of computation by offering a completely new paradigm. To achieve scalable quantum computation, optimizing compilers and a corresponding software design flow will be essential. We present a software architecture for compiling quantum programs from a high-level language program to hardware-specific instructions. We describe the necessary layers of abstraction and their differences and similarities to classical layers of a computer-aided design flow. For each layer of the stack, we discuss the underlying methods for compilation and optimization. Our software methodology facilitates more rapid innovation among quantum algorithm designers, quantum hardware engineers, and experimentalists. It enables scalable compilation of complex quantum algorithms and can be targeted to any specific quantum hardware implementation.
Practical realizations of quantum computers are poised to deliver outstanding computational capabilities far beyond the reach of any classical supercomputer. While classical systems are reliably implemented using CMOS technology, the fabrication of quantum hardware has not yet reached a commercially viable level of maturity. Nowadays, many different technologies are being developed as competing candidates to build the first error-corrected quantum computer. Among the software resources required to operate such a system, quantum compilers translate a high-level description of a quantum algorithm into low-level, technology-dependent quantum instructions. Many quantum algorithms, including Shor's and Grover's algorithms, require to compute some classical logic functions on the quantum computer. The first part of this thesis deals with the problem of compiling quantum circuits that perform such classical Boolean functions, called oracles, into a fault-tolerant set of instructions. Oracle circuits often demand many resources in terms of the number of qubits and gates. The focus is on compiling quantum circuits starting from multi-level logic networks representing large Boolean functions while minimizing the resource footprint of the obtained quantum circuits. At the same time, the trade-off between memory resources and the number of operations typical of such a compilation process is explored. As part of the effort in reducing the resources required to perform a given quantum program, I also present some quantum circuit optimization techniques. The researched algorithms leverage data structures and techniques borrowed and adapted from classical logic synthesis, e.g., SAT solvers, LUT mapping, and multi-level logic networks. I implemented all the compilation algorithms presented in this thesis as part of open-source projects. In particular, I develop and maintain caterpillar---a C++ header-only library dedicated to the quantum compilation of oracles and quantum memory management. The second part of this thesis describes how to equip quantum programming language compilers with automatic accuracy management. Despite the availability of many of such languages, resource estimation of quantum algorithms does not yet support taking approximation errors into account. This general methodology is applicable to any programming language and I demonstrate its integration into the Q# compiler. The technique consists of providing language support to ease the accuracy-aware programming task. The user can define accuracy parameters that will be automatically optimized according to a constraint and a cost function directly generated from the source code. In the presented practical evaluations, the constraint function is the overall allowed accuracy, while the cost function is application-dependent and related to the number of gates. During the optimization process, such functions are evaluated hundreds of times. For this reason, we extract them as (near-)symbolic expressions, whose evaluation time does not depend on the quantum algorithm size. The algorithms and the methodologies presented in this thesis are part of a widespread effort of the research community to build a complete and efficient software stack to program and control the first practical universal quantum computer.