Predicting Good Quantum Circuit Compilation Options Nils QuetschlichLukas BurgholzeryRobert Willez

2025-05-02 0 0 1.71MB 11 页 10玖币
侵权投诉
Predicting Good Quantum
Circuit Compilation Options
Nils QuetschlichLukas BurgholzerRobert Wille
Chair for Design Automation, Technical University of Munich, Germany
Institute for Integrated Circuits, Johannes Kepler University Linz, Austria
Software Competence Center Hagenberg GmbH (SCCH), Austria
nils.quetschlich@tum.de lukas.burgholzer@jku.at robert.wille@tum.de
https://www.cda.cit.tum.de/research/quantum
Abstract—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 corre-
sponding 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 learn-
ing 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).
I. INTRODUCTION
The capabilities of quantum computers are steadily
evolving—achieving more physical qubits, lower error rates,
and faster operations. Devices are increasingly made available
through manufacturers, such as IBM Quantum, or third-party
cloud providers, such as Amazon Web Services. Furthermore,
several Software Development Kits (SDKs) for programming
these devices have been developed, e.g., IBM’s Qiskit [1],
Quantinuum’s TKET [2], Google’s Cirq [3], Xanadu’s Penny-
lane [4], and Rigetti’s Forest [5]. As a result of this progress,
academia and industry have started to elaborate possible
applications for this new technology. In fact, the potential of
quantum computing is currently being explored for several
application domains such as chemistry (e.g., [6]), finance (e.g.,
[7]), optimization (e.g., [8]), and machine learning (e.g., [9]).
Even dedicated workflows describing the steps required to
solve a classical problem using quantum computing start to
emerge (e.g., [10]).
The process towards executing corresponding quantum al-
gorithms on quantum computers has a lot of similarities to
the process of executing classical algorithms or programs on
classical computers. In the classical world, a program must be
transformed so that it can be executed on a specific Central
Processing Unit (CPU) which provides its own Instruction
Set Architecture (ISA). This transformation process is called
compilation and is conducted by compilers—usually coming
with numerous settings and optimization parameters. Simi-
larly, once an application for quantum computing has been
encoded as a quantum circuit, it needs to be compiled to the
targeted device’s native gate-set while obeying all restrictions
imposed by the device, e.g., limitations on the interaction of
qubits.
For classical compilation, guidelines and best-practices have
been developed over the previous decades such that even
end-users without a background in computer science can
compile and execute their programs. In quantum compilation,
however, this is not yet the case and classical compilation
schemes cannot be adopted in a one-to-one fashion. The reason
for that lies within the constraints (such as the restricted
connectivity of quantum devices) to be satisfied by a com-
piled quantum circuit compared to classical software. Since
comparable guidelines and best-practices have not yet been
developed for quantum circuit compilation, expert knowledge
is required and especially end-users without a background in
quantum computing are easily overwhelmed with a flood of
different qubit technologies, devices, compilers, and (quite fre-
quently, poorly documented) settings to choose from. Without
actionable advice, it is extremely difficult for an end-user to
decide on a combination of all these options for a correspond-
ingly considered application.
In this work, we treat the problem as a statistical classifi-
cation task and explore the utilization of supervised machine
learning techniques to optimize the compilation of quantum
circuits. We propose a framework that, given a quantum
circuit, predicts the best combination of these options and,
by that, automatically decides for end-users which qubit
technology, which specific device, which compiler, and which
corresponding settings to choose for realizing their applica-
tions. By this, a similar kind of comfort is provided to the
end-users of quantum computers as is taken for granted in the
classical world.
arXiv:2210.08027v3 [quant-ph] 19 May 2023
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,
resource estimation has still been an open research question.
Microsoft recently proposed the Azure Quantum Resource
Estimator [24] which is publicly available in their SDK.
Furthermore, a application-specific resource estimator in the
domain of derivative pricing has been developed [25] and can
be used to estimate the minimal quantum computing resources
needed to achieve a real-world quantum advantage in this do-
main. However, resource estimation often requires end-users to
manually provide a lot of information on particular hardware
aspects such as gate times and fidelities.
A different, but related, approach is to evaluate whether
existing architectures and compilers are capable of executing
a given quantum circuit. One example is the NISQ Analyzer
proposed in [26] which allows one to determine architectures
that are expected to be capable of reliably executing a given
circuit based on their number of qubits and a measure of
their maximum supported circuit depth. Although this solution
requires less manual input, it still provides no advice on which
compiler (settings) to use and also on which of the determined
architectures to pick.
In the recent past, many tools for comparing the
performance of different quantum circuit compilers for
different devices and/or compilation options have been
proposed [27]–[30]. However, in all these approaches, each
input circuit is simply compiled for every possible combination
of compilation options and the best circuit according to
some metric is reported, i.e., the best option is determined
in a brute-force fashion. While this provides the basis for
interesting case studies, such an approach cannot be feasibly
employed in practical situations due to the sheer amount of
time it takes to try out all options on every invocation with a
particular circuit—a situation which is only going to get worse
with the ongoing increase in options.
In addition to the above approaches, machine learning meth-
ods have been proposed to tackle certain quantum compilation
challenges by learning from data. In [31], the influence of
several circuit characteristics on the quality of the circuit
execution results is studied using Multi-Criteria Decision
Analysis methods and machine learning approaches to opti-
mize such. Similarly, the approach proposed in [32] tries to
learn an estimate of circuit fidelity for specific devices using
the graph structure of quantum circuits. Complementarily, a
reinforcement learning-based approach that models quantum
compilation as a Markov Decision Process with the goal
of learning optimal compilation sequences has recently been
proposed in [33].
Overall, there are many interesting activities happening in
this area. Nevertheless, to the best of the authors’ knowledge,
there is no automatic solution to determine the best com-
bination of quantum compilation options without explicitly
executing and examining all of them—which might be feasible
for conducting a case study on a handful of devices and
compilers but is certainly not scalable enough to support
end-users in realizing their real-world applications. In this
work, we apply similar techniques as in classical compiler
optimization targeting this problem.
III. PROPOSED SOLUTION:
PREDICTING GOOD COMPILATION OPTIONS
As discussed in the previous section, naively executing and
evaluating all possible combinations of compilation options on
demand quickly becomes infeasible due to the large number
of possible options. Even if an end-user was able to utilize all
those different SDKs to compile the specific quantum circuit
for all computers, it would have been a very time-consuming
and costly endeavor. Thus, in this work, we propose a method-
ology that allows one to predict good combinations of options
without the need for explicit compilation. To this end, the
problem is interpreted as a statistical classification task which
constitutes a prime task for supervised machine learning algo-
rithms. In the following, each individual aspect of the proposed
methodology is described and illustrated exemplary. Based on
that, Section IV then covers how this results in a corresponding
framework for the prediction of good combinations of options
and evaluates the benefits for end-users.
A. Compilation Options and Compilation Pipeline
Given certain qubit technologies with a set of respective
devices and certain compilers with various settings, the search
space of all compilation options is spanned by all the possible
combinations of technologies, devices, compilers, and settings.
Therefore, a compilation pipeline needs to be set up to realize
each combination of compilation options as a basis for the
proposed methodology. This poses a significant challenge as a
result of the vastly different interfaces and usability levels of
existing SDKs. Overall, this results in a decision tree structure,
where each path from the root node to a leaf node represents
one possible combination of compilation options.
Example 1. For illustration purposes assume that in the
following, the end-user has to decide between four devices
based on superconducting qubits (with 8,27,80, and 127
qubits, respectively) and a single ion trap-based one (with
11 qubits). Additionally, assume that IBM’s Qiskit [1] and
Quantinuum’s TKET [2] are available as state-of-the-art rep-
resentatives for compilers. Last but not least, assume that in
the case of Qiskit four different optimization levels (called
O0to O3) are considered, while in the case of TKET two
different qubit placement algorithms (called Line Placement
and Graph Placement) can be used for the compilation.
Both considered compilers are capable of compiling a
quantum circuit for all the considered devices. Therefore,
the corresponding search space for compilation options is
structured as illustrated in Fig. 1—comprising a total of 30
different combinations of compilation options.
B. Evaluation Metric
Based on the constructed search space, the definition of
an evaluation metric—determining whether a combination of
compilation options is good for a certain quantum circuit—is
an essential part of the proposed framework. All further steps
aim to optimize the prediction quality of the resulting model
according to this evaluation metric.
In principle, this evaluation metric can be designed to be
arbitrarily complex, e.g., factoring in actual costs of executing
quantum circuits on the respective platform or availability
摘要:

PredictingGoodQuantumCircuitCompilationOptionsNilsQuetschlichLukasBurgholzeryRobertWillezChairforDesignAutomation,TechnicalUniversityofMunich,GermanyyInstituteforIntegratedCircuits,JohannesKeplerUniversityLinz,AustriazSoftwareCompetenceCenterHagenbergGmbH(SCCH),Austrianils.quetschlich@tum.delukas...

展开>> 收起<<
Predicting Good Quantum Circuit Compilation Options Nils QuetschlichLukas BurgholzeryRobert Willez.pdf

共11页,预览3页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:10玖币 属性:11 页 大小:1.71MB 格式:PDF 时间:2025-05-02

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 11
客服
关注