# Adiabatic quantum learning

Nannan Ma  Department of Physics, National University of Singapore, Singapore
117551, Singapore  Wenhao Chu  Department of Physics, National University of
Singapore, Singapore 117551, Singapore  Jiangbin Gong<EMAIL_ADDRESS>Department of Physics, National University of Singapore, Singapore 117551,
Singapore  Centre for Quantum Technologies, National University of Singapore,
Singapore 117543, Singapore  Joint School of National University of Singapore
and Tianjin University, International Campus of Tianjin University, Binhai New
City, Fuzhou 350207, China

###### Abstract

Adiabatic quantum control protocols have been of wide interest to quantum
computation due to their robustness and insensitivity to their actual duration
of execution. As an extension of previous quantum learning algorithms, this
work proposes to execute some quantum learning protocols based entirely on
adiabatic quantum evolution, hence dubbed as “adiabatic quantum learning”. In
a conventional quantum machine learning protocol, the output is usually the
expectation value of a pre-selected observable and the projective measurement
of which forces a quantum circuit to run many times to obtain the output with
a reasonable precision. By contrast, the proposed adiabatic quantum learning
here may be integrated with future adiabatic weak measurement protocols, where
a single measurement of the system allows to extract the expectation value of
observables of interest without disrupting the concerned quantum states. Our
main idea is illustrated with simple examples.

##  I Introduction

Quantum computation [1, 2] is expected to lead the next computation revolution
by fully exploiting quantum advantages [3]. The converged efforts on scalable
quantum computation would not be possible by pioneering theoretical work [4,
5, 6, 7] and experimental demonstrations [8, 9, 10, 11]. Meanwhile, inspired
by the capability of machine learning [12], there have been tremendous efforts
to transplant machine learning thinking and algorithms to quantum platforms
[13, 14, 15], hence the promising research field of quantum machine learning
(QML). To date QML is mainly based on the so-called variational quantum
circuits (VQCs)[16, 17, 18, 19, 20, 21, 22]. In VQCs, the output, namely, the
expectation value of an observable of interest, is normally obtained from many
conventional, hence strong and projective measurements. For example, an
initial state (e.g., the vacuum state $\ket{0}$) goes through a series of
quantum parameterized gate operations (unitary operators). These parameterized
gates are introduced to encode $N$-dimensional input
$\textbf{x}=(x_{1},...,x_{N})$ as well as $M$ training variables
$\textbf{w}=(w_{1},...,w_{M})$. A prediction $f_{\textbf{w}}(\textbf{x})$ can
be made from the estimation
$\bra{0}U^{\dagger}(\textbf{x},\textbf{w})\hat{O}U(\textbf{x},\textbf{w})\ket{0}$
of a projective measurement on observable $\hat{O}$, where
$U^{\dagger}(\textbf{x},\textbf{w})$ is the overall time evolution operator.
As a stimulating development, a quantum version of the so-called universal
approximation theorem (UAT)[18, 23] has been obtained, confirming the
expressivity of a quantum circuit to approximate any integrable functional
relationships.

What motivated this work is the recognition that the above outlined
architecture of VQCs still relies on the necessary repetition of many
projective measurements [24] in extracting the expectation value of an
observable of interest. The precision of measurement is inherently related
with the variance of the eigenvalues of a concerned observable. In situations
involving excitations in a high-dimensional Hilbert space, the convergence of
the measured observable can be slow. Even for a low-dimensional Hilbert space,
a large number of quantum gates are still involved to encode many parameters,
and hence it is highly costly to repeat the entire sequence of quantum gate
operations after a projective measurement. Moreover, if non-commuting
observables are both of interest, extra measurements must be performed by
restarting the learning algorithm all over again. That a measurement collapses
and hence destroys the quantum state under measurement is not an issue of VQCs
themselves. Yet, to find ways to mitigate this issue would constitute an
important progress [25, 26, 27, 28, 29].

The real question of this work is hence the following: Is it possible to
execute QML algorithms in a way that is compatible with some innovative
measurement protocols, so that we can avoid the repetition of costly quantum
gate operations [30]? Our proposal of adiabatic quantum learning here aims to
offer a positive answer, at least theoretically. Indeed, we advocate that in
future quantum learning algorithms, the innovate adiabatic weak measurement
protocol [31, 32] may replace projective measurements so as to save
tremendously the needed number of quantum gate operations in implementing QML.
In a nutshell, adiabatic quantum measurement is based on the weak coupling
between a quantum system and a measuring device, say,
$H_{\mathrm{int}}=\frac{\hat{p}\hat{O}}{T}$, over a sufficiently long
integration time $T$, where $\hat{p}$ is the momentum operator of the pointer.
A simple consideration of the first-order perturbation theory indicates that
if the system is prepared on one of its energy eigenstates, then there will be
a small energy shift $\frac{p\langle\hat{O}\rangle}{T}$. Assuming that quantum
adiabatic conditions [33, 34] are obeyed, the system will stay on its
instantaneous eigenstates. Meanwhile, the energy shift of the system-pointer
coupling causes the pointer to change over a distance proportional to
$\expectationvalue{O}$. Throughout this process, the system and the pointer
will not get entangled due to the perturbative nature of the system-pointer
coupling. Indeed the adiabatic condition ensures that the system remains at
its slightly perturbed energy eigenstates. This being the case, upon finally
checking the actual position shift of the pointer and subject to the initial
spreading of the pointer states as the only source of error without a lower
bound [35], one can infer the expectation value of $\expectationvalue{O}$
without collapsing the measured state to one of the eigenstates of $\hat{O}$.
As is now clear, the readout of the said expectation value is achieved without
incurring a wavefunction collapse. As strange as it may sound, recent
brilliant experiments have demonstrated the in-principle feasibility of such a
weak measurement protocol [36, 37]. It is important to note that the
prerequisite to implement this weak measurement scheme is to prepare the
system under measurement on one of its energy eigenstates. As a matter of
fact, it is the Hamiltonian of the system itself that protects the system on
its initial eigenstate when a weak coupling between the system and a pointer
is turned on.

