Data-driven Acceleration of Quantum Optimization and Machine Learning via Koopman Operator Learning
Abstract
Efficient optimization methods play a crucial role for quantum optimization and machine learning on near-term quantum computers.
Unlike classical computers, obtaining gradients on quantum computers is costly with sample complexity scaling with the number of parameters and measurements.
In this paper, we connect the natural gradient method in quantum optimization with Koopman operator theory, which provides a powerful framework for predicting nonlinear dynamics.
We propose a data-driven approach for accelerating quantum optimization and machine learning via Koopman operator learning.
To predict parameter updates on quantum computers, we develop new methods including the sliding window dynamic mode decomposition (DMD) and the neural-network-based DMD.
We apply our methods both on simulations and real quantum hardware.
We demonstrate efficient prediction and acceleration of gradient optimization on the variational quantum eigensolver and quantum machine learning
Introduction
The fields of quantum technology and quantum computation are under rapid development in recent years.
Two promising applications of quantum technology, quantum optimization [39] and quantum machine learning (QML) [5], have gained increased interest.
The Variational Quantum Algorithm (VQA) [7] such as the Quantum Approximate Optimization Algorithm (QAOA) [13] has been developed for solving optimization on graphs.
By benchmarking against a variety of classical algorithms, a recent experiment on 289 qubits has demonstrated a powerful application of VQA for classical optimization problems [12].
The Variational Quantum Eigensolver (VQE) [42, 56] has been applied to find quantum states for understanding science in high energy physics [22, 47], condensed matter physics [58], and quantum chemistry [41].
In quantum machine learning, both theoretical advantages have been investigated [19, 30, 17, 20, 10, 29], and experiments on real quantum computers have demonstrated encouraging progress [18, 49].
In the noisy intermediate-scale quantum (NISQ) era [44], the current quantum computers suffer from noise and the computation resources are limited.
To address the issue, hybrid classical-quantum schemes have been developed for quantum optimization and quantum machine learning, which perform optimization and machine learning on parameterized quantum circuits with quantum features while optimizing the circuit’s parameters through classical computers.
In contrast to classical machine learning, for which the backprogation algorithm shares the same complexity as the forward evaluation, the hybrid scheme has much higher cost for obtaining gradients due to: (1) gradient calculation typically has linear scaling with respect to the number of parameters; and (2) repeated measurements are required to estimate the gradient for each parameter.
Despite their popularity, gradient-based methods on real quantum computers are computationally inefficient to implement, which limits their applications in practice.
To develop scalable and efficient optimization methods for quantum optimization and quantum machine learning is an important open problem in the field.
Here, we propose a data-driven approach for accelerating quantum optimization and quantum machine learning via Koopman operator learning [24].
By viewing parameter optimization on quantum computers as a nonlinear dynamical process in the parameter space, we connect gradient dynamics in quantum optimization to the Koopman operator theory, which has been developed to successfully predict nonlinear dynamics through linear dynamics embedded into a higher dimensional space [6, 35, 37, 36, 48].
In particular, we find that the Koopman operator theory has a natural connection to the quantum natural gradient method.
Based on the insights of the theory, we develop new Koopman operator learning algorithms, including the sliding window dynamic mode decomposition (SW-DMD) and neural-network-based DMD, for quantum optimization and quantum machine learning.
Our approach is data-driven and efficiently predicts the gradient dynamics with cost that does not scale with the number of parameters.
We show the effectiveness of our algorithms for the variational quantum eigensolver with the natural gradient and Adam [21] optimizers on quantum Ising model simulations and demonstrate their success on a real IBM quantum computer.
Furthermore, using our methods, we accelerate quantum machine learning on the fashion-MNIST dataset.
Related Work
Koopman operators.
Koopman operator theory [24, 57] was first proposed by Koopman and von Neumann in early 1930s to understand dynamical systems.
Dynamic mode decomposition (DMD) [50] was developed to learn the Koopman operator under the linear dynamics assumption of the observed data.
Later, more advanced methods such as the extended-DMD based on kernel methods [3] and dictionary learning [25] were introduced to go beyond the linear dynamics assumption, and achieved better performance.
Recently, machine learning methods were integrated into Koopman operator learning where neural networks are used to learn the mapping to high dimensional space, in which the dynamics becomes linear [34, 27].
The machine learning Koopman operator methods were shown to learn nonlinear differential equation dynamics successfully.
Furthermore, Koopman operator theory was applied to optimize neural network training [9, 55] and pruning [45].
These works take the perspective of viewing the optimization process of neural networks as a nonlinear dynamical evolution and uses dynamic mode decomposition to predict the parameter updates in the future.
In a more empirical study, [52] trained a convolutional neural network (CNN) to predict the future weights of neural networks, trained on standard vision tasks.
Recently, researchers considered
Koopman operator theory for quantum control [15] and prediction of one particle quantum system evolution [23].
Since quantum mechanical systems provide a natural high dimensional Hilbert space through the wave function, the theory was considered for embedding classical equations on quantum computers for learning and solving differential equations [28, 14].
Optimization methods on quantum computers.
To perform optimization on quantum computers, gradient-free methods such as SPSA [53] and COBYLA [43] are used though they may not scale well to quantum circuits with large number of parameters.
For gradient methods, Adam is a common choice for better scaling though its complexity scales with the number of parameters as discussed above.
There are also higher order methods such as the quantum natural gradient method [54] with faster convergence but more challenges to realize experimentally.
Our work.
There are several important features of our work that distinguish it from the relevant works above.
First, our goal is to accelerate quantum optimization and quantum machine learning, which compared to classical neural networks has much higher complexity of taking gradients, such that the gain of acceleration will be much more prominent.
Second, instead of predicting the gradient dynamics directly, we focus on decreasing the loss function during the training and develop iterative optimal prediction algorithms, which is much more flexible and effective than the one-time prediction in the previous work [9].
Third, the previous literature on Koopman operators for neural networks applies only the standard DMD which may not be well situated for complicated nonlinear training dynamics.
Instead, we develop and investigate the sliding window DMD (SW-DMD) and several variants of neural-network-based DMD, including the multi-layer perceptron DMD (MLP-DMD),
MLP-SW-DMD and CNN-DMD.
Connecting Koopman Operator Theory and Quantum Optimization 3.1 Koopman Operator Theory
Consider a dynamical system with a collection of state variables { x ( t ) ∈ R n } with a transition function T such
that x ( t + 1) =
T ( x ( t )) .
According to the Koopman operator theory [24], there exists a linear operator K and a function g such that
[Equation] [Equation]
) where K is the Koopman operator.
While the Koopman operator generally can act on an infinitedimensional space, it can be represented as a Koopman matrix K ∈ R m × m when it is constrained to a finite dimensional invariant subspace with g : R n → R m .
An important question in Koopman operator theory is to search for the function g , and a number of methods have been developed to tackle the problem [34, 27, 50, 3, 25].
3.2 Variational Quantum Eigensolver (VQE)
Consider a Hamiltonian H describing interactions in a physical system with N qubits.
H is a
Hermitian operator acting on the 2 N -dimesional Hilbert space for wave functions, which are l 2normalized complex-valued vectors.
The energy of the system from a wave function ψ is given by
L ( ψ ) = ⟨ ψ, H ψ ⟩ .
VQE encodes the wave function as ψ θ by a set of parameters θ ∈ R n params via a parameterized quantum circuit as the top left part of Figure 1 shows.
The goal of VQE is to minimize the loss by minimizing for θ in the following objective θ ∗ =
arg min θ L ( θ ) =
arg min θ ⟨ ψ θ , H ψ θ ⟩ .
Quantum machine learning has a similar setup that targets at minimizing L ( θ ) , and parameterized quantum circuits in QML are called quantum neural networks.
To compute the gradient for the quantum circuit, it requires to evaluate the loss with a perturbation in each direction i , for example by using the parameter-shift rule [38, 51] ( L ( θ i + π/ 2)
−L ( θ i − π/ 2)) / 2 , which leads to an O ( n params ) computational cost per iteration.
This is much more expensive than O (1) cost of backpropagation per iteration in classical machine learning.
Hence, the classical computational resources in the Koopman operator learning, even including training neural-network-based algorithms in the following sections, typically are much cheaper than the quantum cost.
3.3 Quantum Fisher Information and Quantum Natural Gradient
The quantum natural gradient method [54] generalizes the classical natural gradient method [1] to the context of wave function optimization.
The following nonlinear differential equation describes the natural gradient update for parameter θ under arg min θ ⟨ ψ θ , H ψ θ ⟩
[Equation]
[Equation]
) where η is the learning rate, and F is the quantum Fisher Information matrix given by F ij = ⟨ ∂ψ θ ∂θ i , ∂ψ θ ∂θ j ⟩ − ⟨ ∂ψ θ ∂θ i , ψ θ ⟩⟨ ψ θ , ∂ψ θ ∂θ j ⟩ .
The above equation for θ can be shown equivalent to the dynamical equation of ψ θ ( t ) with the projection operator P ψ θ on the manifold given by the parameterized quantum circuit [16]
[Equation]
ψ θ ( t ) .
[Figure]
Since H is a linear operator
Eq. 3 is close to a linear differential equation when the parametrized quantum circuit is sufficiently expressive such that the projection is within the manifold.
Viewing the parameters θ ( t ) as the state variable x ( t ) in the Koopman theory the wave function ψ θ naturally generated by the quantum circuit plays the role of g in Eq.
which makes the embedded dynamics close to linear in the Hilbert space.
The existence of ψ θ and its approximate linear dynamics builds the theoretical foundation for Koopman operator learning algorithms in optimization and the application of parameter update acceleration.
Koopman Operator Learning Algorithms 4.1 Our framework: data-driven approach for accelerating optimization
Our approach is shown in Figure 1.
We use a quantum computer to measure L at the initial parameter θ ( t 0 ) of the quantum circuit.
Then, we use an optimizer on a classical computer, such as Adam to update the parameter θ , thus incrementing the optimization iteration by 1.
If the optimizer is gradient-based, for each iteration, O ( n params ) additional quantum measurements are needed to evaluate the gradient.
Next, we input the updated parameters into the quantum circuit and repeat this procedure for m steps.
We acquire a time sequence θ ( t 0 ) , θ ( t 1 ) , ..., θ ( t m ) .
We then the apply
Koopman operator learning algorithms to the acquired data and predict the time series for n DMD steps to obtain θ ( t m +1 ) , θ ( t m +2 ) , ..., θ ( t m + n DMD ) .
The loss at these predicted parameters can also be evaluated on the quantum computer, but no gradient measurement is needed.
From these n DMD loss function values and the last step from the VQE θ ( t m ) , we find the lowest loss and the corresponding time t opt .
The optimal Koopman-predicted parameter θ ( t opt ) is then used as the initial point for the next quantum optimization and quantum machine learning.
We repeat this cycle to accelerate the loss decrease with less resources.
4.2 Sliding Window DMD (SW-DMD)
Dynamic mode decomposition [6] uses a linear fit for the dynamics in the original space for the column vector θ ∈ R n as follows θ ( t k +1 )
=
K θ ( t k ) .
We concatenate θ at successive times to obtain two data matrices
[Equation]
where Θ ( t 1 ) is the one-step time evolution of Θ ( t 0 ) .
In the case of approximate linear dynamics, the matrix K is the same for all times t k , and then the DMD fit becomes Θ ( t 1 )
≈ K Θ ( t 0 ) ,
where
K ∈ R n × n .
The best fit is at the minimum of the Frobenius loss
[Equation]
where + is the pseudo-inverse.
When the dynamics of θ is not linear, we can instead consider a time-delayed embedding with a sliding window and concatenate the steps to form an extended data matrix [11]
[Equation]
Φ is generated by a sliding window of size d + 1 at m + 1 consecutive time steps.
Each column of Φ is a time-delayed embedding for Θ , and the different columns ϕ in Φ are embeddings at different starting times.
The time-delayed embedding captures some nonlinearity in the dynamics of θ , with
[Equation]
where K ∈ R n × n ( d +1)
The best fit is given by
[Equation]
The used data from the acquired time series with the largest time in the above equation is θ ( t m + d +1 ) .
When making prediction, we start with θ ( t m + d +2 )
=
K ϕ ( t m +1 ) .
Then we update from ϕ ( t m +1 ) to ϕ ( t m +2 ) by removing the oldest data θ ( t m +1 ) and adding the newly predicted data θ ( t m + d +2 ) .
We repeat this prediction using θ ( t k + d +1 ) =
K ϕ ( t k ) iteratively.
Our approach is different from the approach used by [11], as we do not perform an additional singular value decomposition before doing
DMD and our matrix K is non-square.
We denote DMD performed this way as sliding window DMD (SW-DMD).
The standard DMD is a special case of SW-DMD when the sliding window size is 1 ( i.e. , d = 0 ).
4.3 Neural DMD
General formulation.
In order to improve DMD by making it more amenable to nonlinear dynamics, we investigate whether Φ can be a neural network.
By simply writing Φ in Eq. 8 as a neural network, we obtain arg min K,α
[Equation]
(9) where K ∈ R N in × N out is a linear Koopman operator, and Φ α ( Θ ( t 0 )) is a nonlinear neural embedding by a neural network Φ α with parameters α .
More specifically, Φ α :=
NN α ◦ Φ is a composition of the neural network architecture NN α and the sliding window embedding Φ from the previous section.
The parameters K and α are trained jointly on Eq.
9 from scratch with every new batch of optimization history by using the Adam optimizer.
See hyperparameter details in Appendix C. We use the MSE loss, which minimizes the Frobenius norm.
MLP-DMD, CNN-DMD and MLP-SW-DMD methods.
We consider three natural choices for the architecture of the neural network, which we list below.
Figure 2 (a) demonstrates that our first choice is a simple MLP.
The result is MLP-DMD .
The architecture is two linear layers with an ELU [8] activation on the hidden layer and a residual connection with expansion ration 1 (higher ratios are more prone to overfitting to the noise in the history of optimization that is used as training data to the neural network).
MLP-DMD does not use mixing of information between simulation steps, as in our
SW-DMD method.
Thus, we also consider a 1D CNN encoder in Figure 2 (b) to form the CNN-DMD method.
In CNN-DMD, the simulation steps form the temporal dimension, and the parameters form the channel dimension of the CNN.
We use causal masking of the CNN kernels on the encoder in order to avoid look-ahead bias.
During the inference, we look at the history of simulated steps, and look at the prediction of the last step.
Then we recurrently feed the last step and resume the
[Figure]
t(
[Figure]
) t(
[Figure]
) t(
[Figure]
dim
[Figure]
predictions.
The architecture is two 1D-CNN layers with bottleneck middle channel number of 1 (to avoid overfitting) and ELU activation in between.
Because DMD is a special case of SW-DMD, we also naturally define an MLP-SW-DMD method, i.e. , we simply consider our MLP-DMD method for input obtained by window size larger than 1.
We build our neural networks with Pytorch [40].
See
Appendix C for additional details.
Experiments 5.1 Quantum Optimization
For quantum optimization, we perform experiments for the 1D Ising model with the periodic boundary condition and the transverse field h = 0 .
8 to minimize the energy and find the ground state wave function.
We perform simulations of VQE using Qiskit [2], a python framework for quantum computation.
The experimental details are in Appendices A and B.
5.1.1 Noiseless Quantum Simulations
Noiseless quantum Natural gradient simulations.
In Figure 3a, when using the natural gradient, we compare our DMD methods and the baseline standard DMD method on a 5-qubit Ising model with the circular-entanglement RealAmplitudes ansatz and reps=1 (2 layers, 10 parameters).
Solid parts of the lines are from piecewise VQE, and the dashed lines connecting the solid parts indicate where the
DMD methods are used for acceleration.
The learning rate is 0 .
We perform n total = 100 full
VQE iterations and use n sim = 10 , n DMD = 40 for all DMD methods, and window size n SW =for SW-DMD and MLP-SW-DMD.
Since with the natural gradient, θ has the quantum wave function as a natural embedding with approximately linear dynamics, Koopman operator learning can be hypothesized to yield good prediction of dynamics.
All the DMD algorithms at 30 iterations are able to achieve an optimal loss close to the full VQE, which indicates successful acceleration of quantum optimization.
DMD and SW-DMD perform a little better than neural-network-based methods including MLP-DMD, MLP-SW-DMD, and CNN-DMD.
This could be related to over-fitting of the neural networks for simple parameters dynamics.
Noiseless Adam simulations.
Instead of the natural gradient, we show another case using the
Adam optimizer based on the vanilla gradient obtained from the parameter-shift rule.
We perform experiments on the 10-qubit Ising model with the circular-entanglement RealAmplitudes ansatz and reps=1 (2 layers, 20 parameters).
In Figure 3b, we use n total = 200 , n sim = 10 , n DMD = 90 .
For
SW-DMD and MLP-SW-DMD, the sliding window size is n SW = 6 .
The Adam learning rate is 0 .
All the DMD methods can significantly accelerate quantum optimization.
The extended DMD methods (SW-DMD, MLP-DMD, MLP-SW-DMD, CNN-DMD) have greater acceleration than the standard DMD, which demonstrates the improved efficiency from our time-delay and neural-network extensions.
5.1.2 Ablations
We show an ablation analysis for all DMD methods associated with n sim ∈ { 7 , 8 , 10 , 15 , 20 , 25 , 30 } , n
DMD = 90 , and n SW = 6 for SW-DMD and MLP-SW-DMD.
We define the relative expense spent
[Figure] [Figure]
[Figure] [Figure]
Experimental results the quantum Ising model at h = 0 .
on the quantum computer measured by the relative number of VQE iterations compared to the full
VQE.
We define the relative gradient steps as the number of gradient steps that DMD methods utilize compared to the full VQE gradient steps.
n DMD is chosen large enough so that it does not affect the minimum loss much.
The relative loss is defined as ( L min, VQE + DMD − L min, full VQE ) /
( L initial, full VQE − L min, full VQE ) .
A smaller relative loss means better performance.
At the same relative loss, smaller relative gradient steps imply more acceleration of quantum optimization ( e.g. , relative gradient steps at 10% indicate 10 times speedup).
Figure 3c shows the relative loss versus the relative gradient steps with the same results in Table A1 of Appendix D for better numerical resolution.
The performance of DMD methods should be compared to pure VQE (black line).
The relative loss of all the DMD methods are below the pure VQE at the same relative gradient steps, which means all the DMD methods can successfully accelerate quantum optimization.
SW-DMD and MLP-SW-DMD as timedelay embedding extensions to the standard DMD method, all yield very significant acceleration and have the best performances in general among all the DMD methods.
MLP-DMD, MLP-SW-DMD and CNN-DMD, as the neural-network extensions of the standard DMD, also outperform the standard
DMD.
5.1.3 Quantum Optimization on a Real Quantum Computer
We implement VQE for the 3-qubit Ising model at h = 0 .
8 on a real IBM quantum computer Lima using the SPSA optimizer (learning rate 0 .
04 and perturbation 0 .
and 10k quantum shots.
We have
[Figure] [Figure]
applied measurement error mitigation to reduce the effect of noise on the real hardware.
The ansatz is RealAmplitudes with 2 layers (6 parameters) with linear entanglement.
With the SPSA optimizer, every iteration of update contains 1 center measurement and 2 gradient measurements in only one random direction in the parameter space, so each iteration takes 3 measurements.
The smaller number of gradient measurements makes it easier to implement on near-term real quantum computers, compared to Adam.
On the other hand, using SPSA may also require a higher number of iterations.
DMD always only takes 1 center measurement without gradient measurements.
As shown in Figure 3d, on IBM Lima, we first perform a full pure VQE for 38 iterations.
To mitigate the effect of the random direction in gradient measurements, we use the first 12 VQE iterations for
Koopman training and apply SW-DMD with n SW = 8 to make prediction for 20 iterations.
Early in prediction, SW-DMD agrees with the full VQE result, and then further decreases the loss even though higher than the full VQE loss.
However, the expense of each prediction step is much less than a VQE gradient step.
It is a promising validation of our approach that SW-DMD can help reduce the quantum resource needed in quantum optimization on a real quantum computer.
Note that IBM
Lima can have a relatively big uncertainty over different experimental times, and the final difference between the full VQE and SW-DMD could be within the experimental uncertainty in quantum lab.
On FakeLima, a noise model that mimics the real hardware Lima, we use the same setup and present the simulated results in
Appendix F.
The decrease in energy of SW-DMD prediction is more efficient on FakeLima than real Lima, which may reflect the daily fluctuation of Lima as a physical apparatus compared to FakeLima.
5.2 Quantum Machine Learning
We use an interleaved block-encoding scheme [26, 46] for QML with its quantum neural network architecture shown in Figure 4a and apply Koopman operator learning.
We consider the task of binary classification on a filtered Fashion-MNIST dataset with samples labeled by “T-shirt” and “ankel boot” and implement it in Yao [33], a framework for quantum algorithms in Julia [4].
Each is downsampled to 16 × 16 pixels, and is then as an input x ∈ [0 , 1] 256 fed into interleaved encoding quantum gate.
The parameters θ are also encoded in the interleaved encoding quantum gate.
Then the quantum measurements are used as the output for computing the cross-entropy loss.
The details of the QML data and architecture are in
Appendix G.
The full QML training has n total = 100 iterations.
We choose n sim = 10 , n DMD = 20 , and n SW = 6 for SW-DMD and MLP-SW-DMD.
To reduce the number of parameters in the neural networks used in DMD including MLP-DMD, MLP-SW-DMD,
CNN-DMD, we adopt a layer-wise partition in θ with details in Appendix G. Figure 4b shows that
DMD methods can achieve good accuracy while saving quantum resources compared to full QML, since all the lines from DMD are significantly above the full QML.
This demonstrates significant acceleration of our DMD methods for QML.
Conclusion
Quantum optimization and quantum machine learning are promising for solving certain problems beyond the capability of classical computation.
However, in the NISQ era, gradient-based optimization on quantum computers is costly since it takes O ( n params ) gradient measurements for each iteration while the current quantum computing resources are limited.
Built on the insight from Koopman operator theory, we have developed data-driven sliding-window and neural-network based DMD for accelerating quantum optimization and quantum machine learning.
We have demonstrated the effectiveness of our approach on both simulations and real quantum computers, and recently extended it to various systems of larger system sizes [32].
Our work bridges the fields of machine learning and quantum optimization and opens up opportunities for further exploration of optimization problems through Koopman operator theory.
Acknowledgement
The authors acknowledge helpful discussions with Hao He, Charles Roques-Carmes, Eleanor Crane,
Nathan Wiebe, Zhuo Chen, Ryan Levy, Lucas Slattery, Bryan Clark, Weikang Li, Xiuzhe Luo, Patrick
Draper, Aida El-Khadra, Andrew Lytle, Yu Ding.
DL, RD and MS acknowledge support from the
NSF AI Institute for Artificial Intelligence and Fundamental Interactions (IAIFI).
DL is supported in part by the Co-Design Center for Quantum Advantage (C2QA).
JS acknowledges support from the
U.S. Department of Energy, Office of Science, Office of High Energy Physics QuantISED program under an award for the Fermilab Theory Consortium “Intersections of QIS and Theoretical Particle
Physics”.
We acknowledge the use of IBM Quantum services for this work.
The views expressed are those of the authors, and do not reflect the official policy or position of IBM or the IBM Quantum team.
In this paper we used ibmq_lima , which is one of the IBM Quantum Falcon Processors.
A Setup of VQE+DMD runs
In quantum optimization of the 1D Ising model, we run VQE for n sim iterations starting from a random initial point in the parameter space.
Then, we apply DMD methods to the history of parameters from VQE, predict the future trajectory for n DMD iterations, and evaluate the loss on the predicted trajectory.
From the n DMD evaluations, we find the minimum loss and the corresponding point in the parameter space, and use this optimal point as the starting point of the next n sim iterations of VQE.
We then repeat the alternating runs of VQE and DMD.
n sim and n DMD are hyperparameters in our algorithm.
In SW-DMD, there is an additional hyperparameter, the sliding window size n SW , with the constraint n SW < n sim .
Note that DMD is a special case of SW-DMD with n SW = 1 .
We benchmark the standard DMD, and our extended SW, MLP, MLP-SW and CNN DMDs with n sim = 10 .
We choose the sliding window size n SW = 6 for SW-DMD and MLP-SW-DMD.
In parallel, we also perform a pure VQE run for n total iterations, starting from the same initial point as the alternating VQE+DMD runs.
B Quantum Ising Model with Transverse Field
The 1D quantum Ising model with the periodic boundary condition and transverse field h is the
Hamiltonian
[Equation]
(10) where
[Equation]
(11) are Pauli matrices, and the subscripts on them denote which qubit they act on.
The periodic boundary condition defines the qubits at i =
and i = N + 1 to be identical.
C Further details on neural DMD
Optimization hyperparameter The neural network is trained from scratch by using Adam for 30k steps with 9k steps of linear warmup from 0 to 0.001 and then cosine decay back to 0 at step 30k.
Activation Besides ELU, we also explored cosine, ReLU and tanh activations.
We found ELU to be the best which could be because: tanh suffers from vanishing gradients, ReLU biases to positive numbers (while input phases quantum circuit parameters θ are unconstrained) and cosine is periodic.
The importance of learning rate scheduler.
We train the neural network Φ α from scratch every time we obtain parameters optimization history as training data.
A stable learning with well converging neural network at every single Koopman operator fitting stage is important.
It is found vital to use a cosine-decay scheduler with a linear warmup, which is typically useful in the computer vision literature [31].
We linearly scale the learning rate from 0 to 0.001 for the first 9k steps of the neural network optimization, and then use a cosine-decay from 0.001 to 0 until the final step at 30k.
The importance of residual connections.
In our work we use a residual connection so that DMD becomes as a special case of the neural DMD parameterization.
The residual connection is indeed very useful, as it is driven by the Koopman operator learning formulation and makes it possible for the encoder to learn the identity.
For identity encoder, MLP(-SW)-DMD or CNN-DMD become vanilla (SW-)DMD.
D Numerical Results on Ablations
The numerical values of relative loss versus relative gradient steps for the 10-qubit quantum Ising model Adam noiseless simulations in Figure 3c are given in Table A1.
All the DMD methods can accelerate the quantum optimization.
[Table]
E RealAmplitudes Ansatz
The RealAmplitudes ansatz from Qiskit always produces a real-valued wave function ψ θ with no imaginary part.
The minimum loss of the Ising-model can always be achieved by a real-valued ψ θ , so this ansatz can help to reduce the redundancy in the functional form of ψ θ and therefore, is beneficial for our use.
With the RealAmplitudes ansatz, ψ θ as a function of θ is a nonlinear function consisting of alternating layers of the rotational gates for the Pauli matrix
[Equation]
(12) with rotation angles being the parameters θ , and controlled- X gates with no parameter.
Each layer of the rotational gates for Y has N (the number of qubits) parameters, so N times the number of rotational layers gives the total number of parameters.
F Comparison between Real Lima and FakeLima
[Figure]
We perform simulation using FakeLima provided in Qiskit, a noise model that mimics the real hardware Lima, on the same 3-qubit Ising model at h = 0 .
8 as we do on the real Lima.
The setup we use on FakeLima is the same as the real Lima with n total = 38 , n sim = 12 , n SW = 8 with
SW-DMD.
The FakeLima results shown in Figure A1 are qualitatively consistent with Figure 3d with less fluctuation in the loss evaluation and a cleaner decrease in energy.
G QML Data and Architecture Details
In our QML example, the quantum computer has N = 10 qubits.
The interleaved encoding gate consists of 9 layers.
Each layer has a rotational layer and a linear entanglement layer.
On the linear entanglement layer, each qubit has three rotational gates for X , Z , X in a sequence.
Therefore, each layer has 30 rotational angles, and the whole QML architecture has 270 rotational angles.
Since each input example x is 256-dimensional, we only use the first 256 rotational angles to encode the input data.
The parameters θ are also encoded in the rotational angles such that the angles are x + θ .
All the examples share the same θ .
In each quantum measurement, each qubit is in the 0-state or the 1-state, and the probability for the qubit to be in the 0-state is between 0 and 1.
We regard this probability as the probablity for the image to be a “T-shirt”.
We only use the probability on the 5th qubit ( i = 5 ) as the output and compute the cross-entropy loss with the labels.
We use 500 training examples and 500 test examples.
During training, we use the stochastic gradient descent optimizer with the batch size
50 and learning rate 0 .
In neural DMD including MLP-DMD, MLP-SW-DMD, CNN-DMD, we group θ by layers in the encoding gate.
There are 9 groups with group size 30.
We perform neural DMD for each group, so that the number of parameters in the neural networks for DMD is not too large.
After predicting each group separately, we combine all groups of θ to evaluate the loss and accuracy.