Toward Trainability of Quantum Neural Networks

1 INTRODUCTION . Neural Networks ( Hecht-Nielsen , 1992 ) using gradient-based optimizations have dramatically advanced researches in discriminative models , generative models , and reinforcement learning . To efficiently utilize the parameters and practically improve the trainability , neural networks with specific architectures ( LeCun et al. , 2015 ) are introduced for different tasks , including convolutional neural networks ( Krizhevsky et al. , 2012 ) for image tasks , recurrent neural networks ( Zaremba et al. , 2014 ) for the time series analysis , and graph neural networks ( Scarselli et al. , 2008 ) for tasks related to graph-structured data . Recently , the neural architecture search ( Elsken et al. , 2019 ) is proposed to improve the performance of the networks by optimizing the neural structures . Despite the success in many fields , the development of the neural network algorithms could be limited by the large computation resources required for the model training . In recent years , quantum computing has emerged as one solution to this problem , and has evolved into a new interdisciplinary field known as the quantum machine learning ( QML ) ( Biamonte et al. , 2017 ; Havlı́ček et al. , 2019 ) . Specifically , variational quantum circuits ( Benedetti et al. , 2019 ) have been explored as efficient protocols for quantum chemistry ( Kandala et al. , 2017 ) and combinatorial optimizations ( Zhou et al. , 2018 ) . Compared to the classical circuit models , quantum circuits have shown greater expressive power ( Du et al. , 2020a ) , and demonstrated quantum advantage for the low-depth case ( Bravyi et al. , 2018 ) . Due to the robustness against noises , variational quantum circuits have attracted significant interest for the hope to achieve the quantum supremacy on near-term quantum computers ( Arute et al. , 2019 ) . Quantum Neural Networks ( QNNs ) ( Farhi & Neven , 2018 ; Schuld et al. , 2020 ; Beer et al. , 2020 ) are the special kind of quantum-classical hybrid algorithms that run on trainable quantum circuits . Recently , small-scale QNNs have been implemented on real quantum computers ( Havlı́ček et al. , 2019 ) for supervised learning tasks . The training of QNNs aims to minimize the objective function f with respect to parameters θ . Inspired by the classical optimizations of neural networks , a natural strategy to train QNNs is to exploit the gradient of the loss function ( Crooks , 2019 ) . However , the recent work ( McClean et al. , 2018 ) shows that n-qubit quantum circuits with random structures and large depth L = O ( poly ( n ) ) tend to be approximately unitary 2-design ( Harrow & Low , 2009 ) , and the partial derivative vanishes to zero exponentially with respect to n. The vanishing gradient problem is usually referred to as the Barren Plateaus ( McClean et al. , 2018 ) , and could affect the trainability of QNNs in two folds . Firstly , simply using the gradient-based method like Stochastic Gradient Descent ( SGD ) to train the QNN takes a large number of iterations . Secondly , the estimation of the derivatives needs an extremely large number of samples from the quantum output to guarantee a relatively accurate update direction ( Chen et al. , 2018 ) . To avoid the Barren Plateaus phenomenon , we explore QNNs with special structures to gain fruitful results . In this work , we introduce QNNs with special architectures , including the tree tensor ( TT ) structure ( Huggins et al. , 2019 ) referred to as TT-QNNs and the setp controlled structure referred to as SCQNNs . We prove that for TT-QNNs and SC-QNNs , the expectation of the gradient norm of the objective function is bounded . Theorem 1.1 . ( Informal ) Consider the n-qubit TT-QNN and the n-qubit SC-QNN defined in Figure 1-2 and corresponding objective functions fTT and fSC defined in ( 3-4 ) , then we have : 1 + log n 2n · α ( ρin ) ≤ Eθ‖∇θfTT‖2 ≤ 2n− 1 , 1 + nc 21+nc · α ( ρin ) ≤ Eθ‖∇θfSC‖2 ≤ 2n− 1 , where nc is the number of CNOT operations that directly link to the first qubit channel in the SCQNN , the expectation is taken for all parameters in θ with uniform distributions in [ 0 , 2π ] , and α ( ρin ) ≥ 0 is a constant that only depends on the input state ρin ∈ C2 n×2n . Moreover , by preparing ρin using the L-layer encoding circuit in Figure 4 , the expectation of α ( ρin ) could be further lower bounded as Eα ( ρin ) ≥ 2−2L . Compared to random QNNs with 2−O ( poly ( n ) ) derivatives , the gradient norm of TT-QNNs ad SCQNNs is greater than Ω ( 1/n ) or Ω ( 2−nc ) that could lead to better trainability . Our contributions are summarized as follows : • We prove Ω̃ ( 1/n ) and Ω̃ ( 2−nc ) lower bounds on the expectation of the gradient norm of TT-QNNs and SC-QNNs , respectively , that guarantees the trainability on related optimization problems . Our theorem does not require the unitary 2-design assumption in existing works and is more realistic to near-term quantum computers . • We prove that by employing the encoding circuit in Figure 4 to prepare ρin , the expectation of term α ( ρin ) is lower bounded by a constant 2−2L . Thus , we further lower bounded the expectation of the gradient norm to the term independent from the input state . • We simulate the performance of TT-QNNs , SC-QNNs , and random structure QNNs on the binary classification task . All results verify proposed theorems . Both TT-QNNs and SC-QNNs show better trainability and accuracy than random QNNs . Our proof strategy could be adopted for analyzing QNNs with other architectures as future works . With the proven assurance on the trainability of TT-QNNs and SC-QNNs , we eliminate one bottleneck in front of the application of large-size Quantum Neural Networks . The rest parts of this paper are organized as follows . We address the preliminary including the definitions , the basic quantum computing knowledge and related works in Section 2 . The QNNs with special structures and the corresponding results are presented in Section 3 . We implement the binary classification using QNNs with the results shown in Section 4 . We make conclusions in Section 5 . 2 PRELIMINARY . 2.1 NOTATIONS AND THE BASIC QUANTUM COMPUTING . We use [ N ] to denote the set { 1 , 2 , · · · , N } . The form ‖ · ‖ denotes the ‖ · ‖2 norm for vectors . We denote aj as the j-th component of the vector a . The tensor product operation is denoted as “ ⊗ ” . The conjugate transpose of a matrixA is denoted asA† . The trace of a matrixA is denoted as Tr [ A ] . We denote ∇θf as the gradient of the function f with respect to the vector θ . We employ notations O and Õ to describe the standard complexity and the complexity ignoring minor terms , respectively . Now we introduce the quantum computing . The pure state of a qubit could be written as |φ〉 = a|0〉+b|1〉 , where a , b ∈ C satisfies |a|2+|b|2 = 1 , and { |0〉 = ( 1 , 0 ) T , |1〉 = ( 0 , 1 ) T } , respectively . The n-qubit space is formed by the tensor product of n single-qubit spaces . For the vector x ∈ R2n , the amplitude encoded state |x〉 is defined as 1‖x‖ ∑2n j=1 xj |j〉 . The dense matrix is defined as ρ = |x〉〈x| for the pure state , in which 〈x| = ( |x〉 ) † . A single-qubit operation to the state behaves like the matrix-vector multiplication and can be referred to as the gate in the quantum circuit language . Specifically , single-qubit operations are often used including RX ( θ ) = e−iθX , RY ( θ ) = e−iθY , and RZ ( θ ) = e−iθZ : X = ( 0 1 1 0 ) , Y = ( 0 −i i 0 ) , Z = ( 1 0 0 −1 ) . Pauli matrices { I , X , Y , Z } will be referred to as { σ0 , σ1 , σ2 , σ3 } for the convenience . Moreover , two-qubit operations , the CNOT gate and the CZ gate , are employed for generating quantum entanglement : CNOT = • = |0〉〈0| ⊗ σ0 + |1〉〈1| ⊗ σ1 , CZ = • • = |0〉〈0| ⊗ σ0 + |1〉〈1| ⊗ σ3 . We could obtain information from the quantum system by performing measurements , for example , measuring the state |φ〉 = a|0〉+b|1〉 generates 0 and 1 with probability p ( 0 ) = |a|2 and p ( 1 ) = |b|2 , respectively . Such a measurement operation could be mathematically referred to as calculating the average of the observable O = σ3 under the state |φ〉 : 〈σ3〉|φ〉 ≡ 〈φ|σ3|φ〉 ≡ Tr [ |φ〉〈φ| · σ3 ] = |a|2 − |b|2 = p ( 0 ) − p ( 1 ) = 2p ( 0 ) − 1 . The average of a unitary observable under arbitrary states is bounded by [ −1 , 1 ] . 2.2 RELATED WORKS . The barren plateaus phenomenon in QNNs is first noticed by McClean et al . ( 2018 ) . They prove that for n-qubit random quantum circuits with depth L = O ( poly ( n ) ) , the expectation of the derivative to the objective function is zero , and the variance of the derivative vanishes to zero with rate exponential in the number of qubits n. Later , Cerezo et al . ( 2020 ) prove that for L-depth quantum circuits consisting of 2-design gates , the gradient with local observables vanishes with the rate O ( 2−O ( L ) ) . The result implies that in the low-depth L = O ( log n ) case , the vanishing rate could be O ( 1polyn ) , which is better than previous exponential results . Recently , some techniques have been proposed to address the barren plateaus problem , including the special initialization strategy ( Grant et al. , 2019 ) and the layerwise training method ( Skolik et al. , 2020 ) . We remark that these techniques rely on the assumption of low-depth quantum circuits . Specifically , Grant et al . ( 2019 ) initialize parameters such that the initial quantum circuit is equivalent to an identity matrix ( L = 0 ) . Skolik et al . ( 2020 ) train parameters in subsets in each layer , so that a low-depth circuit is optimized during the training of each subset of parameters . Since random quantum circuits tend to be approximately unitary 2-design1 as the circuit depth increases ( Harrow & Low , 2009 ) , and 2-design circuits lead to exponentially vanishing gradients ( McClean et al. , 2018 ) , the natural idea is to consider circuits with special structures . On the other hand , tensor networks with hierarchical structures have been shown an inherent relationship with classical neural networks ( Liu et al. , 2019 ; Hayashi et al. , 2019 ) . Recently , quantum classifiers using hierarchical structure QNNs have been explored ( Grant et al. , 2018 ) , including the tree tensor network and the multi-scale entanglement renormalization ansatz . Besides , QNNs with dissipative layers have shown the ability to avoid the barren plateaus ( Beer et al. , 2020 ) . However , theoretical analysis of the trainability of QNNs with certain layer structures has been little explored ( Sharma et al. , 2020 ) . Also , the 2-design assumption in the existing theoretical analysis ( McClean et al. , 2018 ; Cerezo et al. , 2020 ; Sharma et al. , 2020 ) is hard to implement exactly on near-term quantum devices .

Summary: The design of a useful generalization of neural networks on quantum computers has been challenging because the gradient signal will decay exponentially with respect to the depth of the quantum circuit (saturating to exponentially small in system size after the depth is linear in system size). This work provides a detailed analysis of quantum neural networks with a tree structure that uses only a depth logarithmic in the system size. The authors show that the gradient signal will only be polynomially small with respect to the system size. The authors also provide empirical verification of the theoretical analysis showing a much larger gradient norm. However, the improvement in prediction accuracy (under early stopping) when using tree-structure quantum neural networks is not very significant. This is likely because the considered system size (8 qubits) is too small to fully demonstrate the exponential decay and the inability to train random quantum neural networks.