To show that quantum learning algorithms can be compatible with the above-
summarized weak adiabatic measurement scheme, in the following we shall depict
a learning architecture which is based entirely on adiabatic quantum gates,
that is, throughout the process the system is always on one of its energy
eigenstates. This way, in principle weak quantum adiabatic measurement can be
introduced at any step of a quantum learning algorithm without destroying the
quantum state, and the expectation value of an observable of interest can be
extracted in principle, without the need to repeat the quantum gate sequences.
The extraction of non-coummuting observables, as pointed by Anharonov’s paper
itself [31], is also possible and hence potentially brings in even more
resource saving. This paper is organized as follows. we will illustrate first
(i) how to encode a learning algorithm into operations on instantaneous
Hamiltonians, (ii) how to design operations to make adiabatic quantum
evolution possible (iii) how to execute the training procedure for such
architectures. We shall present two working examples where our protocol is
applied to conventional classification tasks.

##  II Theoretical considerations

###  II.1 Representation and operations

Consider a quantum system described by a $D$-dimensional Hilbert space. In
general, the complete set of all possible observables include $D^{2}$
elements, one of them being the identity and the rest can be all traceless and
Hermitian. Because the identity element does not affect the eigenvalues (gap)
and the eigenstates of the possible system Hamiltonian, we may omit this
operator and hence only keep $D^{2}-1$ elements. These element will be denoted
as $e_{i},i\in{1,...,D^{2}-1}$, forming the lie algebra of lie group SU(D) ,
with known and important properties such as
$[e_{a},e_{b}]=2i\sum_{c=1}^{D^{2}-1}C_{abc}e_{c}$, where $C_{abc}$ is real
and called the structure constant. The structure constant is not unique, but
we can always find the proper choice of $e_{i}$, so that
$\mathrm{Tr}(e_{a}e_{b})=2\delta_{ab}$ and
$C_{abc}=\frac{1}{4i}\mathrm{Tr}([e_{a},e_{b}]e_{c})$. It is obvious that the
structure constant is anti-symmetric in all three indices and must be 0 once
two indices are the same.

A time-dependent Hamiltonian $H(t)$, which will be necessary in our quantum
learning algorithms, will be characterized with a $d=D^{2}-1$ dimensional unit
vector $\vec{n}(t)$, namely, the Hamiltonian vector. Under the assumption that
initial system stays at the ground state of $H(\vec{n}(0))$ and the ensuing
evolution is adiabatic, the final state of the system must be the ground state
of $H(\vec{n}(T))$. What the final Hamiltonian is depends on the evolution
path of the instantaneous Hamiltonians, or more precisely the track of
$\vec{n}$ in the $d$-dimensional parameter space of the Hamiltonian. As such,
it is intuitive to incorporate the learning process into the track of
$\vec{n}$ in terms of time. As explained in Introduction, we start from an
eigenstate of the Hamiltonian and attempt to ensure adiabatic time evolution
afterwards is to make sure that at any point of the quantum manipulation, the
state is the eigenstate of the instantaneous Hamiltonian and as such, it is
possible to use the above-mentioned weak adiabatic measurement scheme to probe
the system without destroying the current quantum state.

To ensure that the time evolution of the system can be adiabatic, we need to
make sure that along the track of $\vec{n}$ in time, the eigenvalues of the
time-evolving Hamiltonians do not touch. This will restrict all possible time
dependence of the Hamiltonian to a small subset. We adopt the following simple
strategy. Let a Hamiltonian be mapped to a point of the $d$-dimensional unit
sphere, only the rotation operation around a certain axis in the parameter
space is considered. That is, in order to keep the energy-level gaps open
during the entire quantum control protocol, only a subgroup of
$\mathrm{SO}(D^{2}-1)$ will be selected as our operators. One subgroup
satisfying our conditions consists of all the rotations around the $d$
independent axes. More technical details are presented in Appendix A, where it
is explicitly shown that such kind of changes to the Hamiltonian can always be
described by a unitary transformation of the Hamiltonian matrix, which can
preserve the spectrum of the initial Hamiltonian and hence will not introduce
any level crossing during the operation. Furthermore, as shown in Appendix A,
a unitary transformation to a Hamiltonian can be always be understood as a
rotational operation defined here applied to a Hamiltonian matrix. This
indicates that the expressivity of our protocol based on a subset of
rotational operations is as powerful as the conventional quantum circuit.

Much similar to our conventional understanding of the rotational group
$\mathrm{SO}(3)$, one can identify a $d$-dimensional unit vector $\vec{m}$ as
the rotation axis, and then set the rotation angle to be $\theta$, so as to
construct the operation “rotation around $\vec{m}$ by $\theta$ ”. The
resulting rotation matrix can be expressed $e^{\theta A}$, with $A$ being the
generator corresponding to a rotation axis $\vec{m}$ and is given by

$A_{ij}=\sum_{k}C_{ijk}m_{k}.$ (1)

Here A is skew symmetric with $A^{T}=-A$.

In a 2-dimensional Hilbert space (as an example, also to be used later), basic
elements of a Hamiltonian are the three Pauli matrices $\sigma_{i}$,
$i\in{1,2,3}$. They form the set of bases to depict an arbitrary $2^{2}-1=3$
dimensional unit vector $\vec{n}$ to characterize a Hamiltonian:
$H(\vec{n})=\vec{n}\cdot\vec{\sigma}$. The structure constant is
$\epsilon_{abc}$ (Levi-Civita symbol) with
$[\sigma_{a},\sigma_{b}]=2i\epsilon_{abc}\sigma_{c}$. Its rotation generator
around $\vec{m}$ is $A_{ij}=\sum_{k}\epsilon_{ijk}m_{k}$ and corresponding
rotation matrix is given by $e^{\theta A}=\cos\theta I+\sin\theta
A+(1-\cos\theta)A^{2}$. The explicit expression of this rotational matrix is
as the following:

