We consider the problem of approximate quantum compiling as studied in [10]. This approach involves
the design of a parametric quantum circuit with fixed depth - the parameters are then adjusted to bring it
as “close” as possible to the target, where “close” is defined via some carefully chosen metric (see section
2.2). In [10], it was shown that such an approach could be used to derive a 14-CNOT decomposition of a
4-qubit Toffoli gate from scratch. It was furthermore shown that the Quantum Shannon Decomposition,
introduced by Shende, Bullock and Markov [11], can be compressed by a factor of two without practical
loss of fidelity. In this work, our main contribution is a new classical algorithm for quantum compilation
which significantly improves convergence - see below and main text for details.
In addition to the sub-circuit problem discussed above, we consider state preparation as an example
where classical techniques can play a significant role. For a large class of quantum algorithms, the en-
tanglement of the wavefunction is weakly entangled at the beginning of the circuit and grows with the
depth. There exist widely studied classical techniques (i.e. Tensor Networks) to store the wavefunction
of a large number of qubits when the system is only weakly entangled. Thus, this opens the possibility
of using classical Tensor Network techniques for state preparation to optimally compile the early parts
of a quantum circuit, in a similar way to [8,9]. One of the biggest obstacles however to any quantum
compilation technique, whether it is quantum assisted or not, is the existence of barren plateaus in the
parameter landscape, i.e. large regions where the gradient of the cost function vanishes exponentially in
the number of qubits, thus rendering it extremely difficult to train. A proposed solution for the quantum
assisted quantum compiling approach is to use shallow circuit Ansatz’ and so-caled “local cost functions”.
In short, a cost function calculated via a quantum circuit is local if it involves the measurement of only a
small number of qubits - a global cost function involves the measurement of all qubits. Here we design a
new classical algorithm inspired by the distinction between local and global cost functions made in [7,12]
for quantum compilation. In particular, we derive an expression inspired by the quantum approach that
can be easily implemented on a classical computer and that allows us to escape the barren plateaus. This
new cost function introduces a number of coefficients that we must update throughout the optimsation
procedure. Our algorithm implements a scheme to do so effectively, such that short depth parametric
quantum circuits can be found that closely approximate the target circuit of interest.
Our main contributions in this work are as follows: we derive an explicit expression for the local cost
functions considered in [7,12] in equation (14), such that they obtain a clear and intuitive operational
meaning. We use this to develop a new cost function - see equation (21) - whose gradient can be efficiently
calculated classically. We consider a particular case where our cost function can be studied analytically
and we show how the variance of its gradient behaves - see equation (29) - which allows us to understand
how and why our classical compilation scheme allows for the escape from barren plateaus. We develop
an algorithm to update the coefficients appearing in our new cost function - see section 4, appendix A
and appendix B. Finally, we demonstrate numerically in Figures 6and 8that the combination of our cost
function and our algorithm to update the coefficients significantly improves the convergence of certain
problems in quantum compilation.
The outline of this article is as follows: in section 2, we review approximate quantum compiling and
we show how it can be formulated as an optimisation problem. In section 3, we discuss the convergence
issues that are commonly encountered in quantum compiling problems - we discuss in particular the
appearance of barren plateaus in the parameter landscape. We introduce our classical version of the
local cost function and we show how, for a particular example where the cost function can be studied
analytically, the variance of the gradient of our cost function behaves as a function of the number of
qubits. In section 4, we describe our scheme to update the coefficients that appear in our classical local
cost function over the course of the optimisation procedure. In section 5, we present some numerical
results on simulations for up to 24 qubits showing that our classical local cost function significantly
improves convergence as compared to the global one. We conclude in section 6.
2 Setup
Quantum compilation is an active research area with a wide spectrum of research directions. One such
direction is to find the the best representation - in terms of some distance or structural properties - of a
generic unitary in a certain canonical basis (e.g. [13–17]). One can also consider an approach based on
exact qubit routing, i.e. mapping logical qubits to physical qubits so that the resulting unitary coincides
with the original one (up to a permutation) while allowing for compatibility with the hardware topology
2