QTN-VQC: A N E ND - TO -E ND L EARNING FRAMEWORK FOR Q UANTUM N EURAL N ETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
The advent of noisy intermediate-scale quantum (NISQ) computers raises a crucial challenge to design quantum neural networks for fully quantum learning tasks.
To bridge the gap, this work proposes an end-to-end learning framework named
QTN-VQC, by introducing a trainable quantum tensor network (QTN) for quantum embedding on a variational quantum circuit (VQC).
The architecture of QTN is composed of a parametric tensor-train network for feature extraction and a tensor product encoding for quantum embedding.
We highlight the QTN for quantum embedding in terms of two perspectives: (1) we theoretically characterize
QTN by analyzing its representation power of input features; (2) QTN enables an end-to-end parametric model pipeline, namely QTN-VQC, from the generation of quantum embedding to the output measurement.
Our experiments on the MNIST dataset demonstrate the advantages of QTN for quantum embedding over other quantum embedding approaches.
I NTRODUCTION
The state-of-the-art machine learning (ML), particularly based on deep neural networks (DNN), has enabled a wide spectrum of successful applications ranging from the everyday deployment of speech recognition (Deng et al., 2013) and computer vision (Sermanet et al., 2014) through to the frontier of scientiﬁc research in synthetic biology (Jumper et al., 2021).
Despite rapid theoretical and empirical progress in DNN based regression and classiﬁcation (Goodfellow et al., 2016), DNN training algorithms are computationally expensive for many new scientiﬁc applications, such as new drug discovery (Smalley, 2017), which requires computational resources that are beyond the computational limits of classical hardwares (Freedman, 2019).
Fortunately, the imminent advent of quantum computing devices opens up new possibilities of exploiting quantum machine learning (QML) (Biamonte et al., 2017; Schuld et al., 2015; Schuld & Petruccione, 2018; Schuld & Killoran, 2019; Saggio et al., 2021; Dunjko, 2021) to improve the computational efﬁciency of ML algorithms in the new scientiﬁc domains.
Although the exploitation of quantum computing devices to carry out QML is still in its initial exploratory stages, the rapid development in quantum hardware has motivated advances in quantum neural networks (QNN) to run in noisy intermediate-scale quantum (NISQ) devices (Preskill, 2018;
Huggins et al., 2019; Huang et al., 2021; Kandala et al., 2017).
A NISQ device means that not enough qubits could be spared for quantum error correction, and the imperfect qubits have to be directly used at the physical layer.
Even though, a compromised QNN approach is proposed by employing hybrid quantum-classical models that rely on the optimization of variational quantum circuits (VQC) (Benedetti et al., 2019; Mitarai et al., 2018).
The resilience of the VQC based models to certain types of quantum noise errors and high ﬂexibility concerning coherence time and gate requirements (McClean et al., 2018) admit many practical implementations of QNN on NISQ devices (Chen et al., 2020b; Yang et al., 2021; Du et al., 2020; 2021; Skolik et al., 2021; Dunjko et al., 2016; Jerbi et al., 2021; Ostaszewski et al., 2021).
One notable limitation in the current QNN training pipeline is that the quantum embedding is not fully realizable in a quantum computer, which may impede the learning of the QNN.
Hence, this work proposes QTN-VQC to enable an end-toend trainable QNN, including data embedding to quantum measurements, that are easily realizable in quantum devices, where QTN stands for the quantum tensor network (Or´us, 2019; Huckle et al., 2013; Biamonte et al., 2017; Murg et al., 2010) for generating quantum embedding. [Equation] 0 ⟩ | 0 ⟩
[Figure]
[Figure]
Classical data [Figure] Quantum Circuit Quantum [Figure]
Generation z
[Figure]
z
[Figure]
[Equation]
[Figure]
[Equation]
[Figure]
[Equation]
[Figure]
[Equation]
[Figure]
As shown in Figure 1, our QNN builds a unitary linear operator that consists of three main components: (1) quantum embedding generation; (2) variational quantum circuit; (3) measurement.
Quantum embedding generation, also known as quantum encoding, applies a ﬁxed unitary linear operator H x transforming classical vectors x to quantum states | ψ x (cid:105) in a Hilbert space.
This step is an important aspect of designing quantum algorithms that directly impact the entire computation cost of VQC and owns a characteristic of quantum superposition.
Moreover, the VQC comprises two types of quantum gates: (1) Controlled-NOT (CNOT) gates; (2) learnable parametric quantum gates. The CNOT gates ensure the property of quantum entanglement through mutually connecting the qubits, and the parametric quantum gates can be adjustable to best ﬁt the quantum input states.
The model parameters of VQC should be optimized by employing variants of gradient descent algorithms during the training process.
Those parametric quantum gates of VQC are similar to the weights assigned to DNN, and such quantum circuits have been justiﬁed to be resilient to quantum noises (Farhi et al., 2014;
Kandala et al., 2017; McClean et al., 2016).
Besides, the measurement M ( | g θ ( x ) (cid:105) ) aims at projecting the quantum output states | g θ ( x ) (cid:105) to one classical output z i .
This work focuses on quantum embedding generation because it is quite related to the practical usage in machine learning applications in terms of computational cost and representation capability of classical input features.
In particular, we design a novel quantum tensor network (QTN) for quantum embedding generation.
More speciﬁcally, the QTN consists of a tensor-train network (TTN) for dimension reduction and a quantum tensor encoding framework for outputting quantum embeddings.
The dimension reduction is a necessary procedure before the quantum encoding because only a small number of qubits could be supported on available NISQ computers at this moment.
A typical approach for dimension reduction relies on a classical fully-connected layer, also known as a dense layer, to convert high-dimensional input vectors y into low-dimensional ones x .
However, since a dense layer cannot be physically mapped on a quantum computer, much overhead has to be incurred by frequently communicating between classical and quantum devices during the end-to-end training pipeline.
As shown in Figure 2 (b), one of our contribution is to leverage a tensor train network (TTN) to replace the dense layer in Figure 2 (a).
The beneﬁts of applying TTN arise from two aspects: (1) TTN can maintain the representation power of the dense layer, which will be justiﬁed in our theorems; (2) TTN is a tensor network and can be ﬂexibly placed in quantum computers, which enables an end-to-end training process fully conducted in a quantum computer.
Moreover, in this work, a tensor product encoding (TPE) is delicately designed for generating quantum embedding, which builds the relationship between a classical vector x and the corresponding quantum state | x (cid:105) ; Besides, we further investigate the representation of QTN-VQC in terms of model size and nonlinear activation function used in TTN.
We denote a QTN as the combination of TTN and TPE and utilize QTN-VQC as a genuine end-to-end learning framework for QNN.
R ELATED W ORK
The work (Schuld & Petruccione, 2018; Biamonte et al., 2017; Dunjko & Briegel, 2018) demonstrate that VQC shows great promise in surpassing the performance of classical ML.
Prominent examples of VQC based models include quantum approximate optimization algorithm (QAOA)
(Farhi et al., 2014), and quantum circuit learning (QCL) (Mitarai et al., 2018).
Various architectures and geometries of VQC have been shown in tasks ranging from image classiﬁcation (Henderson et al., 2020;
Chen et al., 2020a; Kerenidis et al., 2020) to reinforcement learning (Chen et al., 2020b).
As for quantum embedding, basis encoding is the process of associating classical input data in the form of binary strings with the computational basis state of a quantum system (Leymann & Barzen, 2020).
Similarly, amplitude encoding is a technique involving encoding data into the amplitudes of a quantum state (Soklakov & Schack, 2006).
Unfortunately, the computational cost of both quantum embedding and amplitude encoding becomes exponentially expensive with the increasing number of qubits (Schuld & Killoran, 2019).
A new technique of angle embedding makes use of the quantum gates to generate quantum states (Fu et al., 2011), but it cannot deal with the high-dimensional feature inputs.
Therefore, this work exploits the use of TTN for dimension reduction followed by a TPE for generating quantum embedding.
In particular, this work employs the TTN for dimensionality reduction.
The TTN model based on TT decomposition in neural networks was ﬁrst proposed in (Oseledets, 2011), and it could be ﬂexibly extended the convolutional neural network (CNN) (Garipov et al., 2016) and recurrent neural network (RNN) (Tjandra et al., 2017).
The empirical study of TTN on machine learning tasks shows that TTN is capable of maintaining the DNN baseline results (Qi et al., 2020a; Yu et al., 2017; Yang et al., 2017; Jin et al., 2020).
However, to our best knowledge, no existing works have applied TTN to QML.
Besides, since the tensor network-based machine learning model like TTN is closely related to quantum machine learning in terms of their model structures (Liu & Wang, 2018;
Gao et al., 2017), the QTN-VQC model can be directly regarded as the classical simulation of the corresponding quantum machine learning.
In addition to a classical dense layer, more complicated architectures like AlexNet (Lloyd et al., 2020) could be used for dimension reduction, and we also compare the performance between TTN and AlexNet-based models.
N OTATIONS
We denote R I as a I -dimensional real coordinate space, and R I
× I 2 ×··· I K refers to a space of Korder tensors.
The symbol W ∈ R I
×
I 2 ×···× I K represents a K -order multi-dimensional tensor in R I
×
I 2 ×··· I K , and the symbols v ∈ R I and W ∈ R
I × J represent a vector and a matrix, respectively.
For the notations of quantum computing, ∀ v ∈ R I , the symbol | v (cid:105) denotes a quantum state associated with a 2 I -dimensional vector in a Hilbert space.
Particularly, | 0 (cid:105) =
[1 0] T and | 1 (cid:105) =
[0 1] T .
The quantum gate R Y ( θ ) means a Pauli- Y gate with a unitary operator as deﬁned in Eq.
(1), which implies a qubit rotates the Bloch sphere along the Y-axis by a given angle θ .
[Equation]
Moreover, the operator ⊗ is a tensor product.
Given the vectors v i ∈ R I , the tensor product of I vectors is deﬁned as ⊗ I i
=1 v i , which is a 2 I -dimensional vector and can provide a compact represen- rrr K −r K
I K − I K − I K I I
Irr K − J J J
J K − 2 J K −
J K (a) Tensor-Train Network: given a set of TT-ranks , a circle represents a core tensor and each line is related to a dimension.
r 1 , r 2 ,..., r K } | 0 ⟩ | 0 ⟩ | 0 ⟩ (b) Tensor Product Encoding: denotes the Pauli-Y rotation gate R Y ( π x )
R Y ( π x 1 )
R Y ( π x 2 )
R Y ( π x d ) tation for v 1 ⊗ v 2 ⊗ · · · ⊗ v I .
Similarly, the symbol | 0 (cid:105) ⊗ S means a tensor product of S quantum states of | 0 (cid:105) .
Furthermore, for a scalar v , the quantum state | v (cid:105) can be written as:
[Equation]
QTN-VQC: O UR P ROPOSED E ND - TO -E ND L EARNING F RAMEWORK
This section introduces our proposed end-to-end learning framework, namely QTN-VQC in this work.
As shown in Figure 3, the QTN model includes two components (a) TTN and (b) TPE, which will be separately introduced in Section 4.1 and Section 4.2.
Moreover, Figure 4 illustrates the framework of VQC and Section 4.3 is devoted to discussing the details of VQC.
4. T ENSOR T RAIN N ETWORK FOR D IMENSION R EDUCTION
We leverage TTN (Novikov et al., 2015) for the dimension reduction of input features.
TTN relies on the TT decomposition (Oseledets, 2011) and has been commonly employed in machine learning tasks like speech processing (Qi et al., 2020b) and computer vision (Yang et al., 2017).
The TT decomposition assumes that given a set of TT-ranks { r 0 , r 1 , ..., r K } , a K -order tensor
W ∈ R
I
×
I 2 ×···× I K is factorized into the multiplication of 3 -order tensors X k ∈ R r k − 1 × I k × r k .
In more detail, given a set of indices { i 1 , i 2 , ..., i K } , X ( i 1 , i 2 , ..., i K ) is decomposed as:
[Equation]
where ∀ i k ∈
[ I k ] , X k ( i k ) ∈
R r k − 1 × r k .
Since r 0 = r 1 = 1 , the term (cid:81)
Kk =1 X k
( i k ) is a scalar value.
TTN employs the TT decomposition in a dense layer and is explicitly demonstrated in Figure 3 (a).
In more detail, for an input tensor X ∈ R I 1 × I 2 ×···× I K and an output tensor Y ∈ R J 1 × J 2 ×···× J K , we achieve Y ( j 1 , [Equation]
[Equation]
K [Equation] = [Equation]
[Equation] k [Equation] (cid:33)
[Equation] where X k ( i k ) ∈ R r k − 1 × r k , and Y k ( j k ) ∈ R r k − 1 × r k which results in a scalar (cid:81)
Kk =1 Y k ( j k ) because of the ranks r [-
-]0 = r 1 = 1 ; W (( i 1 , j 1 ) , ( i 2 , j 2 ) , ..., ( i K , j K )) is closely associated with
W ( m 1 , m 2 , ..., m K ) as deﬁned in Eq.
(3), if each index m k
= i
k
× j k is set.
The multi-dimensional tensor W is decomposed into the multiplication of 4 -order tensors W k ∈ R r k − 1 ×
I k × J k × r k .
A nonlinear activation function, e.g., Sigmoid, Tanh, and ReLU, is imposed upon the tensor Y .
Compared with a dense layer with (cid:81)
Kk =
I k J k parameters, a TTN owns as few as (cid:80)
Kk =
1 r k r k −
I k J k trainable parameters.
When a TTN is utilized for the dimension reduction, the high-dimensional input vector x ∈ R I is ﬁrst reshaped into a tensor X ∈ R I
×
I 2 ×···× I K , and then we can represent X as a TT format that goes through TTN.
The outputs of TTN can be converted back to a tensor Y ∈ R J 1 × J 2 ×···× J K , which is further reshaped to a lower dimensional vector y ∈ R J .
Here, we deﬁne (cid:81)
Kk =
I k
= I and (cid:81)
Kk =1 J k
= J .
Moreover, the computational complexities of TTN and the related dense layer are in the same scale, which is discussed in (Yang et al., 2017).
Eq.
(4) suggests that TTN is a multi-dimensional extension of a dense layer, where the trainable weight matrix of a dense layer is changed to the learnable core tensors.
Additionally, many empirical studies demonstrate that a TTN is capable of maintaining the baseline results of the dense layer (Qi et al., 2020b; Yang et al., 2017; Novikov et al., 2015; Qi et al., 2020a).
More signiﬁcantly, since TTN can be ﬂexibly mapped into a quantum circuit, the quantumness inherent in TTN brings great advantages over other architectures like the dense layer.
In other words, although TTN is treated classically, it is possible to substitute equivalent quantum circuits for TTN when more qubits become available (Du et al., 2020), which implies that QTN-VQC stands for a genuine end-to-end QNN learning architecture on a quantum computer.
Furthermore, since the gradient exploding and diminishing problems are serious issues in the TTN training. To avoid those training problems, we only consider 3 -order core tensors and small TT-ranks to conﬁgure a simple TTN in our experimental simulations. Our theoretical analysis of QTN-VQC based on Theorem 3 in Section 5 suggests that the representation power is not related to TT-ranks and the tensor order K , thus small TT-ranks and the tensor order K are preferred. In particular, a lower K can signiﬁcantly reduce the computational cost and speed up the convergence rate.
4. T ENSOR P RODUCT E NCODING
In this subsection, we ﬁrst introduce Theorem 1, and then we derive our TPE associated with the circuits in Figure 3 (b).
Theorem 1.
Given the classical vector x = [ x 1 , x 2 , ..., x I ] T ∈ R I , a TPE as shown in Figure 3 (b) can result in a quantum state | x (cid:105) with the following complete vector representation as:
[Equation]
Proof.
Since each element x i in the vector x can be written as | x i (cid:105) =
cos x i | 0 (cid:105)
+
sin x i | 1 (cid:105) , the quantum state | x (cid:105) can be written as:
[Equation]
When the vector x goes through the quantum tensor network, which implies the following as:
[Equation]
The preceding equation, in turn, implies that Eq.
Theorem 1 builds a connection between the vector x and the quantum state | x (cid:105) , and the resulting | x (cid:105) is taken as the quantum embedding as the inputs to VQC.
Since ⊗ I i =1 R Y (2 x i ) is a reversely unitary linear operator, there is no information loss incurred during the stage of quantum encoding.
Furthermore, if the input is multiplied with a constant π 2 , we obtain the following term as: [Equation]
[Equation]
which corresponds to Figure 3 (b).
| 0 ⟩ | 0 ⟩ | 0 ⟩ | 0 ⟩
[Figure]
· · · · ⨁ ⨁ ⨁
[Figure] [Figure] [Figure] [Figure]
β
[Figure]
[Figure]
R X (
[Figure]
R
[Figure]
[Figure]
[Figure]
( γ
[Figure]
[Figure]
[Figure]
[Figure] [Figure] 4. T HE F RAMEWORK OF V ARIATIONAL Q UANTUM C IRCUIT The framework of VQC is shown in Figure 4 (a), where 4 qubit wires are taken into account, and the CNOT gates aim at mutually entangling the channels such that | x 1 (cid:105) , | x 2 (cid:105) , | x 3 (cid:105) and | x 4 (cid:105) lie in the same entanglement state.
The Pauli-X, Y, Z gates R X ( · ) , R Y ( · ) and R Z ( · ) with learnable parameters ( α 1 , β 1 , γ 1 ) , ( α 2 , β 2 , γ 2 ) , ( α 3 , β 3 , γ 3 ) , ( α 4 , β 4 , γ 4 ) are built to set up the learnable part.
Being similar to the unitary operators of R Y ( α ) , R X ( β ) and R Z ( γ ) , which are deﬁned in Figure(b), are separately associated with the rotations along X-axis and Z-axis by the given angles of β and γ .
Besides, the quantum circuits in the dash square can be repeatedly copied to compose a deeper architecture.
The outputs of VQC are connected to the measurement which projects the quantum states into a certain quantum basis that becomes a classical scalar
z i .
As for the end-to-end training paradigm for QTN-VQC, the learnable parameters come from the
VQC and TTN models, and they should be updated by applying the back-propagation algorithm based on the Adam optimizer.
Given D qubits and H depths, there are totally 3 DH trainable parameters for VQC.
Consequently, there are (cid:80)
Kk =
1 r k − 1 r k
I k J k + 3 DH parameters for QTNVQC.
On the other hand, the Dense-VQC model possesses more model parameters than QTN-VQC ( (cid:81)
Kk =1 r k − 1 r k
I k J k + 3 DH vs. (cid:80)
Kk =
1 r k − 1 r k
I k J k + 3 DH ).
C HARACTERIZING R EPRESENTATION P OWER OF QTN-VQC
This section focuses on analyzing the representation power of QTN-VQC.
As shown in Figure 5, given d qubits and a target quantum state | z (cid:105) =
⊗ Dd =1 | z d (cid:105) , since H θ is known as a linear operator and T x is deﬁned as a deﬁnite mapping from input x to the unitary matrix U x , the representation power of QTN-VQC is determined by how TTN can approximate the classical vector T − 1 x ( H − 1 θ | z (cid:105) ) .
To understand the expressiveness of TTN, we ﬁrst start with the discussion on the expressive capability of Dense-VQC (a dense layer is taken for dimension reduction) and then generalize it to QTN-VQC.
Based on the universal approximation theorem (Cybenko, 1989; Barron, 1994) for a feed-forward neural network, we derive the following theorem as:
Theorem 2.
Given a target vector T − 1 x ( H − 1 θ | z (cid:105) ) , there exists a feed-forward neural network f dense with a dense layer connecting to D qubits, then
[Equation]
(9) where the activation function tanh( · ) is imposed upon the dense layer, and C is a constant associated with the target vector T − 1 x ( H − 1 θ | z (cid:105) ) . [Figure]
Since TTN is a compact TT representation of a dense layer, by modifying Theorem 2 for TTN, we can also derive the upper bound on the approximation error as follows:
Theorem 3.
Given a target vector T − 1 x ( H − 1 θ | z (cid:105) ) , there exists a TTN, denoted as f TTN , with a TT layer connecting to D qubits, then
[Equation]
where (cid:81)
Kk = 1 D k = D , the Sigmoid activation function is imposed upon the TTN model, K denotes the multi-dimensional order, C is a constant associated with the target vector T − 1 x ( H − 1 θ | z (cid:105) ) .
Comparing the two upper bounds, it is observed that TTN can attain an identical upper bound as the dense layer on the approximation error because (cid:81)
Kk = 1 D k = D .
That implies that TTN can at least maintain the representation power of a dense layer.
Besides, the number of qubits D is a key factor determining the upper bound on the approximation error.
However, D is a small ﬁxed number on a NISQ device, and a larger number of qubits D is expected to further improve the representation power of QTN-VQC.
However, the computational costs of classical simulation may grow exponentially with the increasing number of qubits, and a small number of qubits have to be considered in practice.
E XPERIMENTS AND R ESULTS 6. E XPERIMENTAL SETUPS
We assess our QTN-VQC based end-to-end learning system on the standard MNIST.
MNIST is a dataset for the task of 10 digit classiﬁcation, where there are 50000 and 10000 28 × 28 image data assigned for training and testing, respectively.
The full MNIST dataset is challenging for quantum machine learning algorithms, and many works only consider 2-digit classiﬁcation on the MNIST task (Wang et al., 2021; Chen et al., 2020a).
Moreover, the image data are separately reshaped into 784 dimensional input vectors.
Dense-VQC and PCA-VQC are taken as our experimental baselines to compare with our QTN-VQC model.
Dense-VQC denotes that a dense layer is used for dimension reduction, and PCA-VQC refers to using principal component analysis (PCA) to extract low-dimensional features before training the VQC parameters.
As for the experiments of QTN-VQC, the image data are reshaped into 3-order 7 × 16 × 7 tensors.
We set small TT-ranks as { 1 , 2 , 2 , 1 } to reduce the computational cost of TTN. the image data are represented as the TT format according to Eq.
(3) before going through the TTN model.
Sincequbits are used for the quantum encoding, the output of TTN needs to conﬁgure the tensor format as 2 × 2 × 2 , which results in 8 dimensional output vectors.
Besides, the model parameters of QTN-VQC are randomly initialized based on the Gaussian distribution, and the back-propagation algorithm is applied to train the models.
The Sigmoid function is utilized for the hidden layers of TTN.
To be consistent with QTN-VQC, the weight of the dense layer for Dense-VQC is conﬁgured as the shape of 784 × 8 .
Although Dense-VQC is a hybrid classical-quantum model, the training process of Dense-VQC can also be set as an end-to-end pipeline and the weights of the dense layer are updated during the training stage.
The Sigmoid function is used for the dense layer.
On the other hand, PCA is employed to reduce the feature dimension to 8 , and the resulting low-dimensional features are further encoded into quantum states.
Consequently, PCA-VQC admits the VQC parameters solely to be updated during the training stage.
A standard AlexNet (Iandola et al., 2016) is employed to constitute an AlexNet-VQC to compare the performance.
Moreover, 6 VQC layers are constructed to form a deep model, and the outputs of the VQC model are connected to 10 classes with a non-trainable matrix.
The back-propagation algorithm based on the Adam optimizer with a learning rate of 0 .
001 is employed for the model training.
The loss of cross-entropy (CE) is utilized as the objective function during the training stage, and it is also taken as the metric to evaluate the model performance.
We leverage the tools of Pennylane (Bergholm et al., 2018) and PyTorch (Paszke et al., 2019) to simulate the model performance.
In particular, we separately simulate the model performance with noiseless quantum circuits and noisy quantum circuits corrupted by quantum noises from IBM quantum machines.
6. E XPERIMENTAL R ESULTS OF N OISELESS Q UANTUM C IRCUIT
Table 1 shows the ﬁnal results of the models on the test dataset.
QTN-VQC owns much fewer model parameters than Dense-VQC ( 328 vs. 6416 ) and attains even higher classiﬁcation accuracy than Dense-VQC ( 91 .
43% vs. 88 .
54% ) and lower loss values than Dense-VQC ( 0 .
3090 vs. 0 .
However, PCA-VQC with 144 trainable VQC parameters attains the worst performance by all metrics, which implies that a trainable quantum embedding is of signiﬁcance to boost experimental performance.
Although our empirical results cannot reach the state-of-the-art classiﬁcation performance of classical ML algorithms, our empirical results demonstrate the advantages of QTN-VQC over the PCA-VQC and Dense-VQC counterparts.
With the development of more powerful quantum devices supporting more qubits, the representation power of QTN-VQC can be improved and better experimental results could be attained. Moreover, AlexNet-VQC achieves better results than
QTN-VQC ( 92 . 81% vs. 91 . , but it involves more model parameters than QTN-VQC.
[Table]
6. E XPERIMENTAL R ESULTS OF N OISY Q UANTUM C IRCUIT
To empirically validate the effectiveness of our proposed VQC algorithm, we proceed with the simulation of the practical experiments with noisy quantum circuits.
More speciﬁcally, we follow an established noisy circuit experiment with the NISQ device suggested by (Chen et al., 2020b).
One major advantage of the setups is to observe the robustness and preserve the quantum advantages of a deployed VQC with physical settings being close to quantum processing unit (QPU) experiments without an executive queuing time.
As for the detailed setup, we ﬁrst use an IBM Q 20-qubit machine to collect channel noise in the real scenario for a deployed VQC and upload the machine noise into our Pennylane-Qiskit simulator (denoted as Acc q 20 .
We provide a depolarizing noisy circuit simulation (denoted as Acc depo ) based on a depolarizing channel attained from (Nielsen & Chuang, 2010) with a noise level of 0 . 1 .
As shown in Table 2, the quantum noise brings about the performance degradation of all models, but our proposed QTN-VQC consistently outperforms PCA-VQC and Dense-VQC in the condition of noisy quantum circuits.
In particular, QTN-VQC can even outperform the AlexNet-VQC counterpart in noisy circuit conditions.
6. F URTHER D ISCUSSIONS
The above experimental results show the advantages of QTN-VQC over Dense-VQC and PCAVQC in the scenarios with noiseless and noisy quantum circuits.
Next, we will further discuss the representation power of QTN-VQC based on two factors: (1) the activation function used in TTN; (2) the number of qubits. [Table]
T HE ACTIVATION FUNCTION USED IN TTN
Table 3 compares the results of QTN-VQC based on different activation functions.
Our simulation on noiseless quantum circuits shows that the non-linear activation functions can bring more performance gain than a linear one [Table] but the Sigmoid function attains a better performance than the
Tanh and ReLU counterparts in our experiments.
Our experiments also correspond to the universal approximation theory for QTN-VQC in Theorem [Table] [Table]
[Table]
T HE NUMBER OF QUBITS
Finally [Table] we investigate the effects of the number of qubits on the performance of QTN-VQC by increasing the qubits from 8 to 12 and 16 .
Accordingly, the output of TTN is conﬁgured as a tensor format of 2 × 3 ×
[Table]
and the model size is increased from 328 to 464 and 600 , respectively.
Our experiments show that the baseline performance of QTN-VQC can be further improved by increasing the number of qubits, which implies that more qubits are likely to possess higher accuracy.
[Table]
C ONCLUSIONS
This work proposes a genuine end-to-end learning framework for quantum neural networks based on
QTN-VQC.
QTN consists of a TTN for dimension reduction and a TPE framework for generating quantum embedding.
The TTN model is a compact representation of a dense layer to classically simulate quantum machine learning algorithms.
Our theorem on the representation of QTN-VQC shows that the number of qubits is inversely related to the approximation error of QTN-VQC and the non-linear activation plays an important role.
Our experiments compare our proposed QTN-VQC with Res-VQC, Dense-VQC, and PCA-VQC. Our simulated results demonstrate that QTN-VQC obtains better experimental performance than Dense-VQC and PCA-VQC with both noiseless and noisy quantum circuits, and it achieves marginally worse performance than AlexNet-VQC.
Besides, our results justify our theorem on the representation power of QTN-VQC.
A A PPENDIX
The section of appendix includes the proofs for Theorem 2 and Theorem 3.
A. P ROOF FOR T HEOREM
Proof.
Theorem 2 is derived from the modiﬁcation of the universal approximation theory proposed by Barron (1994); Cybenko (1989).
The universal approximation theory is shown in Lemma 1, which suggests that a feed-forward neural network with d neurons can approximate any continuous function with arbitrarily small (cid:15) .
Lemma 1.
Given a continuous target function ˆ f : R I → R , we can employ a 2-layer neural network with a non-linear activation f : R I → R , such that
[Equation]
where J denotes the number of neurons, and C ˆ f is a constant associated with ˆ f .
In particular, for r ≥ 1 , C f satisﬁes the following condition as:
[Equation]
where D k ˆ f = (cid:104) ∇ ˆ f, ∇ 2 ˆ f, ..., ∇ k ˆ f (cid:105) T .
To associate Lemma 1 with our Theorem 2, the target function is replaced with the target vector
H − 1 X H − 1 θ | z (cid:105) , then there is a neural network with a dense layer connected to D qubits such that
[Equation]
[Equation] where C is related to the target vector H − 1 X H − 1 θ | z (cid:105) .
A. P ROOF FOR T HEOREM
Proof.
Assume that X = f TTN ( y ) ,
ˆ X = H − 1 X H − 1 θ | z (cid:105) and the TT decomposition of target vector is { ˆ X 1 , ˆ X 2 , ..., ˆ X K } , then we obtain ||
H − 1 X H −
[Equation]
On the other hand, we denote vec ( Y k ) and vec ( X k ) as the vectorization of the tensors Y k and X k , respectively.
We also deﬁne (cid:81)
Kk =
I k
= I , W k ∈ R D
k ×
I k
× r k − 1 × r k as the TTN parameters, and also deﬁne W k ∈ R I k
× r k − 1 r k D k as the matricization of W k .
Moreover, σ refers to a non-linear activation function.
Since vec ( X k )
=
σ ( W T vec ( Y k )) that corresponds to a dense layer, we can obtain that
[Equation]
In sum, we can further obtain
[Equation]
where (cid:81)
Kk = 1 D k = D .
B A PPENDIX
This section includes additional experimental simulations.
First, we assess the settings of TT-ranks, and then we compare the convergence rates of QTN-VQC and Dense-VQC in the experiments.
B. E XPERIMENTS ON TT- RANKS FOR QTN-VQC
Table 5 corresponds to the experiments of QTN-VQC with 8 qubits and the Sigmoid function.
The empirical results suggest that the larger TT-ranks cannot result in better results than the smaller ones.
The main reason is that the TT-ranks can correspond to a manifold, and there may potentially exist an optimal manifold with smaller TT-ranks that corresponds to the best performance.
[Table]
B. A COMPARISON OF CONVERGENCE RATES
Next, we analyze the computational complexity for TTN for QTN-VQC.
In more detail, given the
TT-ranks { r 1 , r 2 , ..., r K } , a multi-dimensional tensor W is factorized into several K -order tensors
W k ∈ R r k − 1 ×
I k
× J k × r k , the computational complexity of the feed-forward process is in the scale of
O ( K max k I k max k J k
(max k r k ) K ) .
In contrast, the computational overhead for a dense layer is in the scale of O ( (cid:81) k
I k (cid:81)
k J k ) .
It means that smaller TT-ranks can reduce the computational cost for QTN-VQC, which explains that smaller TT-ranks { 1 , 2 , 2 , 1 } is conﬁgured in our experiments of QTN-VQC.
Empirically, we compare the convergence rates of different models on the test data in our experiments.
In our experimental settings with the Tanh activation function and 8 qubits, the QTN-VQC model consistently attains a faster convergence rate than the Dense-VQC and PCA-VQC counterparts.
Moreover, Table 6 compares the absolute running time of QTN-VQC with Dense-VQC and
AlexNet-VQC.
Since our experiments are conducted on the same GPUs and CPUs, the training time of all models can be comparable.
Our evaluation shows that QTN-VQC is marginally slower than
Dense-VQC, but it is much faster than AlexNet-VQC.
[Table]
C E XPERIMENTS OF L ABELED F ACES IN THE W ILD (LFW) C. E XPERIMENTAL SETUPS
The LFW is a dataset for the task of unconstrained face recognition, which is composed ofimages with the shape of [154 , 154 , 3] .
The shape of We randomly split all the datasets intotraining data, 2000 test data.
16 qubits are used for VQC, and the shape of the input tensor is set as 22 × 147 × 22 .
The other settings are kept the same as the conﬁgurations for the MNIST task.
C. E XPERIMENTAL RESULTS
Table 6 presents the simulation results under the noiseless quantum circuit condition, while Table 7 demonstrates the empirical results in the setting of noisy quantum circuits.
The QTN-VQC outperforms the Dense-VQC counterpart ( 92 . 15 vs. 91 . 27 ), and it owns much fewer model parameters ( 2816 vs. 1 .
1 × 10 6 ).
Although
The experimental results on the LFW dataset also highlight the advantages of QTN-VQC in terms of fewer model parameters and better empirical performance.
[Table]
[Table]