$\scriptsize{\left[\begin{array}[]{ccc}\cos(\theta)+(1-\cos(\theta))m_{1}^{2}&-\sin(\theta)m_{3}+(1-\cos(\theta))m_{1}m_{2}&\sin(\theta)m_{2}+(1-\cos(\theta))m_{1}m_{3}\\\
\sin(\theta)m_{3}+(1-\cos(\theta))m_{2}m_{1}&\cos(\theta)+(1-\cos(\theta))m_{2}^{2}&-\sin(\theta)m_{1}+(1-\cos(\theta))m_{2}m_{3}\\\
-\sin(\theta)m_{2}+(1-\cos(\theta))m_{3}m_{1}&sin(\theta)m_{1}+(1-\cos(\theta))m_{3}m_{2}&\cos(\theta)+(1-\cos(\theta))m_{3}^{2}\end{array}\right]}$
(2)

Upon this rotation, the new unit vector depicting the new Hamiltonian becomes

$\vec{n^{\prime}}=\cos(\theta)\vec{n}-\sin(\theta)\vec{n}\times\vec{m}+(1-\cos(\theta))(\vec{m}\cdot\vec{n})\vec{m}$
(3)

where $\vec{n}$ and $\vec{n^{\prime}}$ are the Hamiltonian vector respectively
before and after a rotation operator. For a 2-dimensional Hilbert space, these
operations are the SO(3) rotational group.

Figure 1: The flow of adiabatic learning protocol. The initial Hamiltonian
$H_{0}$ and initial state are prefixed. Input $x$ and variational parameters
$w$ control the operations on the Hamiltonian as a function of time, and the
evolution path of the Hamiltonian yields the adiabatic state evolution. During
the entire learning process, the system’s state remains on one of its energy
eigenstates. This allows our learning protocol to be integrated with weak
adiabatic measurement, such that the expectation value of an observable can be
obtained without collapsing the state of the system. The repetition of a
learning unit improves the expressivity, just as how data re-uploading
improves the learning capability of a conventional quantum circuit structure.
For a 2-dimensional Hilbert space with 1-dimensional input $x=\pi/3$ and
weight $w_{1}=[\pi/2,\pi/6]$, there are three adiabatic rotations respectively
around the $y$ axis (in encoding clock) by $x$, around the $z$ axis (in
variational block) by $w_{11}$ and around the $x$ axis (in variational block)
by $w_{12}$. The Bloch sphere illustrates the track traced out by the
Hamiltonian starting from $H_{0}=\sigma_{z}$.

###  II.2 Learning structure

Our choice of a subset of operations to the system Hamiltonian is to make sure
that adiabatic time evolution can be possible. Plus if this operation is
indeed executed slowly, then adiabatic time evolution can be achieved
throughout. Under this assumption, the track of instantaneous Hamiltonian
determines the output of a learning process. In our protocol, the ground state
of the initial Hamiltonian $H_{0}$ is used as the initial state. They are
hence fixed and easy to prepare. The classical input data is then encoded as
the rotation angle with certain pre-selected axis of the parameter space. This
hence forms the encoding part. Meanwhile, some operations are reserved as the
adjustable part, usually the actual rotation angles along a certain axis of
the parameter space, thus serving as the variational parameters.

In principle, we can arrange rather arbitrarily the execution of the encoding
step and the variational parameters in a learning structure. However, it is
wise to exploit some useful concepts widely used in QVC in our adiabatic
protocol. In particular, let us choose a special operation configuration as an
encoding block with their rotation parameters $x$ as the input data, then
another configuration as the variational block with their rotation parameters
$w$ as the variational parameters for the training step. These two blocks make
up a unit. Given the mapping between the adiabatic evolution under
consideration and possible unitary operations from a quantum circuit, many
techniques that may improve the learning ability or expressivity can be
transplanted into the execution of our learning protocol. One important
technique is the so-called re-uploading strategy [38]. This strategy is to
overcome the fact that a learned map $f_{\textbf{w}}(\textbf{x})$ typically
has a restricted frequency spectrum in its Fourier expansion. According to
several theoretical studies [23, 39], the repetition of data uploading or
adding more encoding layers can however expand its frequency spectrum and
hence enable our learning model to gain a better learning capability. Inspired
by this progress, we propose to repeat our learning unit constructed above
several times, so as to also implement the data re-uploading strategy. For
different units, their encoding blocks can be chosen to be the same, but
parameters of different variational blocks are independent. For an input, we
get a track of the unit vector representing the instantaneous Hamiltonian
through a series of rotation operations determined by input and variational
parameters. To drive an adiabatic evolution following this track, we introduce
a time scale, namely, $g=\Delta_{t}/\Delta_{\theta}$, where $\Delta_{t}$ is
the duration to rotate an angle $\Delta_{\theta}$. $g$ is hence the period
needed for a unit change of rotation angle occurs. The inverse of $g$
determines the speed of the adiabatic time evolution, which should be set to
be sufficiently small. The layout of this learning protocol is shown in Fig.
1. To visualize the track of time-evolving Hamiltonian, the Bloch sphere in
Fig. 1 illustrates the effect of the first learning unit. The encoding block
only has one rotation operation around the $y$-axis and the variational block
consists of two operations respectively around the $z$ and $x$-axis, all
preserving the spectrum of the Hamiltonian. The initial Hamiltonian is
$\sigma_{z}$. For one-dimensional input $x=\pi/3$ and two-dimensional weight
$w_{1}=[\pi/2,\pi/6]$, the initial green vector is rotated around $y$ by
$60^{\circ}$ to the brown intermediate vector, then around $z$ by $90^{\circ}$
to the blue vector, finally around $x$ by $30^{\circ}$ to the red vector. As a
result, the track is comprised of three arcs (green, brown and blue) depicting
the adiabatic evolution path. At the end of such adiabatic evolution, the
state is still the ground state of final Hamiltonian $H_{T}$ where $T$ is the
total operation time. This makes it possible to extract the expectation value
of some observation by use of the weak adiabatic measurement advocated above.

