Journal of Frontiers of Computer Science and Technology

• Science Researches •     Next Articles

Quantum neural network based on swap test and phase estimation

LI Panchi,  LIU Guangshuo   

  1. School of Computer and Information Technology, Northeast Petroleum University, Daqing, Heilongjiang 163318, China

由交换测试和相位估计构建的量子神经网络

李盼池,刘广硕   

  1. 东北石油大学 计算机与信息技术学院,黑龙江 大庆 163318

Abstract: To address the integration of quantum computing and neural computing, this paper investigates a quantum neural network (QNN) model and algorithm based on exchange tests. First, a quantum circuit for exchange tests with multi-qubit control is proposed, and a quantum neuron model is developed by combining this with phase estimation. The model uses quantum bits for inputs, weights, and outputs, where the phase of the weight qubits serves as the model parameters. Based on this quantum neuron, a QNN model is constructed, with measurements performed at the network's output to obtain real-valued outputs. Various quantum circuits associated with the network model are designed in detail, and the input-output relationships for each network layer are derived according to quantum computing theory. Additionally, a method for adjusting network parameters based on the gradient descent algorithm is thoroughly developed. Finally, simulations are conducted on a classical computer using planar point set recognition and handwritten digit binary classification. Although these simulations do not verify the parallelism of quantum computing, they do validate the model's execution effectiveness. The results show that the proposed model has a clear advantage in classification performance compared to a classical backpropagation (BP) neural network with the same parameter scale. This demonstrates that constructing QNN models based on multi-qubit exchange tests and phase estimation is both effective and feasible, offering a new perspective for future research on quantum neural networks.

Key words: quantum circuits, swap test, phase estimation, quantum neuron, quantum neural network

摘要: 针对量子计算和神经计算的融合问题,研究了一种基于交换测试和相位估计的量子神经网络模型及算法。首先提出了一种采用多比特控制的交换测试量子线路,在此基础上结合相位估计提出了一种量子神经元模型,该模型的输入、权重、输出均为量子比特,其中权重比特的相位为模型参数。然后基于量子神经元构建了量子神经网络模型,并在该模型的输出端执行测量,以获得网络的实值输出。文中详细设计了与网络模型相关的各种量子线路,根据量子计算理论导出了网络各层的输入输出关系,根据梯度下降算法,详细设计网络参数的调整方法。最后,在经典计算机上,以平面点集识别和手写体数字二分类问题为仿真对象,虽然不能验证量子计算的并行性,但能验证模型的执行效果。仿真结果表明,该模型的分类能力相较于同等参数规模的经典BP神经网络有明显优势,从而揭示出基于多比特交换测试和相位估计方法构建量子神经网络模型的研究方案是有效的可行的,可为量子神经网络研究提供一种新思路。

关键词: 量子线路, 交换测试, 相位估计, 量子神经元, 量子神经网络