Quantum convolutional neural networks and design methods for quantum convolutional neural networks
By designing a quantum convolutional neural network that supports multiple encoding, convolution, and pooling methods, the problem of reduced efficiency and applicability of quantum computers in different application scenarios is solved, realizing a flexible quantum convolutional neural network that can adapt to multiple data types and improve prediction accuracy.
Patent Information
- Application Number
- CN202411344258.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2044-09-25
AI Technical Summary
In existing technologies, specific quantum convolutional neural networks need to be designed for different application scenarios, which reduces the overall efficiency and applicability of quantum computers.
A quantum convolutional neural network is provided, including a quantum state encoding module, a quantum convolution module, and a quantum pooling module. It supports at least two encoding, convolution, and pooling methods, and can customize the quantum neural network according to user needs. The model can be optimized through the quantum convolutional neural network training module.
It achieves the flexibility and adaptability of quantum convolutional neural networks, enabling them to handle multiple data types and improve the prediction accuracy and applicability of the model.
Smart Images

Figure CN119250222B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum computing, and more specifically, to a quantum convolutional neural network and a design method for quantum convolutional neural networks. Background Technology
[0002] In the realm of classical computing, convolutional neural networks (CNNs) excel at extracting feature information and are widely used in image, audio, and video processing. Compared to CNNs based on the limited computing power of classical computers, quantum CNNs, built on quantum computers and utilizing quantum computing, are more efficient and faster, especially in handling complex data structures and performing specific types of computational tasks, where they promise to demonstrate unique advantages. However, different applications often require different quantum CNNs, reducing the overall efficiency and applicability of quantum computers. Summary of the Invention
[0003] This application provides a quantum convolutional neural network and a design method for quantum convolutional neural networks.
[0004] This 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 methods. The quantum state encoding module is configured to map the features of the input data to quantum state data features corresponding to the selected encoding method in response to the selected encoding method.
[0006] The quantum convolution module supports at least two convolution modes. The quantum convolution module is configured to perform convolution processing on the quantum state data features in response to the selected convolution mode to obtain convolutional quantum state data features corresponding to the selected convolution mode.
[0007] The quantum pooling module supports at least two pooling modes. 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 the 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 methods for processing input data, thereby enabling the customization of quantum neural networks for different machine learning tasks and data types, and the construction of suitable quantum convolutional neural networks according to user needs.
[0009] In some embodiments, the quantum convolutional neural network further includes a quantum convolutional neural network training module, which is configured to obtain a current loss based on the actual output data corresponding to the predicted data and the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss.
[0010] Thus, the quantum convolutional neural network also includes a quantum convolutional neural network training module. This module is configured to obtain the current loss based on the actual output data corresponding to the predicted data and the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss. In this way, the quantum convolutional neural network also includes a convolutional neural network training module that can process the obtained predicted data and actual output data to obtain the current loss. Based on the calculated current loss, the training module uses optimization algorithms to optimize the quantum convolutional neural network to reduce the loss and improve the model's prediction accuracy.
[0011] In some implementations, the quantum convolutional neural network training module is configured as follows:
[0012] The current loss is obtained based on the estimated data and the actual output data;
[0013] Compare the current loss with the target loss;
[0014] If the current loss does not meet the target loss, optimize the quantum state encoding module.
[0015] Thus, the quantum convolutional neural network training module obtains the current loss based on the predicted data and the actual output data, and compares the current loss with the target loss. If 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 optimal quantum state encoding module.
[0016] In some implementations, the quantum convolutional neural network training module is configured as follows:
[0017] An optimized encoding scheme is obtained by adjusting the quantum gate parameters in the selected encoding scheme;
[0018] The features of the input data are mapped to the features of the quantum state data according to the optimized encoding method.
[0019] Thus, the quantum convolutional neural network training module adjusts the quantum gate parameters in the selected encoding scheme to obtain an optimized encoding scheme. Based on the optimized encoding scheme, it maps the features of the input data to quantum state data features. In this way, the quantum convolutional neural network training module optimizes the encoding scheme by adjusting the quantum gate parameters in the selected encoding scheme, and maps the input data to new quantum state data based on the optimized encoding scheme, thereby obtaining accurate prediction results and improving the accuracy of the quantum convolutional neural network.
[0020] In some implementations, the quantum state encoding module supports at least two of the following encoding methods: single-rotation gate local feature encoding, CZ gate entanglement encoding, and CNOT gate encoding.
[0021] Thus, the quantum state encoding module supports at least two encoding methods among single-rotation gate local feature encoding, CZ gate entanglement encoding, and CNOT gate encoding. This provides at least two encoding methods, allowing users to select the appropriate method based on their needs and adapt to different application scenarios.
[0022] In some implementations, the quantum convolution module supports at least two of the following convolution methods: parameterized quantum convolution, two-qubit cascaded structure convolution, quantum ring convolution, and two-qubit nearest neighbor quantum convolution.
[0023] Thus, the quantum convolution module supports at least two of the following convolution methods: parameterized quantum convolution, two-qubit cascaded structure convolution, quantum ring convolution, and two-qubit nearest neighbor quantum convolution. This provides at least two convolution methods, allowing users to select the appropriate method based on their needs and adapt to different application scenarios.
[0024] In some implementations, the quantum pooling module supports at least two of the following pooling methods: two-bit quantum pooling, pooling composed of parameterized quantum gates and CNOTs, two-bit bidirectional quantum pooling, and cascaded multi-bit quantum pooling.
[0025] Thus, the quantum pooling module supports at least two of the following pooling methods: two-qubit quantum pooling, pooling using parameterized quantum gates and CNOTs, two-qubit bidirectional quantum pooling, and cascaded multi-qubit quantum pooling. This provides at least two pooling methods, allowing users to select the appropriate method based on their needs and adapt to different application scenarios.
[0026] In some implementations, the input data includes: image, natural language, or audio data.
[0027] Thus, quantum convolutional neural networks can process a variety of data, including images, natural language, or audio data, to meet a wide range of different application scenarios.
[0028] This application provides a method for designing a quantum convolutional neural network, the method comprising:
[0029] A quantum state encoding module that supports at least two encoding methods is provided to map the features of input data to quantum state data features corresponding to the selected encoding method, based on the selected encoding method.
[0030] A quantum convolution module that provides support for at least two convolution modes is provided to perform convolution processing on the quantum state data features according to the selected convolution mode to obtain convolutional quantum state data features corresponding to the selected convolution mode.
[0031] A quantum pooling module that supports at least two pooling methods is provided 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 the estimated data of the input data.
[0032] Thus, the quantum convolutional neural network provides a quantum state encoding module that supports at least two encoding methods to map the features of the input data 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 to perform convolution processing on the quantum state data features according to the selected convolution method, obtaining 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 to perform pooling processing on the convolutional quantum state data features according to the selected pooling method, obtaining pooled quantum state data features to obtain the predicted data of the input data. This provides a flexible quantum convolutional neural network that can be customized for different machine learning tasks and data types, allowing for the construction of suitable quantum convolutional neural networks according to user needs.
[0033] In some embodiments, the method further includes:
[0034] A quantum convolutional neural network training module is provided to obtain a current loss based on the estimated data and the actual output data corresponding to the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss.
[0035] Thus, this method provides a quantum convolutional neural network training module to obtain the current loss based on the predicted data and the actual output data corresponding to the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss. Through this iterative optimization process, the network can learn from the data and improve its prediction accuracy.
[0036] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description
[0037] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein:
[0038] Figure 1 This is a schematic diagram of the structure of the quantum convolutional neural network according to an embodiment of this application;
[0039] Figure 2 This is a schematic diagram of the structure of the quantum convolutional neural network according to an embodiment of this application;
[0040] Figure 3 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0041] Figure 4 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0042] Figure 5 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0043] Figure 6 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0044] Figure 7 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0045] Figure 8 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0046] Figure 9 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0047] Figure 10 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0048] Figure 11 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0049] Figure 12 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0050] Figure 13 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0051] Figure 14 This is a circuit diagram of the quantum convolutional neural network according to an embodiment of this application;
[0052] Figure 15 This is a flowchart illustrating the method of an embodiment of this application;
[0053] Figure 16 This is a flowchart illustrating the method of an embodiment of this application;
[0054] Figure 17 This is a schematic diagram of a quantum convolutional neural network according to an embodiment of this application;
[0055] Figure 18 This is a schematic diagram of the training loss of the quantum convolutional neural network according to an embodiment of this application;
[0056] Figure 19 This is a schematic diagram illustrating the training accuracy of the quantum convolutional neural network according to an embodiment of this application. Detailed Implementation
[0057] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.
[0058] In classical computer science, convolutional neural networks (CNNs) are a type of feedforward neural network that uses convolutional operations instead of matrix multiplication to extract features. They exhibit excellent performance in feature extraction and are widely used in many fields, including image, audio, and video processing. The core of a CNN is the convolutional layer, which uses a set of learnable filters to scan the input data and extract local features. The network also includes pooling layers, which reduce the dimensionality of the data by aggregating and statistically analyzing features within local regions. Through the stacked combination of multiple convolutional and pooling layers, CNNs possess powerful modeling capabilities.
[0059] Compared to convolutional neural networks (CNNs) based on the limited computing power of classical computers, quantum convolutional neural networks are a type of network architecture used in quantum machine learning. By extending the design principles of classical CNNs to quantum variational circuits, a quantum version of CNNs is obtained. Quantum convolutional neural networks (QCNNs), based on quantum computers and utilizing the characteristics of quantum computing, theoretically possess higher efficiency and speed potential. This is because quantum computers, leveraging the superposition and entanglement properties of qubits, can process vast amounts of information simultaneously, potentially achieving computational modes more efficient than classical computing. Especially when dealing with complex data structures and performing specific types of computational tasks, quantum convolutional neural networks are expected to demonstrate unique advantages.
[0060] However, in related technological fields, specific quantum convolutional neural networks (QCNNs) often need to be designed for different application scenarios, which may reduce the overall efficiency and applicability of quantum computers. Because quantum computers operate fundamentally differently from classical computers, the design and optimization of quantum convolutional neural networks often require customization for specific problems. This customization process may increase the complexity of developing and implementing quantum algorithms, thus limiting the efficient application of quantum computers in a wide range of scenarios.
[0061] Based on the above issues, please refer to Figure 1 This 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 encoding module 10 supports at least two encoding methods. The quantum state encoding module 10 is configured to map the features of the input data to quantum state data features corresponding to the selected encoding method in response to the selected encoding method.
[0063] The quantum convolution module 20 supports at least two convolution modes. The quantum convolution module 20 is configured to perform convolution processing on quantum state data features in response to the selected convolution mode to obtain convolutional quantum state data features corresponding to the selected convolution mode.
[0064] The quantum pooling module 30 supports at least two pooling methods. The quantum pooling module 30 is configured to perform pooling processing on the convolutional quantum state data features in response to the selected pooling method to obtain pooled quantum state data features, so as to obtain the estimated data of the input data.
[0065] Specifically, encoding methods refer to the process of converting classical information into quantum states. Quantum state data characteristics refer to the information carried by the quantum state after the classical data is converted. A quantum state is a fundamental concept in quantum mechanics describing a quantum system; it is an abstract mathematical object, usually represented by a wave function or density matrix, used to describe all possible states of a quantum system and their probabilities. Encoding methods can include single-rotation gate local feature encoding, CZ-gate entanglement encoding, and CNOT-gate encoding, among others.
[0066] In this embodiment, the quantum state encoding module 10 supports at least two encoding methods among single-rotation gate local feature encoding, CZ gate entanglement encoding, and CNOT gate encoding. When the user selects a suitable encoding method according to their needs, the quantum state encoding module 10 responds to the selected encoding method by mapping the features of the input data to quantum state data features corresponding to the selected encoding method.
[0067] Convolution refers to the methods used in image processing, signal processing, and machine learning to perform convolution operations on data. Convolution is a mathematical operation that extracts local features from data by sliding a convolution kernel or filter across the data and calculating a weighted sum of the data within a window. Convolution methods can include parametric quantum convolution, two-qubit cascaded convolution, quantum ring convolution, and two-qubit nearest neighbor quantum convolution, among others.
[0068] In this embodiment, the quantum convolution module 20 supports at least two convolution methods selected from parameterized quantum convolution, two-qubit cascaded structure convolution, quantum ring convolution, and two-qubit nearest neighbor quantum convolution. When a user selects a suitable convolution method based on their needs, the quantum convolution module determines the convolution method to be used in response to the selected method. When the quantum state data features encoded 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 features according to the selected convolution method to obtain convolutional quantum state data features corresponding to the selected convolution method.
[0069] Pooling refers to the downsampling or dimensionality reduction operations performed on data in image processing, signal processing, and machine learning. Pooling is a commonly used data processing technique that improves computational efficiency and reduces overfitting by retaining important information while reducing data volume. Pooling methods can include two-qubit quantum pooling, pooling using parameterized quantum gates and CNOTs, two-qubit bidirectional quantum pooling, and cascaded multi-qubit quantum pooling, among others.
[0070] In this embodiment, the quantum pooling module 30 supports at least two of the following pooling methods: two-qubit quantum pooling, pooling composed of parameterized quantum gates and CNOTs, two-qubit bidirectional quantum pooling, and cascaded multi-qubit quantum pooling. When a user selects a suitable pooling method based on their needs, the quantum pooling module 30 determines the pooling method to be used in response to the selected method. When the convolutional quantum state data features obtained by the quantum convolution module 20 are transmitted 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 method to obtain pooled quantum state data features, thereby obtaining the predicted data of the input data.
[0071] In summary, the quantum convolutional neural network of this application includes a quantum state encoding module, a quantum convolution module, and a quantum pooling module. Each module provides at least two methods for processing input data. This allows for the customization of quantum neural networks for different machine learning tasks and data types, enabling the construction of suitable quantum convolutional neural networks according to user needs.
[0072] Please see 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 a current loss based on the actual output data corresponding to the predicted data and the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss.
[0073] Specifically, in machine learning or data science, predicted data refers to the predictions or estimates made by a model based on new input data. In this application's embodiments, it indicates the result obtained after processing by quantum convolution using user-selected encoding, convolution, and pooling methods. True output data refers to the known correct answer or target value corresponding to the input data in machine learning or data science. Target loss, in machine learning and optimization problems, typically refers to a predefined or expected loss function value, representing an acceptable level of model performance.
[0074] In this embodiment, the quantum convolutional neural network training module 40 can obtain the current loss based on the actual output data corresponding to the predicted data and 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 processes the obtained predicted data and actual output data to obtain the current loss. Based on the calculated current loss, the training module uses an optimization algorithm to optimize the quantum convolutional neural network 100 to reduce the loss and improve the model's prediction accuracy.
[0076] In some implementations, the quantum convolutional neural network training module 40 is configured as follows:
[0077] The current loss is obtained based on the estimated data and the actual output data;
[0078] Compare the current loss with the target loss;
[0079] Optimize the quantum state encoding module when the current loss does not meet the target loss.
[0080] Specifically, Cross-Entropy Loss is a commonly used loss function, primarily for classification problems, aiming to quantify the difference between predicted and true values. The Adam Optimizer (Adaptive Moment Estimation 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 obtained predicted data and the actual output data. In some embodiments, the current loss is calculated by combining the obtained predicted data and 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 expected target loss. If the current loss does not meet the target loss, the Adam optimizer is used to set the learning rate and batch size to optimize the quantum state encoding module 10 for training the quantum convolutional neural network 100.
[0082] Thus, the quantum convolutional neural network training module 40 obtains the current loss, and based on the current loss and the target loss, determines the optimal quantum state encoding module 10.
[0083] In some implementations, the quantum convolutional neural network training module 40 is configured as follows:
[0084] An optimized encoding scheme is obtained by adjusting the quantum gate parameters in the selected encoding scheme;
[0085] The input data features are mapped to quantum state data features based on the optimized encoding method.
[0086] Specifically, given the current loss, the quantum convolutional neural network training module 40 can use gradient calculation methods in quantum computing to calculate the gradient of the current loss with respect to the quantum gate parameters. Based on the calculated gradient, the quantum convolutional neural network training module 40 then uses an optimization algorithm to update the quantum gate parameters in the selected encoding scheme, obtaining an optimized encoding scheme. Furthermore, it can map the features of the input data to quantum state data features based on the optimized encoding scheme.
[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 to new quantum state data based on the optimized encoding method to obtain accurate prediction results and improve the accuracy of the quantum convolutional neural network 100.
[0088] In some implementations, the input data includes images, natural language, or audio data.
[0089] Specifically, quantum convolutional neural networks can process a variety of data, including images, natural language, or audio data.
[0090] Thus, quantum convolutional neural networks can process various types of data, such as images, natural language, or audio data, enabling multimodal learning. Furthermore, because they can handle multiple data types, quantum convolutional neural networks can be transferred and applied across different domains and tasks, increasing their versatility and flexibility.
[0091] In some implementations, the quantum state encoding module 10 can support at least two of the following encoding methods: single-rotation gate local feature encoding, CZ gate entanglement encoding, and CNOT gate encoding.
[0092] Specifically, the quantum state encoding module 10 in the quantum convolutional neural network 100 can process various types of data, including images, natural language, or audio data, to cope with a variety of different application scenarios.
[0093] Please see Figure 3 , Figure 3 The illustrated single-rotation-gate local feature encoding method maps simple data features to a quantum single-rotation gate. This method uses a parameterized x-rotation gate, with the parameters encoded into the rotation angle. While relatively simple to operate and capable of rapid quantum encoding of data, it has low requirements for quantum hardware. However, it is insufficient for representing complex data features. Therefore, single-rotation-gate local feature encoding is suitable for scenarios with relatively simple data features and limited computational resources.
[0094] Please see Figure 4 , Figure 4The illustrated CZ-gate entanglement coding scheme is an encoding method that introduces CZ gates to enhance expressive power through entanglement. Based on the single-rotation-gate local feature encoding scheme, the CZ-gate entanglement coding scheme uses CZ gates to entangle qubits pairwise. CZ gates can achieve entanglement between qubits, improving the richness of data representation. Furthermore, current hardware provides good support for CZ gates. However, compared to the single-rotation-gate local feature encoding scheme, the CZ-gate entanglement coding scheme places higher demands on quantum hardware. The introduction of entanglement operations also increases the complexity of the encoding. Therefore, the CZ-gate entanglement coding scheme is suitable for scenarios requiring the expression of more complex data features and where the quantum hardware supports CZ gates.
[0095] Please see Figure 5 , Figure 5 The illustrated CNOT gate encoding scheme is an encoding method that incorporates CNOT gates. CNOT gates can implement more complex quantum operations, including quantum logic gate operations between qubits, and offer better expressive power. Furthermore, CNOT gates are the cornerstone for building more complex quantum algorithms and are suitable for various quantum computing tasks. However, CNOT gates are more complex to implement than CZ gates, placing higher demands on quantum hardware. They also require more qubits and more precise quantum control. Therefore, the CNOT gate encoding scheme is suitable for scenarios that require complex quantum operations and have high requirements for the number of qubits and quantum control.
[0096] Thus, the quantum state encoding module 10 provides at least two encoding methods so that users can select the appropriate encoding method according to their needs and adapt to different application scenarios.
[0097] In some implementations, the quantum convolution module 20 supports at least two of the following convolution methods: parameterized quantum convolution, two-qubit cascaded structure convolution, quantum ring convolution, and two-qubit nearest neighbor quantum convolution.
[0098] Specifically, please refer to Figure 6 , Figure 6 The illustrated parameterized quantum convolution method is a simple feature extraction approach that performs local quantum convolution with parameterized quantum gates only on each qubit. This method uses parameterized x-rotation gates and z-rotation gates, where the parameter is the rotation angle. Because it operates only on a single qubit, it is easy to implement and has relatively low requirements for quantum hardware. However, operations on a single qubit may not be sufficient to extract complex features. Therefore, parameterized quantum convolution is suitable for scenarios with relatively simple data features and limited computational resources.
[0099] Please see Figure 7 , Figure 7The illustrated two-qubit cascaded convolutional structure uses x-rotation gates and y-rotation gates, and then uses CNOT gates to entangle the qubits pairwise. This two-qubit cascaded convolutional structure can implement more complex quantum operations. However, compared to more complex structures, its expressive power may be insufficient. Furthermore, compared to single-qubit operations, the cascaded structure increases the complexity of the operations. Therefore, the two-qubit cascaded convolutional structure is suitable for scenarios requiring the expression of more complex data features and where the quantum hardware supports two-qubit operations.
[0100] Please see Figure 8 , Figure 8 The illustrated quantum ring convolution method uses x-rotation gates and z-rotation gates, followed by CNOT gates to entangle qubits pairwise, forming a ring topology that provides a richer quantum operation space. However, the quantum ring convolution method requires quantum hardware that supports the ring topology. Furthermore, the ring structure may require more precise quantum control and optimization. Therefore, the quantum ring convolution method is suitable for scenarios that require complex quantum operations and have high requirements for the number of qubits and quantum control.
[0101] Please see Figure 9 , Figure 9 The illustrated two-bit nearest neighbor quantum convolution method uses z-rotation gates, y-rotation gates, and then a controlled x-rotation gate to entangle the bits pairwise, forming a relatively simple and easy-to-implement two-bit nearest neighbor structure. This method can model complex problems in a simulator environment. Therefore, the two-bit nearest neighbor quantum convolution method is suitable for exploring the performance of quantum algorithms in a simulator environment, especially for preliminary research on the capabilities of existing quantum hardware.
[0102] Thus, the quantum convolution module 20 provides at least two convolution methods so that users can select the appropriate convolution method according to their needs and adapt to different application scenarios.
[0103] Please see Figure 8 In some implementations, the quantum pooling module 30 supports at least two of the following pooling methods: two-bit quantum pooling, pooling composed of parameterized quantum gates and CNOTs, two-bit bidirectional quantum pooling, and cascaded multi-bit quantum pooling.
[0104] Specifically, please refer to Figure 10 , Figure 10 The illustrated two-qubit quantum pooling method uses a controlled x-rotation gate and is a layer-by-layer shrinking two-qubit quantum pooling module. The layer-by-layer shrinking structure is relatively simple and easy to implement. However, it may be insufficient for handling complex data features, and the layer-by-layer shrinking design may reduce the parallelism of operations. Thus, the two-qubit quantum pooling method is suitable for scenarios requiring high-fidelity processing and with less stringent requirements for data feature representation.
[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] Please see Figure 11 , Figure 11 This paper illustrates a pooling structure using a y-rotation gate, a CNOT gate, a parameterized quantum gate with a parametric rotation gate applied to the control bit, and a CNOT. This pooling structure, by pooling only the control bit, can selectively retain or eliminate specific types of information. However, the selection of the control bit and the pooling operation increase computational complexity. Therefore, the pooling structure using a y-rotation gate, a CNOT gate, a parameterized quantum gate with a parametric rotation gate applied to the control bit, and a CNOT is suitable for scenarios requiring precise control of information processing flow and where computational resource requirements are not particularly high.
[0107] Please see Figure 12 , Figure 12 This paper illustrates a pooling structure using a y-rotation gate, a CNOT gate, a parameterized quantum gate with a parameterized rotation gate applied to the controlled bit, and a CNOT. This pooling structure, by pooling only the controlled bit, can selectively process specific types of data. However, pooling only the controlled bit cannot fully utilize all data features. Therefore, the pooling structure using a y-rotation gate, a CNOT gate, a parameterized quantum gate with a parameterized rotation gate applied to the controlled bit, and a CNOT is suitable for scenarios requiring refined processing of specific data features and where computational efficiency is a concern.
[0108] Please see Figure 13 , Figure 13 The illustrated two-qubit bidirectional quantum pooling method uses two CNOT gates, enabling simultaneous processing of two qubits of information and improving efficiency. Compared to multi-qubit structures, the two-qubit structure used in the two-qubit bidirectional quantum pooling method is relatively simple. However, the two-qubit bidirectional quantum pooling method is insufficient for handling very complex data features and is more suitable for processing simple or moderately complex data. Thus, the two-qubit bidirectional quantum pooling method is suitable for scenarios that require processing moderately complex data and have limited computational resources.
[0109] Please see Figure 14 , Figure 14 The illustrated cascaded multi-qubit quantum pooling method uses multiple controlled parametric x-gates to form a cascaded multi-qubit structure, providing a richer operation space. However, its implementation is complex, requiring precise control of the operations of multiple qubits and placing high demands on quantum hardware. Therefore, the cascaded multi-qubit quantum pooling method is suitable for scenarios that require processing complex data characteristics and where the quantum hardware supports multi-qubit operations.
[0110] Thus, the quantum pooling module 30 provides at least two pooling methods so that users can select the appropriate pooling method according to their needs and adapt to different application scenarios.
[0111] Please see Figure 15 This application provides a method for designing a quantum convolutional neural network, the method comprising:
[0112] 011: A quantum state encoding module that provides support for at least two encoding methods, so as to map the features of the input data to quantum state data features corresponding to the selected encoding method according to the selected encoding method;
[0113] 012: A quantum convolution module that provides support for at least two convolution modes, so as to perform convolution processing on quantum state data features according to the selected convolution mode to obtain convolutional quantum state data features corresponding to the selected convolution mode;
[0114] 013: A quantum pooling module that provides support for at least two pooling methods to perform pooling processing on the features of convolutional quantum state data according to the selected pooling method to obtain pooled quantum state data features, so as to obtain the predicted data of the input data.
[0115] Specifically, the quantum convolutional neural network provides a quantum state encoding module supporting at least two encoding methods to map the features of the input data to quantum state data features corresponding to the selected encoding method. Next, the quantum convolutional neural network provides a quantum convolution module supporting at least two convolution methods to perform convolution processing on the quantum state data features according to the selected convolution method to obtain convolutional quantum state data features corresponding to the selected convolution method. Finally, the quantum convolutional neural network provides a quantum pooling module supporting at least two pooling methods to perform pooling processing on the convolutional quantum state data features according to the selected pooling method to obtain pooled quantum state data features, thereby obtaining the predicted data of the input data. The quantum convolutional neural network obtained through the design method of this application can be further explained in the above embodiments, and will not be repeated here.
[0116] Thus, the quantum convolutional neural network obtained through the design method of this application can provide at least two processing methods for the input data in different modules. This allows for the customization of quantum neural networks for different machine learning tasks and data types, enabling the construction of suitable quantum convolutional neural networks according to user needs.
[0117] Please see Figure 16 In some implementations, the method further includes:
[0118] 014: Provides a quantum convolutional neural network training module to obtain the current loss based on the predicted data and the real output data corresponding to the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss.
[0119] Specifically, this method provides a quantum convolutional neural network training module to obtain the current loss based on the predicted data and the real output data corresponding to the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss.
[0120] In this way, through the iterative optimization process, the network can learn from the data and improve its prediction accuracy.
[0121] The following example illustrates the implementation of this application. The MNIST handwritten digit recognition dataset is a very fundamental and widely used dataset in the field of computer vision. Please refer to... Figure 17 First, the entire training and testing process was performed using the 0-1 classification problem of the MNIST handwritten digit recognition dataset. An autoencoder was used to reduce the dimensionality of the image features, and then an 8-qubit quantum neural network was constructed. Since the test data used was the 0-1 classification problem of the MNIST handwritten digit recognition dataset, the data features of this test data are relatively simple, so the single-rotation-gate local feature encoding method in quantum state encoding module 10 can be selected.
[0122] Furthermore, to make the final learned data features more complex, the two-qubit cascaded convolution structure in quantum convolution module 20 can be selected, and the parameterized quantum gates and CNOT-based pooling structure composed of control bits in quantum pooling module 30 can also be selected. This allows for precise control of the information processing flow, resulting in more complex data features. The specific process of the test data in the quantum convolutional network is as follows: a single-rotation-gate local feature encoding method is used to encode the feature data of the quantum neural network into quantum state data.
[0123] Then, quantum convolution processing is performed on the quantum state data using a two-bit concatenated structure convolution method, and quantum pooling operation processing is performed on the parameterized quantum gate and the pooling structure composed of CNOT for pooling control bits.
[0124] Next, the predicted information obtained by measuring individual qubits is combined with the corresponding label information of the data samples to construct a cross-entropy loss. Then, the Adam optimizer is used to train the quantum neural network with a learning rate of 1e-2 and a batch size of 25. After 200 iterations, the model's test accuracy reached 98.4%. Please refer to [link to relevant documentation]. Figure 18 , Figure 19 The evolution of the model training loss function with the number of training iterations (step) in the above process is as follows: Figure 18 As shown, the validation accuracy changes with the number of training iterations. Figure 19 As shown.
[0125] In this specification, the terms "specifically," "furthermore," "particularly," "understandably," etc., refer to specific features, structures, materials, or characteristics described in connection with embodiments or examples that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0126] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0127] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this 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 methods. The quantum state encoding module is configured to map the features of the input data to quantum state data features corresponding to the selected encoding method in response to the selected encoding method. The input data includes image, natural language, or audio data. The quantum convolution module supports at least two convolution modes. The quantum convolution module is configured to perform convolution processing on the quantum state data features in response to the selected convolution mode to obtain convolutional quantum state data features corresponding to the selected convolution mode. The quantum pooling module supports at least two pooling modes. 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 the estimated data of the input data.
2. The quantum convolutional neural network according to claim 1, characterized in that, The quantum convolutional neural network further includes a quantum convolutional neural network training module, which is configured to obtain the current loss based on the actual output data corresponding to the predicted data and the input data, and to 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: The current loss is obtained based on the estimated data and the actual output data; Compare the current loss with the target loss; If 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: An optimized encoding scheme is obtained by adjusting the quantum gate parameters in the selected encoding scheme; The features of the input data are mapped to the features 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 of the following encoding methods: single-rotation gate local feature encoding, CZ gate entanglement encoding, and CNOT gate encoding.
6. The quantum convolutional neural network according to claim 1, characterized in that, The quantum convolution module supports at least two of the following convolution methods: parameterized quantum convolution, two-qubit cascaded structure convolution, quantum ring convolution, and two-qubit nearest neighbor quantum convolution.
7. The quantum convolutional neural network according to claim 1, characterized in that, The quantum pooling module supports at least two of the following pooling methods: two-bit quantum pooling, pooling composed of parameterized quantum gates and CNOTs, two-bit bidirectional quantum pooling, and cascaded multi-bit quantum pooling.
8. A design method for a quantum convolutional neural network as described in any one of claims 1-7, characterized in that, The method includes: A quantum state encoding module that supports at least two encoding methods is provided to map the features of input data to quantum state data features corresponding to the selected encoding method, wherein the input data includes image, natural language, or audio data. A quantum convolution module that provides support for at least two convolution modes is provided to perform convolution processing on the quantum state data features according to the selected convolution mode to obtain convolutional quantum state data features corresponding to the selected convolution mode. A quantum pooling module that supports at least two pooling methods is provided 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 the estimated data of the input data.
9. The design method of the quantum convolutional neural network according to claim 8, characterized in that, The method further includes: A quantum convolutional neural network training module is provided to obtain a current loss based on the estimated data and the actual output data corresponding to the input data, and to optimize the quantum convolutional neural network based on the current loss and the target loss.
Citation Information
Patent Citations
Text classification method and system based on multi-scale quantum convolutional neural network
CN117786110A
Quantum convolutional neural networks
US20210383189A1