###  II.3 Training

Similar to other learning structures, an appropriate loss function is needed
and it reflects the difference between predictions and targets. One must
attempt to minimize this loss function in order to get optimal learning
parameters in these variational blocks. In our training step, we assume that
we can achieve perfectly adiabatic evolution. That is, the time evolving state
is always the ground state of the instantaneous Hamiltonian along its track.
As shown in the Appendix A, a rotation operation on the Hamiltonian is
equivalent to such a unitary operation acting on its ground state. This
indicates that there is a mapping between our adiabatic protocol and a
conventional VQC, with our protocol adopting a special class of rotation
operations that preserves the spectrum of the Hamiltonian. To us this is good
news since all currently known optimization methods applicable to a quantum
circuit can be implemented in our adiabatic protocol as well. There are three
main methods based on gradient descent: automatic differentiation, numerical
differentiation and parameter shift [40, 19]. Automatic differentiation (AD)
is the most efficient one if the process is simulated on a classical computer.
But if we do not wish to depend on a classical computer, then parameter shift
is favored because it enables us to obtain the theoretical gradient through
two measurement results. Numerical differentiation is the common choice to get
an approximate result by perturbing the respective parameter. Note that if a
method needs to have the expectation value from experiments to optimize, then
a large number of measurements will be executed in traditional protocols. This
is no longer the case here since by construction, the expectation value of
concerned observables can be obtained, at least in the future, by invoking
weak adiabatic measurement protocols. There are still many gradient-free
optimization methods, which are however not considered in this work.

Summarizing this subsection on the training step, we make use of the
availability of various libraries for building and training a quantum circuit
in order to demonstrate that our idea can work in principle. To that end we
map our rotation operations to a quantum circuit and use available libraries
to determine the optimized unitary transformations. These unitary
transformations can be regarded as rotations on the Hamiltonians. If we now
execute the rotations adiabatically, the system always stays at the ground
state of of the instantaneous Hamiltonian. The time evolving state of the
system is hence subject to the desired unitary operations determined from the
circuit optimization (apart from a global phase). With this understanding, we
can apply all optimization methods before we do the actual numerical
simulation based on finite-time rotations of the Hamiltonian parameters. There
will be some errors introduced due to the absence of perfect adiabaticity.
However, our working examples below show that this can be a small issue.

##  III Results

To demonstrate the feasibility of our adiabatic learning protocol, we examine
its implementation in two binary classification tasks, one treats a one-
dimensional data set and the other treats a two-dimensional data set. In the
execution of training on a quantum circuit in the cases below, automatic
differentiation is selected as the optimization method to get the optimal
parameters. The actual AD optimizer is COBYLA.

###  III.1 Case I

As a benchmark step, we start with a working example about one-dimensional
binary classification. The distribution of label is shown in Fig. 2(a). Input
is a real number $x$. There are three isometric parts in the range
$x\in(-1,1)$. The outer two parts (blue) are arranged with the same label
$y=1$ and the central part (green) goes with the label $y=0$.

To execute quantum learning, we next execute adiabatic learning protocol based
on a two-dimensional Hilbert space, equivalent to a one-qubit system. The
initial state under consideration is the qubit ground state $\ket{0}$ and the
initial Hamiltonian is $-\sigma_{z}$, whose vector representation
$\vec{n}_{0}$ is $(0,0,-1)$ according to our notation used in the previous
section. The unit vector is allowed to rotate on the Bloch sphere embedded in
a three-dimensional parameter space. In a learning unit, the encoding block
only contains one rotation operation because of this one-dimensional input.
This operation can be chosen as the rotation around the $x$ axis whose unit
vector is $(1,0,0)$. The rotation angle is based on the input $x$. The
variational block consists of three rotation operations, rotation around the
$z$ axis $(0,0,1)$ by $w_{1}$, rotation around the $y$ axis $(0,1,0)$ by
$w_{2}$ and rotation around the $z$ axis $(0,0,1)$ by $w_{3}$. The variational
parameter in this block is hence a 3-dimensional vector ($w_{1},w_{2},w_{3}$).
To achieve a good precision, we repeat this learning unit for three times. For
a given input, the track of the instantaneous Hamiltonian $H(t)$ in time is
determined by a total of $4\times 3=12$ rotations. This track of the qubit
Hamitonian guides the evolution of the initial state, with the final state
given by
$\ket{\phi_{T}}=\hat{T}\left\\{\exp\left[-i\int_{0}^{T}dtH(t)\right]\right\\}\ket{0}$,
where $\hat{T}$ is the time ordering operator. The adjustable parameters to
train in the training step are implemented by three three-dimensional vectors,
one each from one learning unit. From the adiabatic theorem, the final state
is expected to be an eigenstate of the final instantaneous Hamiltonian $H(T)$.
The final outcome can be the expectation value of the observable $\sigma_{z}$,
denoted by $e$, with $e$ ranging from -1 to 1. The classification criterion
is:

$y=\begin{cases}0\quad e\leq 0\\\ 1\quad e>0\end{cases}$ (4)

