Scrambling Ability of Quantum Neural Networks Architectures
Abstract
In this letter we propose a general principle for how to build up a quantum neural network with high learning efficiency. Our stratagem is based on the equivalence between extracting information from input state to readout qubit and scrambling information from the readout qubit to input qubits. We characterize the quantum information scrambling by operator size growth, and by Haar random averaging over operator sizes, we propose an averaged operator size to describe the information scrambling ability for a given quantum neural network architectures, and argue this quantity is positively correlated with the learning efficiency of this architecture. As examples, we compute the averaged operator size for several different architectures, and we also consider two typical learning tasks, which are a regression task of a quantum problem and a classification task on classical images, respectively. In both cases, we find that, for the architecture with a larger averaged operator size, the loss function decreases faster or the prediction accuracy in the testing dataset increases faster as the training epoch increases, which means higher learning efficiency. Our results can be generalized to more complicated quantum versions of machine learning algorithms.
Classical neural networks can extract information from the input, usually a high-dimensional vector, and encode the information into a number or a low-dimensional vector as output. Classical neural networks have found broad applications in both technology developments and scientific researches. For these applications, there are studies on how to design properly the architectures of neural networks, such as the number of layers, the number of neurons in each layer, and the activation functions, such that extracting information can be made most efficiently classical_structure . Quantum neural networks (QNN) also extract information from the input, usually a high-dimensional quantum wave function, and encode the information into one or a few read-out qubits. QNNs are considered one of the most promising applications in the near-term noise intermediate-scale quantum technology Preskill and have attracted considerable attention recently QNN0 ; QNN1 ; QNN2 ; QNN3 ; QNN4 ; QNN5 ; QNN6 ; QNN7 ; QNN8 ; QNN9 ; QNN10 ; QNN11 ; QNN12 ; QNN13 ; QNN14 ; QNN15 . QNNs are made of local unitary quantum gates, and in practices, we should face the same problem of how we design the architectures of QNN properly.

