Q UANTUM F OURIER N ETWORKS FOR SOLVING P ARAMETRIC PDE S
Anonymous authors
Paper under double-blind review
A BSTRACT
Many real-world problems like modelling environment dynamics, physical processes, time series etc., involve solving Partial Differential Equations (PDEs) parameterized by problem-speciﬁc conditions.
Recently, a deep learning architecture called Fourier Neural Operator (FNO) proved to be capable of learning solutions of given PDE families, for any initial conditions as input.
Given the advancements in quantum hardware and the recent results in quantum machine learning methods, we propose three quantum circuits, inspired by the FNO, to learn this functional mapping for PDEs.
The proposed algorithms are distinguished based on the trade-off between depth and their similarity to the classical FNO.
At their core, we make use of unary encoding paradigm and orthogonal quantum layers, and introduce a new quantum Fourier transform in the unary basis.
With respect to the number of samples, our quantum algorithm is proven to be substantially faster than the classical counterpart.
We benchmark our proposed algorithms on three
PDE families, namely Burger’s equation, Darcy’s ﬂow equation and the NavierStokes equation, and the results show that our quantum methods are comparable in performance to the classical FNO.
We also show an analysis of the image classiﬁcation tasks where our proposed algorithms are able to match the accuracy of the CNNs, thereby showing their applicability to other domains.
I NTRODUCTION
Solving Partial Differential Equations (PDEs) has been a very crucial step in understanding the dynamics of nature.
They have been widely used to understand natural phenomenon such as heattransfer, modelling the ﬂow of ﬂuids, electromagnetism, etc. and lately have also found their applications in understanding the behavior of dynamical markets.
In most of these applications, a closed form solution is difﬁcult to ﬁnd for the resulting PDEs and thus, classical solvers require a lot of evaluations to model the solution for a given PDE.
To approximate such not-so-easily solvable
PDE’s, there has been an extensive research based on neural networks .
A group of these methods
Yu et al.
; Raissi et al.
; Bar & Sochen (2019) aimed at learning the solution function for an instance of PDE and thus requires to be re-trained every time the parameters/conditions in the PDE change.
The other set of methods Zhu & Zabaras (2018); Adler & ¨Oktem (2017); Bhatnagar et al.
(2019) targeted at learning over a family of PDEs but for a speciﬁc resolution dependent, making these methods limited to the discretization or the sampling density used in the training data.
A recent work Li et al.
(2020) addressed both these issues and posed the problem as learning a function-to-function mapping for parametric PDEs.
Experiments on widely popular PDEs showed that it was effective in learning the mapping from a parametric initial condition function to the solution operator for a family of PDEs.
The method proposes a Fourier layer, which uses a learnable linear transform sandwiched between a Fourier Transform ( FT ) and an Inverse Fourier Transform ( IFT ) operation.
This is similar to the convolution operation as it also translates to multiplication in the Fourier space.
The major bottleneck which might hinder the scalability of this classical Fourier Neural Operator (FNO) is its time complexity, limited by the classical Fourier Transform (FT) and Inverse Fourier
Transform (IFT) operations inside the Fourier Layer.
As shown previously by Musk (2020), these operations are much faster when deployed on quantum hardware.
Similar advantages have led to signiﬁcant developments in learning approaches based on near term quantum computing.
The initial demonstrations of these algorithms involved experiments on a small-scale hardware Farhi & Neven
; Coyle et al.
Cappelletti et al.
; Grant et al.
(2018) which established their effectiveness in extracting patterns.
Following this, many works Abbas et al.
; Mari et al.
Beer et al.
(2020); Allcock et al.
(2020) proposed small-scale implementations of fully connected quantum neural networks on near term hardware.
Other proposals Kerenidis et al.
Cong et al.
(2019) for deploying convolution-based learning methods on quantum devices showed effective training in practice.
Furthermore, Chakrabarti et al.
(2019) proposed quantum-hardware implementation for generative adversarial networks.
A different approach, where the inputs are encoded as unary states, using the two-qubits quantum gate RBS ( Reconﬁgurable Beam Splitter ) was proposed in a recent work Johri et al.
This encoding gave rise to the use of orthogonal properties of pure quantum unitaries, as proposed in Kerenidis et al.
(2021) for training, for instance, orthogonal feed-forward networks to damp the gradient based issues while learning.
It used a pyramid circuit based on parameterized RBS gates to implement a learnable orthogonal matrix as compared to the existing classical approaches which offer approximate orthogonality at the cost of increased training time.
This orthogonality in neural networks results in much smoother convergence and also lesser parameters as shown by Li et al.
(2019) for feed-forward neural networks and
Wang et al.
(2020) for convolutional nets.
The effectiveness of these orthogonal quantum networks was further shown in another work on medical image classiﬁcation Mathur et al.
(2021) problem.
We also use a similar idea to do the multi-channel intermediate linear transform using orthogonal matrix but using parameterized butterﬂy circuits instead of pyramid circuits.
Exploiting these advantages offered by quantum computing, in this work, we propose a new kind of Quantum Fourier Transform (QFT), which operates on the unary states and a learnable Quantum
Linear Transform.
We further propose three quantum algorithms inspired by this classical Fourier operation which are faster than the classical operation and require fewer parameters for the same architecture, thereby boosting their scalability.
Given the input of dimension N s × N c , where N s corresponds to number of samples per PDE and N c correspond to feature dimension, the order of time complexity corresponding to Fourier Layer (FL) and proposed algorithms is shown in table 1.
[Table]
The ﬁrst algorithm replicates the classical operation on a quantum circuit.
The other two algorithms are modiﬁcations of the ﬁrst circuit designed for the noisy learning process offered by the near term quantum hardware.
We test all the three proposed algorithms on all the three PDEs evaluated in the classical FNO paper Li et al.
(2020) namely the Burgers equation, Darcy’s Flow equation and
Navier Stokes equation on the synthetic datasets used in that paper.
We also test our algorithms against the Convolutional neural networks (CNNs) on benchmark datasets for image classiﬁcation namely MNIST, Fashion-MNIST Xiao et al.
Pneumonia-MNIST Yang et al.
In all the experiments, three algorithms perform similarly and comparable to state-of-the-art FNO for PDEs. Also, they perform decently on the image classiﬁcation tasks.
C LASSICAL F OURIER N EURAL O PERATOR
Given a training set comprising the family of a Partial Differential Equation, the classical FNO Li et al.
(2020) aims to learn a functional mapping from a parameterized initial condition to the solution function for this family.
This means given an initial condition function characterizing a PDE instance, sampled at different points, it should predict the solution function values at those points at the inference time.
To formulate it, given two functional spaces A
and U along with a set of observations { a j , u j } ( a j ∼ µ is an i.i.d.
sequence sampled from some function f ∈ A ), it learns a parametric mapping G : A × Θ → U .
To achieve this, it proposed a learning network based on iteratively applying a new kind of layer which it termed as the Fourier Layer.
The layer consists of two parts, the top part involves ﬁrstly projecting the input to the Fourier domain and then applying
[Figure]
a linear transform (refer ﬁg. 1) to ﬁrst K modes and crop the rest and then reproject back to the original domain.
This is somewhat similar to convolution but the updates would be taking place in the Fourier space.
The lower part is just a simple convolution and doesn’t play any signiﬁcant role in improving performance.
In this paper, we propose purely quantum algorithms for this top part as a Quantum Fourier Layer and term the network as Quantum Fourier Neural Operator (QFNO).
Now, we look at the mathematical details of the classical Fourier layer for a 1D PDE case (eg.
Burger’s equation), showing the inputs and outputs of each transformation involved.
Given a classical input x ∈ R N c × N s , where N c corresponds to the number of channels/features in the input and N s corresponds to number of samples/observations per function corresponding to a PDE, we denote the corresponding output of this classical operation by y ∈ R N c × N s .
As the quantum matrices are orthogonal and the l 2 -norm of any quantum state vector is 1, we ﬁrst normalize the input x (normalization doesn’t have any signiﬁcant impact on the optimization process) as follows:
[Equation]
Now, following the classical operation, applying the Fourier Transform (FT) along the second dimension to this input ( N s ), FT ( a i ) = a fi where a i = ( a ij ) j ∈ [1 ,N s ] and a fi denote the corresponding fourier-transformed coefﬁcients.
Denoting the maximum number of modes with K , intermediate linear transform is a matrix W ∈ R N c
× N c × K and W k ∈ R N c
× N c denotes this matrix W indexed along the last dimension (corresponding to k th mode).
Here, we assume this matrix W k is orthogonal and thus, can be implemented by a quantum layer.
This transformation is now applied to the ﬁrst K modes along the N s dimension resulting in the following output:
[Equation]
where the vector a fj = ( a fij ) i ∈ [1 ,N c ] .
In the classical paper, they discard the rest of modes (make the vectors zero) and we leave them unchanged here.
We veriﬁed that this doesn’t impacts the optimization signiﬁcantly.
For these transformed K vectors a fj ∈ R N c , we deﬁne b fj =
W j a fj or more explicitly b fij =
(cid:80) N c t ( W jit a ftj ) .
Given W j , a j and b j , we can now write the input after Fourier
Transform and the intermediate linear transform as:
[Equation]
Finally, applying Inverse Fourier Transform ( IFT ) operation on this transformed input, along the
N s dimension, results in the following output as the output of the complete operation:
[Equation]
where y i = ( y ij ) j ∈ [1 ,N s ] .
The Time Complexity of this complete Fourier Layer ( FT +linear transform+ IFT ) is O
( N c + N s log ( N s )) .
Q UANTUM F OURIER N ETWORKS
In this section we propose three quantum circuits to replace the Fourier layer of the FNO, namely the
Sequential (Section 3.2.1), Parallel (Section 3.2.2), and the Compound (Section 3.2.3).
We compare their computational complexities (see Table 1) and their efﬁciency in practice in the following sections.
Before this, we also deﬁne a learnable orthogonal linear transform, using a quantum circuit, called parameterized butterﬂy .
Using this as the building block, we propose the Quantum Circuit to carry out the intermediate linear transform proposed in the classical FNO (Section 2).
3. Q UANTUM B UTTERFLY C IRCUITS
An efﬁcient implementation of FFT, proposed by Cooley & Tukey (1965), involves connections in shape of radix-2 butterﬂies resulting in a logarithmic depth complexity.
Taking inspiration from this, we propose such butterﬂy shaped Quantum Circuits to carry out: a) A learnable linear transform and b) A Quantum Fourier Transform (QFT), both operating only on the unary states.
Here each radix2 operation is implemented using RBS-gates Foxen et al.
Refer supplementary for details regarding the unitary corresponding to this gate.
Parameterized Quantum Butterﬂy .
Due to the logarithmic depth offered by the butterﬂy circuits for FT, which is important given the noisy near-term quantum hardware, we propose such a butterﬂy shaped Quantum Circuit to carry out a learnable linear transform.
Here, each radix-2 butterﬂy shaped connection is replaced by parameterized RBS gates similar to a concurrent work Cherrat et al.
This results in a orthogonal linear transform only on the unary quantum states similar to the pyramidal circuit proposed by Kerenidis et al.
We further propose a controlled version of these linear quantum layers to perform the operation similar to the intermediate linear transform operation in the fourier layers.
Unary Quantum Fourier Transform .
Here, we propose a butterﬂy-shaped Quantum Circuit to carry out the QFT on unary states.
It involves replacing each radix-2 operation in the Butterﬂy FT by a single qubit gate and an RBS-gate with − π/ 4 as the angle.
Refer supplementary for more details and circuit diagrams for the Parameterized Butterﬂy layer and Unary QFT.
3. Q UANTUM C IRCUITS FOR F OURIER L AYER
To perform the classical FNO operation using a quantum circuit, the ﬁnal output state of the circuit should correspond to the quantum-state encoding of the output resulting from this classical operation.
Therefore, we load this classical output into a quantum state and for this we use the unary dataloading similar to the one used in Johri et al.
(2021) due to its logarithmic depth.
It loads an
N -dimensional classical vector into normalized N quantum states corresponding to the unary representation of numbers from 1 to N .
The circuit consists of only the Reconﬁgurable Beam Splitter (RBS) gates.
Using controlled version of this circuit, a matrix loader can be deﬁned which we discuss in the supplementary and it loads the normalized vectors comprising the matrix into quantum states.
Thus, for the classical output y =
( y 1 , · · · , y N c ) , the encoded quantum state | y (cid:105) is:
[Equation]
(5) where | e i (cid:105) denotes the state in unary notation with 1 being at the i th position.
Note there is no normalization factor, as the inputs ( a 1 , · · · , a N c ) were assumed normalized in the previous subsection.
Now, we discuss the three proposed circuit namely sequential, parallelized and the compound circuit.
The sequential circuit replicates the classical operation discussed above and the other two are modiﬁcations to it to make the quantum algorithm more efﬁciently deployable on hardware.
3.2. S EQUENTIAL Q UANTUM C IRCUIT FOR F OURIER L AYER
Figure 1 shows the diagram for this circuit.
Lower register of N s qubits correspond to the second dimension and upper register of N c qubits correspond to the N c dimension used in the above mathematical description of the classical operation.
We begin by discussing the quantum dataloading followed by quantum transforms corresponding to the classical ones formulated above.
Dataloading .
Similar to the quantum-state encoding of the classical output deﬁned above, here also we use the unary matrix loader to load the given input into a quantum state.
As shown in Figure 1, the circuit initially contains N c controlled unary dataloaders, each encoding a row of N s inputs into the quantum state on the lower register.
The loaded state, after controlled operation X N c in the circuit, can be written as:
[Equation]
where the coefﬁcients a ij correspond to normalized matrix elements.
Denoting the given classical input as x ∈ R N c
×
N
s we have (refer supplementary for details):
[Equation]
Now, to apply the QFT operation on lower register, the state can be re-arranged as follows:
[Equation]
Quantum Fourier Transform ( QFT ) .
Given a normalized real vector x = ( x i ) i =1 ,..
M , and its
Fourier Transform x f = ( x f i ) i =1 ,..
M , the QFT operation in unary basis and its inverse, the IQFT operation, can be deﬁned as follows:
[Equation]
Applying this QFT operation to the lower register, on the state in eq.
8, we have:
[Equation]
Quantum Linear Transform .
To realize the intermediate transform used in the classical operation, we implement an orthogonal matrix W k , corresponding to the one in the classical operation, and realize it using a parameterized butterﬂy circuit.
Furthermore, we propose a “ k -butterﬂy” which is a parameterized butterﬂy circuit ( P k ) on the top register controlled by the k th qubit of the lower register.
As shown in Figure 1, it involves using an ancilla qubit (top-most) initialized to state | 1 (cid:105) .
When this qubit is in state | 1 (cid:105)
, then combining it with upper register results in a hamming weight 2 basis | h 2 (cid:105) .
Any transformation on this using the RBS gates would result in an another state of the hamming weight 2 basis.
We can ignore all these hamming weight 2 states using a post select operation.
To apply the k -butterﬂy, we ﬂip this qubit back to 0 if the k th qubit of the lower register is | 1 (cid:105) , using a CNOT gate.
Thus, all the states of upper qubits are in | h 2 (cid:105) basis, except for the ones corresponding to k th unary state of the lower register:
[Equation] [Equation]
Now, applying K such k-butterﬂy circuits, we perform the operation P j on both the unary and the | h 2 (cid:105) states.
We consider the unary states in our analysis since we discard the states in other basis:
[Equation]
[Equation]
Considering only the top register, the k-butterﬂy operation P j corresponds to the sub-matrix W j ∈
R N c × N c .
The overall matrix ( a fij ) can be decomposed into N s vectors a fj = ( a fij ) i ∈
[1 ,N c ] .
Then, for the ﬁrst K vectors a fj ∈ R N c we will have b fj =
W j a fj , where b fj will be the same as in the classical case.
Finally, the output state of this circuit after IQFT on the lower register becomes:
[Equation]
Since IQFT ( (cid:80) i x fi | e i (cid:105) ) =
(cid:80) i x
i | e i (cid:105) , where IFT ( x f ) = x , this implies that j th component of IFT would be same as the coefﬁcient of j th state in IQFT .
From this we can conclude that the state in eq.
5 is equivalent to the state in eq.
13 and thus, this circuit replicates the classical operation.
The depth complexity of this circuit is O
( ( K + 1) log ( N c )
+ ( N c + 2) log ( N s ) ).
[Figure]
3.2. P ARALLELIZED Q UANTUM C IRCUIT FOR F OURIER L AYER
Given the multiplicative noise model for the NISQ devices, the depth of the learnable part, which is proportional to K for the sequential circuit, might be a hindrance to learning and it also increases the computation time.
A useful modiﬁcation then can be parallelizing the learnable butterﬂy circuits.
Figure 2 shows this modiﬁed version of the sequential circuit, which consists of K quantum circuits operating parallely and each implementing only one learnable circuit controlled by one of the top
K qubits in the lower register.
As all the circuits upto the learnable part are similar to the sequential circuit, we can directly write the state after the QFT, using eq.
10, as:
[Equation] [Equation]
where the index k denotes the k th parallel circuit.
Also, in the k th parallel circuit, the learnable butterﬂy part is controlled by the k th qubit of the lower register.
We recall that the pyramid applied on the top register is effectively mapping the vector a fj to b fj (see Eq.13) and thus we can write the updated state of the circuits as:
[Equation]
Now, applying IQFT on the lower register in each of the circuits independently:
[Equation]
In supplementary, we derive that this joint output of these circuits cannot lead to the output of the classical operation even after measurement and classical post-processing.
We also show that how measuring without applying the IQFT operation and instead applying the classical IFT , after some post-processing, can lead to the same output as the classical operation.
The depth of this parallel version of sequential circuit is (2) log ( N c )
+ ( N c + 2) log ( N s ) and a total of K quantum circuits are required to execute this parallely.
3.2. C OMPOUND Q UANTUM C IRCUIT FOR F OURIER L AYER
As highlighted in previous subsection, depth of the parameterized part of the sequential circuit might make the learning process difﬁcult on currently available noisy quantum hardware.
To deal with this, we propose another variant of the sequential circuit, where, instead of having the parameterized circuit controlled by top K qubits of lower register, we span a a single bigger pyramid over the upper register ( N s ) and top K qubits in the lower register.
Note the upper and lower registers are unary independently.
Therefore, if we jointly consider the upper register and top K from the lower register, then there would be states with hamming weight two as well, corresponding to the scenario whenis in one of the top K qubits of the lower register.
Thus, instead of a unary basis (which corresponds to having hamming weight only one), we have hamming weight one and hamming weight two basis.
Lets imagine a butterﬂy circuit on N c + K qubits.
The complete unitary will be a 2 N c + K × 2 N c + K block diagonal matrix with each block corresponding to a subspace with ﬁxed hamming weight
Kerenidis & Prakash (2022), B = B 1 ⊗ B 2 ⊗ ...
⊗ B n , where B i correspond to the block diagonal unitary for subspace with hamming weight i .
Since our input has hamming weight 1 or 2 , we only care about unitaries B 1 and B 2 .
B 1 will be of size ( N c + K ) ×
( N c + K ) and B 2 of (cid:0) N c
+ K 2 (cid:1) × (cid:0) N c
+ K 2 (cid:1) .
Given these unitaries, we take the input state and split it into ( N c + K ) hamming weight 1 states and (cid:0) N c + K 2 (cid:1) hamming weight 2 states.
Then we apply the B 1 and B 2 to these states.
Also, B 1 is a butterﬂy matrix and B 2 is the corresponding compound order two matrix Horn & Johnson (2012).
Figure 2 shows the diagram for this circuit.
Given the circuit is similar to the sequential circuit till the QFT operation, the state of this circuit would be same as the one in eq.
We now separate this complete state into two sets of states corresponding to hamming weight 1 and 2 :
[Equation]
where the ﬁrst term corresponds to hamming weight 2 states | h 2 (cid:105) and similarly the second term corresponds to hamming weight 1 states |
h 1 (cid:105) .
Lets ﬁrst focus on the term corresponding to | h 1 (cid:105) .
It does not contain the states where the qubits in upper register are all 0 and the 1 lies in the top K qubits of the lower register.
It implies that the coefﬁcients of all these states should be taken as zero.
Therefore, the state corresponding to this | h 1 (cid:105) can also be written as:
[Equation]
where | e 0 (cid:105) denotes the state corresponding to no ones in the upper N c register and | e ij (cid:105) denotes the hamming weight 2 state for the lower register, where i and j denote the positions of 1 .
Similarly, if we consider the ﬁrst term in eq.
17 corresponding to | h 2 (cid:105) , we further have to include states where both ones are in upper register or both ones in top K of the lower register.
These new states again would have zero coefﬁcients.
As a result, we can write the term corresponding to | h 2 (cid:105) in eq.
17 as:
[Equation]
This results in a total of (cid:0) N c + K 2 (cid:1) states.
Now, we apply the butterﬂy circuit, corresponding to unitary
B 1 , to the | h 1 (cid:105) state in eq.
For notational consistency we denote this operation as a multiplication with matrix W 1 ∈ R ( N c + K ) ×
( N c + K ) .
It results in the transformed coefﬁcients b ij :
[Equation]
Furthermore, we also apply a post select operation to preserve the basis, selecting only the states with non-zero coefﬁcient before applying the B 1 .
Now, for the hamming weight 2 state, the second order compound unitary B 2 , denoted by the matrix W 2 ∈ R q × q where q = (cid:0) N c + K 2 (cid:1) , has each of its elements corresponding to the determinant of a 2 × 2 submatrix of W 1 :
[Equation]
21) for some a, b, k < N c + K .
After applying this unitary B 2 on | h 2 (cid:105) states, their coefﬁcients c ij are:
[Equation]
Similar to the case of hamming weight 1, here also we use a post select operation to discard the states which initially had coefﬁcients zero thereby preserving the basis.
Combining the transformed | h 1 (cid:105) , | h 2 (cid:105) states and applying IQFT on the lower register, the ﬁnal output state of this circuit is:
[Equation]
 (23) and the order of the depth complexity is log ( N c + K ) + log ( N c )