However, note that our implementation equally applies if the expectation value
of any other osbervable $\sigma_{x}$ or $\sigma_{y}$ is used. As mentioned
before, in our actual numerical experiments, we transform these rotation
operations to its quantum circuit analogy. We then use the package Qiskit to
construct the corresponding quantum circuit and train it with a selected
optimizer to get these optimal parameters.

Figure 2:  One-dimensional binary classification. (a) The label $y$
distribution in range $x\in[-1,1]$. $y=1$ when $|x|>\frac{1}{3}$ and $y=0$
otherwise. (b) The classification result of 100 samples. The
misclassifications marked with red circles occur in the neighborhood of the
two boundaries. The accuracy of the classification is $94\%$. (c) The output
difference between ideal evolution with perfect adiabaticity and the actual
time evolution in our numerical simulation. The roughness of the actual
simulation result is due to nonadiabatic effects. (d) The fidelity of
evolution state against the eigenstate of instantaneous Hamiltonian for sample
$x=0$ during the whole adiabatic evolution. Note that though the fidelity
keeps at almost unity throughout the operation, the influence of finite-time
operation on adiabaticity is still visible in panel (c).

According to distribution presented in Fig. 2(a), the train data consists with
$N_{t}=20$ randomly selected samples. After training, we get optimal
parameters, a 9-dimensional vector [-0.572, 0.643, 0.478, 1.57, 1.886, -1.225,
-1.4, -1.568, 0.856]. The training score that represents the ratio of getting
the correct prediction is 0.95, which means that there are only 1 sample
classified wrongly. Then we use the test data set that contains 100 samples
uniformly in range $[-1,1]$ to verify our adiabatic learning structure. Again,
for a given input, the initial state $\ket{0}$ evolves following the track of
the instantaneous Hamiltonians. We then get the output. In this process, we
set the operation time-scale parameter $g=0.01/0.0005=20$ per angle change
(the large this number is, the closer to the adiabatic limit). Then, the
evolution period for different input will be determined with
$\Delta_{t}=g\times\Delta_{\theta}$ (as mentioned in learning structure part).
The final classification result is presented in Fig. 2(b), where the accuracy
is seen to be at 94%. There it is also clear that the misclassifications
(marked with red circles) all occur around two boundaries. This is
understandable and typical because of the effect of the finite size of the
training data set. It is important to look into possible nonadiabatic effects,
because the time-evolution state cannot exactly follow the track of the time
evolving Hamiltonian, so long as the adiabatic protocol is completed with a
finite duration. Fig. 2(c) compares the output of actual time evolution with
the idealized time evolution with perfect adiabaticity. Their results match
each other with a reasonably high accuracy, with the roughness of the actual
output over a finite duration somewhat expected due to nonadiabatic effects
associated with finite-time nature of the simulation. It is also of interest
to inspect the difference between the actual time-evolving state
$|\phi_{\mathrm{sim}}(t)\rangle$ and the ground state $\ket{\phi_{g}(t)}$ of
the corresponding instantaneous Hamiltonian. To that end we introduce the
fidelity $f$, which is
$|\innerproduct{\phi_{\mathrm{sim}}(t)}{\phi_{g}(t)}|^{2}$ as a function of
time. This fidelity ranges in $[0,1]$, with $f=1$ if these two state are the
same and $f=0$ if they are orthogonal. In Fig. 2(d), we select a sample with
$x=0$ from the test data and check the time dependence of the defined fidelity
over the entire duration of the adiabatic learning protocol. It is seen there
the fidelity would stay close to unity for finite-time operations with $g=20$.
That is, to suppress possible nonadiabatic effects on the accuracy of our
classification task, the important adiabatic parameter $g$ should be at the
order of $10$ and the state fidelity is expected to be around $99.9\%$, which
is within the reach of today’s quantum control technologies.

###  III.2 Case II

Having benchmarked our protocol in a one-dimensional classification example,
we next stretch it to a two-dimensional binary classification task to check
our protocol’s performance further.

As shown in Fig. 3(a), the distribution is as follows: in a square with width
2, a circle divide it into two parts with the same area. The radius is
$\sqrt{2/\pi}$. Like the situation in the previous case, we set the label of
the part (blue) outside this circle as $y=1$ and the other part (green) as
$y=0$. Input is a two-dimensional vector $[x_{1},x_{2}]$, with
$x_{1},x_{2}\in[-1,1]$ . The target output for label 1 is 1 and label 0 is
$-1$.

In our learning structure, the variational block is the same as that in the
previous case. The encoding block is now comprised of two rotations
corresponding to the two elements of input. One is the rotation around the $z$
axis by $x_{1}$, followed by the rotation around the $y$ axis by $x_{2}$. We
still repeat this learning unit for three times as an example. So all the
variational parameters make up a $3\times 3=9$-dimensional vector. The initial
state is still the ground state $\ket{0}$ of Hamiltonian $-\sigma_{z}$, and
the observable for measurement at the end is still chosen to be $\sigma_{z}$.

Figure 3: Two-dimensional binary classification. (a) The label distribution
inside a square of length 2, with the boundary of the two labels being a
circle with a radius $\sqrt{2/\pi}$. (b) The classification result of 200
randomly selected samples. These wrongly classified samples are marked with
red circles and locate around the boundary. The accuracy is $92.5\%$. (c) The
output distribution in this square. The surface is somewhat rough, which is
again due to nonadiabatic effects in our actual time evolution. This is also
reflected from its projection at the bottom, where the boundary (white part,
output $=0$) for classification is seen to be not a perfect circle.

It is also natural to train our variational parameters after transforming
rotation operations on time dependent Hamiltonian to the corresponding quantum
circuits. 200 samples are selected randomly as the training data and the loss
function is still the L2 norm as we use in the previous case. The optimal
parameter vector is [-0.268, 1.628, 0.0176, 2.367, 0.1684, 2.796, 1.044,
1.616, 0.866] with accuracy $91.5\%$.

