Equivalence Checking of Parameterized antum Circuits
Verifying the Compilation of Variational antum Algorithms
Tom Peham
Chair for Design Automation,
Technical University of Munich,
Germany
tom.peham@tum.de
Lukas Burgholzer
Institute for Integrated Circuits,
Johannes Kepler University Linz,
Austria
lukas.burgolzer@jku.at
Robert Wille
Chair for Design Automation,
Technical University of Munich,
Germany
Software Competence Center
Hagenberg GmbH, Austria
robert.wille@tum.de
ABSTRACT
Variational quantum algorithms have been introduced as a
promising class of quantum-classical hybrid algorithms that can
already be used with the noisy quantum computing hardware
available today by employing parameterized quantum circuits.
Considering the
non-trivial
nature of quantum circuit compilation
and the subtleties of quantum computing, it is essential to verify
that these parameterized circuits have been compiled correctly.
Established equivalence checking procedures that handle
parameter-free
circuits already exist. However, no methodology
capable of handling circuits with parameters has been proposed
yet. This work lls this gap by showing that verifying the
equivalence of parameterized circuits can be achieved in a purely
symbolic fashion using an equivalence checking approach based
on the
ZX-calculus
. At the same time, proofs of inequality can be
eciently obtained with conventional methods by taking
advantage of the degrees of freedom inherent to parameterized
circuits. We implemented the corresponding methods and proved
that the resulting methodology is complete. Experimental
evaluations (using the entire parametric ansatz circuit library
provided by Qiskit as benchmarks) demonstrate the ecacy of the
proposed approach. The implementation is open source and
publicly available as part of the equivalence checking tool
QCEC (
https://github.com/cda-tum/qcec
) which is part of the
Munich Quantum Toolkit (MQT).
1 INTRODUCTION
Quantum computers promise a computational advantage over
classical computers for certain problems [1]–[3]. Far-term
quantum algorithms such as Shor’s algorithm for integer
factorization [4] and Grover search [5] require robust, large-scale
error correction schemes to retrieve a meaningful result from their
execution [6]. Noisy Intermediate Scale Quantum (NISQ)
computers [7], the ones that are available today, are not able to
implement this error correction yet. Due to the high gate error
rates and short coherence times of NISQ devices, the depth of any
quantum circuit to be run on them is inherently limited.
Variational Quantum Algorithms [8] have been proposed to
achieve a computational advantage despite these limitations.
These algorithms use quantum programs as subroutines in a
classical optimization routine. The optimization loop iteratively
improves the parameters of a quantum circuit ansatz, which, in
turn, is used to estimate some desired quantity, such as the
expectation value of some observable. This general variational
framework has been applied to solve problems in chemistry [9],
nance [10], discrete optimization [11], and more.
But, before running an ansatz on a target device, a compilation
step has to be performed where the circuit is translated into a
natively supported gate-set and routed such that it conforms to the
device’s topological constraints—a costly and non-trivial
procedure [12]–[15]. To avoid the necessity of recompiling a
quantum circuit in each iteration step of a variational algorithm,
the circuit is usually compiled once in parameterized form in
which the parameters tuned by the classical optimization routine
are not bound to specic values. This compiled parameterized
circuit can then be used in the optimization loop without having to
perform all compilation steps over and over again.
The increasing use of parameterized circuits in the development
of quantum algorithms has also brought along the need for
verifying that these circuits have been compiled correctly.
Established equivalence checking methods such as proposed
in [16]–[20] are able to prove that a compiled circuit still adheres
to its specication after compilation. However, these approaches
cannot handle parameterized circuits. The only way to verify the
compilation of variational quantum algorithms with these
methods is to check the equivalence of the original and the
instantiated compiled ansatz in each iteration. Since equivalence
checking is a hard problem for even one instance—it is, in fact, a
QMA-complete problem [21]—solving it over and over again is
hardly a feasible approach.
In this work, we propose, for the rst time, a methodology to
solve the equivalence checking problem for parameterized quantum
circuits. The proposed, multi-stage method starts out by using an
approach based on the
ZX-calculus
[22], [23] to try and prove the
equivalence of both parameterized circuits. If this does not succeed,
parameters of the circuits are instantiated, and a conventional,
complete equivalence checker is employed. In order to make this
check as easy as possible, we derive an instantiation scheme that
allows simplifying most of the parameterized gates from the circuits.
Furthermore, we prove this yields a complete equivalence checking
procedure for parameterized quantum circuits.
The resulting methodology has been evaluated on the entire
Qiskit [24] parameterized circuit library, which shows that the
proposed approach can decide the equivalence of variational ansatz
circuits for a high number of qubits and larger circuit depth than
is even practically executable today. The instantiation scheme, in
particular, allows for checking instances that would be infeasible
to handle otherwise—reducing the equivalence checking runtime
arXiv:2210.12166v1 [quant-ph] 21 Oct 2022