Enhancing the expressivity of quantum neural networks with residual connections

Jingwei Wen,Zhiguo Huang,Dunbo Cai,Ling Qian
2024-01-29
Abstract:In the recent noisy intermediate-scale quantum era, the research on the combination of artificial intelligence and quantum computing has been greatly developed. Inspired by neural networks, developing quantum neural networks with specific structures is one of the most promising directions for improving network performance. In this work, we propose a quantum circuit-based algorithm to implement quantum residual neural networks (QResNets), where the residual connection channels are constructed by introducing auxiliary qubits to the data-encoding and trainable blocks of the quantum neural networks. Importantly, we prove that when this particular network architecture is applied to a $l$-layer data-encoding, the number of frequency generation forms can be extended from one, namely the difference of the sum of generator eigenvalues, to $\mathcal{O}(l^2)$. And the flexibility in adjusting the corresponding Fourier coefficients can also be improved due to the diversity of spectrum construction methods and the additional optimization degrees of freedom in the generalized residual operators. These results indicate that the residual encoding scheme can achieve better spectral richness and enhance the expressivity of various parameterized quantum circuits. Extensive numerical demonstrations in regression tasks of fitting various functions and applications in image classification with MNIST datasets are offered to present the expressivity enhancement. Our work lays the foundation for a complete quantum implementation of the classical residual neural networks and explores a new strategy for quantum feature map in quantum machine learning.
Quantum Physics
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: how to enhance the expressive power of quantum neural networks (QNNs) by introducing residual connections. Specifically, the author proposes an algorithm based on quantum circuits to implement quantum residual neural networks (QResNets), and constructs residual connection channels by introducing auxiliary qubits. This method aims to expand the number of frequency generation forms, from one spectral form in single - layer data encoding to \(O(l^2)\) spectral forms, where \(l\) is the number of data encoding layers. In addition, by increasing the diversity of spectral construction methods and the additional optimization degrees of freedom in the generalized residual operator, the flexibility of Fourier coefficients is improved, thereby enhancing the expressive power of parameterized quantum circuits. ### Main contributions: 1. **Propose quantum residual neural networks (QResNets)**: By introducing auxiliary qubits in data encoding and training blocks, residual connection channels are constructed. 2. **Expand frequency generation forms**: It is proved that when using the residual encoding scheme, the number of frequency generation forms can be expanded from one in single - layer data encoding to \(O(l^2)\), where \(l\) is the number of data encoding layers. 3. **Improve the flexibility of Fourier coefficients**: Through multiple spectral construction methods and additional optimization parameters in the generalized residual operator, the diversity of Fourier coefficients is increased. 4. **Numerical verification**: The enhanced expressive power is demonstrated through regression tasks and image classification tasks (such as handwritten digit recognition on the MNIST dataset). In particular, in function fitting tasks, the residual encoding scheme significantly improves the fitting accuracy of the model. ### Specific technical details: - **Implementation of quantum residual connections**: Quantum residual connections are implemented by introducing auxiliary qubits and control - gate operations. Specifically, the residual operator \(R(x/\theta)\) can be expressed as: \[ R(x/\theta)|\phi_0\rangle=\frac{1}{2}(\sigma_0^{\otimes n}+L(x/\theta))|\phi_0\rangle \] where \(\sigma_0\) is the identity matrix, and \(L(x/\theta)\) is the unified representation of gate operations in data encoding and training blocks. - **Enhancement of frequency spectra**: By introducing residual connections, the forms of frequency spectra become more abundant. For single - layer data encoding, the frequency spectrum can be expanded as: \[ \Omega_R^{l = 1}=\{w_k - w_j,\pm w_k\mid j,k\in[d]\} \] For multi - layer data encoding, the number of frequency combination forms can reach \(O(l^2)\). - **Measurement scheme**: To obtain the expected value of the observable \(O\), a new observation operator \(\bar{O}=|0\rangle\langle0|\otimes O\) is introduced, and the residual loss function is calculated by measuring the output state \(\phi_f\) of the system. ### Numerical experiment results: - **Function fitting tasks**: By fitting functions with different spectra, the superiority of the residual encoding scheme over the traditional encoding scheme is demonstrated. For example, for the multi - frequency function \(y_2(x)\), the mean square error (MSE) of the traditional encoding scheme is 0.09, while the MSE of the model using the residual feature map \(R(x)\) operator is only \(2.1\times10^{-3}\). - **Image classification tasks**: In handwritten digit recognition on the MNIST dataset, the accuracy of the model using the residual encoding scheme is more than 7% higher than that of the traditional encoding scheme. In conclusion, this paper significantly enhances the expressive power and fitting performance of quantum neural networks by introducing residual connections, providing a new strategy for the development of quantum machine learning.