The adiabatic evolution is simulated again with adiabatic time-scale parameter
$g=0.01/0.0005=20$ per angle change as in previous case. We verify the
performance of such an adiabatic learning protocol with a test data set
consisting of 200 samples. The obtained result is presented in Fig. 3(b). The
points classified wrongly are marked with red circles. The classification
accuracy is found to be $92.5\%$. Similar to the previous case, these wrong
points are located around the boundary (the black circle). Evidently then, the
adopted learning structure has effectively learned the pattern of this two-
dimensional binary distribution. Finally, the output of adiabatic learning for
all the input data is shown in Fig. 3(c). The color represents the value of
output. The surface made up of output is not as smooth as it should be
theoretically. It is again due to finite-time nature of our numerical
simulations. From the contour plane projected at the bottom in Fig. 3(c), we
can confirm that though the classification boundary is not a perfect circle,
it really reflects the correct pattern with an acceptable error. Our results
here demonstrate again that adiabatic learning structure advocated above can
achieve the same learning capability in comparison to others based on more
general quantum circuits. The gained advantage is then the following: within
some acceptable small nonadaiabatic effects, the state of the system always
stays at the ground state of the instantaneous Hamiltonian, thus allowing to
carry out adiabatic weak measurements at any point of the learning protocol
and hence possibly bypassing the annoying repetition of projective
measurements in obtaining the expectation value of an observable.

##  IV Conclusion

In this work, we have proposed an alternative quantum learning structure,
which allows its ultimate integration with the innovative weak adiabatic
measurement scheme proposed by Aharonov and Vaidman [31]. Because the output
state in conventional quantum learning protocols is usually not the eigenstate
of a pre-chosen observable, the repetition of many measurements, which is the
strong projective measurement by default, always destroys the final state and
hence may not fully use the information of the final state from a long
sequence of quantum operations. The key message from this paper is that the
quantum learning structure can be integrated with weak adiabatic measurement
schemes by always letting the time-evolving states be one of its energy
states. To that end, instead of encoding the learning process into unitary
operators, the rotation on the Hamiltonian matrix along a set of axes is used
to construct a learning structure. We show that our learning protocol should
have the same learning capacity when compared with the traditional methods
based on more general quantum circuits. Theoretically, it is now possible to
imagine that at the end of quantum operations, the expectation value of an
observable can be obtained with a single measurement with a reasonable good
precision, without collapsing the state under measurement. This will greatly
facilitate the optimization process in variational learning by reducing the
complexity of output measurement on a quantum learning machine. It should be
even more useful in high-dimensional systems where eigenvalues of an
observable are likely to have a lager variance. In addition, our learning
protocol allows us to probe the intermediate state without disturbing the
computation or learning process. Unlike a conventional computation processes
regarded as a black box, the flow of our protocol thus becomes transparent and
any unexpected error can be monitored along the way without destroying the
time evolving state. Actual performance of our protocol in real experimental
platforms should be explored in the near future.

Recently, some other learning structures are being developed, such as deep
multi-layer perceptrons [41] and quantum-classical convolutional neural
network(CNN) [42, 43]. We note that more layers needed would require more
measurements in the interior of their learning processes. How to reduce
complications in the measurement steps there should be urgent and our
adiabatic learning protocol likely brings a long-term solution when these
learning structure can be implemented by adiabatic time evolution and then
integrated with adiabatic measurement schemes.

##  Appendix A The equivalence between an adiabatic evolution and a quantum
circuit

As explained in the method part, a traceless Hamiltonian in a $D$-dimensional
Hilbert space can be decomposed with $D^{2}-1$ traceless elements
$e_{i},i\in\\{1,\dots,D^{2}-1\\}$. It means that a $D^{2}-1$ dimensional unit
vector $\vec{n}$ represents a Hamiltonian in tersm of $H=\vec{n}\cdot\vec{e}$.
$C_{abc}$ is the structure constant with
$[e_{a},e_{b}]=2i\sum_{c=1}^{D^{2}-1}C_{abc}e_{c}$. After a selected
rotational operation $R$ around a $D^{2}-1$ dimensional unit vector $\vec{m}$
by angle $\theta$, the new unit vector $\vec{n^{\prime}}=R(\vec{n})$
representing a new Hamiltonian $H^{\prime}$ can be regarded as the result of a
unitary operator $U$ acting on $H$, $H^{\prime}=UHU^{\dagger}$.

Here we give the explicit mapping relation to find the corresponding unitary
operator $U$. As shown in the main text, the selected rotational operation
around $\vec{m}$ by $\theta$ is in the form of $R=e^{\theta A}$ with
$A_{ab}=\sum_{c}C_{abc}m_{c}$. As the rotation angle approaches 0, i.e.,
$\theta\to 0$, a straightforward relation emerges:

$\begin{split}n^{\prime}_{a}&=\sum_{b}R_{ab}n_{b}\\\
&=\sum_{b}(\delta_{ab}+\theta\sum_{c}m_{c}C_{abc}+\\\
&\quad\frac{1}{2}\theta^{2}\sum_{cde}C_{acd}C_{cbe}m_{d}m_{e}+\dots)n_{b}\end{split}$
(5)

The effect on the Hamiltonian then becomes the following:

