Abstract Quantum circuit compilation is an indispensable part of executing quantum circuits on quantum devices. It translates logical quantum circuits into physical quantum circuits that meet the device constraints. However, nonspecialist users require extensive expertise to effectively select and evaluate quantum circuit compilation processes. Therefore, this paper proposes a quantum circuit compilation option prediction method based on Deep Residual Attention Neural Network. The method aims to automate the selection of the best compilation scheme and enhance the efficiency and accuracy of quantum circuit compilation. Firstly, a quantum circuit feature extraction algorithm based on Time-Weighted Interaction Graph is proposed. This algorithm can effectively represent quantum circuits using fixed-length vectors, making the model input scalable. Secondly, for existing one-dimensional features, a quantum circuit compilation option prediction model based on Deep Residual Attention Neural Network is designed and trained. This model is capable of quickly and accurately predicting the optimal compilation option combination. Extensive experimental evaluations and comparisons are carried out on the MQT (Munich Quantum Toolkit) quantum circuit compilation dataset. These evaluations verify the effectiveness and advancement of the proposed method. Compared with the current state-of-the-art method (Random Forest), the proposed method improves the accuracy by 5.44%, the Top-3 accuracy by 2.6%, and the F1 by 2.05%.
Abstract Quantum circuit compilation is an indispensable part of executing quantum circuits on quantum devices. It translates logical quantum circuits into physical quantum circuits that meet the device constraints. However, nonspecialist users require extensive expertise to effectively select and evaluate quantum circuit compilation processes. Therefore, this paper proposes a quantum circuit compilation option prediction method based on Deep Residual Attention Neural Network. The method aims to automate the selection of the best compilation scheme and enhance the efficiency and accuracy of quantum circuit compilation. Firstly, a quantum circuit feature extraction algorithm based on Time-Weighted Interaction Graph is proposed. This algorithm can effectively represent quantum circuits using fixed-length vectors, making the model input scalable. Secondly, for existing one-dimensional features, a quantum circuit compilation option prediction model based on Deep Residual Attention Neural Network is designed and trained. This model is capable of quickly and accurately predicting the optimal compilation option combination. Extensive experimental evaluations and comparisons are carried out on the MQT (Munich Quantum Toolkit) quantum circuit compilation dataset. These evaluations verify the effectiveness and advancement of the proposed method. Compared with the current state-of-the-art method (Random Forest), the proposed method improves the accuracy by 5.44%, the Top-3 accuracy by 2.6%, and the F1 by 2.05%.
Any potential application of quantum computing, once encoded as a quantum circuit, needs to be compiled in order to be executed on a quantum computer. Deciding which qubit technology, which device, which compiler, and which corresponding settings are best for the considered problem—according to a measure of goodness—requires expert knowledge and is overwhelming for end-users from different domains trying to use quantum computing to their advantage. In this work, we treat the problem as a statistical classification task and explore the utilization of supervised machine learning techniques to optimize the compilation of quantum circuits. Based on that, we propose a framework that, given a quantum circuit, predicts the best combination of these options and, therefore, automatically makes these decisions for end-users. Experimental evaluations show that, considering a prototypical setting with 3000 quantum circuits, the proposed framework yields promising results: for more than three quarters of all unseen test circuits, the best combination of compilation options is determined. Moreover, for more than 95% of the circuits, a combination of compilation options within the top-three is determined—while the median compilation time is reduced by more than one order of magnitude. Furthermore, the resulting methodology not only provides end-users with a prediction of the best compilation options, but also provides means to extract explicit knowledge from the machine learning technique. This knowledge helps in two ways: it lays the foundation for further applications of machine learning in this domain and, also, allows one to quickly verify whether a machine learning algorithm is reasonably trained. The corresponding framework and the pre-trained classifier are publicly available on GitHub (https://github.com/cda-tum/MQTPredictor) as part of the Munich Quantum Toolkit (MQT).
The growing variety of quantum hardware technologies, each with unique peculiarities such as connectivity and native gate sets, creates challenges when selecting the best platform for executing a specific quantum circuit. This selection process usually involves a brute-force approach: compiling the circuit on various devices and evaluating performance based on factors such as circuit depth and gate fidelity. However, this method is computationally expensive and does not scale well as the number of available quantum processors increases. In this work, we propose a Graph Neural Network (GNN)based predictor that automates hardware selection by analyzing the Directed Acyclic Graph (DAG) representation of a quantum circuit. Our study evaluates 498 quantum circuits (up to 27 qubits) from the MQT Bench dataset, compiled using Qiskit on four devices: three superconducting quantum processors (IBM-Kyiv, IBM-Brisbane, IBM-Sherbrooke) and one trappedion processor (IONQ-Forte). Performance is estimated using a metric that integrates circuit depth and gate fidelity, resulting in a dataset where 93 circuits are optimally compiled on the trappedion device, while the remaining circuits prefer superconducting platforms. By exploiting graph-based machine learning, our approach avoids extracting the circuit features for the model evaluation but directly embeds it as a graph, significantly accelerating the optimal target decision-making process and maintaining all the information. Experimental results prove94.4%accuracy and an85.5%F1 score for the minority class, effectively predicting the best compilation target. The developed code is publicly available on GitHub (https://github.com/antotu/GNN-Model-Quantum-Predictor).
Fueled by recent accomplishments in quantum computing hardware and software, an increasing number of problems from various application domains are being explored as potential use cases for this new technology. Similarly to classical computing, realizing an application on a particular quantum device requires the corresponding (quantum) circuit to be compiled so that it can be executed on the device. With a steadily growing number of available devices—each with their own advantages and disadvantages—and a wide variety of different compilation tools, the number of choices to consider when trying to realize an application is quickly exploding. Due to missing tool support and automation, especially end-users who are not quantum computing experts are easily left unsupported and overwhelmed. In this work, we propose a methodology that allows one to automatically select a suitable quantum device for a particular application and provides an optimized compiler for the selected device. The resulting framework—called the MQT Predictor —not only supports end-users in navigating the vast landscape of choices, it also allows mixing and matching compiler passes from various tools to create optimized compilers that transcend the individual tools. Evaluations of an exemplary framework instantiation based on more than 500 quantum circuits and seven devices have shown that—compared with both Qiskit’s and TKET’s most optimized compilation flows for all devices—the MQT Predictor produces circuits within the top-3 out of 14 baselines in more than 98% of cases while frequently outperforming any tested combination by up to 53% when optimizing for expected fidelity . Additionally, the framework is trained and evaluated for critical depth as another figure of merit to showcase its flexibility and generalizability—producing circuits within the top-3 in 89% of cases while frequently outperforming any tested combination by up to 400%. MQT Predictor is part of the Munich Quantum Toolkit (MQT) and publicly available as open-source on GitHub ( https://github.com/cda-tum/mqt-predictor ) and as an easy-to-use Python package ( https://pypi.org/p/mqt.predictor ).
Any quantum computing application, once encoded as a quantum circuit, must be compiled before being executable on a quantum computer. Similar to classical compilation, quantum compilation is a sequential process with many compilation steps and numerous possible optimization passes. Despite the similarities, the development of compilers for quantum computing is still in its infancy—lacking mutual consolidation on the best sequence of passes, compatibility, adaptability, and flexibility. In this work, we take advantage of decades of classical compiler optimization and propose a reinforcement learning framework for developing optimized quantum circuit compilation flows. Through distinct constraints and a unifying interface, the framework supports the combination of techniques from different compilers and optimization tools in a single compilation flow. Experimental evaluations show that the proposed framework—set up with a selection of compilation passes from IBM’s Qiskit and Quantinuum’s TKET—significantly outperforms both individual compilers in 73% of cases regarding the expected fidelity. The framework is available on GitHub (https://github.com/cda-tum/MQTPredictor) as part of the Munich Quantum Toolkit (MQT).
To make quantum algorithms executable on a particular quantum device, they need to be compiled into circuits that respect constraints of the quantum hardware. This compilation usually involves multiple steps, where many hardware-compatible circuits are generated, and the best circuit is selected. To say which circuit is best, the quality of a circuit is generally quantified by a figure of merit (FoM). For FoMs, there is a trade-off between ease of calculation and accuracy in predicted execution quality. Commonly used FoMs, e.g., the number of gates, circuit depth, etc., are easy to evaluate, but do not directly capture the effects of circuit structure and noise. On the other end of the spectrum are FoMs that require full circuit execution and take a prohibitively long time to evaluate. One example is the probability of successful trials (PST), i.e., the probability of obtaining the initial state after running the quantum circuit followed by its inverse. Here, we investigate advantages and disadvantages of different FoMs, and formulate the properties of an ideal FoM. Based on our results, we propose wPST, a weighted version of the PST that accounts for individual qubits, not just the whole state. To quickly predict PST and wPST, we design machine learning models that take into account both the quantum circuit and quantum hardware data. In numerical simulations and experiments on quantum processors, we find that our machine learning-predicted FoMs outperform commonly used FoMs, increasing the correlation with the true PST or wPST by over 50%. To make our model useful for quantum compilers, we devise a two-step process to predict the wPST for non-transpiled quantum circuits: first, we predict the additional quantum gates required for the given quantum circuit, and then we predict the wPST, accounting for coherence times in the quantum device.
Quantum machine learning (QML) has demonstrated the potential to outperform classical machine learning algorithms in various fields. However, encoding classical data into quantum states, known as quantum data loading, remains a challenge. Existing methods achieve high accuracy in loading single data, but lack efficiency for large-scale data loading tasks. In this work, we propose Neural Circuit Parameter Prediction, a novel method that leverages classical deep neural networks to predict the parameters of parameterized quantum circuits directly from the input data. This approach benefits from the batch inference capability of neural networks and improves the accuracy of quantum data loading. We introduce real-valued parameterization of quantum circuits and a three-phase training strategy to further enhance training efficiency and accuracy. Experimental results on MNIST dataset show that our method achieves a 17.31 % improvement in infidelity score and 108 times faster runtime compared to existing methods. Our approach provides an efficient solution for quantum data loading, enabling the practical deployment of QML algorithms on large-scale datasets.