Privacy Protection Method and System Based on Quantum Circuit Equivalent Homomorphic Encryption Algorithm
Through the privacy protection method based on the quantum line equivalent homomorphic encryption algorithm, the problem of insufficient privacy protection of data, parameters and models in quantum computing is solved, safe and efficient privacy protection is achieved, and the usability of the model is maintained.
Patent Information
- Application Number
- CN202411115068.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2044-08-14
AI Technical Summary
The prior art is difficult to protect the privacy of data sets, training parameters and models in quantum computing at the same time, and often it is difficult to achieve a good balance between maintaining the availability and privacy of algorithm models.
The privacy protection method based on the quantum line equivalent homomorphic encryption algorithm is adopted, and the encrypted quantum lines are generated through quantum state coding and variational training layer coding, and run on the quantum cloud server to obtain measurement results.
A comprehensive privacy protection of data, parameters and models is achieved, ensuring security during transmission and processing, while avoiding negative impacts on model accuracy.
Smart Images

Figure CN119106439B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quantum computing privacy protection, and particularly relates to a privacy protection method and system based on a quantum circuit equivalent homomorphic encryption algorithm. Background Art
[0002] In the context of current Machine Learning as a Service (MLaaS), cloud service providers (CSPs) provide data holders with machine learning-based data processing, model training, and prediction services, attracting users interested in machine learning to deploy applications on the cloud platform without having to build their own large-scale infrastructure and computing resources. In this process, the CSP can be an external application, a partner company, or even the company itself. Data holders, such as governments, banks, hospitals, insurance companies, or e-commerce websites, can choose to store and process data on the cloud platform or use the services provided by the cloud platform.
[0003] Although MLaaS offers many benefits, the privacy issues of data holders are very serious. The dataset, training parameter set, and model are all facing various threats. From the perspective of application scenarios, data holders can use MLaaS in three ways:
[0004] 1) The data holder provides its dataset to the CSP, expecting the CSP to select a machine learning model and use the dataset for training.
[0005] 2) The data holder not only provides the dataset but also provides training parameters and the model to the CSP, expecting the CSP to provide computing power to train the model.
[0006] 3) The data holder deploys the trained model to the CSP and expects the CSP to provide machine learning services to end users.
[0007] For the above three application scenarios, without privacy protection, malicious CSPs or third-party attackers will easily obtain the dataset, parameters, and model of data holders, posing a huge threat to user privacy information.
[0008] For ordinary users, it is difficult to own a quantum computer or quantum device, and most of them can only resort to quantum cloud service providers to participate in quantum computing. Therefore, the demand for Quantum Cloud Service Providers (QCaaS) will exceed that of MLaaS in traditional computing. This results in a more important position for QCSP than CSP. The application scenarios of QCaaS are similar to those of MLaaS, but due to users' higher dependence on QCSP, when facing malicious QCSP and third-party attackers, users face greater privacy threats. Therefore, in QCaaS, it is crucial to protect the security and privacy of users' data, training parameters, and models.
[0009] Quantum neural network is a typical hybrid quantum-classical algorithm model that contains a large amount of private information. In this model, users input their data, training parameters, and model algorithms into the quantum cloud server. The quantum cloud server provides quantum computing capabilities and returns the measurement results to the users, who then update the parameters locally, repeating this process until the model converges or reaches the end condition. In this process, users are not only threatened by the privacy of malicious QCSP but are also more vulnerable to eavesdropping attacks by third-party attackers during repeated communication interactions.
[0010] Currently, there are few methods to protect all private information of users in quantum computing and service research. They usually only focus on one aspect. For example, to protect the privacy of the dataset, homomorphic encryption and secure multi-party computing methods are usually used. Most secure multi-party computing schemes based on homomorphic encryption can process encrypted data in the first application scenario without affecting its original accuracy, thus well solving the privacy threat of the dataset in quantum computing and services. None of the existing technologies can simultaneously protect the privacy of the dataset, parameter set, and model in the second and third application scenarios. Methods based on traditional homomorphic encryption are difficult to effectively protect the parameter set and model simultaneously. The differential privacy method can protect the parameter set and model by adding noise at appropriate positions, but this method may have a negative impact on the accuracy of the original model, thus affecting its usability. The larger the privacy budget, the greater the negative impact. Existing technologies are all typical schemes that protect privacy at the cost of usability.
[0011] In summary, for existing research, methods based on homomorphic encryption can solve the problem of dataset privacy protection but cannot simultaneously protect the privacy of the parameter set and model. Although methods based on differential privacy can comprehensively protect the dataset, parameter set, and model, they will have a negative impact on the results. Therefore, how to protect the privacy of the dataset, parameter set, and model without affecting accuracy is a very important issue.
[0012] Therefore, the problems and defects of existing technologies are as follows:
[0013] 1. Insufficient protection for data, parameters, and model privacy simultaneously:
[0014] Most of the existing technologies only focus on protecting data privacy, while neglecting the privacy protection of training parameters and the model structure itself, which is insufficient in many scenarios.
[0015] 2. Difficult to balance privacy, complexity, and usability:
[0016] Although differential privacy technology protects data privacy to some extent, it is often difficult to achieve a good balance between protecting privacy and maintaining the usability of the algorithm model.
[0017] 3. Small key space and limited security:
[0018] In existing privacy protection technologies, the key space is small, which limits their security, especially when facing complex attacks. Summary of the Invention
[0019] Aiming at the above deficiencies in the existing technologies, a privacy protection method and system based on a quantum circuit equivalent homomorphic encryption algorithm provided by the present invention solve the problem of insufficient privacy protection for data, parameters, and models in the existing technologies.
[0020] To achieve the above invention purpose, according to the first aspect of the present invention, a privacy protection method based on a quantum circuit equivalent homomorphic encryption algorithm is provided, including the following steps:
[0021] S1. Obtain the original sample set and normalize the original sample set to obtain the preprocessed data set;
[0022] S2. Divide the preprocessed data set into a sample set and a test set;
[0023] S3. Encode the sample set onto the quantum state according to the quantum state encoding rule, and encode the training parameters onto the variational training layer according to the variational training layer rule to obtain a quantum circuit;
[0024] S4. Input the quantum circuit into the quantum circuit equivalent replacement homomorphic encryption algorithm, and output the encrypted quantum circuit through the quantum circuit equivalent replacement homomorphic encryption algorithm;
[0025] S5. Upload the encrypted quantum circuit to the quantum cloud server and run it to obtain the measurement result;
[0026] S6. Post-process the measurement result according to the original algorithm to obtain the true result of the original model.
[0027] The beneficial effects of the above solution are:
[0028] (1) The present invention not only protects data privacy, but also protects training parameters and model structures, which is very important for application scenarios that require protecting the algorithm itself and data.
[0029] (2) Through the high efficiency of quantum computing, the present invention can quickly process complex data, and at the same time protect the security of data and parameters through quantum circuit equivalent homomorphic encryption.
[0030] (3) The present invention is applicable to any quantum computing algorithm and various data sets and tasks, demonstrating broad application potential.
[0031] Further, in step S3, the quantum state encoding rule is angle encoding.
[0032] Further, in step S3, the variational training layer is TwoLocal.
[0033] Further, in step S4, the encrypted quantum circuit is output by equivalent replacement of the homomorphic encryption algorithm through the quantum circuit, specifically including:
[0034] S41. Divide the quantum circuit into at least two sub - quantum circuits according to the unitary time, and obtain at least two unitary matrices corresponding to the at least two sub - quantum circuits respectively;
[0035] S42. Generate at least two random global phases according to the at least two unitary matrices, and multiply the at least two random global phases and the at least two unitary matrices according to a preset formula to obtain at least two global unitary matrices;
[0036] Among them, the number of the at least two random global phases, the at least two unitary matrices, and the at least two global unitary matrices is the same;
[0037] S43. According to the unitary matrix decomposition algorithm, construct each of the at least two global unitary matrices into at least two sub - quantum encryption circuits respectively;
[0038] S44. Re - combine the at least two sub - quantum encryption circuits according to the unitary time to obtain the encrypted quantum circuit, and output the encrypted quantum circuit.
[0039] Further, in step S42, the preset formula is:
[0040]
[0041] Among them, represents the global unitary matrix, represents the sub - quantum circuit, represents the random global phase, represents the unitary matrix.
[0042] The beneficial effects of the above further solution are as follows: By encrypting the complete quantum circuit on the client side and uploading it to the server side for execution, this method eliminates the need for decryption and ensures the security of quantum data, parameters, and model structures during transmission and processing.
[0043] Further, the method further includes:
[0044] Testing using an ad-hoc dataset.
[0045] According to a second aspect of the present invention, there is provided a privacy protection system based on a quantum circuit equivalent homomorphic encryption algorithm, the system including:
[0046] A data preprocessing module, configured to obtain an original sample set, normalize the original sample set to obtain a preprocessed data set; divide the preprocessed data set into a sample set and a test set;
[0047] An original quantum circuit construction module, configured to encode the sample set onto a quantum state according to quantum state encoding rules, and encode training parameters onto a variational training layer according to variational training layer rules to obtain a quantum circuit;
[0048] A homomorphic encryption module, configured to input the quantum circuit into a quantum circuit equivalent replacement homomorphic encryption algorithm, and output an encrypted quantum circuit through the quantum circuit equivalent replacement homomorphic encryption algorithm;
[0049] A post-processing module, configured to upload the encrypted quantum circuit to a quantum cloud server and run it to obtain measurement results; post-process the measurement results according to the original algorithm to obtain the true results of the original model.
[0050] According to a third aspect of the present invention, there is provided an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to the first aspect.
[0051] According to a fourth aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause a computer to execute the method according to the first aspect.
[0052] According to a fifth aspect of the present invention, there is provided a computer program product, including a computer program, the computer program implementing the method according to the first aspect when executed by a processor. Description of the Drawings
[0053] Figure 1Schematic diagram of a privacy protection method based on a quantum circuit equivalent homomorphic encryption algorithm;
[0054] Figure 2 Schematic diagram of the process for a user to interact with a quantum server using the quantum circuit equivalent replacement homomorphic encryption algorithm in a cloud environment;
[0055] Figure 3 Schematic diagram of the specific process for encrypting a quantum circuit using the quantum circuit equivalent replacement homomorphic encryption algorithm;
[0056] Figure 4 Schematic diagram for comparing the original HHL circuit and the encrypted HHL circuit;
[0057] Figure 5 Schematic diagram for comparing the original VQC circuit and the encrypted VQC original circuit;
[0058] Figure 6 Schematic diagram for comparing the accuracy and loss between VQC and the method described in the present invention on an ad - hoc dataset. Detailed implementation manners
[0059] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0060] As Figure 1 shown, a privacy protection method based on a quantum circuit equivalent homomorphic encryption algorithm includes the following steps:
[0061] S1. Obtain the original sample set and normalize the original sample set to obtain a pre - processed dataset.
[0062] S2. Divide the pre - processed dataset into a sample set and a test set.
[0063] S3. Encode the sample set onto a quantum state according to the quantum state encoding rule, and encode the training parameters onto the variational training layer according to the variational training layer rule to obtain a quantum circuit.
[0064] In this embodiment, in step S3, the quantum state encoding rule is angle encoding.
[0065] In this embodiment, in step S3, the variational training layer is TwoLocal.
[0066] Optionally, in the client, the user can normalize the input data. And can use the quantum state preparation method to convert these data into quantum states, and construct an original quantum circuit model (that is, construct a quantum circuit) by adopting the model structure and measurement method corresponding to the HHL algorithm.
[0067] Optionally, step S3 can be performed in the client. In the client, the input data (i.e., the sample set) can be normalized. And these data can be converted into quantum states using a quantum state preparation method, or a model structure and measurement method corresponding to a quantum neural network algorithm can be adopted to construct an original quantum circuit model (i.e., construct a quantum circuit).
[0068] In this embodiment, the number of inputs of the sample set can be 16 bits, the number of quantum states can be 4 bits, and the number of training parameters can be 32.
[0069] In this embodiment, the acquisition of the quantum circuit in step S3 can be as follows:
[0070]
[0071] Wherein, represents the quantum circuit, represents the quantum circuit model itself, represents the sample set, represents the training parameter set.
[0072] In this embodiment, the design of homomorphic encryption allows the user to run on a local or any classical computer, which reduces the requirements for the user's quantum capabilities to the greatest extent.
[0073] S4. Input the quantum circuit into the homomorphic encryption algorithm with quantum circuit equivalent replacement, and output the encrypted quantum circuit through the homomorphic encryption algorithm with quantum circuit equivalent replacement.
[0074] In this embodiment, in step S4, outputting the encrypted quantum circuit through the homomorphic encryption algorithm with quantum circuit equivalent replacement specifically includes:
[0075] S41. Divide the quantum circuit into at least two sub-quantum circuits according to the unitary time, and obtain at least two unitary matrices respectively corresponding to the at least two sub-quantum circuits;
[0076] S42. Generate at least two random global phases according to the at least two unitary matrices, and multiply the at least two random global phases and the at least two unitary matrices according to a preset formula to obtain at least two global unitary matrices;
[0077] Wherein, the number of the at least two random global phases, the at least two unitary matrices, and the at least two global unitary matrices is the same;
[0078] S43. According to the unitary matrix decomposition algorithm, respectively construct each of the at least two global unitary matrices into at least two sub-quantum encryption circuits;
[0079] S44. Recombine at least two sub - quantum encryption circuits according to the unitary time to obtain an encrypted quantum circuit, and output the encrypted quantum circuit.
[0080] Further, in step S42, the preset formula is:
[0081]
[0082] Among them, represents the global unitary matrix, represents the sub - quantum circuit, represents the random global phase, represents the unitary matrix.
[0083] Exemplarily, as Figure 2 shown, Figure 2 is a schematic diagram of the process of a user using a quantum circuit equivalent replacement homomorphic encryption algorithm to interact with a quantum server in a cloud environment. In Figure 2 , it shows the privacy protection process of a user using the Quantum Circuit Equivalence Homomorphic Encryption (QCEHE) method in a quantum algorithm in a cloud environment. The user first inputs classical data and training parameters into a quantum computing model to form a complete quantum circuit. This circuit is then encrypted by the QCEHE method to generate an equivalent encrypted circuit. The user uploads this encrypted circuit to a quantum cloud server for execution. The result returned by the encrypted circuit is mathematically equivalent to the result of the original unencrypted circuit, and the user can directly perform subsequent processing without decryption.
[0084] As Figure 3 shown, Figure 3 is a schematic diagram of the specific process of encrypting a quantum circuit by the quantum circuit equivalent replacement homomorphic encryption algorithm. In Figure 3 , it shows the process of the quantum circuit equivalent substitution algorithm (QESA) used to enhance the security of a quantum circuit. This process can start from the circuit decomposition module. Among them, the input quantum circuit is decomposed into sub - circuits, and each sub - circuit is represented as a sub - unitary matrix. In the global phase module, a random global phase is added to each sub - unitary matrix, representing the first round of homomorphic encryption. Finally, in the unitary matrix decomposition module, different decomposition algorithms are applied to further change the data, parameters, and structure of each sub - unitary matrix to complete the second round of homomorphic encryption. The encryption of these two steps ensures the security and privacy of the quantum circuit when processed on a classical computer or server.
[0085] As Figure 4 shown,Figure 4 Schematic diagram for comparison between the original HHL circuit and the encrypted HHL circuit.
[0086] As Figure 5 shown, Figure 5 Schematic diagram for comparison between the original VQC circuit and the encrypted VQC circuit.
[0087] Optionally, the user can perform homomorphic encryption on the original quantum circuit model on the local client and upload the encrypted quantum circuit to the quantum server for running. The encrypted quantum circuit protects the user's data and model structure.
[0088] In this embodiment, the user can perform homomorphic encryption on the original quantum circuit model on the local client, ensuring the privacy and security of the user's data and model structure, and taking advantage of quantum computing to improve the efficiency of data processing and analysis.
[0089] S5. Upload the encrypted quantum circuit to the quantum cloud server and run it to obtain the measurement result.
[0090] Optionally, after the quantum cloud server finishes running, the quantum server can return the measurement result to the user. At the same time, due to the characteristics of this homomorphic encryption method, the user does not need to decrypt. Just process the obtained measurement result according to the post-processing method of the quantum neural network model itself to obtain the classification result of the data.
[0091] In this embodiment, the original quantum circuit model is constructed through the model structure and measurement method corresponding to the quantum neural network algorithm, and the measurement result is processed according to the post-processing method of the quantum neural network model itself, which can ensure the privacy and security of the user's data and model structure, and take advantage of quantum computing to improve the efficiency of data processing and analysis. It demonstrates the strong application potential of the quantum computing privacy protection method based on the homomorphic encryption algorithm of quantum circuit equivalence classes in processing sensitive data, especially in the fields where data privacy and security need to be ensured. By combining quantum computing and encryption technology, not only the efficiency of data processing is improved, but also the security and privacy of the data are ensured.
[0092] S6. Post-process the measurement result according to the original algorithm to obtain the true result of the original model.
[0093] In this embodiment, after step S6, the method further includes:
[0094] Testing with an ad-hoc dataset.
[0095] Optionally, the Iris dataset can also be used for testing. In the test, the classical data is encoded into quantum states by using the angle encoding method, and the number of classical data inputs is set to 8 bits, that is, the number of quantum states is 4 bits.
[0096] As Figure 6 shown Figure 6 is a schematic diagram comparing the accuracy and loss of VQC and the method described in the present invention on an ad - hoc dataset. By Figure 6 comparison, it can be seen that the losses and accuracies of the privacy - protected scheme and the non - privacy - protected scheme are similar. Therefore, the privacy - protection scheme described in the present invention has no impact on machine - learning training.
[0097] In this embodiment, a unitary matrix factorization algorithm based on classical mathematical methods is used. This algorithm can decompose any unitary matrix into a series of single - qubit rotations and two - qubit gates, and all quantum circuits are unitary matrices. This means that for any unitary matrix formed by a quantum circuit, it can be decomposed into different forms, and similarly, any quantum circuit can be converted into encrypted quantum circuits with different compositions and different parameters. Therefore, the client does not need to have any quantum capabilities because the circuit used to encode classical data can be decomposed, and this scheme can be used in the circuit to protect private data, training parameters, and model structures. And the test method described in this embodiment can achieve the feasibility of pure - classical user privacy protection and the comprehensive evaluation of privacy protection.
[0098] Moreover, in this embodiment, by hiding parameters, it is ensured that even if the quantum server is attacked, the key model parameters will not be leaked. By encrypting the quantum - gate operations, the data and model during the training process are further protected.
[0099] The method described in the present invention is applicable to pure - quantum computing models (such as the HHL model), and can also be applied to hybrid quantum - classical quantum - machine - learning models (such as quantum - neural - network models), demonstrating its generality for quantum - computing models. It is not only applicable to small - scale datasets (such as ad hoc), but also can be applied to more complex datasets (such as MNIST), demonstrating its wide applicability.
[0100] The method described in the present invention uses the open - source libraries Qiskit and Pyqpanda for experiments, demonstrating the compatibility of this method with existing quantum - computing tools, making this method more easily adopted and applied by the quantum - computing community.
[0101] In an exemplary embodiment, the embodiment of the present invention also provides a privacy - protection system based on a quantum - circuit equivalent - homomorphic encryption algorithm, which can be used to implement the privacy - protection method based on the quantum - circuit equivalent - homomorphic encryption algorithm as described in the foregoing embodiment. The system includes:
[0102] A data preprocessing module, configured to obtain an original sample set, normalize the original sample set to obtain a preprocessed data set; divide the preprocessed data set into a sample set and a test set;
[0103] An original quantum circuit construction module, configured to encode the sample set onto a quantum state according to a quantum state encoding rule, and encode training parameters onto a variational training layer according to a variational training layer rule to obtain a quantum circuit;
[0104] A homomorphic encryption module, configured to input the quantum circuit into a quantum circuit equivalent replacement homomorphic encryption algorithm, and output an encrypted quantum circuit through the quantum circuit equivalent replacement homomorphic encryption algorithm;
[0105] A post-processing module, configured to upload the encrypted quantum circuit to a quantum cloud server and run it to obtain a measurement result; post-process the measurement result according to an original algorithm to obtain a true result of an original model.
[0106] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.
[0107] In an exemplary embodiment, the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method as described in the above embodiments.
[0108] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to cause a computer to execute the method as described in the above embodiments.
[0109] In an exemplary embodiment, the computer program product includes a computer program, and the computer program implements the method as described in the above embodiments when executed by a processor.
[0110] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0111] In the context of the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0112] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0113] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0114] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.
[0115] Those of ordinary skill in the art will realize that the embodiments described herein are for helping the reader to understand the principles of the present invention, and it should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific deformations and combinations without departing from the essence of the present invention according to these technical revelations disclosed in the present invention, and these deformations and combinations are still within the protection scope of the invention.
Claims
1. A privacy protection method based on quantum circuit equivalent homomorphic encryption algorithm, characterized in that: The method comprises: S1. Obtain an original sample set, and normalize the original sample set to obtain a preprocessed data set; S2, dividing the preprocessed data set into a sample set and a test set; S3, encoding the sample set into the quantum state according to the quantum state encoding rule, and encoding the training parameters into the variational training layer according to the variational training layer rule, to obtain the quantum circuit, the acquisition expression of the quantum circuit is: in, represents a quantum circuit, represents the quantum circuit model itself, represents the sample set, represents the training parameter set; S4, inputting the quantum circuit into a quantum circuit equivalent replacement homomorphic encryption algorithm, and outputting the encrypted quantum circuit through the quantum circuit equivalent replacement homomorphic encryption algorithm; S5, uploading the encrypted quantum circuit to the quantum cloud server and running it to obtain the measurement result; S6. Post-processing the measurement results according to the original algorithm to obtain the true results of the original model; The step of equivalently replacing the quantum circuit with the homomorphic encryption algorithm to output the encrypted quantum circuit specifically includes: S41, dividing the quantum circuit into at least two sub-quantum circuits according to unitary time, and obtaining at least two unitary matrices corresponding to the at least two sub-quantum circuits respectively; S42, generating at least two random global phases according to the at least two unitary matrices, and multiplying the at least two random global phases and the at least two unitary matrices according to a preset formula to obtain at least two global unitary matrices; The preset formula is: in, represents the global unitary matrix, represents a sub-quantum circuit, represents a random global phase, represents a unitary matrix; wherein the at least two random global phases, the at least two unitary matrices and the at least two global unitary matrices are the same in number; S43, according to the unitary matrix decomposition algorithm, each of the at least two global unitary matrices is constructed into at least two sub-quantum encryption circuits; S44, reorganizing the at least two sub-quantum encryption circuits according to unitary time to obtain the encrypted quantum circuit, and outputting the encrypted quantum circuit.
2. The method according to claim 1, characterized in that In step S3, the quantum state encoding rule is angle encoding.
3. The method according to claim 1, characterized in that In step S3, the variational training layer is TwoLocal.
4. The method according to claim 1, characterized in that: The method further comprises: Use ad-hoc dataset for testing.
5. A privacy protection system based on quantum circuit equivalent homomorphic encryption algorithm, characterized in that: The system comprises: The data preprocessing module is used to obtain an original sample set and normalize the original sample set to obtain a preprocessed data set; and divide the preprocessed data set into a sample set and a test set; The original quantum circuit construction module is used to encode the sample set into the quantum state according to the quantum state encoding rule, and encode the training parameters into the variational training layer according to the variational training layer rule to obtain the quantum circuit. The acquisition expression of the quantum circuit is: in, represents a quantum circuit, represents the quantum circuit model itself, represents the sample set, represents the training parameter set; A homomorphic encryption module is used to input the quantum circuit into a quantum circuit equivalent replacement homomorphic encryption algorithm, and output the encrypted quantum circuit through the quantum circuit equivalent replacement homomorphic encryption algorithm. The outputting the encrypted quantum circuit through the quantum circuit equivalent replacement homomorphic encryption algorithm specifically includes: Dividing the quantum circuit into at least two sub-quantum circuits according to unitary time, and obtaining at least two unitary matrices corresponding to the at least two sub-quantum circuits respectively; Generate at least two random global phases according to the at least two unitary matrices, and multiply the at least two random global phases and the at least two unitary matrices according to a preset formula to obtain at least two global unitary matrices; The preset formula is: in, represents the global unitary matrix, represents a sub-quantum circuit, represents a random global phase, represents a unitary matrix; wherein the at least two random global phases, the at least two unitary matrices and the at least two global unitary matrices are the same in number; According to a unitary matrix decomposition algorithm, each of the at least two global unitary matrices is constructed into at least two sub-quantum encryption circuits; Recombining the at least two sub-quantum encryption circuits according to the unitary time to obtain the encrypted quantum circuit, and outputting the encrypted quantum circuit; The post-processing module is used to upload the encrypted quantum circuit to the quantum cloud server and run it to obtain the measurement result; according to the original algorithm, the measurement result is post-processed to obtain the true result of the original model.
6. An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the method described in any one of claims 1-4.
7. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 4.
8. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Quantum federal learning method and system
CN116366250A
Quantum neural network privacy protection method and system for protecting input data and parameters
CN117675196A