$\begin{split}\vec{n^{\prime}}\cdot\vec{e}&=\vec{n}\cdot\vec{e}+\theta\sum_{abc}m_{c}n_{b}C_{abc}e_{a}+\\\
&\quad\frac{1}{2}\theta^{2}\sum_{abcde}C_{acd}C_{cbe}m_{d}m_{e}n_{b}e_{a}+\dots\\\
&=\vec{n}\cdot\vec{e}+i(\theta/2)\sum_{ab}m_{a}n_{b}[e_{a},e_{b}]+\frac{1}{2}(i\theta/2)^{2}\sum_{abcd}2iC_{cbd}[e_{a},e_{d}]+\dots\\\
&=\vec{n}\cdot\vec{e}+i(\theta/2)\sum_{ab}m_{a}n_{b}[e_{a},e_{b}]+\frac{1}{2}(i\theta/2)^{2}\sum_{abc}m_{a}n_{b}m_{c}(e_{a}[e_{c},e_{b}]+[e_{b},e_{a}]e_{c})+\dots\\\
&=(I+i(\theta/2)\vec{m}\cdot\vec{e}+\frac{1}{2}i[(\theta/2)\vec{m}\cdot\vec{e}]^{2}+\dots)\vec{n}\cdot\vec{e}(I-i(\theta/2)\vec{m}\cdot\vec{e}+\frac{1}{2}-i[(\theta/2)\vec{m}\cdot\vec{e}]^{2}+\dots)\\\
&=e^{i(\theta/2)\vec{m}\cdot\vec{e}}\vec{n}\cdot\vec{e}e^{-i(\theta/2)\vec{m}\cdot\vec{e}}\\\
&=U(\theta)\vec{n}\cdot\vec{e}U^{\dagger}(\theta).\end{split}$ (6)

Thus, with an infinitesimal rotation, the relation between a unitary
transformation $U(\theta)=e^{i(\theta/2)\vec{m}\cdot\vec{e}}$ experienced by a
Hamiltonian and the corresponding rotational operation $R=e^{\theta A}$ on the
corresponding unit vector is obvious. With multiplication of many such
infinitesimal rotations, it becomes obvious that a corresponding unitary
operator can be found for any rotation angle $\theta$. Furthermore, any
unitary operator in a quantum circuit can be written as $U(\theta)$ in terms
of the exponential of some Hermitian operators (apart from a global phase).
Thus, from a unitary operator considered in a quantum circuit, a corresponding
rotational operator can always be identified. This establishes the mapping
between a rotational operation in our protocol and unitary operators in a
conventional quantum circuit. As argued in the main text, our protocol is
hence expected to have the same expressivity as in a conventional quantum
circuit. This also explains why we can first find optimal variational
parameters from the corresponding quantum circuits in the training step and
then finally do the finite-time rotational operations to implement our
adiabatic learning protocol.