+ ( N c + 2) log ( N s ) .
E XPERIMENTS
In this section, we analyze our proposed Quantum algorithms for solving PDEs and Image classiﬁcation tasks.
We compare them against the state-of-the-arts in both the domains, i.e. , classical
Fourier Networks (PDEs) and CNNs (image classiﬁcation), for both the tasks.
All the details related to architecture/hyperparamaters are provided at the end of the paper.
All the experiments shown in this section are simulated, i.e., the quantum operations have been simulated using classical matrices corresponding to quantum unitaries.
The currently available quantum hardware is limited to 8qubits and is also too noisy for deeper circuits.
Deploying these algorithms on a quantum hardware will involve noise which can be either due to noisy quantum gates, measurement, environment, etc.
4. P ARTIAL D IFFERENTIAL E QUATIONS
We show results on all the three PDEs used in the classical Fourier Layer paper Li et al.
Burger’s equation, Darcy’s Flow equation and Navier-Stokes equation, using the datasets proposed in that paper.
All of these equations were designed for modelling the ﬂow of ﬂuids and have found their applications in other domains as well.
We abstractly describe the three tasks.
For equations and other details please refer Li et al.
We analyze the performance of the trained networks across different resolutions ( N s ) for the ﬁrst two and for different viscosity values for the third.
Burger’s Equation .
It is a 1D-Partial Differential Equation for modeling ﬂuid motion.
The initial condition of the ﬂuid is represented by a function.
We need to learn the mapping from this function to the solution function at time one, for a given viscosity.
Figure 3 (left) shows the comparison of relative error in estimating this mapping among the classical Fourier Layer, classical CNNs and proposed quantum circuits for the Fourier Layers, across different resolutions.
The quantum circuits perform comparably to the classical Fourier Layer and much better than classical CNNs.
Darcy’s Flow Equation .
For this case, it is a 2D PDE where the aim is to learn the mapping from the diffusion coefﬁcient function to the solution function in presence of a forcing function.
All of them are functions of positional coordinates only.
Figure 3 shows the relative error for the 2D-version of all the methods in solving this PDE, across different resolutions.
Here also the three quantum circuits and the classical fourier layer show similar performance, consistent across resolutions, and the CNNs much worse results, having error
Navier Stokes Equation .
Similar to Li et al.
, we consider the 2D-navier Stokes Equation where the aim is to model the ﬂuid vorticity upto instant T ( > 10) given the vorticity upto time 10 .
Figure 3 (right) shows the performance comparison for this equation between our proposed circuits and classical methods.
It shows the convergence comparison for this family with viscosity ν ﬁxed to 1 e − 3 for all the methods.
Here again, it can be observed that all the proposed circuits and the classical Fourier method perform signiﬁcantly better than CNNs.
Also, from Table 2, sequential circuit performs similarly to the classical method and the others converge at a slightly higher error.
[Table]
4. I MAGE C LASSIFICATION
We further compare our proposed Quantum algorithms on the downstream image classiﬁcation tasks, as a side experiment, on benchmark datasets including the MNIST , FashionMNIST Xiao et al.
(2017) and PneumoniaMNIST Yang et al.
(2021) datasets.
Figure 4 shows the results for this evaluation.
It can be observed that our proposed algorithms perform decently in the imageclassiﬁcation task as well.
C ONCLUSION
We proposed a quantum algorithm to carry out the recently proposed classical Fourier Neural Operator on the quantum hardware.
We further proposed two more quantum algorithms, which perform a different operation than the classical algorithm and can be much more efﬁciently deployed on a quantum hardware.
The aim is to make the learning process more efﬁcient when using the noisy quantum hardware.
Experimental results further verify that proposed quantum circuits perform efﬁciently when solving PDEs.
The sequential circuit is quite similar to the best performing classical algorithm for PDEs and performs decently on image classiﬁcation as well.
An interesting future direction can be further modifying the learning process of the compound circuit so that it outperforms the sequential circuit at the same time being more efﬁcient to deploy.
R EPRODUCIBILITY S TATEMENT
We have used the JAX framework to develop the methods discussed in the paper.
All the experiments shown in the paper are simulated by deﬁning the matrices using the unitaries corresponding to the quantum gates used in the paper.
The architectural and hyperparameter details for both classical and quantum Fourier Layers are same as the ones used in Li et al.
All the experiments involve a 4-layered architecture corresponding to both classical Fourier baseline and quantum Fourier circuits.
The architecture for CNNs used in the Burger and Darcy Flow PDE experiement is a Fully
Convolution Networks based architecture proposed in Zhu & Zabaras (2018).
For the Navier stokes, we use the ResNet architecture for CNNs, comprising 18 Residual Blocks as used in Li et al.
For the CNNs in the image classiﬁcation tasks, we use a four layered architecture with 64 channels and also use a max-pooling layer after the second and fourth layer.
For both the tasks, each classical or quantum layer is immediately followed by a ReLU activation and Batch Normalization operation.
For the classiﬁcation tasks, ﬁnally the output of each of the architectures is fed to a linear layer with projection heads equal to number of classes for that task.
For the classical FNOs and proposed quantum FNOs except the compound quantum FNO, K is ﬁxed to 16 for 1D PDE and image classiﬁcation and 12 for 2D PDEs, and N c = 64 for the 1D PDE and 32 for the 2D PDEs.
For image classiﬁcation, N c is set to 16 .
For the compound quantum FNO, due to less parameteric requirements K is set to 16 and N c to 48 for all the tasks.
The input for the PDEs having N c initially 1 is ﬁrst projected to the the required N c using a linear layer for all the classical and quantum fourier methods similar to Li et al.
The ﬁnal output of all the layers of N c features is back projected to N c = 1 using another linear layer.
For all the PDEs, unless speciﬁed, 1000 train instances andtest instances are used and training is carried out for
Appendix A Q UANTUM B UTTERFLY C IRCUITS
As discussed in the paper, replacing each radix-2 butterﬂy shaped operation in the butterﬂy diagram for Fast Fourier Transform (FFT) by a parameterized 2-qubit gate, Reconﬁgurable Beam Splitter ( RBS ) gate, results in a parameterized butterﬂy circuit (See Figure 5).
The gate is parameterized by a single parameter θ and the corresponding unitary is:
[Equation]
It can be observed that it applies transformations on the | 01 (cid:105) and | 10 (cid:105) basis and is an identity operation on the remaining.
These both comprise the unary basis or hamming weight 1 basis for two qubits.
It can then be understood that it applies transformation between the states with same hamming weight basis and thus, preserves the hamming weight.
Therefore, if we load our input to a basis with a certain hamming weight, then after any transformation made of these RBS gates, the basis states corresponding to non-zero coefﬁcients in the output will have that same hamming weight.
Corresponding to N qubits would be only N unary states and thus, if an N -dimensional input is encoded into N -unary states using the unary loading similar to Johri et al.
(2021), then the transformation resulting from this butterﬂy circuit can be seen as a multiplication of the coefﬁcients of these N unary states with an orthogonal matrix W ∈ R N × N .
A recent work by Kerenidis et al.
(2021) further explains this orthogonal matrix multiplication for a pyramid-shaped circuit.
Unary QFT .
As shown in Figure 5 (Right), replacing the RBS gate in parameterized butterﬂy circuit with a ﬁxed single qubit gate and a ﬁxed angle RBS gate results in a circuit which can perform
QFT in the unary basis.
The depth complexity of this circuit is still O(log ( M )) where M is the number of qubits and also the total number of unary states.
The single qubit gate is just a Phase gate which rotates about the Z -axis with angle set to − 2 πkN and matrix corresponding to this gate is:
[Equation]
where N and k corresponding to each ω are same as in the corresponding radixoperation in the classical butterﬂy Fourier Transform ( ω kN ).
B D ATA L OADERS
Since our input is a N c × N s matrix, to load it into a quantum state, the matrix can be interpreted as
N c vectors each of size N s .
The resultant should be a superposition of these vectors.
In the paper we discussed a recent work Johri et al.
(2021) which used dataloaders to load N dimensional input to N unary quantum states.
One of the proposed dataloaders is shown in Figure 6 for 8 qubits.
It involves ﬁrstly ﬂipping the ﬁrst qubit to state | 1 (cid:105) .
Then it involves applying (N-1)
RBS gates with precomputed angles ( α i ) for loading this vector.
It can be observed that it is a log -depth circuit.
For a classical input vector a = ( a 1 ,..., a N ), it results in the following quantum state:
[Equation]
where | e i (cid:105) denotes the unary basis states for N qubits.
There will be total N such state and coefﬁcient of each of these states would correspond to the normalized classical vector element.
To load the input matrix b ∈ R N c ×
N s we can superpose its row vectors
b i , where each of these vectors would be ﬁrst loaded using some controlled vector-loader.
To do so, we ﬁrst load the norms corresponding to each of these rows
|| b i || using the norm-loader shown in the circuit diagrams in the paper.
It results in the following state on the upper register:
[Equation] [Equation]
Now, for each of the unary states | e i (cid:105) in the upper register, we load the corresponding row vectors ( b ij ) j ∈ [1 ,N s ] in the lower register using a controlled version of the unary vector loader (controlled operations labelled ||
X
i || in the circuit diagrams) which involves applying the unary vector loader and its adjoint along with CNOT gates.
For more details on this loader, refer Cherrat et al.
The ﬁnal loaded state after N c of these controlled unary vector loaders is:
[Equation]
C P ARALLEL Q UANTUM C IRCUIT
Given the ﬁnal state, after the IQFT, for the parallelized circuit in Eq.16 in the paper:
[Equation]
[Equation]
We denote coefﬁcients of this state corresponding to k th circuit by ( c ij ) k and thus re-writing it as:
[Equation]
where ( c ij ) k are explicitly given by using the equation for the fourier transform as follows:
[Equation]
Similarly writing c ij for the sequential circuit discussed in the paper (using eq. 13):
[Equation]
Comparing the above two equations leads to the observation that coefﬁcients in Eq.
31 wouldn’t be a subset of coefﬁcients in Eq.
and there is no closed form classical processing/transformation to achieve this.
Thus, this parallel circuit results in a somewhat different operation which is intuitively similar to the sequential circuit.
Given, the experimental results, this operation is also effective in dealing with PDEs/Images, at the same time being more effective than sequential circuit under noisy scenarios.
However, if we remove the IQFT operation from this circuit and instead apply the classical IFT , measuring after eq. 15, we get the following K matrices after applying the square root operation:
[Equation] [Equation]
where b fj and a fj have been deﬁned previously.
There are K such N c × N s matrices.
In case we combine b fk from all of the K matrices with ( a fj ) j ∈ [ K +1 ,N s ] from any of the K matrices, suppose the ﬁrst one, it leads to the following N c
× N s matrix:
[Equation]
(33) which is exactly same as eq. 3.
Thus, this circuit (without the IQFT) followed by some classical post-processing and IFT can replicate the classical fourier layer operation.
D W HY C OMPOUND M ATRIX ?
The intuition behind why a different operation than classical, in form of this compound matrix, might work lies in the expressive power of this operation.
The matrix for the sequential circuit can be interpreted as a special case of this compound matrix where instead of trainable connections, upper and lower registers interact using a ﬁxed control gate.
Due to this special connection, this transform is making the convergence efﬁcient.
This compound matrix, thus, is a more expressive version of the linear transform and also with a lower depth.
Using it was further backed by the assumption that if optimized carefully it might lead to either a more parallelized version of the sequential circuit or a completely different and a more efﬁcient learned matrix.
Also, this is more a quantum-native operation which would be quite complex to carry out classically and thus can provide a better demonstration of quantum-advantage.