To be concrete, we consider QNN as shown in Fig. 1(a). The dataset is denoted by ( labels data), where is a quantum wave function and is its label. The quantum circuit denoted by a unitary transformation is made of several local (say, two-qubit) quantum gates. There are various ways to construct with two-qubit gates, and different constructions correspond to different architectures. In the end, one measures the readout qubit-, say, by measuring , one can introduce the measurement operator as
(1) |
where the superscrip labels the qubits. Aside from the readout qubit , no measurement is performed at other qubits, which are described by the identity matrix denoted by . The measurement yields a readout
(2) |
A loss function is designed to measure how close is to , and one trains the parameters in the two-qubit gates to minimize the loss function. During training, the QNN can also make predictions on the test dataset. Therefore, for a given task and dataset, and by averaging over different initializations, the loss or the accuracy as a function of training epoch mostly depends on the architecture of QNN. The issue addressed in this work is whether there is a guiding principle for designing the most efficient architecture in learning, that is, as the training epoch increases, the decreasing of the loss or the increasing of the accuracy is the fastest.
In the case of classical neural networks, there is always information loss from the input layer to the output layer. However, for QNN, the total information is conserved during unitary transformation through the quantum circuit. Note that a unitary transformation is reversible, when we say a QNN encodes the information from the input wave function to the readout qubit, it is equivalent to say that the QNN scrambles the information from the readout qubit to all input qubits. Thus, the efficiency of extracting information is equivalent to the efficiency of scrambling information. Lots of studies in the past few years have established several related quantities to characterize quantum information scrambling, such as the out-of-time-ordered correlator OTOC1 ; OTOC2 ; OTOC3 ; OTOC4 ; OTOC5 ; OTOC6 , the tripartite information I31 ; I32 ; I33 ; I34 and the operator size growth OSG1 ; OSG2 ; OSG3 ; OSG4 ; OSG5 ; OSG6 ; OSG7 ; OSG8 ; OSG9 ; OSG10 ; OSG11 . Recently, the tripartite information has also been used to reveal universal features in the training dynamics of QNN I3_QNN . This work focuses on the architecture and the main results are two folds:
i) We propose a quantity based on the operator size to characterize the information scrambling ability of a QNN architecture.
ii) We show that the scrambling ability quantified in this way is positively correlated with the learning efficiency of the QNN architecture.
Architectures. We demonstrate our results using several different architectures shown in Fig. 1(b-f) as examples. The entire quantum circuit is made of a number of units, i.e. , as shown in Fig. 1(a). In each unit, contains a number of two-qubit gates , and it ensures that every qubit is operated at least once. denotes a two-qubit gate acting on qubit- and -. Each is parameterized as
(3) |
where are generators and are parameters. In a QNN, these parameters need to be determined by training. How to arrange these to form , and then to form , is referred to as the architecture.
Fig. 1(b-f) show architectures considered in this work. For cases shown in Fig. 1(b-d), all qubits are aligned along a one-dimensional line and all gates operator on two neighboring qubits. They differ by the ordering of these gates, and they are called Brick Wall (B), Lambda (), and Chain (C) as what they look like. For the case shown in Fig. 1(e), all qubits sit in a one-dimensional circle, and the way they interact is reminiscent of the hyperbolic geometry, for which it is called Hyperbolic (H). Finally, for the case shown in Fig. 1(f), qubits sit at the corners of a three-dimensional cube. The two-qubit gates first act on four pairs of neighboring gates along , and then four pairs of neighboring gates along and finally four pairs of neighboring gates along . Below we explicitly show the scrambling ability and its correlation with learning ability using these architectures, however, we emphasize that we have tried more generic architectures and our conclusions below hold for general architectures.
Operator Size. Now we briefly introduce the operator size OSG1 ; OSG2 ; OSG3 ; OSG4 ; OSG5 ; OSG6 ; OSG7 ; OSG8 ; OSG9 ; OSG10 ; OSG11 . Let us consider a system with -qubit and an operator in this system. Generally, we can expand the operator as
(4) |
where with subscript respectively denotes identity () and three Pauli matrices . Here denotes a set , and we use to denote the number of non-zero elements in the set , i.e. the number of operators in that are not identity. Then, the size of an operator is defined as
(5) |
In the most general case, there are totally terms in the expansion Eq. 4. Here we give two examples. If we consider the measurement operator defined in Eq. 1, we have . If we consider a uniform distribution among all traceless operators, with , then
(6) |
Furthermore, if we consider the situation that, among -qubit, operators on a fraction of qubits () are uniformly distributed among and operators on the rest qubits are always identity. Then, the operator size is reduced to .
We present an argument to bring out the connection between operator size and the learning ability of a QNN. Let us consider the operator in Eq. 2. Initially, operator is not identity only at the measurement qubit-, however, because does not commute with , can also be one of the three Pauli matrices on other qubits and the operator size increases. Generally, when the operator becomes more and more complicated as the depth of QNN increases, the operator size of increases. However, if is not sufficiently large, there is still a large probability that takes identity operator on some qubits. Since acts on the input state, and if the operator is nearly identity on some qubits, the QNN can hardly extract information from the input wave function at those qubits. Therefore, a necessary condition for accurate learning is that reaches a sufficient large value.

depends on both the architecture and the parameters of the unitary . Since for a QNN, the parameters keep updating during training but the architecture is fixed as a prior, we would like to have a quantity that only depends on the architecture. To this end, we propose to consider an averaged operator size
(7) |
Here means Haar random average overall two-qubit gates in . Since the parameters in have been averaged over, defined by Eq. 7 only depends on the architecture. This quantifies characterizes that for generic parameters, how fast the operator size grows in a given QNN architecture. We propose to use this parameter to quantify the ability to scramble quantum information for a given architecture. We argue that for an architecture with larger , it is easier to reach a suitable parameter such that is large enough that ensures efficient information extraction from the input wave functions.
The Haar random average can also simplify the calculation of the operator size. For instance, let us consider a two-qubits system and an operator . Expanding as Eq. 4, and after averaging over the Haar random unitary, the weight () reads OSG1
(8) |
Consequently, the probability of having a non-identity operator only on the first or only on the second site is , and the probability for having non-identity operators on both sites is . Based on Eq. (8), for any QNN with composited by two-qubits gates, the operator size growth can be explicitly deduced as the depth of the QNN increases.
We compute defined in Eq. 7 for different architectures shown in Fig. 1 and the results are shown in Fig. 2. The results show the ordering of as . Especially, it is clear that the supercube (S) performs obviously better than others. And the difference between different architectures is the most significant for intermediate QNN depth. When the number of units is too small (e.g. ) and the QNN is too shallow, the unitary is not complicated enough that a local operator cannot be sufficiently scrambled for all architectures. On the other hand, when the number of units is large enough (e.g. ) and the QNN is deep enough, the unitary is sufficiently complicated for all architectures and for all cases approach ( for considered here), and their differences also become insignificant.
Learning Efficiency. To relate the learning efficiency to the scrambling ability defined above, we consider two typical training tasks. The first is a regression task of information recovering in a quantum system. Let us consider an unknown initial product state , its total magnetization is given by
(9) |
Now let us consider a chaotic Hamiltonian
(10) |
where and are a set of randomly chosen parameters. We evolve with this Hamiltonian for sufficient long time to ensure a chaotic unitary dynamics, which yields . For QNN, the training dataset is taken as , where is taken as the total magnetization , and is the number of dataset. The loss function is taken as
(11) |
where is the readout of QNN given by Eq. 2 with input . In Fig. 3(a-b) we show how the loss function decreases as the training epoch increases. The trained QNN supposedly can recover the magnetization information of the initial state from the final state after a chaotic evolution.