## References

  * Lloyd [1996] S. Lloyd, Universal quantum simulators, Science 273, 1073 (1996).
  * DiVincenzo [1995] D. P. DiVincenzo, Quantum computation, Science 270, 255 (1995).
  * Nielsen and Chuang [2002] M. A. Nielsen and I. Chuang, Quantum computation and quantum information (2002).
  * Shor [1999] P. W. Shor, Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer, SIAM review 41, 303 (1999).
  * Grover [1996] L. K. Grover, A fast quantum mechanical algorithm for database search, in  _Proceedings of the twenty-eighth annual ACM symposium on Theory of computing_ (1996) pp. 212–219.
  * Montanaro [2016] A. Montanaro, Quantum algorithms: an overview, npj Quantum Information 2, 1 (2016).
  * Liu  _et al._ [2021a] Y. Liu, S. Arunachalam, and K. Temme, A rigorous and robust quantum speed-up in supervised machine learning, Nature Physics 17, 1013 (2021a).
  * Peruzzo  _et al._ [2014] A. Peruzzo, J. McClean, P. Shadbolt, M.-H. Yung, X.-Q. Zhou, P. J. Love, A. Aspuru-Guzik, and J. L. O’brien, A variational eigenvalue solver on a photonic quantum processor, Nature communications 5, 1 (2014).
  * Kandala  _et al._ [2017] A. Kandala, A. Mezzacapo, K. Temme, M. Takita, M. Brink, J. M. Chow, and J. M. Gambetta, Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets, Nature 549, 242 (2017).
  * Vandersypen  _et al._ [2001] L. M. Vandersypen, M. Steffen, G. Breyta, C. S. Yannoni, M. H. Sherwood, and I. L. Chuang, Experimental realization of shor’s quantum factoring algorithm using nuclear magnetic resonance, Nature 414, 883 (2001).
  * Arute  _et al._ [2019] F. Arute, K. Arya, R. Babbush, D. Bacon, J. C. Bardin, R. Barends, R. Biswas, S. Boixo, F. G. Brandao, D. A. Buell, _et al._ , Quantum supremacy using a programmable superconducting processor, Nature 574, 505 (2019).
  * Carleo  _et al._ [2019] G. Carleo, I. Cirac, K. Cranmer, L. Daudet, M. Schuld, N. Tishby, L. Vogt-Maranto, and L. Zdeborová, Machine learning and the physical sciences, Reviews of Modern Physics 91, 045002 (2019).
  * Biamonte  _et al._ [2017] J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, and S. Lloyd, Quantum machine learning, Nature 549, 195 (2017).
  * Cong  _et al._ [2019] I. Cong, S. Choi, and M. D. Lukin, Quantum convolutional neural networks, Nature Physics 15, 1273 (2019).
  * Schuld and Killoran [2019] M. Schuld and N. Killoran, Quantum machine learning in feature hilbert spaces, Physical review letters 122, 040504 (2019).
  * McClean  _et al._ [2016] J. R. McClean, J. Romero, R. Babbush, and A. Aspuru-Guzik, The theory of variational hybrid quantum-classical algorithms, New Journal of Physics 18, 023023 (2016).
  * Yuan  _et al._ [2019] X. Yuan, S. Endo, Q. Zhao, Y. Li, and S. C. Benjamin, Theory of variational quantum simulation, Quantum 3, 191 (2019).
  * Goto  _et al._ [2021] T. Goto, Q. H. Tran, and K. Nakajima, Universal approximation property of quantum machine learning models in quantum-enhanced feature spaces, Physical Review Letters 127, 090506 (2021).
  * Mitarai  _et al._ [2018] K. Mitarai, M. Negoro, M. Kitagawa, and K. Fujii, Quantum circuit learning, Physical Review A 98, 032309 (2018).
  * Havlíček  _et al._ [2019] V. Havlíček, A. D. Córcoles, K. Temme, A. W. Harrow, A. Kandala, J. M. Chow, and J. M. Gambetta, Supervised learning with quantum-enhanced feature spaces, Nature 567, 209 (2019).
  * Lloyd  _et al._ [2020] S. Lloyd, M. Schuld, A. Ijaz, J. Izaac, and N. Killoran, Quantum embeddings for machine learning, arXiv preprint arXiv:2001.03622 (2020).
  * Schuld  _et al._ [2020] M. Schuld, A. Bocharov, K. M. Svore, and N. Wiebe, Circuit-centric quantum classifiers, Physical Review A 101, 032308 (2020).
  * Pérez-Salinas  _et al._ [2021] A. Pérez-Salinas, D. López-Núñez, A. García-Sáez, P. Forn-Díaz, and J. I. Latorre, One qubit as a universal approximant, Physical Review A 104, 012405 (2021).
  * Von Neumann [2018] J. Von Neumann, Mathematical foundations of quantum mechanics, in  _Mathematical Foundations of Quantum Mechanics_ (Princeton university press, 2018).
  * Alonso and García [2022] D. Alonso and A. R. García, Single energy measurement integral fluctuation theorem and non-projective measurements, arXiv preprint arXiv:2212.13225 (2022).
  * Banchi and Crooks [2021] L. Banchi and G. E. Crooks, Measuring analytic gradients of general quantum evolution with the stochastic parameter shift rule, Quantum 5, 386 (2021).
  * Huang  _et al._ [2020] H.-Y. Huang, R. Kueng, and J. Preskill, Predicting many properties of a quantum system from very few measurements, Nature Physics 16, 1050 (2020).
  * Gresch and Kliesch [2023] A. Gresch and M. Kliesch, Guaranteed efficient energy estimation of quantum many-body hamiltonians using shadowgrouping, arXiv preprint arXiv:2301.03385 (2023).
  * Kohda  _et al._ [2022] M. Kohda, R. Imai, K. Kanno, K. Mitarai, W. Mizukami, and Y. O. Nakagawa, Quantum expectation-value estimation by computational basis sampling, Physical Review Research 4, 033173 (2022).
  * Solinas  _et al._ [2023] P. Solinas, S. Caletti, and G. Minuto, Quantum gradient evaluation through quantum non-demolition measurements, arXiv preprint arXiv:2301.07128 (2023).
  * Aharonov  _et al._ [1988] Y. Aharonov, D. Z. Albert, and L. Vaidman, How the result of a measurement of a component of the spin of a spin-1/2 particle can turn out to be 100, Physical review letters 60, 1351 (1988).
  * Aharonov and Vaidman [1993] Y. Aharonov and L. Vaidman, Measurement of the schrödinger wave of a single particle, Physics Letters A 178, 38 (1993).
  * Born and Fock [1928] M. Born and V. Fock, Beweis des adiabatensatzes, Zeitschrift für Physik 51, 165 (1928).
  * Kato [1950] T. Kato, On the adiabatic theorem of quantum mechanics, Journal of the Physical Society of Japan 5, 435 (1950).
  * Zhang and Gong [2020] D.-J. Zhang and J. Gong, Dissipative adiabatic measurements: Beating the quantum cramér-rao bound, Physical Review Research 2, 023418 (2020).
  * Piacentini  _et al._ [2017] F. Piacentini, A. Avella, E. Rebufello, R. Lussana, F. Villa, A. Tosi, M. Gramegna, G. Brida, E. Cohen, L. Vaidman, _et al._ , Determining the quantum expectation value by measuring a single photon, Nature Physics 13, 1191 (2017).
  * Pan  _et al._ [2020] Y. Pan, J. Zhang, E. Cohen, C.-w. Wu, P.-X. Chen, and N. Davidson, Weak-to-strong transition of quantum measurement in a trapped-ion system, Nature Physics 16, 1206 (2020).
  * Pérez-Salinas  _et al._ [2020] A. Pérez-Salinas, A. Cervera-Lierta, E. Gil-Fuster, and J. I. Latorre, Data re-uploading for a universal quantum classifier, Quantum 4, 226 (2020).
  * Schuld  _et al._ [2021] M. Schuld, R. Sweke, and J. J. Meyer, Effect of data encoding on the expressive power of variational quantum-machine-learning models, Physical Review A 103, 032430 (2021).
  * Li  _et al._ [2017] J. Li, X. Yang, X. Peng, and C.-P. Sun, Hybrid quantum-classical approach to quantum optimal control, Physical review letters 118, 150503 (2017).
  * Alam and Ghosh [2022] M. Alam and S. Ghosh, Deepqmlp: A scalable quantum-classical hybrid deepneural network architecture for classification, arXiv preprint arXiv:2202.01899 (2022).
  * Henderson  _et al._ [2020] M. Henderson, S. Shakya, S. Pradhan, and T. Cook, Quanvolutional neural networks: powering image recognition with quantum circuits, Quantum Machine Intelligence 2, 1 (2020).
  * Liu  _et al._ [2021b] J. Liu, K. H. Lim, K. L. Wood, W. Huang, C. Guo, and H.-L. Huang, Hybrid quantum-classical convolutional neural networks, Science China Physics, Mechanics & Astronomy 64, 1 (2021b).