Neural network construction method and training method based on heterogeneous quantum computing resources
By constructing and training quantum neural networks in a heterogeneous quantum computing resource environment, the problem of resource limitations of a single quantum processor is solved, enabling efficient distributed training and expansion of quantum neural networks, and improving the applicability and performance of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU INNOVATION RES INST OF BEIJING UNIV OF AERONAUTICS & ASTRONAUTICS
- Filing Date
- 2026-03-23
- Publication Date
- 2026-07-03
Smart Images

Figure CN121902850B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of quantum machine learning and distributed intelligent computing technology, and more specifically, to a method for constructing and training neural networks based on heterogeneous quantum computing resources. Background Technology
[0002] With the continuous development of quantum computing theory and experimental techniques, quantum neural networks, as an important research direction at the intersection of quantum computing and artificial intelligence, have received widespread attention in tasks such as classification, regression, feature mapping, generative modeling, and combinatorial optimization approximation. A typical quantum neural network is usually composed of a parameterized quantum circuit (PQC), whose output is obtained by measuring quantum states, and the parameters of the quantum circuit are iteratively updated using classical optimization algorithms, thereby achieving quantum-classical hybrid training.
[0003] However, due to the current stage of quantum hardware development, quantum neural networks still face a series of key technical challenges in practical deployment and training. First, the number of qubits that can be stably used by a single quantum processor (QPU) is limited, making it difficult to support large-scale or deeply structured quantum neural network models, thus restricting their expressive power in high-dimensional data processing tasks. Second, different QPUs differ significantly in the number of qubits and qubit connection topology, exhibiting obvious heterogeneity in quantum hardware capabilities. This results in low efficiency in the utilization of quantum computing resources and increases the complexity of quantum neural network system design and implementation. Furthermore, traditional centralized quantum neural networks are highly dependent on a single QPU, with limited model scalability. When the model size or task complexity increases, quantum hardware resources easily become a performance bottleneck, failing to meet practical application requirements. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method for constructing and training neural networks based on heterogeneous quantum computing resources, so as to solve the problem that existing quantum computing neural networks are difficult to meet practical needs in deployment and training.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] In a first aspect, the present invention provides a method for constructing neural networks based on heterogeneous quantum computing resources, comprising:
[0007] The same classical feature extraction network is built on each quantum computing node;
[0008] Based on the number of available qubits in each quantum computing node, the output feature vector of the classical feature extraction network is masked to obtain local input features;
[0009] Construct a quantum neural network corresponding to each quantum computing node based on the number of available qubits at each quantum computing node;
[0010] The network parameters of the classical feature extraction network are shared equally among the quantum computing nodes, and the parameter prefixes of the quantum neural network are updated collaboratively among the quantum computing nodes.
[0011] The feature extraction network and quantum neural network corresponding to each quantum computing node are trained and global parameter aggregation and update alternately until the quantum neural network converges.
[0012] In an optional implementation, the step of constructing the same classical feature extraction network on each quantum computing node includes:
[0013] Let the set of available qubits for all quantum processors in the system node be:
[0014]
[0015] Among them, the The number of qubits available in the quantum processor corresponding to each node is: ;
[0016] The maximum number of qubits in the system is defined as:
[0017] ;
[0018] On each quantum computing node, a classical feature extraction network with an identical structure is constructed. Its input is the original data sample. The output is a length of Feature vectors:
[0019]
[0020] in, This represents the classic network parameters.
[0021] In an optional implementation, the step of masking the output feature vector of the classical feature extraction network to obtain local input features based on the number of available qubits at each quantum computing node includes:
[0022] For the Each node defines a mask operator:
[0023]
[0024] Among them, the former One element is 1, and the rest are 0;
[0025] node The input features of a quantum neural network are defined as follows:
[0026]
[0027] in Represents element-wise product, the first... The zero features thereafter will not be used as inputs to the quantum circuit, thus obtaining the local input features.
[0028] In an optional implementation, the step of constructing a quantum neural network corresponding to each quantum computing node based on the number of available qubits of each quantum computing node includes:
[0029] In the On the quantum computing node, constructing the ... Parameterized quantum circuitry matching the QPU capabilities of individual quantum computing nodes:
[0030]
[0031] in, The number of qubits As quantum feature input, These are trainable quantum parameters;
[0032] Quantum circuit output via measurement operator get:
[0033] ,
[0034] in, The results are used as predictions for classification or regression learning tasks.
[0035] In an optional implementation, the step of evenly distributing and sharing the network parameters of the classical feature extraction network across all the quantum computing nodes includes:
[0036] After a round of local training, each quantum computing node uploads the corresponding network parameters, and the central node or a specific quantum computing node acts as a coordination module to perform the computation equally.
[0037]
[0038] And The classical feature extraction network is broadcast to all quantum computing nodes for the next round of training.
[0039] In an optional implementation, the step of collaboratively updating the parameter prefixes of the quantum neural network across each of the quantum computing nodes includes:
[0040] Define the system's global quantum parameter vector:
[0041]
[0042] in With the maximum number of qubits correspond;
[0043] No. Each quantum computing node only maintains and updates the prefix parameter:
[0044] ;
[0045] During the aggregation update phase, for each parameter dimension Perform weighted or mean updates:
[0046]
[0047] in .
[0048] In an optional implementation, the step of alternately training and updating the feature extraction network and quantum neural network corresponding to each quantum computing node until the quantum neural network converges includes:
[0049] Each quantum computing node receives global classical parameters With quantum parameter prefix;
[0050] Each quantum computing node performs forward propagation locally:
[0051]
[0052] Each quantum computing node calculates its local loss function and performs local backpropagation;
[0053] Each quantum computing node updates its local classical and quantum parameters respectively;
[0054] Each quantum computing node performs classical parameter equal distribution aggregation and quantum parameter prefix aggregation;
[0055] Repeat the above steps until the quantum neural network converges.
[0056] Secondly, the present invention provides a neural network training method based on heterogeneous quantum computing resources, applied to quantum computing nodes, the method comprising:
[0057] Receive global classic parameters With quantum parameter prefix;
[0058] Local forward propagation is performed:
[0059]
[0060] Calculate the local loss function and perform local backpropagation;
[0061] Update the local classical and quantum parameters separately;
[0062] Perform classical parameter equal-distribution aggregation and quantum parameter prefix aggregation;
[0063] Repeat the above steps until the quantum neural network converges.
[0064] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to implement the neural network construction method based on heterogeneous quantum computing resources described in the first aspect.
[0065] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the neural network construction method based on heterogeneous quantum computing resources described in the first aspect.
[0066] The present invention provides a method for constructing and training a neural network based on heterogeneous quantum computing resources. Without relying on a single large-scale quantum processor, it realizes the distributed construction and efficient training of quantum neural networks in a heterogeneous quantum computing resource environment, which significantly improves the scalability, hardware adaptability and engineering feasibility of quantum neural network models.
[0067] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0068] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0069] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention is shown;
[0070] Figure 2 The diagram illustrates a flowchart of a neural network construction method based on heterogeneous quantum computing resources provided by an embodiment of the present invention.
[0071] Figure 3This diagram illustrates the principle of a neural network construction method based on heterogeneous quantum computing resources provided by an embodiment of the present invention.
[0072] Figure 4 This diagram illustrates a handwritten image classification example provided by an embodiment of the present invention.
[0073] Figure 5 This diagram illustrates the structure of a classic feature extraction network provided in an embodiment of the present invention.
[0074] Figure 6 A schematic diagram of a quantum neural network architecture provided by an embodiment of the present invention is shown;
[0075] Figure 7 A schematic diagram of an experimental result provided by an embodiment of the present invention is shown;
[0076] Figure 8 This diagram illustrates a distributed method result comparison provided by an embodiment of the present invention.
[0077] Figure 9 The diagram illustrates the classification accuracy of the distributed quantum neural network provided in each round according to an embodiment of the present invention.
[0078] icon:
[0079] 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication module. Detailed Implementation
[0080] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0081] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0082] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0083] Please refer to Figure 1 , Figure 1 This is a block diagram of an electronic device 100 provided in this embodiment. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0084] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0085] The processor 120 is used to read / write data or programs stored in the memory 110 and to perform corresponding functions.
[0086] The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.
[0087] It should be understood that, Figure 1 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 1The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0088] Please refer to Figure 2 , Figure 2 This embodiment provides a flowchart illustrating a method for constructing a neural network based on heterogeneous quantum computing resources. The method includes:
[0089] S210. Construct the same classical feature extraction network on each quantum computing node.
[0090] Please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating the principle of a neural network construction method based on heterogeneous quantum computing resources provided in this embodiment.
[0091] A quantum computing node is a quantum computing hardware and software unit that includes a quantum processor (QPU), quantum control circuits, a cooling system, classical interfaces, and an operating system. Among these, the QPU is the core hardware of quantum computing and is a physical device used to directly perform qubit operations.
[0092] In quantum computing networks, a single quantum computing node is often insufficient to meet the resource requirements of quantum computing. Therefore, multiple quantum computing nodes can be used to construct a quantum computing network. First, a classical feature extraction network with an identical structure is built on each quantum computing node to preprocess the input data and perform feature mapping. The output dimension of this classical feature extraction network is fixed to the maximum number of qubits supported by the entire system. This is to ensure compatibility with quantum neural networks of different sizes in the future.
[0093] S220. Based on the number of available qubits at each quantum computing node, the output feature vector of the classical feature extraction network is masked to obtain local input features.
[0094] Regarding the first A quantum computing node, based on its number of available qubits. The output feature vector of the classic feature extraction network is masked, retaining only the first few features. One dimension is used to identify the qubits, while the other dimensions are masked, thus obtaining local input features that strictly match the size of the qubits at that node.
[0095] S230. Construct a quantum neural network corresponding to each quantum computing node based on the number of available qubits of each quantum computing node.
[0096] Constructing its number of qubits at each node A compatible parameterized quantum neural network, which takes masked classical features as input and realizes sub-neural network inference through quantum state preparation, parameterized quantum gate operation and measurement process.
[0097] S240. The network parameters of the classical feature extraction network are shared equally among the quantum computing nodes, and the parameter prefixes of the quantum neural network are updated collaboratively among the quantum computing nodes.
[0098] During distributed training, the classic feature extraction networks at each node maintain a consistent structure, and their parameters are shared and synchronously updated among the nodes through an even distribution method. Specifically, after completing local training, each node uploads the classic network parameters to the central coordination module, where the parameters are averaged and then broadcast back to each node, thereby achieving globally consistent feature extraction capabilities.
[0099] To address the issue of inconsistent quantum neural network scales across different nodes, this invention employs a parameter prefix sharing mechanism: in the global parameter space, different nodes only share the parameter prefix portion within their implementable range. For the... Each node, only for the first One quantum parameter participates in aggregation and synchronous update, while the remaining higher-order parameters are maintained independently by nodes with larger qubits, thereby ensuring the physical feasibility of the parameter sharing process and the stability of training.
[0100] S250. Alternately train and update the feature extraction network and quantum neural network corresponding to each quantum computing node until the quantum neural network converges.
[0101] By alternately executing local quantum-classical hybrid training at each node and global parameter aggregation and updating, a closed-loop distributed optimization process is formed. This achieves collaborative training and convergence of the overall distributed quantum neural network while ensuring the physical executability of the quantum circuits at each node.
[0102] This embodiment realizes the distributed construction and efficient training of quantum neural networks in heterogeneous quantum computing resource environments without relying on a single large-scale quantum processor, significantly improving the scalability, hardware adaptability and engineering feasibility of quantum neural network models.
[0103] In one implementation, the step of constructing the same classical feature extraction network on each quantum computing node includes:
[0104] Let the set of available qubits for all quantum processors in the system node be:
[0105]
[0106] Among them, the The number of qubits available in the quantum processor corresponding to each node is: ;
[0107] The maximum number of qubits in the system is defined as:
[0108] ;
[0109] On each quantum computing node, a classical feature extraction network with an identical structure is constructed. Its input is the original data sample. The output is a length of Feature vectors:
[0110]
[0111] in, This represents the classic network parameters.
[0112] This classic network can take various forms, such as convolutional neural networks, fully connected networks, or Transformers; this invention does not limit its specific structure. Of course, this classic network can also be replaced with parameterized or fixed dimensionality reduction methods, as long as the output dimension is maintained. .
[0113] In one implementation, the step of masking the output feature vector of the classical feature extraction network to obtain local input features based on the number of available qubits at each quantum computing node includes:
[0114] For the Each node defines a mask operator:
[0115]
[0116] Among them, the former One element is 1, and the rest are 0;
[0117] node The input features of a quantum neural network are defined as follows:
[0118]
[0119] in Represents element-wise product, the first... The zero features thereafter will not be used as inputs to the quantum circuit, thus obtaining the local input features.
[0120] This embodiment enables all nodes to share a unified feature extraction capability, with each node only inputting feature dimensions compatible with its number of qubits to the quantum circuit.
[0121] In one embodiment, the step of constructing a quantum neural network corresponding to each quantum computing node based on the number of available qubits of each quantum computing node includes:
[0122] In the On the quantum computing node, constructing the ... Parameterized quantum circuitry matching the QPU capabilities of individual quantum computing nodes:
[0123]
[0124] in, The number of qubits As quantum feature input, These are trainable quantum parameters;
[0125] Quantum circuit output via measurement operator get:
[0126] ,
[0127] in, The results are used as predictions for classification or regression learning tasks.
[0128] QPU capability typically refers to the hardware computing power and execution capability of quantum computing, including: the number of effective qubits, quantum gate fidelity and coherence time, the depth and complexity of executable quantum circuits, and capabilities such as quantum parallel computing, quantum optimization, and quantum simulation.
[0129] In one embodiment, the step of evenly distributing and sharing the network parameters of the classical feature extraction network among the quantum computing nodes includes:
[0130] After a round of local training, each quantum computing node uploads the corresponding network parameters, and the central node or a specific quantum computing node acts as a coordination module to perform the computation equally.
[0131]
[0132] And The classical feature extraction network is broadcast to all quantum computing nodes for the next round of training.
[0133] This embodiment allows all nodes to share a unified feature representation space, unaffected by the heterogeneity of the number of qubits.
[0134] In one embodiment, the step of collaboratively updating the parameter prefixes of the quantum neural network across each of the quantum computing nodes includes:
[0135] Define the system's global quantum parameter vector:
[0136]
[0137] in With the maximum number of qubits correspond;
[0138] No. Each quantum computing node only maintains and updates the prefix parameter:
[0139] ;
[0140] During the aggregation update phase, for each parameter dimension Perform weighted or mean updates:
[0141]
[0142] in .
[0143] This embodiment enables all quantum parameters to be physically realized at the corresponding nodes, allowing large-scale quantum models to be trained collaboratively by multiple small-scale QPUs.
[0144] In one implementation, the step of alternately training and updating the feature extraction network and quantum neural network corresponding to each of the quantum computing nodes until the quantum neural network converges includes:
[0145] Each quantum computing node receives global classical parameters With quantum parameter prefix;
[0146] Each quantum computing node performs forward propagation locally:
[0147]
[0148] Each quantum computing node calculates its local loss function and performs local backpropagation;
[0149] Each quantum computing node updates its local classical and quantum parameters respectively;
[0150] Each quantum computing node performs classical parameter equal distribution aggregation and quantum parameter prefix aggregation;
[0151] Repeat the above steps until the quantum neural network converges.
[0152] Please refer to Figure 4 , Figure 4 This is a schematic diagram of a handwritten image classification example provided in this embodiment.
[0153] This embodiment selects the classification task of 0s and 1s in the MNIST handwritten digit dataset. The effectiveness of the proposed distributed quantum neural network method is determined by examining the classification accuracy of different methods under different training samples. Some handwritten images are shown below. Figure 4 As shown, the image size is 28×28.
[0154] First, determine the set of available qubits in each QPU node of the system; here, we set it to be [value missing]. The system, {6, 6, 5, 4, 4, 3}, contains 6 nodes and a total of 28 qubits. The maximum number of qubits is [missing information]. .
[0155] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of a classic feature extraction network provided in this embodiment.
[0156] Then, a classic feature extraction network with a consistent structure is built on each computing node. This can be constructed as a simple convolutional neural network, using 3×3 kernel convolutional layers, ReLU activation function, max pooling layer, 3×3 kernel convolutional layers, ReLU activation function, and average pooling layer, finally forming a linear layer. The network construction diagram is as follows. Figure 3 Such a classic network extracts 6-dimensional features from 28×28 image data.
[0157] To ensure compatibility with QPUs containing different numbers of qubits, the six features extracted from the classical network need to be masked.
[0158] Assume the features extracted by the network are Then the feature of the input containing only 3 bits is: .
[0159] Then, sub-quantum neural networks are constructed for each computing node. The input features can be obtained through... Rotary gates are used for encoding, while parameterized quantum circuits are constructed on each bit. and Rotating door, and constructing a linear double bit. The gate generates bit entanglement. Trainable quantum parameters. Quantity is
[0160]
[0161] in For similar structures, the number of layers is typically chosen to be 1 to speed up training. The choice of architecture between classical feature extraction networks and quantum neural networks is not specified in this invention; network structures with more parameters or stronger architectures can be selected.
[0162] Since this example focuses on a classification task, the quantum neural network uses Pauli-Z measurements, and only performs measurements on the first bit, which significantly reduces the measurement overhead. The constructed quantum neural network architecture is as follows: Figure 6 As shown, this illustrates the construction of nodes with different numbers of qubits and their combination with feature masks.
[0163] Allocate an equal number of QPU nodes to 6 different nodes However, different training datasets were used, while identical validation and test datasets were used, with each dataset containing 2000 samples. The batch size for all experiments was set to 64, the optimizer was Adam, the learning rate was 0.01, and the loss function was cross-entropy loss.
[0164] For training the distributed quantum neural network, multiple rounds of parameter aggregation and allocation were employed. The experiment consisted of five rounds, each with 40 epochs, and an early stopping mechanism was used. If the loss of a node's model validation set failed to decrease for 10 consecutive iterations in a round, the training iteration for that node was stopped early. After all models stopped iterating in a round, the classical feature extraction network used the even-sharing mechanism described in the scheme for parameter synchronization, while the quantum neural network used prefix sharing and collaborative parameter updates. After all parameter updates were completed, a new round of distributed model training began.
[0165] In addition to the experiment with distributed quantum neural networks for parameter aggregation, this case study also included three other comparative experiments:
[0166] 1. Quantum Neural Networks without Parameter Sharing and Aggregation (Acc Single Qum). Each computing node contains a quantum neural network that extracts classical networks and learns its own dataset independently, without exchanging information with each other.
[0167] 2. Distributed classical neural networks with even parameter sharing (Acc Combine Cls). This method adds an extra linear layer to the classical neural network used for feature extraction, increasing the maximum number of bits to dimension 2. Each computing node maintains a consistent classical network, learns its own dataset, and performs multiple rounds of parameter sharing, but the total number of parameters is still greater than that of distributed quantum neural networks.
[0168] 3. Classical neural networks that do not share or aggregate parameters (Acc Single Cls). Each computing node maintains consistency in its classical neural network, learning from its own dataset, but there is no parameter interaction between nodes.
[0169] In the four experiments, all experimental parameters were kept consistent except for parameter swapping to ensure fair comparison. The comparison metric was the classification accuracy on the same test set, and the experimental results were also examined with different numbers of training samples. The random numbers selected were 5, 10, 50, 100, and 500. Without fixing the random seed, each experiment was performed 5 times, and the mean classification accuracy and standard deviation of these experiments were obtained for different samples. The experimental results are presented in... Figure 7 and Figure 8 middle.
[0170] Figure 7 The results shown are from four different experiments. Figure 8 This shows two distributed methods (classical neural networks and quantum neural networks).
[0171] These results show that:
[0172] 1) Without parameter sharing, the quantum neural network at each node exhibits better classification accuracy compared to the classical neural network.
[0173] 2) After adding parameter sharing, the distributed quantum neural network exhibits the best classification accuracy. Even with very few training samples, the test accuracy can still exceed 96%, and the accuracy exceeds 99.5% with 500 training samples. While the accuracy of the classical neural network is greatly improved after adding distribution, it is still weaker than the distributed quantum neural network.
[0174] 3) The addition of distributed systems can effectively improve the performance of single points of interest due to the extra information provided.
[0175] at last, Figure 9 The paper demonstrates the classification accuracy of the distributed quantum neural network in each round. It can be seen that as the number of rounds of parameter exchange increases, the overall classification accuracy is continuously improved. At the same time, it shows a very small standard deviation in the 5th round, which indicates that each node has learned good parameters, even though the QPU architecture of each computing node is different.
[0176] In one embodiment, the present invention also provides a neural network training method based on heterogeneous quantum computing resources, applied to quantum computing nodes, the method comprising:
[0177] Receive global classic parameters With quantum parameter prefix;
[0178] Local forward propagation is performed:
[0179]
[0180] Calculate the local loss function and perform local backpropagation;
[0181] Update the local classical and quantum parameters separately;
[0182] Perform classical parameter equal-distribution aggregation and quantum parameter prefix aggregation;
[0183] Repeat the above steps until the quantum neural network converges.
[0184] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0185] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0186] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0187] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing neural networks based on heterogeneous quantum computing resources, characterized in that, include: The same classical feature extraction network is built on each quantum computing node; Based on the number of available qubits in each quantum computing node, the output feature vector of the classical feature extraction network is masked to obtain local input features; Construct a quantum neural network corresponding to each quantum computing node based on the number of available qubits at each quantum computing node; The network parameters of the classical feature extraction network are shared equally among the quantum computing nodes, and the parameter prefixes of the quantum neural network are updated collaboratively among the quantum computing nodes. The feature extraction network and quantum neural network corresponding to each quantum computing node are trained and global parameter aggregation and update alternately until the quantum neural network converges.
2. The method for constructing neural networks based on heterogeneous quantum computing resources according to claim 1, characterized in that, The step of constructing the same classical feature extraction network on each quantum computing node includes: Let the set of available qubits for all quantum processors in the system node be: Among them, the The number of qubits available in the quantum processor corresponding to each node is: ; The maximum number of qubits in the system is defined as: ; On each quantum computing node, a classical feature extraction network with an identical structure is constructed. Its input is the original data sample. The output is a length of Feature vectors: in, This represents the classic network parameters.
3. The method for constructing neural networks based on heterogeneous quantum computing resources according to claim 2, characterized in that, The step of masking the output feature vector of the classical feature extraction network to obtain local input features based on the number of available qubits at each quantum computing node includes: For the Each node defines a mask operator: Among them, the former One element is 1, and the rest are 0; node The input features of a quantum neural network are defined as follows: in Represents element-wise product, the first... The zero features thereafter will not be used as inputs to the quantum circuit, thus obtaining the local input features.
4. The method for constructing neural networks based on heterogeneous quantum computing resources according to claim 3, characterized in that, The step of constructing a quantum neural network corresponding to each quantum computing node based on the number of available qubits of each quantum computing node includes: In the On the quantum computing node, construct the connection with the first Parameterized quantum circuitry matching the QPU capabilities of individual quantum computing nodes: in, For the first The number of qubits available for a quantum processor corresponding to each node. As quantum feature input, These are trainable quantum parameters; Quantum circuit output via measurement operator get: , in, The results are used as predictions for classification or regression learning tasks.
5. The method for constructing neural networks based on heterogeneous quantum computing resources according to claim 4, characterized in that, The step of evenly distributing and sharing the network parameters of the classical feature extraction network among the quantum computing nodes includes: After a round of local training, each quantum computing node uploads the corresponding network parameters, and the central node or a specific quantum computing node acts as a coordination module to perform the computation equally. And The classical feature extraction network is broadcast to all quantum computing nodes for the next round of training.
6. The method for constructing neural networks based on heterogeneous quantum computing resources according to claim 5, characterized in that, The step of collaboratively updating the parameter prefixes of the quantum neural network across each of the quantum computing nodes includes: Define the system's global quantum parameter vector: in With the maximum number of qubits correspond; No. Each quantum computing node only maintains and updates the prefix parameter: ; During the aggregation update phase, for each parameter dimension Perform weighted or mean updates: in .
7. The method for constructing neural networks based on heterogeneous quantum computing resources according to claim 6, characterized in that, The step of alternately training and updating the feature extraction network and quantum neural network corresponding to each quantum computing node until the quantum neural network converges includes: Each quantum computing node receives global classical parameters With quantum parameter prefix; Each quantum computing node performs forward propagation locally: Each quantum computing node calculates its local loss function and performs local backpropagation; Each quantum computing node updates its local classical and quantum parameters respectively; Each quantum computing node performs classical parameter equal distribution aggregation and quantum parameter prefix aggregation; Repeat the above steps until the quantum neural network converges.
8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the neural network construction method based on heterogeneous quantum computing resources as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the neural network construction method based on heterogeneous quantum computing resources as described in any one of claims 1-7.
Citation Information
Patent Citations
Federal learning method based on quantum transfer learning
CN120975252A