The second task is a classification task of recognizing classical images. We take large numbers of RGB images with either a number or a number embedded in the background. Each image contains pixels. Considering a system with qubits, there are totally bases in the Hilbert space. A general wave function can be expanded in terms of these bases. Each pixel corresponds to a base, and the information of each pixel is encoded into the coefficient of its corresponding base RGB . In this way, for each image, we generate a wave function as input. The label is taken as if the image contains the number and if the image contains the number . The readout of the QNN is also given by Eq. 2 with the input . In this case, the loss function is taken as the cross-entropy between and , and since lies between , we define as such that it lies in the range of . Then the loss function is given by
(12) |
After leaning, we let the QNN to make predictions on a testing dataset . For each input , a trained QNN returns a prediction given by Eq. 2. Now we interpret the prediction as the number with if , and as the number with if . Then, we can obtain an accuracy as
(13) |
In Fig. 3(c-d) we also show how the accuracy increases as the training epoch increases.
The results shown in Fig. 3 have been averaged over a few runs with different initializations, and therefore, their differences mainly reflect the differences in learning efficiency between different architectures. In Fig. 3(a-b), we show that in the first task, for most training epochs, the loss function is ordered as . In Fig. 3(c-d), we show that in the second task, for most training epochs, the accuracy is ordered as . Both orders are consistent with the order of defined for different architectures. This means that for a fixed target loss value or prediction accuracy, the architecture with the largest can reach this target with the smallest training epoch. In this sense, we consider this architecture as the most efficient one. Therefore, these examples support our intuition of the positive correlation between scrambling ability and learning efficiency.
We also note that this correlation is most pronounced for intermediate training epochs and for intermediate depths of the QNN. This is because quantifies the scrambling ability of architectures with generic parameters, but for sufficiently long training, the QNN can always reach the optimal parameters. Also, for sufficiently deep QNN, all architectures with generic parameters can always lead to the most scrambled operators, whose size reaches the saturation value, as one can see from Fig. 2. Therefore, the differences in learning efficiency also become less significant, as one can see by comparing Fig. 3(b)(d) with (a)(c).
Outlook. To the best of our knowledge, this work is the first attempt to understand how to design the most efficient architectures in QNN. Our design principle is based on quantum information scrambling in a quantum circuit, described by the operator size growth. We propose a quantity to quantify the scrambling ability of a QNN architecture, which is based on how fast the size of a local operator grows under generic unitary transformations generated by the quantum circuit. We conjecture the positive correlation between this quantity and the learning ability of the QNN, and the conjecture is confirmed by two typical learning tasks. Our discussion is so far limited to the quantum version of fully connected neural networks, and in the future, it can be generalized to other quantum versions of neural networks, such as quantum convolutional neural networks QCNN1 ; QCNN2 ; QCNN3 , quantum recurrent neural networks QRNN1 ; QRNN2 , and quantum autoencoders QAE1 ; QAE2 ; QAE3 .
Acknowledgment. This work is supported by Beijing Outstanding Young Scientist Program, NSFC Grant No. 11734010, MOST under Grant No. 2016YFA0301600.
References
- (1) Ian Goodfellow, Yoshua Bengio, and Aaron Couville, Deep Learning (2016).
- (2) John Preskill, “Quantum computing in the NISQ era and beyond,” Quantum (2018).
- (3) Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, and Seth Lloyd, Q“uantum machine learning,” Nature 549, 195–202 (2017).
- (4) Marcello Benedetti, John Realpe-Gómez, Rupak Biswas, and Alejandro Perdomo-Ortiz, “Quantum-Assisted Learning of Hardware-Embedded Probabilistic Graphical Models,” Phys. Rev. X (2017).
- (5) E Torrontegui, and JJ García-Ripoll, “Unitary quantum perceptron as efficient universal approximator,” EPL (Europhysics Letters) 125, 30004 (2019).
- (6) Marcello Benedetti, Delfina Garcia-Pintos, Oscar Perdomo, Vicente Leyton-Ortega, Yunseong Nam, and Alejandro PerdomoOrtiz, “A generative modeling approach for benchmarking and training shallow quantum circuits,” npj Quantum Inf. 5, 45 (2019).
- (7) Edward Farhi, and Hartmut Neven, “Classification with Quantum Neural Networks on Near Term Processors,” arXiv:1802.06002.
- (8) Jarrod R McClean, Sergio Boixo, Vadim N Smelyanskiy, Ryan Babbush, and Hartmut Neven, “Barren plateaus in quantum neural network training landscapes,” Nat. Commun. 9, 4812 (2018).
- (9) K. Mitarai, M. Negoro, M. Kitagawa, and K. Fujii, “Quantum circuit learning,” Phys. Rev. A 98, 032309 (2018).
- (10) William Huggins, Piyush Patil, Bradley Mitchell, K Birgitta Whaley, and E Miles Stoudenmire, “Towards quantum machine learning with tensor networks,” Quantum Sci. Technol. 4, 024001 (2019).
- (11) Maria Schuld, Alex Bocharov, Krysta M. Svore, and Nathan Wiebe, “Circuit-centric quantum classifiers,” Phys. Rev. A 101, 032308 (2020).
- (12) Edward Grant, Marcello Benedetti, Shuxiang Cao, Andrew Hallam, Joshua Lockhart, Vid Stojevic, Andrew G Green, and Simone Severini, “Hierarchical quantum classifiers,” npj Quantum Inf. 4, 65 (2018).
- (13) Jin-Guo Liu and Lei Wang, “Differentiable learning of quantum circuit Born machines,” Phys. Rev. A 98, 062324 (2018).
- (14) Guillaume Verdon, Jason Pye, and Michael Broughton, “A Universal Training Algorithm for Quantum Deep Learning,” arXiv:1806.09729.
- (15) Jinfeng Zeng, Yufeng Wu, Jin-Guo Liu, Lei Wang, and Jiangping Hu, “Learning and inference on generative adversarial quantum circuits,” Phys. Rev. A 99, 052306 (2019).
- (16) Yuxuan Du, Min-Hsiu Hsieh, Tongliang Liu, and Dacheng Tao, “The Expressive Power of Parameterized Quantum Circuits,” arXiv:1810.11922.
- (17) Kerstin Beer, Dmytro Bondarenko, Terry Farrelly, Tobias J Osborne, Robert Salzmann, and Ramona Wolf, “Efficient Learning for Deep Quantum Neural Networks,” arXiv:1902.10445.
- (18) Matthew J. S. Beach, Roger G. Melko, Tarun Grover, and Timothy H. Hsieh, “Making trotters sprint: A variational imaginary time ansatz for quantum many-body systems,” Phys. Rev. B 100, 094434 (2019).
- (19) Stephen H. Shenker, and Douglas Stanford, “Black holes and the butterfly effect,” J. High Energy Phys. (2014).
- (20) Daniel A. Roberts, Douglas Stanford, and Leonard Susskind, “Localized shocks,” J. High Energy Phys. (2015).
- (21) Daniel A. Roberts, and Douglas Stanford, “Diagnosing chaos using four-point functions in two-dimensional conformal field theory,” Phys. Rev. Lett. (2015).
- (22) Juan Maldacena, Stephen H. Shenker, and Douglas Stanford, “A bound on chaos,” J. High Energy Phys. (2016).
- (23) Pavan Hosur, Xiao-Liang Qi, and Daniel Roberts, “Chaos in quantum channels,” J. High Energy Phys. (2016).
- (24) Ruihua Fan, Pengfei Zhang, Huitao Shen and Hui Zhai, “Out-of-Time-Order correlation for many-body localization,” Sci. Bulletin, 62(10), 707-711 (2016).
- (25) Mukund Rangamani, and Massimiliano Rota, “Entanglement structures in qubit systems,” J. Phys. A: Math. Theor. 48, 385301 (2015).
- (26) Alexei Kitaev, and John Preskill, “Topological entanglement entropy,” Phys. Rev. Lett. (2006).
- (27) Michael Levin, and Xiao-Gang Wen, “Detecting topological order in a ground state wave function,” Phys. Rev. Lett. (2006).
- (28) Christoph Sünderhauf, Lorenzo Piroli, Xiao-Liang Qi, Norbert Schuch, and J. Ignacio Cirac, “Quantum chaos in the Brownian SYK model with large finite N : OTOCs and tripartite information”, Journal of High Energy Physics, 2019, 38 (2019).
- (29) Daniel A. Roberts, Douglas Stanford, and Alexandre Streicher, “Operator growth in the SYK model,” J. High Energy Phys. (2018).
- (30) Adam Nahum, Sagar Vijay, and Jeongwan Haah, “Operator spreading in random unitary circuits,” Phys. Rev. X (2018).
- (31) C. W. von Keyserlingk, Tibor Rakovszky, Frank Pollmann, and S. L. Sondhi, “Operator hydrodynamics, OTOCs, and entanglement growth in systems without conservation laws,” Phys. Rev. X (2018).
- (32) Vedika Khemani, Ashvin Vishwanath, and David A. Huse, “Operator Spreading and the Emergence of Dissipative Hydrodynamics under Unitary Evolution with Conservation Laws,” Phys. Rev. X (2018).
- (33) Tibor Rakovszky, Frank Pollmann, and C. W. von Keyserlingk, “ Diffusive hydrodynamics of Out-of-Time-Order Correlators with Charge Conservation,” Phys. Rev. X (2018).
- (34) Xiao Chen, and Tianci Zhou, “Operator scrambling and quantum chaos,” arXiv: 1804.08655 (2018).
- (35) Andrew Lucas, “Operator Size at Finite Temperature and Planckian Bounds on Quantum Dynamics,” Phys. Rev. Lett. (2019).
- (36) Shenglong Xu, and Brian Swingle, “Locality, quantum fluctuations, and scrambling,” Phys. Rev. X. (2019).
- (37) Xiao-Liang Qi, and Alexandre Streicher, “Quantum epidemiology: operator growth, thermal effects and SYK,” J. High Energy Phys. (2019).
- (38) Shenglong Xu, and Brian Swingle, “Accessing scrambling using matrix product operators,” Nat. Phys. (2020).
- (39) Yuri D. Lensky, Xiao-Liang Qi, and Pengfei Zhang, “Size of bulk fermions in the SYK model,” J. High Energy Phys. (2020).
- (40) Huitao Shen, Pengfei Zhang, Yi-Zhuang You, and Hui Zhai, “Information scrambling in quantum neural networks,” Phys. Rev. Lett. (2020).
- (41) See the supplementary information for details of how to encode the information of a RGB image into a quantum wave function.
- (42) Iris Cong, Soonwon Choi, and Mikhail D. Lukin, “Quantum convolutional neural networks,” Nat. Phys. (2019).
- (43) Maxwell Henderson, Samriddhi Shakya, Shashindra Pradhan, and Tristan Cook,“Quanvolutional neural networks: powering image recognition with quantum circuits,” arXiv: 1904.04767 (2019).
- (44) Seunghyeok Oh, Jaeho Choi, and Joongheon Kim, “A tutorial on quantum convolutional neural networks (QCNN),” arXiv: 2009.09423 (2020).
- (45) Johannes Bausch, “Recurrent quantum neural networks,” arXiv: 2006.14619.
- (46) Laxmidhar Behera, Indrani Kar, and Avshalom C. Elitzur, “Recurrent quantum neural network and its applications,” The Emerging Physics of Consciousness (2006).
- (47) Jonathan Romero, Jonathan P. Olson, and Alan Aspuru-Guzik, “Quantum autoencoders for efficient compression of quantum data,” Quantum Sci. Technol. (2017).
- (48) Dmytro Bondarenko, and Polina Feldmann, “Quantum autoencoders to denoise quantum data,” Phys. Rev. Lett. (2020).
- (49) Alex Pepper, Nora Tischler, and Geoff J. Pryde, “Experimental realization of a quantum autoencoder: The compression of qutrits via machine learning,” Phys. Rev. Lett. (2019).
- (50) For supercube circuits (S), we set the last unit the same as the Hyperbolic unit Fig. 1(e). Other units are choosen such that the circuit repeats the structure of Fig.1(f) and each unit contains two-qubit gates. Such a structure eliminates redundant gates in and is found to be optimal for the operator size growth.