CN116366250A - Quantum federal learning method and system - Google Patents

Quantum federal learning method and system Download PDF

Info

Publication number
CN116366250A
CN116366250A CN202310645770.0A CN202310645770A CN116366250A CN 116366250 A CN116366250 A CN 116366250A CN 202310645770 A CN202310645770 A CN 202310645770A CN 116366250 A CN116366250 A CN 116366250A
Authority
CN
China
Prior art keywords
quantum
vqc
computing node
model
quantum computing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310645770.0A
Other languages
Chinese (zh)
Other versions
CN116366250B (en
Inventor
李亚麟
张晓星
高站勇
邵烽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Weizhi Quantum Technology Co ltd
Original Assignee
Jiangsu Weizhi Quantum Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Weizhi Quantum Technology Co ltd filed Critical Jiangsu Weizhi Quantum Technology Co ltd
Priority to CN202310645770.0A priority Critical patent/CN116366250B/en
Publication of CN116366250A publication Critical patent/CN116366250A/en
Application granted granted Critical
Publication of CN116366250B publication Critical patent/CN116366250B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Electromagnetism (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Optical Communication System (AREA)

Abstract

The invention discloses a quantum federal learning method and a system, and the technical scheme is as follows: the method comprises the following specific steps: s101: initializing global parameters theta_0 by fusion computing nodes, encrypting the initialized global parameters by using a public key of the quantum computing nodes, and then sending the encrypted global parameters to the corresponding quantum computing nodes; s102: the quantum computing node decrypts the received encrypted information by using the private key of the quantum computing node to obtain theta_0, initializes a local variable component sub-circuit VQC model by using the theta_0, and performs the following steps of: in the t+1st cycle iteration process, for each quantum computing node, executing the following computing steps, wherein the initial value of t is 0; s103: when the VQC model converges, stopping S102 the iterative process to obtain a trained VQC model, and the method has the beneficial effects that: the privacy of each party is guaranteed, the method has higher performance, the convergence speed can be increased, and the communication cost is further reduced.

Description

Quantum federal learning method and system
Technical Field
The invention relates to the technical field of federal learning, in particular to a quantum federal learning method and system.
Background
The federal learning is a distributed machine learning technology, the core idea is that distributed model training is performed among a plurality of data sources with local data, under the premise that local individual or sample data does not need to be exchanged, a global model based on virtual fusion data is built only by exchanging model parameters or intermediate results, so that balance of data privacy protection and data sharing calculation is realized, quantum calculation is an emerging calculation mode, data calculation is realized based on superposition entanglement of quantum states and the like, compared with a classical calculation mode, the calculation speed is greatly accelerated, the method has very high application potential, VQC (variational quantum circuit, variable component sub-line) is a quantum calculation line model containing parameters and is used for realizing variable component sub-algorithms (VQA, variational quantum algorithm), and the method can obtain practical quantum lines through training parameters similar to machine learning.
On the one hand, all the existing quantum computing nodes are not willing to share private data with other parties, on the other hand, the computing data of quantum computing is quantum state data, and the quantum state data is shared through a quantum channel, so that the problems of high cost and low efficiency are solved.
Disclosure of Invention
Therefore, the invention provides a quantum federal learning method and a system, which are used for solving the problems of high cost and low efficiency.
In order to achieve the above object, the present invention provides the following technical solutions: a quantum federal learning method, comprising:
s101: fusion computing node initializing global parameters
Figure SMS_1
And encrypting the initialized global parameters by using the public key of the quantum computing node and then sending the encrypted global parameters to the corresponding quantum computing node.
S102: the quantum computing node decrypts the received encrypted information by using the private key of the quantum computing node to obtain
Figure SMS_2
By using
Figure SMS_3
Initializing a local variable component sub-line (VQC) model, and executing the following steps of:
in the t+1st cycle iteration process, for each quantum computing node, executing the following computing steps, wherein the initial value of t is 0;
s1021, inputting the local training data into a local VQC model to obtain an output result;
s1022, updating the local parameters based on the output result by using the following gradient descent formula
Figure SMS_4
Figure SMS_5
wherein ,
Figure SMS_6
representing parameters obtained after the t-th iteration of the ith quantum computing node,/for>
Figure SMS_7
Learning step length of the i-th quantum computing node, < ->
Figure SMS_8
Calculating a pseudo-inverse matrix corresponding to the node for the ith quantum,>
Figure SMS_9
gradient representing loss function of VQC model in the ith quantum computation node, +.>
Figure SMS_10
Representing the loss function of the VQC model in the ith quantum computation node, +.>
Figure SMS_11
N is the number of quantum computing nodes;
s1023 each quantum computing node utilizes public key
Figure SMS_12
For get->
Figure SMS_13
Encrypted +.>
Figure SMS_14
The encryption information is sent to the fusion computing node, and the fusion computing node calculates encryption information of the global parameter based on the homomorphic encryption principle, specifically as follows:
Figure SMS_15
wherein ,
Figure SMS_16
weight representing the ith quantum computation node, +.>
Figure SMS_17
Calculating parameters of the node after t+1st iteration training for the ith quantum, +.>
Figure SMS_18
Fusion calculation global parameters after t+1 times of iterative training,/>
Figure SMS_19
Representing an encryption function having homomorphic properties;
s1024, fusing computing nodes to
Figure SMS_20
Sent to each quantum computing node, each quantum computing node uses private key->
Figure SMS_21
Decrypting it to get the global parameter->
Figure SMS_22
And uses the global parameter +.>
Figure SMS_23
Updating its own VQC model, returning to S1021 to enter executionPerforming next iteration;
s103: and when the VQC model converges, stopping S102 the iterative process to obtain a trained VQC model.
Preferably, the loss function in the step S1022 is a square loss function or a cross entropy loss function.
Preferably, in step S102, the VQC model includes an encoding module, a parameter-free sub-calculation module and a parameter-containing sub-calculation module, and the parameter-free sub-calculation module and the parameter-containing sub-calculation module form a quantum calculation layer.
Preferably, the encoding module comprises a RY gate acting on each qubit in the VQC model.
Preferably, the non-parametric sub-computation module comprises a CNOT gate acting on qubits in the VQC model.
Preferably, the parametric sub-computation module comprises at least one of an RX gate, an RY gate and an RZ gate for acting on qubits in the VQC model.
The quantum federation learning system comprises a fusion computing node 110, a first quantum computing node 121, a second quantum computing node 122 and a third quantum computing node 123, wherein the fusion computing node is a server for realizing classical computation, the quantum computing node is a quantum computer, the fusion computing node and the quantum computing node are communicated through classical channels, the number of the fusion computing nodes is 1, and the number of the quantum computing nodes is a plurality;
the fusion computing node is a third party and is used for carrying out fusion computation on the update parameters sent by each quantum computing node to obtain global update parameters, the quantum computing nodes have local training data and are used for training the variable component sub-circuits VQC of the quantum computing nodes by utilizing the training data, the VQC model of each quantum computing node is the same,
for each quantum computing node, it has the same public key
Figure SMS_24
And private key->
Figure SMS_25
The embodiment of the invention has the following advantages:
1. the quantum federation learning framework is that after the local data is utilized by each quantum computing node to update parameters, the parameters are sent to the fusion computing node to calculate global variables, and then the local model is updated by returning each quantum computing node, wherein the fusion computing node can only acquire encrypted parameter information, and each computing node does not have parameter information of other quantum computing nodes even though sharing a public key and a private key, so that each party cannot directly acquire parameters of other parties, and privacy of each party is further ensured;
2. compared with the traditional gradient descent algorithm such as a random gradient descent algorithm (SGD), the adopted gradient descent algorithm has higher performance, can accelerate convergence speed, further reduces communication cost, updates global parameters by a fusion calculation method adopted by the fusion calculation nodes, can comprehensively utilize the parameters of each quantum calculation node, accelerates global training speed, utilizes homomorphic encryption, ensures that the parameters of each quantum calculation node are not known by the fusion calculation nodes, and ensures smooth fusion calculation.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It will be apparent to those of ordinary skill in the art that the drawings in the following description are exemplary only and that other implementations can be obtained from the extensions of the drawings provided without inventive effort.
The structures, proportions, sizes, etc. shown in the present specification are shown only for the purposes of illustration and description, and are not intended to limit the scope of the invention, which is defined by the claims, so that any structural modifications, changes in proportions, or adjustments of sizes, which do not affect the efficacy or the achievement of the present invention, should fall within the ambit of the technical disclosure.
FIG. 1 is a schematic diagram of an overall system architecture provided by the present invention;
FIG. 2 is a diagram of a VQC model provided by the invention;
FIG. 3 is a second VQC model diagram provided by the invention;
FIG. 4 is a third view of the VQC model provided by the present invention;
FIG. 5 is a diagram of a VQC model provided by the invention.
In the figure: 110. fusing the computing nodes; 121. quantum computing node one; 122. quantum computing node II; 123. and a quantum computing node III.
Detailed Description
Other advantages and advantages of the present invention will become apparent to those skilled in the art from the following detailed description, which, by way of illustration, is to be read in connection with certain specific embodiments, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The VQC model is used to perform specific quantum calculations. Quantum computing is performed by quantum computers, which in general are of mixed structure, comprising two major parts: part of the computers are classical computers and are responsible for performing classical computation and control; the other part is quantum equipment, which is responsible for running quantum programs so as to realize quantum computation. The quantum program is a series of instruction sequences written by quantum language and capable of running on a quantum computer, so that the support of quantum logic gate operation is realized, and finally, quantum calculation is realized. Specifically, the quantum program is a series of instruction sequences for operating the quantum logic gate according to a certain time sequence.
In practical applications, quantum computing simulations are often required to verify quantum algorithms, quantum applications, etc., due to the development of quantum device hardware. Quantum computing simulation is a process of realizing simulated operation of a quantum program corresponding to a specific problem by means of a virtual architecture (namely a quantum virtual machine) built by resources of a common computer. In general, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program, namely the program for representing the quantum bit and the evolution thereof written in the classical language, wherein the quantum bit, the quantum logic gate and the like related to quantum computation are all represented by corresponding classical codes.
Quantum circuits, which are one embodiment of quantum programs and weigh sub-logic circuits as well, are the most commonly used general quantum computing models, representing circuits that operate on qubits under an abstract concept, and their composition includes qubits, circuits (timelines), and various quantum logic gates, and finally the result often needs to be read out through quantum measurement operations.
Unlike conventional circuits, which are connected by metal lines to carry voltage or current signals, in a quantum circuit, the circuit can be seen as being connected by time, i.e., the state of the qubit naturally evolves over time, as indicated by the hamiltonian operator, during which it is operated until a logic gate is encountered.
One quantum program is corresponding to one total quantum circuit, and the quantum program refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits of the quantum program. It can be understood that: one quantum program may consist of a quantum circuit, a measurement operation for the quantum bits in the quantum circuit, a register to hold the measurement results, and a control flow node (jump instruction), and one quantum circuit may contain several tens of hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process of executing all quantum logic gates according to a certain time sequence. Note that the timing is the time sequence in which a single quantum logic gate is executed.
It should be noted that in classical computation, the most basic unit is a bit, and the most basic control mode is a logic gate, and the purpose of the control circuit can be achieved by a combination of logic gates. Similarly, the way in which the qubits are handled is a quantum logic gate. The quantum state can be evolved by using quantum logic gates which form the basis of a quantum circuit, the quantum logic gates comprising single bit quantum logic gates, e.g. HadamardDoors (H-door, adam Ma Men), berlin-X-doors (X-door, berlin X-door), berlin-Y-doors (Y-door, berlin Y-door), berlin-Z-doors (Z-door, berlin Z-door), RX-doors (RX-revolving doors), RY-doors (RY-revolving doors), RZ-doors (RZ-revolving doors), and the like; multi-bit quantum logic gates such as CNOT gates, CR gates, iSWAP gates, toffoli gates, and the like. Quantum logic gates are typically represented using unitary matrices, which are not only in matrix form, but also an operation and transformation. The general function of a quantum logic gate on a quantum state is to calculate by multiplying the unitary matrix by a vector corresponding to the right vector of the quantum state. For example, the quantum state right vector |0>The corresponding vector may be
Figure SMS_26
Quantum state right vector |1>The corresponding vector may be +.>
Figure SMS_27
The invention provides a quantum federal learning method with reference to figures 1-5, which comprises the following steps:
s101: fusion computing node initializing global parameters
Figure SMS_28
The initialized global parameters are encrypted by using the public key of the quantum computing node and then sent to the corresponding quantum computing node;
s102: the quantum computing node decrypts the received encrypted information by using the private key of the quantum computing node to obtain
Figure SMS_29
Utilize->
Figure SMS_30
Initializing a local variable component sub-line (VQC) model, and executing the following steps of:
in the t+1st cycle iteration process, for each quantum computing node, the following computing steps are performed, wherein the initial value of t is 0
S1021, inputting the local training data into a local VQC model to obtain an output result;
S1022based on the output result, updating the local parameters by using the following gradient descent formula
Figure SMS_31
Figure SMS_32
wherein ,
Figure SMS_33
representing parameters obtained after the t-th iteration of the ith quantum computing node,/for>
Figure SMS_34
Learning step length of the i-th quantum computing node, < ->
Figure SMS_35
Calculating a pseudo-inverse matrix corresponding to the node for the ith quantum,>
Figure SMS_36
gradient representing loss function of VQC model in the ith quantum computation node, +.>
Figure SMS_37
Representing a loss function of a VQC model in an ith quantum computing node, wherein i is E (1, n), and n is the number of the quantum computing nodes;
specifically, the loss function is calculated from the output result, and may be, for example, a square loss function, a cross entropy loss function, or the like;
referring to fig. 2, the VQC model includes an encoding module, a parameter-free sub-calculation module and a parameter-containing sub-calculation module, where the parameter-free sub-calculation module and the parameter-containing sub-calculation module form a quantum calculation layer, and there may be multiple quantum calculation layers in the same VQC model (in fig. 2,
Figure SMS_38
the lower part is a coding module->
Figure SMS_39
The lower part is not provided withParameter-containing sub-calculation module->
Figure SMS_40
The lower part is provided with a parameter-containing sub-calculation module); in one possible implementation, the encoding module includes a RY gate acting on each qubit in the VQC model, the non-parametric sub-computation module includes a CNOT gate acting on a qubit in the VQC model, and the parametric sub-computation module includes at least one of an RX gate, a RY gate, and an RZ gate for acting on a qubit in the VQC model.
The coding module inputs classical data
Figure SMS_41
Conversion to the Quantum state->
Figure SMS_42
The parameter-free sub-calculation module consists of one or more CNOT gates, and the parameter-free sub-calculation module for the first quantum calculation layer is provided with +.>
Figure SMS_43
The parameter-containing sub-calculation module is composed of a plurality of RX gates, RY gates and RZ gates, the parameters of the parameter-containing sub-calculation module are trained parameters, and the parameter-containing sub-calculation module of the first quantum calculation layer is used for->
Figure SMS_44
And (3) representing.
Figure SMS_45
The matrix is composed of submatrices corresponding to all quantum computing layers>
Figure SMS_46
The method is characterized by comprising the following steps of:
Figure SMS_47
Figure SMS_48
wherein for each parametric sub-calculation module can be expressed as
Figure SMS_49
, />
Figure SMS_50
Is->
Figure SMS_51
Is the number of quantum computation layers, r and s are the sequence numbers.
For the VQC model comprising 2 quantum computing layers shown in fig. 3, see fig. 3, the VQC model comprises 3 qubits, one coding module acting on the 3 qubits and two quantum computing layers, the coding module comprises 3 RY gates acting on the 3 qubits respectively, the parameters of the RY gates are
Figure SMS_52
Product of the input data. In the first quantum computing layer acting on the quantum bits, the parameter-free sub-computing module comprises 2 CNOT gates, the first CNOT gate acts on the first two quantum bits, the second CNOT gate acts on the second two CNOT gates, and the parameter-containing sub-computing module comprises two RZ gates respectively acting on the first two quantum bits. In the second quantum computing layer acting on the quantum bits, the parameter-free sub-computing module comprises 2 CNOT gates, the first CNOT gate acts on the first two quantum bits, the second CNOT gate acts on the second two CNOT gates, and the parameter-containing sub-computing module comprises two RY gates and RX gates which act on the second two quantum bits respectively.
For the VQC model, its corresponding pseudo-inverse matrix
Figure SMS_53
The method comprises the following steps:
Figure SMS_54
wherein :
Figure SMS_55
with reference to figure 4 of the drawings,
Figure SMS_56
,/>
Figure SMS_57
obtained by measuring the quantum states of the 1 st and 2 nd quantum bits output by the encoding module, respectively, i.e. the quantum states used for inputting the first quantum computing layer. See fig. 5->
Figure SMS_58
, />
Figure SMS_59
Obtained by measuring the quantum states of the 2 nd and 3 rd quantum bits output by the first quantum computing layer, respectively, i.e. the quantum states for input to the second quantum computing layer.
S1023 each quantum computing node utilizes public key
Figure SMS_60
For get->
Figure SMS_61
Encrypted +.>
Figure SMS_62
) The encryption information is sent to the fusion computing node, and the fusion computing node calculates encryption information of the global parameter based on the homomorphic encryption principle, specifically as follows:
Figure SMS_63
wherein ,
Figure SMS_64
weight representing the ith quantum computation node, +.>
Figure SMS_65
Is the ith quantityParameter after t+1st iteration training of sub-calculation node, < ->
Figure SMS_66
Fusion calculation global parameters after t+1 times of iterative training,/>
Figure SMS_67
Representing an encryption function having homomorphic properties.
Homomorphic encryption is a cryptographic technique based on the theory of computational complexity of mathematical problems. The homomorphically encrypted data is processed to obtain an output, and the output is decrypted, the result of which is the same as the output result obtained by processing the unencrypted original data by the same method. In particular, the individual quantum computing nodes may be based on cryptographic functions
Figure SMS_68
Using the same public key +.>
Figure SMS_69
Parameters local to each>
Figure SMS_70
And encrypting, then sending the encrypted information to a fusion computing node, and directly performing the calculation on the encrypted information by the fusion computing node to obtain the encrypted information of the global parameter. Therefore, the fusion of the computing nodes to acquire the related information of the global parameters can be avoided, and the confidentiality of the computing process is improved.
S1024, fusing computing nodes to
Figure SMS_71
Sent to each quantum computing node, each quantum computing node uses private key->
Figure SMS_72
Decrypting it to get the global parameter->
Figure SMS_73
And uses the global parameter +.>
Figure SMS_74
Updating its own VQC model, returning to S1021 to perform the next iteration.
Specifically, the fusion computing node will compute
Figure SMS_75
And sending the data to each quantum computing node, decrypting the data by each quantum computing node to obtain global parameters, and updating a local VQC model by using the global parameters to complete 1 iterative training process.
S103: and when the VQC model converges, stopping S102 the iterative process to obtain a trained VQC model.
Specifically, a threshold value of the iteration number may be preset, and when the actual iteration number is smaller than the threshold value, the VQC model is considered to have no convergence; when the actual iteration times are greater than or equal to the threshold value, the VQC model is considered to be converged, the iteration process is stopped, and the finally obtained VQC model is used as a trained VQC model.
In another aspect of the present invention, referring to fig. 1, there is further provided a quantum federation learning system, including a fusion computing node 110, a first quantum computing node 121, a second quantum computing node 122, and a third quantum computing node 123, where the fusion computing node is a server for implementing classical computing, the quantum computing node is a quantum computer, the fusion computing node and the quantum computing node communicate through classical channels, the number of the fusion computing nodes is 1, and the number of the quantum computing nodes is multiple.
The fusion computing node is a third party and is used for carrying out fusion computation on the update parameters sent by each quantum computing node to obtain global update parameters, the quantum computing nodes have local training data and are used for training the variable component sub-circuits VQC of the quantum computing nodes by utilizing the training data, the VQC model of each quantum computing node is the same,
for each quantum computing node, it has the same public key
Figure SMS_76
And private key->
Figure SMS_77
Specifically, the fusion computing node and each quantum computing node in the quantum federation learning system may be used to implement each step in the above-described quantum federation learning method, which is not described herein.
The above description is of the preferred embodiments of the present invention, and any person skilled in the art may modify the present invention or make modifications to the present invention with the technical solutions described above. Therefore, any simple modification or equivalent made according to the technical solution of the present invention falls within the scope of the protection claimed by the present invention.

Claims (7)

1. A method of quantum federal learning, comprising:
s101: fusion computing node initializing global parameters
Figure QLYQS_1
The initialized global parameters are encrypted by using the public key of the quantum computing node and then sent to the corresponding quantum computing node;
s102: the quantum computing node decrypts the received encrypted information by using the private key of the quantum computing node to obtain
Figure QLYQS_2
Utilize->
Figure QLYQS_3
Initializing a local variable component sub-line (VQC) model, and executing the following steps of:
in the t+1st cycle iteration process, for each quantum computing node, executing the following computing steps, wherein the initial value of t is 0;
s1021, inputting the local training data into a local VQC model to obtain an output result;
s1022, updating the local parameters based on the output result by using the following gradient descent formula
Figure QLYQS_4
Figure QLYQS_5
wherein ,
Figure QLYQS_6
representing parameters obtained after the t-th iteration of the ith quantum computing node,/for>
Figure QLYQS_7
Learning step length of the i-th quantum computing node, < ->
Figure QLYQS_8
Calculating a pseudo-inverse matrix corresponding to the node for the ith quantum,>
Figure QLYQS_9
gradient representing loss function of VQC model in the ith quantum computation node, +.>
Figure QLYQS_10
Representing the loss function of the VQC model in the ith quantum computation node,
Figure QLYQS_11
n is the number of quantum computing nodes;
s1023 each quantum computing node utilizes public key
Figure QLYQS_12
For get->
Figure QLYQS_13
Encrypted +.>
Figure QLYQS_14
Sending the global parameter encryption information to a fusion computing node, calculating encryption information of the global parameter by the fusion computing node based on homomorphic encryption principle,the method comprises the following steps:
Figure QLYQS_15
wherein ,
Figure QLYQS_16
weight representing the ith quantum computation node, +.>
Figure QLYQS_17
Calculating parameters of the node after t+1st iteration training for the ith quantum, +.>
Figure QLYQS_18
The global parameters obtained by fusion calculation after t+1 times of iterative training are used, and E () represents an encryption function with homomorphic property;
s1024, fusing computing nodes to
Figure QLYQS_19
Sent to each quantum computing node, each quantum computing node uses private key->
Figure QLYQS_20
Decrypting it to get the global parameter->
Figure QLYQS_21
And uses the global parameter +.>
Figure QLYQS_22
Updating the VQC model of the user, returning to S1021 to execute the next iteration;
s103: and when the VQC model converges, stopping S102 the iterative process to obtain a trained VQC model.
2. The method of quantum federal learning according to claim 1, wherein: the loss function in step S1022 is a square loss function or a cross entropy loss function.
3. The method of quantum federal learning according to claim 1, wherein: in step S102, the VQC model includes an encoding module, a parameter-free sub-calculation module and a parameter-containing sub-calculation module, where the parameter-free sub-calculation module and the parameter-containing sub-calculation module form a quantum calculation layer.
4. A method of quantum federal learning according to claim 3, wherein: the encoding module includes a RY gate that acts on each qubit in the VQC model.
5. A method of quantum federal learning according to claim 3, wherein: the parameter-free sub-calculation module comprises a CNOT gate acting on a qubit in the VQC model.
6. A method of quantum federal learning according to claim 3, wherein: the parametric sub-computation module includes at least one of an RX gate, a RY gate, and an RZ gate for acting on qubits in the VQC model.
7. A quantum federal learning system, characterized by: the method comprises the steps of integrating computing nodes (110), quantum computing nodes I (121), quantum computing nodes II (122) and quantum computing nodes III (123), wherein the integrating computing nodes are servers for realizing classical computation, the quantum computing nodes are quantum computers, the integrating computing nodes and the quantum computing nodes are communicated through classical channels, the number of the integrating computing nodes is 1, and the number of the quantum computing nodes is a plurality;
the fusion computing node is a third party and is used for carrying out fusion computation on the update parameters sent by each quantum computing node to obtain global update parameters, the quantum computing nodes have local training data and are used for training the variable component sub-circuits VQC of the quantum computing nodes by utilizing the training data, the VQC model of each quantum computing node is the same,
for each quantum computationNodes having the same public key
Figure QLYQS_23
And private key->
Figure QLYQS_24
CN202310645770.0A 2023-06-02 2023-06-02 Quantum federal learning method and system Active CN116366250B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310645770.0A CN116366250B (en) 2023-06-02 2023-06-02 Quantum federal learning method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310645770.0A CN116366250B (en) 2023-06-02 2023-06-02 Quantum federal learning method and system

Publications (2)

Publication Number Publication Date
CN116366250A true CN116366250A (en) 2023-06-30
CN116366250B CN116366250B (en) 2023-08-15

Family

ID=86913877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310645770.0A Active CN116366250B (en) 2023-06-02 2023-06-02 Quantum federal learning method and system

Country Status (1)

Country Link
CN (1) CN116366250B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180337899A1 (en) * 2017-05-18 2018-11-22 Robert Bosch Gmbh Post-Quantum Secure Private Stream Aggregation
CN112199702A (en) * 2020-10-16 2021-01-08 鹏城实验室 Privacy protection method, storage medium and system based on federal learning
CN113033828A (en) * 2021-04-29 2021-06-25 江苏超流信息技术有限公司 Model training method, using method, system, credible node and equipment
CN114465722A (en) * 2022-01-29 2022-05-10 深圳前海微众银行股份有限公司 Information processing method, apparatus, device, storage medium, and program product
CN115796295A (en) * 2023-02-08 2023-03-14 苏州浪潮智能科技有限公司 Multi-model optimization method, device and equipment for distributed quantum computer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180337899A1 (en) * 2017-05-18 2018-11-22 Robert Bosch Gmbh Post-Quantum Secure Private Stream Aggregation
CN112199702A (en) * 2020-10-16 2021-01-08 鹏城实验室 Privacy protection method, storage medium and system based on federal learning
CN113033828A (en) * 2021-04-29 2021-06-25 江苏超流信息技术有限公司 Model training method, using method, system, credible node and equipment
CN114465722A (en) * 2022-01-29 2022-05-10 深圳前海微众银行股份有限公司 Information processing method, apparatus, device, storage medium, and program product
CN115796295A (en) * 2023-02-08 2023-03-14 苏州浪潮智能科技有限公司 Multi-model optimization method, device and equipment for distributed quantum computer

Also Published As

Publication number Publication date
CN116366250B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
Rathee et al. Cryptflow2: Practical 2-party secure inference
CN108154240B (en) Low-complexity quantum line simulation system
CN111582491A (en) Construction method and device of quantum line
US20230081903A1 (en) Quantum State Preparation Circuit Generation Method and Apparatus, Chip, Device, and Program Product
KR20160132943A (en) Solving digital logic constraint problems via adiabatic quantum computation
CN113222155B (en) Quantum circuit construction method and device, electronic device and storage medium
WO2021239006A1 (en) Secret sharing-based training method and apparatus, electronic device, and storage medium
Tsmots et al. Neural-like methods and hardware structures for real-time data encryption and decryption
Huang et al. Garbled circuits in the cloud using fpga enabled nodes
Yang et al. Lightweight privacy-preserving GAN framework for model training and image synthesis
CN114819163A (en) Quantum generation countermeasure network training method, device, medium, and electronic device
Hao et al. Fastsecnet: An efficient cryptographic framework for private neural network inference
Khalid et al. An FPGA-based hardware abstraction of quantum computing systems
CN116366250B (en) Quantum federal learning method and system
CN116388954B (en) General secret state data security calculation method
CN112214200A (en) Quantum subtraction operation method and device, electronic device and storage medium
Zhou et al. Breaking symmetric cryptosystems using the offline distributed Grover-meets-Simon algorithm
Chu et al. Cryptoqfl: quantum federated learning on encrypted data
CN114511094A (en) Quantum algorithm optimization method and device, storage medium and electronic device
Zhao et al. PPCNN: An efficient privacy‐preserving CNN training and inference framework
CN115809707A (en) Quantum comparison operation method and device, electronic device and basic arithmetic assembly
Chen et al. GuardHFL: privacy guardian for heterogeneous federated learning
Jing et al. Quantum circuit implementation and resource analysis of LBlock and LiCi
Dai et al. Force: Highly Efficient Four-Party Privacy-Preserving Machine Learning on GPU
Feng et al. PpNNT: Multiparty Privacy-Preserving Neural Network Training System

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant