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:2003.08408 · Proceedings of the ACM on Programming Languages

Enabling accuracy-aware Quantum compilers using symbolic resource estimation

Giulia Meuli, Mathias Soeken, Martin Roetteler, Thomas Häner

Published Nov 13, 2020• 9 citations
arXivHTMLPDF

Abstract

Approximation errors must be taken into account when compiling quantum programs into a low-level gate set. We present a methodology that tracks such errors automatically and then optimizes accuracy parameters to guarantee a specified overall accuracy while aiming to minimize the implementation cost in terms of quantum gates. The core idea of our approach is to extract functions that specify the optimization problem directly from the high-level description of the quantum program. Then, custom compiler passes optimize these functions, turning them into (near-)symbolic expressions for (1) the total error and (2) the implementation cost (e.g., total quantum gate count). All unspecified parameters of the quantum program will show up as variables in these expressions, including accuracy parameters. After solving the corresponding optimization problem, a circuit can be instantiated from the found solution. We develop two prototype implementations, one in C++ based on Clang/LLVM, and another using the Q# compiler infrastructure. We benchmark our prototypes on typical quantum computing programs, including the quantum Fourier transform, quantum phase estimation, and Shor's algorithm.

DOI
10.1145/3428198

Related papers

Automatic accuracy management of quantum programs via (near-)symbolic resource estimation.

Giulia Meuli, Mathias Soeken, Martin Roetteler +1 more

When compiling programs for fault-tolerant quantum computers, approximation errors must be taken into account. We propose a methodology that tracks such errors automatically and solves the optimization problem of finding accuracy parameters that guarantee a specified overall accuracy while aiming to minimize a custom implementation cost. The core idea is to extract constraint and cost functions directly from the high-level description of the quantum program. Then, our custom compiler passes optimize these functions, turning them into (near-)symbolic expressions for (1) the total error and (2) the implementation cost (e.g., total gate count). All unspecified parameters of the quantum program will show up as variables in these expressions, including accuracy parameters. After solving the corresponding optimization problem, a circuit can be instantiated from the found solution. We develop two prototype implementations, one in C++ based on Clang/LLVM, and another using the Q# compiler infrastructure. We benchmark our prototypes on typical quantum computing programs, including the quantum Fourier transform, quantum phase estimation, and Shor's algorithm.

•Mar 18, 2020•2 citations

Program compilation for large-scale quantum computers

Giulia Meuli

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.

•Jan 1, 2020•1 citation

Managing approximation errors in quantum programs

Thomas Häner, Martin Roetteler, Krysta M. Svore

We address the problem of distributing approximation errors in large-scale quantum programs. It has been known for some time that when compiling quantum algorithms for a fault-tolerant architecture, some operations must be approximated as they cannot be implemented with arbitrary accuracy by the underlying gate set. This leads to approximation errors which often can be grouped along subroutines that the given quantum algorithm is composed of. Typically, choices can be made as to how to distribute approximation errors so that the overall error is kept beneath a user- or application-defined threshold. These choices impact the resource footprint of the fault-tolerant implementation. We develop an automatic approximation error management module to tackle the resulting optimization problems. The module is based on annealing and can be integrated into any quantum software framework. Using the benchmark of simulating an Ising model with transverse field, we provide numerical results to quantify the benefits and trade-offs involved in our approach.

arXiv:1807.02336•Jul 6, 2018•3 citations

A Gate-Level Approach To Compiling For Quantum Computers

Henry Gordon Dietz

Programming language constructs generally operate on data words, and so does most compiler analysis and transformation. However, individual word-level operations often harbor pointless, yet resource and power hungry, lower-level operations. By transforming complete programs into gate-level operations on individual bits, and optimizing operations at that level, it is possible to dramatically reduce the total amount of work needed to execute the program's algorithm. This gate-level representation can be in terms of any complete set of logic gate types; earlier work targeted conventional multiplexor gates, but the work reported here centers on targeting CSWAP (FredKin) gates without fanout - a form that can be implemented on a quantum computer. This paper will overview the approach, describe the current state of the prototype compiler, and suggest some ways in which compiler automatic parallelization technology might be extended to allow ordinary programs to take advantage of the unique properties of quantum computers.

International Green and Sustainable Computing Conference•Oct 1, 2018•3 citations

Optimizing Compiler for Quantum Computing Using Qiskit Terra

Peddi Gowtham Balaji, Peraboina Chamikar, Omkar Chowdary +1 more

The recent times of fast development of quantum computers has been followed by many researchers who want to run the larger and more difficult quantum algorithms on it and they have promised such speedup several times. Notwithstanding this, commercial quantum computers are currently fraught with instability and errors. This paper is centered on development of the customized compiler for quantum computing with aid of Qiskit Terra, a QIS framework. We target central classes such as circuit representation structures, programming techniques based on OpenQASM, challenges in the QC architecture, high-level routing optimization, and the structure of the Qiskit Terra compiler. In every circuit, the optimization is provided by methods of Qiskit Terra, including Trivial Layout, Noise Adaptive Layout, Dense Layout, and Custom Layout. These optimization levels address many problems that emerge when circuits are being compiled and executed, and thus, the optimization levels seek to boost circuit efficiency, reduce the count of gates, and enhance the overall performance. The introduction of numerous optimization passes starting from unroller passes that translate gates, the layout passes that map virtual to physical qubits, and the optimization algorithm aimed at the runtime reduction. Modern quantum compilation technologies are being currently developed based on economic (and theoretical) analyses to underpin the investigation and development of optimal quantum computation procedures.

International Conference on Computing, Communication and Networking Technologies (ICCCNT)•Jun 24, 2024•3 citations

Dynamic Programming for Quantum Circuit Optimization with Error Modeling

Jincheng Zhang

Quantum circuit optimization is a critical step in realizing the full potential of quantum computing. However, the inherent noise and decoherence present in quantum systems introduce significant challenges to traditional optimization techniques. This paper proposes a novel approach that leverages dynamic programming (DP) to optimize quantum circuits while explicitly incorporating probabilistic error models. The core idea is to extend the DP table to represent not only the cost (gate count) of minimizing the circuit but also the estimated error probability associated with each sub-circuit. This allows for a more accurate assessment of the trade-off between circuit complexity and fidelity. The algorithm iteratively builds the DP table, considering different circuit decompositions and their corresponding error rates. The resulting optimized quantum circuit minimizes the overall expected error, providing a more robust solution compared to purely gate-count-based optimization. The methodology is presented with detailed formulas and mathematical notation, providing a comprehensive understanding of the approach. This work addresses a key limitation of existing optimization methods by integrating error modeling directly into the dynamic programming framework.

•Sep 5, 2026•0 citations
Approximation errors must be taken into account when compiling quantum programs into a low-level gate set. We present a methodology that tracks such errors automatically and then optimizes accuracy parameters to guarantee a specified overall accuracy while aiming to minimize the implementation cost in terms of quantum gates. The core idea of our approach is to extract functions that specify the optimization problem directly from the high-level description of the quantum program. Then, custom compiler passes optimize these functions, turning them into (near-)symbolic expressions for (1) the total error and (2) the implementation cost (e.g., total quantum gate count). All unspecified parameters of the quantum program will show up as variables in these expressions, including accuracy parameters. After solving the corresponding optimization problem, a circuit can be instantiated from the found solution. We develop two prototype implementations, one in C++ based on Clang/LLVM, and another using the Q# compiler infrastructure. We benchmark our prototypes on typical quantum computing programs, including the quantum Fourier transform, quantum phase estimation, and Shor's algorithm.
When compiling programs for fault-tolerant quantum computers, approximation errors must be taken into account. We propose a methodology that tracks such errors automatically and solves the optimization problem of finding accuracy parameters that guarantee a specified overall accuracy while aiming to minimize a custom implementation cost. The core idea is to extract constraint and cost functions directly from the high-level description of the quantum program. Then, our custom compiler passes optimize these functions, turning them into (near-)symbolic expressions for (1) the total error and (2) the implementation cost (e.g., total gate count). All unspecified parameters of the quantum program will show up as variables in these expressions, including accuracy parameters. After solving the corresponding optimization problem, a circuit can be instantiated from the found solution. We develop two prototype implementations, one in C++ based on Clang/LLVM, and another using the Q# compiler infrastructure. We benchmark our prototypes on typical quantum computing programs, including the quantum Fourier transform, quantum phase estimation, and Shor's algorithm.
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.
We address the problem of distributing approximation errors in large-scale quantum programs. It has been known for some time that when compiling quantum algorithms for a fault-tolerant architecture, some operations must be approximated as they cannot be implemented with arbitrary accuracy by the underlying gate set. This leads to approximation errors which often can be grouped along subroutines that the given quantum algorithm is composed of. Typically, choices can be made as to how to distribute approximation errors so that the overall error is kept beneath a user- or application-defined threshold. These choices impact the resource footprint of the fault-tolerant implementation. We develop an automatic approximation error management module to tackle the resulting optimization problems. The module is based on annealing and can be integrated into any quantum software framework. Using the benchmark of simulating an Ising model with transverse field, we provide numerical results to quantify the benefits and trade-offs involved in our approach.
Programming language constructs generally operate on data words, and so does most compiler analysis and transformation. However, individual word-level operations often harbor pointless, yet resource and power hungry, lower-level operations. By transforming complete programs into gate-level operations on individual bits, and optimizing operations at that level, it is possible to dramatically reduce the total amount of work needed to execute the program's algorithm. This gate-level representation can be in terms of any complete set of logic gate types; earlier work targeted conventional multiplexor gates, but the work reported here centers on targeting CSWAP (FredKin) gates without fanout - a form that can be implemented on a quantum computer. This paper will overview the approach, describe the current state of the prototype compiler, and suggest some ways in which compiler automatic parallelization technology might be extended to allow ordinary programs to take advantage of the unique properties of quantum computers.
The recent times of fast development of quantum computers has been followed by many researchers who want to run the larger and more difficult quantum algorithms on it and they have promised such speedup several times. Notwithstanding this, commercial quantum computers are currently fraught with instability and errors. This paper is centered on development of the customized compiler for quantum computing with aid of Qiskit Terra, a QIS framework. We target central classes such as circuit representation structures, programming techniques based on OpenQASM, challenges in the QC architecture, high-level routing optimization, and the structure of the Qiskit Terra compiler. In every circuit, the optimization is provided by methods of Qiskit Terra, including Trivial Layout, Noise Adaptive Layout, Dense Layout, and Custom Layout. These optimization levels address many problems that emerge when circuits are being compiled and executed, and thus, the optimization levels seek to boost circuit efficiency, reduce the count of gates, and enhance the overall performance. The introduction of numerous optimization passes starting from unroller passes that translate gates, the layout passes that map virtual to physical qubits, and the optimization algorithm aimed at the runtime reduction. Modern quantum compilation technologies are being currently developed based on economic (and theoretical) analyses to underpin the investigation and development of optimal quantum computation procedures.
Quantum circuit optimization is a critical step in realizing the full potential of quantum computing. However, the inherent noise and decoherence present in quantum systems introduce significant challenges to traditional optimization techniques. This paper proposes a novel approach that leverages dynamic programming (DP) to optimize quantum circuits while explicitly incorporating probabilistic error models. The core idea is to extend the DP table to represent not only the cost (gate count) of minimizing the circuit but also the estimated error probability associated with each sub-circuit. This allows for a more accurate assessment of the trade-off between circuit complexity and fidelity. The algorithm iteratively builds the DP table, considering different circuit decompositions and their corresponding error rates. The resulting optimized quantum circuit minimizes the overall expected error, providing a more robust solution compared to purely gate-count-based optimization. The methodology is presented with detailed formulas and mathematical notation, providing a comprehensive understanding of the approach. This work addresses a key limitation of existing optimization methods by integrating error modeling directly into the dynamic programming framework.