Quantum convolutional neural network and design method of quantum convolutional neural network
A customizable quantum convolutional neural network with multiple encoding, convolution, and pooling modes, along with a training module, addresses the inefficiency of existing networks by optimizing for diverse tasks and data types, enhancing flexibility and accuracy.
Patent Information
- Application Number
- CN202411344258.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-25
AI Technical Summary
Existing quantum convolutional neural networks require customization for specific application scenarios, reducing overall efficiency and applicability of quantum computers due to differences in working principles between classical and quantum computers.
A quantum convolutional neural network with a quantum state encoding module, quantum convolution module, and quantum pooling module, supporting multiple encoding, convolution, and pooling modes, along with a training module to optimize the network based on loss comparison, enabling customization for different machine learning tasks and data types.
Enhances the flexibility and efficiency of quantum convolutional neural networks by allowing customization for various applications, improving prediction accuracy through iterative optimization.
Smart Images

Figure CN119250222A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of quantum computing, and more specifically, to a quantum convolutional neural network and a design method for a quantum convolutional neural network. Background Art
[0002] In the field of classical computers, convolutional neural networks have excellent performance in extracting feature information and are widely used in fields such as images, audio, and video. Compared with convolutional neural networks based on the limited computing power of classical computers, quantum convolutional neural networks based on quantum computers and using quantum computing are more efficient and faster, especially when processing complex data structures and performing specific types of computing tasks. Quantum convolutional neural networks are expected to show their unique advantages. However, in related technologies, different quantum convolutional neural networks are often required for different application scenarios, which reduces the overall efficiency and applicability of quantum computers. Summary of the invention
[0003] The present application provides a quantum convolutional neural network and a design method for a quantum convolutional neural network.
[0004] The embodiment of the present application provides a quantum convolutional neural network, which includes a quantum state encoding module, a quantum convolution module and a quantum pooling module;
[0005] The quantum state encoding module supports at least two encoding modes, and the quantum state encoding module is configured to map the characteristics of the input data into quantum state data characteristics corresponding to the selected encoding mode in response to the selected encoding mode;
[0006] The quantum convolution module supports at least two convolution modes, and the quantum convolution module is configured to perform convolution processing on the quantum state data feature in response to the selected convolution mode to obtain the convolution quantum state data feature corresponding to the selected convolution mode;
[0007] The quantum pooling module supports at least two pooling modes, and the quantum pooling module is configured to perform pooling processing on the convolutional quantum state data features in response to the selected pooling mode to obtain pooled quantum state data features, so as to obtain estimated data of the input data.
[0008] Thus, the quantum convolutional neural network provided in this application includes a quantum state encoding module, a quantum convolution module, and a quantum pooling module. Each module provides at least two ways of processing input data under the module, so that the quantum neural network can be customized for different machine learning tasks and data types, and a suitable quantum convolutional neural network can be formed according to user needs.
[0009] In some embodiments, the quantum convolutional neural network also includes a quantum convolutional neural network training module, which is configured to obtain a current loss based on the estimated data and the real output data corresponding to the input data, and optimize the quantum convolutional neural network based on the current loss and the target loss.
[0010] In this way, the quantum convolutional neural network also includes a quantum convolutional neural network training module, which is configured to obtain the current loss according to the estimated data and the real output data corresponding to the input data, and optimize the quantum convolutional neural network according to the current loss and the target loss. In this way, the quantum convolutional neural network also includes a convolutional neural network training module, which can process the obtained estimated data and the real output data to obtain the current loss. Based on the calculated current loss, the training module will use an optimization algorithm to optimize the quantum convolutional neural network to reduce the loss and improve the prediction accuracy of the model.
[0011] In some embodiments, the quantum convolutional neural network training module is configured to:
[0012] Obtaining the current loss according to the estimated data and the actual output data;
[0013] comparing the current loss to the target loss;
[0014] When the current loss does not meet the target loss, the quantum state encoding module is optimized.
[0015] In this way, the quantum convolutional neural network training module obtains the current loss based on the estimated data and the actual output data. And compares the current loss with the target loss. When the current loss does not meet the target loss, the quantum convolutional neural network training module optimizes the quantum state encoding module. In this way, the quantum convolutional neural network training module obtains the current loss, and based on the current loss and the target loss, determines the optimized quantum state encoding module.
[0016] In some embodiments, the quantum convolutional neural network training module is configured to:
[0017] Adjusting the quantum gate parameters in the selected encoding method to obtain an optimized encoding method;
[0018] The characteristics of the input data are mapped to the characteristics of the quantum state data according to the optimized encoding method.
[0019] In this way, the quantum convolutional neural network training module adjusts the quantum gate parameters in the selected encoding method to obtain an optimized encoding method. And maps the characteristics of the input data to the characteristics of the quantum state data according to the optimized encoding method. In this way, the quantum convolutional neural network training module optimizes the encoding method by adjusting the quantum gate parameters in the selected encoding method, and maps the input data to new quantum state data based on the optimized encoding method to obtain accurate estimation results and improve the accuracy of the quantum convolutional neural network.
[0020] In some embodiments, the quantum state encoding module supports at least two encoding modes among a single rotation gate local feature encoding mode, a CZ gate entanglement encoding mode and a CNOT gate encoding mode.
[0021] In this way, the quantum state coding module supports at least two coding methods among the single rotation gate local feature coding method, the CZ gate entanglement coding method and the CNOT gate coding method. In this way, the quantum state coding module provides at least two coding methods so that users can select the appropriate coding method according to their needs to adapt to different application scenarios.
[0022] In some embodiments, the quantum convolution module supports at least two convolution modes among a parameterized quantum convolution mode, a two-bit cascade structure convolution mode, a quantum ring convolution mode, and a two-bit nearest neighbor quantum convolution mode.
[0023] In this way, the quantum convolution module supports at least two convolution methods among the parameterized quantum convolution method, the two-bit cascade structure convolution method, the quantum ring convolution method and the two-bit nearest neighbor quantum convolution method. In this way, the quantum convolution module provides at least two convolution methods so that users can select the appropriate convolution method according to their needs to adapt to different application scenarios.
[0024] In some embodiments, the quantum pooling module supports at least two of the following pooling methods: a dual-bit quantum pooling method, a pooling method composed of parameterized quantum gates and CNOTs, a dual-bit bidirectional quantum pooling method, and a cascaded multi-bit quantum pooling method.
[0025] In this way, the quantum pooling module supports at least two pooling methods among the dual-bit quantum pooling method, the pooling method composed of parameterized quantum gates and CNOT, the dual-bit bidirectional quantum pooling method, and the cascaded multi-bit quantum pooling method. In this way, the quantum pooling module provides at least two pooling methods so that users can select the appropriate pooling method according to their needs to adapt to different application scenarios.
[0026] In some embodiments, the input data includes: image, natural language or audio data.
[0027] In this way, quantum convolutional neural networks can process a variety of data including images, natural language or audio data, and cope with a variety of different application scenarios.
[0028] The present application embodiment provides a method for designing a quantum convolutional neural network, the method comprising:
[0029] Providing a quantum state encoding module that supports at least two encoding modes, so as to map the characteristics of input data into quantum state data characteristics corresponding to the selected encoding mode according to the selected encoding mode;
[0030] Providing a quantum convolution module that supports at least two convolution modes, so as to perform convolution processing on the quantum state data feature according to the selected convolution mode to obtain a convolutional quantum state data feature corresponding to the selected convolution mode;
[0031] A quantum pooling module supporting at least two pooling modes is provided, so as to perform pooling processing on the convolutional quantum state data features according to the selected pooling mode to obtain pooled quantum state data features, so as to obtain estimated data of the input data.
[0032] In this way, the quantum convolutional neural network provides a quantum state encoding module that supports at least two encoding methods, so that according to the selected encoding method, the features of the input data are mapped to quantum state data features corresponding to the selected encoding method. Next, the quantum convolutional neural network provides a quantum convolution module that supports at least two convolution methods, so that according to the selected convolution method, the quantum state data features are convolved to obtain the convolutional quantum state data features corresponding to the selected convolution method. Finally, the quantum convolutional neural network provides a quantum pooling module that supports at least two pooling methods, so that according to the selected pooling method, the convolutional quantum state data features are pooled to obtain the pooled quantum state data features, so as to obtain the estimated data of the input data. In this way, a flexible quantum convolutional neural network is provided, which can customize quantum neural networks for different machine learning tasks and data types, and form suitable quantum convolutional neural networks according to user needs.
[0033] In certain embodiments, the method further comprises:
[0034] A quantum convolutional neural network training module is provided to obtain a current loss according to the estimated data and actual output data corresponding to the input data, and to optimize the quantum convolutional neural network according to the current loss and the target loss.
[0035] Thus, the method provides a quantum convolutional neural network training module to obtain the current loss according to the estimated data and the real output data corresponding to the input data, and optimize the quantum convolutional neural network according to the current loss and the target loss. In this way, through the iterative optimization process, the network can learn from the data and improve its prediction accuracy.
[0036] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0038] Figure 1 It is a schematic diagram of the structure of a quantum convolutional neural network according to an embodiment of the present application;
[0039] Figure 2 It is a schematic diagram of the structure of a quantum convolutional neural network according to an embodiment of the present application;
[0040] Figure 3 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0041] Figure 4 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0042] Figure 5 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0043] Figure 6 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0044] Figure 7 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0045] Figure 8 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0046] Fig. 9 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0047] Fig.10 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0048] Fig.11 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0049] Fig.12 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0050] Fig.13 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0051] Fig.14 is a circuit diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0052] Fig.15 It is a flow chart of the method of the implementation mode of the present application;
[0053] Fig.16 It is a flow chart of the method of the implementation mode of the present application;
[0054] Fig.17 is a schematic diagram of a quantum convolutional neural network according to an embodiment of the present application;
[0055] Fig.18 It is a schematic diagram of the training loss of the quantum convolutional neural network according to the implementation mode of the present application;
[0056] Fig.19 It is a schematic diagram of the training accuracy of the quantum convolutional neural network in the implementation mode of the present application. DETAILED DESCRIPTION
[0057] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0058] In the field of classical computers, a convolutional neural network is a feedforward neural network that uses the mathematical operation of convolution instead of matrix multiplication to extract features. It has excellent performance in extracting feature information and is widely used in many fields such as images, audio, and video. The core of a convolutional neural network is the convolution layer, which uses a set of learnable filters to scan input data to extract local features. In addition, the network also contains a pooling layer, which reduces the dimension of the data by aggregating statistics on features in local areas. Through the stacking combination of multiple convolutional layers and multiple pooling layers, convolutional neural networks have powerful modeling capabilities.
[0059] Compared with convolutional neural networks based on the limited computing power of classical computers, it is a network structure in quantum machine learning. By extending the design ideas of convolutional neural networks in the classical field to quantum variational circuits, a quantum version of the convolutional network is obtained. Quantum convolutional neural networks (QCNN), which are based on quantum computers and use quantum computing characteristics, theoretically have higher efficiency and speed potential. This is because quantum computers use the superposition and entanglement characteristics of quantum bits to process large amounts of information at the same time, which may enable more efficient computing modes than classical computing. Especially when processing complex data structures and performing specific types of computing tasks, quantum convolutional neural networks are expected to show their unique advantages.
[0060] However, in the relevant technical field, specific quantum convolutional neural networks (QCNN) are usually required to be designed for different application scenarios, which may reduce the overall efficiency and applicability of quantum computers. Since the working principle of quantum computers is completely different from that of classical computers, the design and optimization of quantum convolutional neural networks often need to be customized for specific problems. This customized design process may increase the complexity of developing and implementing quantum algorithms, thereby limiting the efficient application of quantum computers in a wide range of scenarios.
[0061] Based on the above questions, please refer to Figure 1 The embodiment of the present application provides a quantum convolutional neural network 100. The quantum convolutional neural network 100 includes a quantum state encoding module 10, a quantum convolution module 20 and a quantum pooling module 30.
[0062] The quantum state coding module 10 supports at least two coding modes, and the quantum state coding module 10 is configured to map the characteristics of the input data into quantum state data characteristics corresponding to the selected coding mode in response to the selected coding mode.
[0063] The quantum convolution module 20 supports at least two convolution modes. The quantum convolution module 20 is configured to perform convolution processing on the quantum state data features in response to the selected convolution mode to obtain the convolutionized quantum state data features corresponding to the selected convolution mode.
[0064] The quantum pooling module 30 supports at least two pooling modes. The quantum pooling module 30 is configured to perform pooling processing on the convolutional quantum state data features in response to the selected pooling mode to obtain pooled quantum state data features to obtain estimated data of the input data.
[0065] Specifically, the encoding method refers to the process of converting classical information into quantum state. The quantum state data feature refers to the information carried by the quantum state after the classical data is converted into the quantum state. The quantum state is the basic concept in quantum mechanics to describe the quantum system. It is an abstract mathematical object, usually represented by a wave function or density matrix, which is used to describe all possible states of the quantum system and their probabilities. The encoding method may include the single rotation gate local feature encoding method, the CZ gate entanglement encoding method, and the CNOT gate encoding method.
[0066] In the embodiment of the present application, the quantum state encoding module 10 can support at least two encoding modes among the single rotation gate local feature encoding mode, the CZ gate entanglement encoding mode and the CNOT gate encoding mode. After the user selects a suitable encoding mode according to his / her own needs, the quantum state encoding module 10 responds to the selected encoding mode and maps the features of the input data into quantum state data features corresponding to the selected encoding mode.
[0067] Convolution refers to the method of performing convolution operations on data in the fields of image processing, signal processing, and machine learning. Convolution is a mathematical operation that extracts local features of data by sliding a convolution kernel or filter over the data and calculating the weighted sum of the data within the window. Convolution methods may include parameterized quantum convolution, two-bit cascade structure convolution, quantum ring convolution, and two-bit nearest neighbor quantum convolution.
[0068] In the implementation manner of the present application, the quantum convolution module 20 can support at least two convolution methods of a parameterized quantum convolution method, a two-bit cascade structure convolution method, a quantum ring convolution method, and a two-bit nearest neighbor quantum convolution method. After the user selects a suitable convolution method according to his own needs, the quantum convolution module determines the convolution method used in response to the selected convolution method. When the quantum state data characteristics obtained by encoding by the quantum state encoding module 10 are transmitted to the quantum convolution module 20, the quantum convolution module 20 performs convolution processing on the quantum state data characteristics according to the selected convolution method to obtain the convolutionized quantum state data characteristics corresponding to the selected convolution method.
[0069] Pooling refers to the method of downsampling or reducing the dimension of data in the fields of image processing, signal processing and machine learning. Pooling is a commonly used data processing technology that improves computing efficiency and reduces overfitting by reducing the amount of data while retaining important information. Pooling methods can include dual-bit quantum pooling, pooling composed of parameterized quantum gates and CNOT, dual-bit bidirectional quantum pooling, and cascaded multi-bit quantum pooling.
[0070] In the implementation mode of the present application, the quantum pooling module 30 can support at least two pooling modes among a dual-bit quantum pooling mode, a pooling mode composed of a parameterized quantum gate and CNOT, a dual-bit bidirectional quantum pooling mode, and a cascaded multi-bit quantum pooling mode. After the user selects a suitable pooling mode according to his own needs, the quantum pooling module 30 determines the pooling mode used in response to the selected pooling mode. When the convolutional quantum state data features obtained by the quantum convolution module 20 are transferred to the quantum pooling module 30, the quantum pooling module 30 performs pooling processing on the convolutional quantum state data features according to the selected pooling mode to obtain the pooled quantum state data features to obtain the estimated data of the input data.
[0071] In summary, the quantum convolutional neural network of the embodiment of the present application includes a quantum state encoding module, a quantum convolution module and a quantum pooling module. Each module provides at least two ways of processing input data under the module. Thus, the quantum neural network can be customized for different machine learning tasks and data types, and a suitable quantum convolutional neural network can be formed according to user needs.
[0072] See also Figure 2 In some embodiments, the quantum convolutional neural network 100 further includes a quantum convolutional neural network training module 40. The quantum convolutional neural network training module 40 is configured to obtain the current loss according to the estimated data and the real output data corresponding to the input data, and optimize the quantum convolutional neural network according to the current loss and the target loss.
[0073] Specifically, estimated data is the prediction or estimate made by the model for new input data in machine learning or data science. In the implementation mode of the present application, it is used to indicate the result obtained after processing by quantum convolution using the encoding method, convolution method and pooling method selected by the user. The real output data refers to the known correct answer or target value corresponding to the input data in machine learning or data science. Target loss refers to the predefined or expected loss function value in machine learning and optimization problems, which represents an acceptable level of model performance.
[0074] In the implementation manner of the present application, the quantum convolutional neural network training module 40 can obtain the current loss based on the estimated data and the real output data corresponding to the input data, and optimize the quantum convolutional neural network based on the current loss and the target loss.
[0075] Thus, the quantum convolutional neural network 100 also includes a convolutional neural network training module 40, which can process the obtained estimated data and the actual output data to obtain the current loss. Based on the calculated current loss, the training module will use an optimization algorithm to optimize the quantum convolutional neural network 100 to reduce the loss and improve the prediction accuracy of the model.
[0076] In some embodiments, the quantum convolutional neural network training module 40 is configured to:
[0077] Get the current loss based on the estimated data and the actual output data;
[0078] Compare current loss to target loss;
[0079] When the current loss does not meet the target loss, the quantum state encoding module is optimized.
[0080] Specifically, Cross-Entropy Loss is a commonly used loss function, mainly used for classification problems, to quantify the difference between the predicted value and the true value. Adam optimizer (Adaptive MomentEstimation Optimizer) is an optimization algorithm used to train neural networks. Batch size refers to the number of data samples used to train the model in each iteration.
[0081] The quantum convolutional neural network training module 40 can obtain the current loss based on the estimated data and the actual output data obtained. In some embodiments, the current loss is calculated by combining the estimated data obtained with the actual output data to construct a cross entropy loss. Then, the quantum convolutional neural network training module 40 compares the obtained current loss with the desired target loss. Then, when the current loss does not meet the target loss, the Adam optimizer is used to set the learning rate and batch size batch size, and the quantum state encoding module 10 is optimized to train the quantum convolutional neural network 100.
[0082] In this way, the quantum convolutional neural network training module 40 obtains the current loss, and determines the optimized quantum state encoding module 10 based on the current loss and the target loss.
[0083] In some embodiments, the quantum convolutional neural network training module 40 is configured to:
[0084] Adjusting the quantum gate parameters in the selected encoding method to obtain an optimized encoding method;
[0085] The characteristics of the input data are mapped to quantum state data characteristics according to the optimized encoding method.
[0086] Specifically, when the current loss is obtained, the quantum convolutional neural network training module 40 can use the gradient calculation method in quantum computing to calculate the gradient of the current loss relative to the quantum gate parameters. The quantum convolutional neural network training module 40 then uses the optimization algorithm to update the quantum gate parameters in the selected encoding method based on the calculated gradient to obtain the optimized encoding method. And it can map the characteristics of the input data to the characteristics of the quantum state data according to the optimized encoding method.
[0087] In this way, the quantum convolutional neural network training module 40 optimizes the encoding method by adjusting the quantum gate parameters in the selected encoding method, and maps the input data into new quantum state data based on the optimized encoding method to obtain accurate estimation results, thereby improving the accuracy of the quantum convolutional neural network 100.
[0088] In some embodiments, the input data includes: images, natural language, or audio data.
[0089] Specifically, quantum convolutional neural networks are able to process a variety of data including images, natural language or audio data.
[0090] In this way, quantum convolutional neural networks can process multiple types of data, such as images, natural language or audio data, to achieve multimodal learning. In addition, due to the ability to process multiple types of data, quantum convolutional neural networks can be migrated and applied between different fields and tasks, increasing their versatility and flexibility.
[0091] In some embodiments, the quantum state encoding module 10 can support at least two encoding methods among a single rotation gate local feature encoding method, a CZ gate entanglement encoding method, and a CNOT gate encoding method.
[0092] Specifically, the quantum state coding module 10 in the quantum convolutional neural network 100 can process a variety of data including images, natural language or audio data, and cope with a variety of different application scenarios.
[0093] See also Figure 3 , Figure 3 The single revolving gate local feature encoding method shown is a local feature encoding method that maps simple data features to a quantum single revolving gate. The single revolving gate local feature encoding method uses an x revolving gate with parameters, and the parameters are encoded on the rotation angle. The single revolving gate local feature encoding method is relatively simple to operate, can quickly realize quantum encoding of data, and has low requirements for quantum hardware. However, the single revolving gate local feature encoding method is not sufficient to express complex data features. In this way, the single revolving gate local feature encoding method is suitable for scenarios where data features are relatively simple and computing resources are limited.
[0094] See also Figure 4 , Figure 4The CZ gate entanglement coding method shown is a coding method that introduces the CZ gate, which improves the expression ability through entanglement. The CZ gate entanglement coding method uses the CZ gate to entangle quantum bits in pairs based on the single rotation gate local feature coding method. The CZ gate can achieve entanglement between quantum bits and improve the richness of data representation. And the current hardware has good support for the CZ gate. However, compared with the single rotation gate local feature coding method, the CZ gate entanglement coding method has higher requirements for quantum hardware. And the introduction of entanglement operations will increase the complexity of coding. In this way, the CZ gate entanglement coding method is suitable for scenarios where more complex data features need to be expressed and quantum hardware supports CZ gates.
[0095] See also Figure 5 , Figure 5 The CNOT gate encoding method shown is an encoding method that introduces the CNOT gate. The CNOT gate can realize more complex quantum operations, including quantum logic gate operations between quantum bits, and has better expression ability. And the CNOT gate is also the cornerstone for building more complex quantum algorithms, which is suitable for a variety of quantum computing tasks. However, the CNOT gate is more complex than the CZ gate in hardware implementation and has higher requirements for quantum hardware. It also requires more quantum bits and more sophisticated quantum control. In this way, the CNOT gate encoding method is suitable for scenarios that need to perform complex quantum operations and have high requirements for the number of quantum bits and quantum control.
[0096] In this way, the quantum state coding module 10 provides at least two coding methods so that the user can select a suitable coding method according to needs to adapt to different application scenarios.
[0097] In some embodiments, the quantum convolution module 20 supports at least two convolution modes among a parameterized quantum convolution mode, a two-bit cascade structure convolution mode, a quantum ring convolution mode, and a two-bit nearest neighbor quantum convolution mode.
[0098] Specifically, see Figure 6 , Figure 6 The parameterized quantum convolution method shown is a simple feature extraction method that only performs local quantum convolution of parameterized quantum gates on each quantum bit. The parameterized quantum convolution method uses x-rotation gates and z-rotation gates with parameters, and the parameters are the rotation angles. The parameterized quantum convolution method only performs operations on a single quantum bit and is easy to implement. And the requirements for quantum hardware are relatively low. However, the operation of a single quantum bit may not be sufficient to extract complex features. In this way, the parameterized quantum convolution method is suitable for scenarios where data features are relatively simple and computing resources are limited.
[0099] See also Figure 7 , Figure 7The two-bit cascade structure convolution method shown uses an x rotation gate and a y rotation gate, and then uses a CNOT gate to entangle the quantum bits in pairs. The two-bit cascade structure convolution method can achieve more complex quantum operations. However, compared with more complex structures, the expression ability of the two-bit cascade structure convolution method may be insufficient. Compared with single quantum bit operations, the cascade structure increases the complexity of the operation. In this way, the two-bit cascade structure convolution method is suitable for scenarios where more complex data features need to be expressed and quantum hardware supports two-bit operations.
[0100] See also Figure 8 , Figure 8 The quantum ring convolution method shown uses x rotation gates and z rotation gates, and then uses CNOT gates to entangle quantum bits in pairs to form a ring topology, providing a richer quantum operation space. However, the quantum ring convolution method requires quantum hardware that supports ring topology. And the ring structure may require more sophisticated quantum control and optimization. In this way, the quantum ring convolution method is suitable for scenarios that need to perform complex quantum operations and have high requirements for the number of quantum bits and quantum control.
[0101] See also Fig. 9 , Fig. 9 The two-bit nearest neighbor quantum convolution method shown uses a z-rotation gate, a y-rotation gate, and then a controlled x-rotation gate to entangle the bits in pairs to form a two-bit nearest neighbor structure, which is relatively simple and easy to implement. The two-bit nearest neighbor quantum convolution method can model complex problems in a simulator environment. In this way, the two-bit nearest neighbor quantum convolution method is suitable for exploring the performance of quantum algorithms in a simulator environment, especially for pre-researching the capabilities of existing quantum hardware.
[0102] In this way, the quantum convolution module 20 provides at least two convolution modes, so that the user can select a suitable convolution mode according to the needs to adapt to different application scenarios.
[0103] See also Figure 8 In some embodiments, the quantum pooling module 30 supports at least two pooling methods among a dual-bit quantum pooling method, a pooling method composed of parameterized quantum gates and CNOTs, a dual-bit bidirectional quantum pooling method, and a cascaded multi-bit quantum pooling method.
[0104] Specifically, see Fig.10 , Fig.10 The dual-bit quantum pooling method shown uses a controlled x-rotating gate, which is a dual-bit quantum pooling module that shrinks layer by layer. The layer-by-layer shrinking structure is relatively simple and easy to implement. However, it may not be sufficient to process complex data features, and the layer-by-layer shrinking design may reduce the parallelism of the operation. In this way, the dual-bit quantum pooling method is suitable for scenarios that require high-fidelity processing and do not require high data feature expression.
[0105] The pooling method composed of parameterized quantum gates and CNOT is a pooling structure composed of parameterized quantum gates and CNOT. The combination of parameterized quantum gates and CNOT gates can provide more operational flexibility.
[0106] See also Fig.11 , Fig.11 A pooling structure composed of a parameterized quantum gate and a CNOT gate with a y rotation gate added to the control bit and a CNOT is shown. The parameterized quantum gate and the CNOT pooling structure can selectively retain or eliminate specific types of information by pooling only the control bit. However, the selection of the control bit and the pooling operation will increase the complexity of the calculation. In this way, the use of y rotation gates and CNOT gates, the parameterized quantum gates with a parameterized rotation gate added to the control bit and the CNOT pooling structure is suitable for scenarios that require precise control of the information processing process and do not require particularly high computing resources.
[0107] See also Fig.12 , Fig.12 A pooling structure composed of a parameterized quantum gate and a CNOT gate with a y rotation gate added to the controlled bit and a CNOT is shown. The parameterized quantum gate and the CNOT pooling structure can process specific types of data in a targeted manner by only pooling the controlled bit. However, pooling only the controlled bit cannot fully utilize all data features. In this way, the pooling structure composed of a parameterized quantum gate and a CNOT gate with a y rotation gate added to the controlled bit and a CNOT is suitable for scenarios where specific data features need to be refined and have certain requirements for computing efficiency.
[0108] See also Fig.13 , Fig.13 The dual-bit bidirectional quantum pooling method shown uses two CNOT gates to process two quantum bits of information at the same time, improving efficiency. Compared with the multi-bit structure, the dual-bit structure used in the dual-bit bidirectional quantum pooling method is relatively simple. However, the dual-bit bidirectional quantum pooling method is not enough to process very complex data features and is more suitable for processing simple or medium-complexity data. In this way, the dual-bit bidirectional quantum pooling method is suitable for scenarios where medium-complexity data needs to be processed and computing resources are limited.
[0109] See also Fig.14 , Fig.14 The cascaded multi-bit quantum pooling method shown uses multiple controlled parameterized x rotation gates to form a multi-bit cascade structure, providing a richer operating space. However, the implementation is complex and requires precise control of the operation of multiple quantum bits, which places high demands on quantum hardware. In this way, the cascaded multi-bit quantum pooling method is suitable for scenarios where complex data features need to be processed and quantum hardware supports multi-bit operations.
[0110] In this way, the quantum pooling module 30 provides at least two pooling modes, so that the user can select a suitable pooling mode according to the needs to adapt to different application scenarios.
[0111] See also Fig.15 The present application embodiment provides a method for designing a quantum convolutional neural network, the method comprising:
[0112] 011: providing a quantum state coding module supporting at least two coding modes, so as to map the characteristics of input data into quantum state data characteristics corresponding to the selected coding mode according to the selected coding mode;
[0113] 012: Provide a quantum convolution module that supports at least two convolution methods, so as to perform convolution processing on the quantum state data features according to the selected convolution method to obtain the convolution quantum state data features corresponding to the selected convolution method;
[0114] 013: Provide a quantum pooling module that supports at least two pooling methods, so as to perform pooling processing on the convolutional quantum state data features according to the selected pooling method to obtain pooled quantum state data features, so as to obtain estimated data of the input data.
[0115] Specifically, the quantum convolutional neural network provides a quantum state coding module that supports at least two encoding methods, so that according to the selected encoding method, the features of the input data are mapped to quantum state data features corresponding to the selected encoding method. Then, the quantum convolutional neural network provides a quantum convolution module that supports at least two convolution methods, so that according to the selected convolution method, the quantum state data features are convoluted to obtain the convolutional quantum state data features corresponding to the selected convolution method. Finally, the quantum convolutional neural network provides a quantum pooling module that supports at least two pooling methods, so that according to the selected pooling method, the convolutional quantum state data features are pooled to obtain the pooled quantum state data features, so as to obtain the estimated data of the input data. The quantum convolutional neural network obtained by the design method of the embodiment of the present application can refer to the explanation of the quantum convolutional neural network in the above embodiment, which will not be repeated here.
[0116] In this way, the quantum convolutional neural network obtained by the design method of the embodiment of the present application can provide at least two ways of processing input data under the module for different modules. Therefore, the quantum neural network can be customized for different machine learning tasks and data types, and a suitable quantum convolutional neural network can be formed according to user needs.
[0117] See also Fig.16 In some embodiments, the method further comprises:
[0118] 014: Provide a quantum convolutional neural network training module to obtain the current loss based on the estimated data and the actual output data corresponding to the input data, and optimize the quantum convolutional neural network based on the current loss and the target loss.
[0119] Specifically, the method provides a quantum convolutional neural network training module to obtain the current loss based on the estimated data and the actual output data corresponding to the input data, and optimize the quantum convolutional neural network based on the current loss and the target loss.
[0120] In this way, through an iterative optimization process, the network is able to learn from the data and improve its prediction accuracy.
[0121] The following is an example to illustrate the implementation of this application. The Mnist handwritten digit recognition dataset is a very basic and widely used dataset in the field of computer vision. Fig.17 First, the full process training and testing of the 0, 1 classification problem of the Mnist handwritten digit recognition dataset was used, and the image feature dimension was reduced by the self-encoding method, and then an 8-qubit quantum neural network was constructed. Since the test data used is the 0, 1 classification problem of the Mnist handwritten digit recognition dataset, the data features of the test data are relatively simple, so the single revolving door local feature encoding method in the quantum state encoding module 10 can be selected.
[0122] In addition, in order to make the data features finally learned more complex, the two-bit cascade structure convolution method in the quantum convolution module 20 can be selected, and the control bit in the quantum pooling module 30 can be selected as the parameterized quantum gate and the pooling structure composed of CNOT. In this way, the information processing flow can be accurately controlled to obtain more complex data features. The specific process of test data in the quantum convolution network is as follows, using a single rotation gate local feature encoding method to encode the feature data of the quantum neural network into quantum state data.
[0123] Then, the quantum state data is quantum convolution processed using a two-bit cascade structure convolution method, as well as quantum pooling operations of a parameterized quantum gate and a pooling structure composed of CNOT that controls the pooling of the control bits.
[0124] After that, we measure the prediction information of a single quantum bit and combine it with the label information of the data sample to construct the cross entropy loss. Then we use the Adam optimizer to set the learning rate to 1e-2 and the batch size to 25 to train the quantum neural network. After 200 iterations, the test accuracy of the model reaches 98.4%. Please refer to Fig.18 , Fig.19 In the above process, the evolution of the model training loss function with the number of training iterations step is as follows Fig.18 As shown in Figure 2, the verification accuracy changes with the number of training iterations. Fig.19 shown.
[0125] In the description of this specification, the descriptions with reference to the terms "specifically", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0126] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0127] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A quantum convolutional neural network, characterized in that: The quantum convolutional neural network includes a quantum state encoding module, a quantum convolution module and a quantum pooling module; The quantum state encoding module supports at least two encoding modes, and the quantum state encoding module is configured to map the characteristics of the input data into quantum state data characteristics corresponding to the selected encoding mode in response to the selected encoding mode; The quantum convolution module supports at least two convolution modes, and the quantum convolution module is configured to perform convolution processing on the quantum state data feature in response to the selected convolution mode to obtain the convolution quantum state data feature corresponding to the selected convolution mode; The quantum pooling module supports at least two pooling modes, and the quantum pooling module is configured to perform pooling processing on the convolutional quantum state data features in response to the selected pooling mode to obtain pooled quantum state data features, so as to obtain estimated data of the input data.
2. The quantum convolutional neural network according to claim 1, characterized in that The quantum convolutional neural network also includes a quantum convolutional neural network training module, which is configured to obtain a current loss based on the estimated data and the real output data corresponding to the input data, and optimize the quantum convolutional neural network based on the current loss and the target loss.
3. The quantum convolutional neural network according to claim 2, characterized in that The quantum convolutional neural network training module is configured as follows: Obtaining the current loss according to the estimated data and the actual output data; comparing the current loss with the target loss; When the current loss does not meet the target loss, the quantum state encoding module is optimized.
4. The quantum convolutional neural network according to claim 3, characterized in that The quantum convolutional neural network training module is configured as follows: Adjusting the quantum gate parameters in the selected encoding method to obtain an optimized encoding method; The characteristics of the input data are mapped to the characteristics of the quantum state data according to the optimized encoding method.
5. The quantum convolutional neural network according to claim 1, characterized in that The quantum state encoding module supports at least two encoding modes among a single rotation gate local feature encoding mode, a CZ gate entanglement encoding mode and a CNOT gate encoding mode.
6. The quantum convolutional neural network according to claim 1, characterized in that The quantum convolution module supports at least two convolution modes among a parameterized quantum convolution mode, a two-bit cascade structure convolution mode, a quantum ring convolution mode and a two-bit nearest neighbor quantum convolution mode.
7. The quantum convolutional neural network according to claim 1, characterized in that The quantum pooling module supports at least two pooling modes among a dual-bit quantum pooling mode, a pooling mode composed of parameterized quantum gates and CNOT, a dual-bit bidirectional quantum pooling mode, and a cascaded multi-bit quantum pooling mode.
8. The quantum convolutional neural network according to claim 1, characterized in that The input data includes: image, natural language or audio data.
9. A method for designing a quantum convolutional neural network as claimed in any one of claims 1 to 8, characterized in that: The method comprises: Providing a quantum state encoding module that supports at least two encoding modes, so as to map the characteristics of input data into quantum state data characteristics corresponding to the selected encoding mode according to the selected encoding mode; Providing a quantum convolution module that supports at least two convolution modes, so as to perform convolution processing on the quantum state data feature according to the selected convolution mode to obtain a convolutional quantum state data feature corresponding to the selected convolution mode; A quantum pooling module supporting at least two pooling modes is provided, so as to perform pooling processing on the convolutional quantum state data features according to the selected pooling mode to obtain pooled quantum state data features, so as to obtain estimated data of the input data.
10. The method for designing a quantum convolutional neural network according to claim 9, characterized in that: The method further comprises: A quantum convolutional neural network training module is provided to obtain a current loss according to the estimated data and actual output data corresponding to the input data, and to optimize the quantum convolutional neural network according to the current loss and the target loss.
Citation Information
Patent Citations
Quantum convolution operator
CN114764620A
Design method and system of quantum convolutional neural network based on quantum circuit
CN116341666A
Multi-classification method and device based on variable component calculation
CN116756663A
Text classification method and system based on multi-scale quantum convolutional neural network
CN117786110A
Quantum convolutional neural networks
US20210383189A1
