In order to demonstrate the effectiveness of the proposed
methodology, we trained a machine learning classifier on 3000
training circuits (taken from the MQT Bench library [11])
considering two qubit technologies, five different devices,
two compilers, and six corresponding settings. The resulting
classifier, which is publicly available along with the proposed
framework, is shown to yield the best possible combination of
compilation options in more than three quarters of all unseen
test circuits. For more than 95% of the circuits, a combination
of compilation options within the top-three is determined—
with the median compilation time being reduced by more
than one order of magnitude compared to manually compiling
for all possible combinations of compilation options and
choosing the best result. Moreover, rather than functioning as a
black-box, the underlying model additionally provides means
to extract explicit knowledge from the classifier—potentially
guiding further works towards exploiting the full potential
of machine learning in this domain and, also, 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 rest of this work is structured as follows: In Section II,
we describe the process of determining a good combination
of compilation options and review the related work. Based
on that, Section III details the methodology to predict good
combinations of options. Section IV describes the resulting
framework and summarizes our experimental evaluations. Sec-
tion V discusses how explicit knowledge can be extracted from
the proposed methodology and how changes in the underlying
data can be incorporated before Section VI concludes this
work.
II. CONSIDERED PROBLEM:
DETERMINING GOOD COMPILATION OPTIONS
In this section, we review the spectrum of options to choose
from when realizing an application on an actual quantum
computer, discuss the resulting dilemma for end-users, and
the related work available on this topic so far.
A. Motivation
Due to its promising applications and the steady evolution
of the corresponding technologies, quantum computing is no
longer a niche topic. Researchers in application domains very
different from quantum computing seek to utilize this technol-
ogy as a tool to solve their domain-specific problems in a more
efficient fashion. As a consequence, quantum computers are no
longer exclusively used by physicists or computer scientists,
but by an interdisciplinary range of end-users.
After a quantum algorithm for solving a particular problem
from an application domain has been developed in terms of
a quantum circuit, the end-user is confronted with a flood of
possible options and design decisions:
•Which qubit technology, e.g., superconducting qubits or
ion traps, is best suited for the application at hand?
•Which particular device, e.g., from IBM or Rigetti, fits
the quantum algorithm best?
•Which compiler, such as IBM’s Qiskit or Quantinuum’s
TKET, is most efficient for compiling the algorithm to
the respective device?
•Which settings and optimizations offered by the compil-
ers, such as different levels of optimization, are adequate
for the problem considered?
Figuring out good combinations of options (according to
some evaluation metric) for a particular application is a highly
non-trivial task due to several factors:
•Different qubit technologies have their own advantages
and disadvantages, e.g., devices based on ion-traps have
an all-to-all connectivity but suffer from slow gate execu-
tion times, while devices based on superconducting qubits
have limited qubit connectivity but fast gate execution
times [12].
•Individual devices greatly vary in their characteristics
such as qubit count, error rates, coherence times, qubit
connectivity, and gate execution times.
•Various compilers have been proposed by industry and
academia, i.e., in [1]–[5], [13]–[15]—each of which is
particularly suited for certain classes of circuits and
architectures.
•Compiler settings and optimizations, quite frequently, are
hardly or insufficiently documented.
•On top of all that, the domain of quantum computing
is fast-paced and constantly changing—quickly and fre-
quently redefining the state of the art.
This leaves end-users without expert knowledge faced with
more options than they can feasibly explore. Since quantum
computing is still in its infancy, this diversity of options is
only going to increase in the future. Thus, automated tools
for predicting good combinations of options are absolutely
necessary in order to provide the same kind of comfort that is
taken for granted in the classical world today. Otherwise, we
might end up in a situation where we have powerful quantum
computers and tools, but only a selected group of people know
how to use them.
B. Related Work
Decades of work on classical compilers have led to many
sophisticated compiler optimization techniques. Autotuning
(which describes the process of trying different compilation
parameters and comparing their result against some metric)
and machine learning (overviews are given in, e.g., [16],
[17]) have shown promising results and established themselves
as state-of-the-art techniques in this domain. Even combined
approaches of those two techniques are explored in [18], where
a machine learning model is used not to directly determine
optimal compiler settings but to identify promising areas of
the optimization space. Additionally, reinforcement learning
gained a lot of attention in recent years with promising results,
e.g., in [19]–[21]—all targeting the LLVM [22] compiler.
In quantum compilation, a domain that is still in its in-
fancy, the applied techniques are not that highly developed.
Nevertheless, first works towards this direction have already
been proposed nearly a decade ago in the form of hardware
resource estimates to reliably execute various quantum algo-
rithms [23] to provide guidance to end-users. Until today,