Distributed computing method, device, medium and equipment based on quantum bit cutting
The initial quantum neural network is split into multiple quantum neural networks through qubit cutting technology, and binary classification is performed by combining the expected values, solving the problem of large-scale quantum neural network computing on NISQ devices and improving the computing quality and efficiency.
Patent Information
- Application Number
- CN202411406890.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-10-10
AI Technical Summary
At this stage, the number of qubits supported on NISQ devices is limited, and the noise impact is great, making it difficult to directly support large-scale quantum neural network computing.
By cutting the initial quantum neural network into multiple quantum neural networks and performing a specific series of quantum gate operations on the qubits in each quantum neural network, the respective set of expected values are obtained, and finally binary classification of the digital images with these expected values.
It realizes the support of large-scale quantum neural networks on NISQ devices, reduces the requirements for the number of qubits, improves the computing quality and binary classification accuracy, and improves training efficiency.
Smart Images

Figure CN118917428B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing technology, and specifically to a distributed computing method, device, storage medium and electronic device based on quantum bit cutting. Background Art
[0002] Quantum computing is a cutting-edge technology that uses the principles of quantum mechanics to process information. It uses quantum bits as basic units and uses characteristics such as quantum superposition and quantum entanglement to efficiently perform computing tasks. Neural networks are an important branch of machine learning and are widely used in scenarios such as image classification, language translation, and recommendation systems. Quantum Neural Network (QNN) is a computing model that combines quantum computing and neural networks. It aims to use quantum advantages such as superposition and entanglement to improve the computing efficiency of neural networks, thereby breaking through the limitations of classical neural networks in terms of computational complexity and speed.
[0003] In order to fully utilize the acceleration advantages of quantum computing to solve practical problems, the number of qubits in the network must reach a certain scale. However, at this stage and for a long time in the future, we will be in the era of Noisy Intermediate-Scale Quantum (NISQ). The number of qubits supported by NISQ devices is limited, and the impact of noise on calculation results will increase with the increase in the number of qubits. It is difficult to directly support large-scale quantum neural networks on NISQ devices. Therefore, it is currently necessary to explore an effective solution. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a distributed computing method, device, storage medium and electronic device based on quantum bit cutting, which is used to at least partially solve the defects of the prior art.
[0005] In a first aspect, a distributed computing method based on quantum bit cutting provided by an embodiment of the present invention comprises the following steps:
[0006] According to the number of quantum bits in the initial quantum neural network, the initial quantum neural network is cut into a plurality of quantum neural networks, wherein the plurality of quantum neural networks at least include a first quantum neural network and a second quantum neural network.
[0007] Based on the first quantum neural network, a first quantum gate series operation is performed on each quantum bit in the first quantum neural network, and expected values of each quantum bit in the first quantum neural network under respective corresponding observables after the first quantum gate series operation is performed are respectively obtained to obtain a first expected value set.
[0008] Based on the second quantum neural network, a second quantum gate series operation is performed on each quantum bit in the second quantum neural network, and the expected value of each quantum bit in the second quantum neural network after the second quantum gate series operation is performed under the respective corresponding observables is obtained to obtain a second expected value set.
[0009] Based on the first expected value set and the second expected value set, final expected values of the n quantum bits in the initial quantum neural network under their respective corresponding observables are determined respectively to obtain a final expected value set.
[0010] According to the structure of the quantum circuit in the initial quantum neural network, two final expected values are selected from the final expected value set and the digital image is binary classified according to the two final expected values.
[0011] In some examples, the first quantum neural network includes m quantum bits q1 to q m and m subcircuits, one subcircuit corresponds to one quantum bit, the first subcircuit includes a first quantum rotation gate, the second subcircuit includes a second quantum rotation gate and a first quantum CNOT gate, the third subcircuit includes a third quantum rotation gate and a second quantum CNOT gate, and so on, the mth subcircuit includes an mth quantum rotation gate and an m-1th quantum CNOT gate; the second quantum neural network includes n-m+1 quantum bits q m+1 To q n+1 And n-m+1 sub-circuits, the m+1th sub-circuit includes the m+1th quantum rotation gate and the mth quantum CNOT gate, the m+2th sub-circuit includes the m+2th quantum rotation gate and the m+1th quantum CNOT gate, and so on, the n-m+1th sub-circuit includes the n-m+1th quantum rotation gate and the nmth quantum CNOT gate.
[0012] In some examples, based on the first quantum neural network, a first quantum gate series operation is performed on each quantum bit in the first quantum neural network, and the expected value of each quantum bit in the first quantum neural network after the first quantum gate series operation is performed under the respective corresponding observable quantity is obtained, and the first expected value set is obtained, including:
[0013] The quantum bits q1 to q m Initialize to state.
[0014] The angle encoding method is adopted to encode the quantum bits q1 to q m Perform the first quantum rotating gate operation.
[0015] For the quantum bits q1 to q1 after the first quantum rotating gate operation is performed m, using the first quantum neural network, repeatedly performing a first quantum gate series of sub-operations, wherein the first quantum gate series of sub-operations includes:
[0016] For quantum bits q1 to q m Perform the second quantum rotating gate operation.
[0017] The quantum bit q1 after the second rotation gate operation is used as the control quantum bit of the first quantum CNOT gate, the quantum bit q2 after the second quantum rotation gate operation is used as the target quantum bit of the first quantum CNOT gate, and the quantum CNOT gate operation is performed on the quantum bit q2.
[0018] The quantum bit q2 that has undergone the quantum CNOT gate operation is used as the control quantum bit of the second quantum CNOT gate, and the quantum bit q3 that has undergone the second quantum rotation gate operation is used as the target quantum bit of the second quantum CNOT gate, and the quantum CNOT gate operation is performed on the quantum bit q3.
[0019] By analogy, the m-1th quantum bit after the m-2th quantum CNOT gate operation is used as the control quantum bit of the m-1th quantum CNOT gate, and the quantum bit after the second quantum rotation gate operation is used as the q m is the target qubit of the m-1th quantum CNOT gate, and for qubit q m Perform a quantum CNOT gate operation.
[0020] Measure the quantum bits q1 to q1 respectively after repeatedly executing the first series of quantum gate sub-operations. m The corresponding expected values are obtained for quantum bits q1 to q m-1 The expected value of the corresponding observable E P1 to E Pm-1 , generating the first expected value subset and the last quantum bit q in the first quantum neural network m In observable O i Expected value under E i , generate the second expected value subset, where, E P1 is the expected value of quantum bit q1 under observable quantity P1, E Pm-1 is the quantum bit q m-1 In observable P m-1 The first expected value set includes the first expected value subset and the second expected value subset, and the observable Oi is the quantum Pauli gate, i is a positive integer not greater than 8.
[0021] In some examples, based on the second quantum neural network, a second series of quantum gate operations are performed on each quantum bit in the second quantum neural network, and expected values of each quantum bit in the second quantum neural network after the second series of quantum gate operations are performed under respective corresponding observables are obtained, and the second expected value set includes:
[0022] The quantum bits q m+1 To q n+1 Initialize to state;
[0023] The angle encoding method is adopted to encode the quantum bit q m+2 To q n+1 Perform the first quantum rotating gate operation;
[0024] The quantum bits q m+1 Prepared into quantum state , where the quantum state For observable eigenvectors below;
[0025] For each quantum state The quantum bit q m+1 and the quantum bit q after the first quantum rotating gate operation m+2 To q n+1 , using the second quantum neural network, repeatedly performing a second series of quantum gate sub-operations, respectively, wherein the second series of quantum gate sub-operations include:
[0026] For quantum bit q m+1 Perform quantum gate revolving door operations;
[0027] The quantum bit q before the revolving door operation m+1 As the control qubit of the mth quantum CNOT gate, the qubit q m+2 As the target qubit of the mth quantum CNOT gate, the qubit q m+2 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation m+2 Perform the second quantum rotating gate operation;
[0028] The quantum bit q that has been operated by the quantum CNOT gate m+2 As the control qubit of the m+1th quantum CNOT gate, the qubit q m+3As the target qubit of the m+1th quantum CNOT gate, the qubit q m+3 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation m+3 Perform the second quantum rotating gate operation; and so on, the quantum bit q n As the control qubit of the nmth quantum CNOT gate, the qubit q n+1 As the target qubit of the nmth quantum CNOT gate, the qubit q n+1 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation n+1 Perform the second quantum rotating gate operation;
[0029] Measure the quantum bit q after repeatedly executing the second series of quantum gate sub-operations m+1 To q n+1 The corresponding expectation value is obtained as the quantum bit q m+1 To q n+1 The expected value of the corresponding observable E i,Pm+1 to E i,Pn+1 , generate the second expected value set, where, E i,Pm+1 is the quantum bit q m+1 In When the quantum bit q m+1 In the observable quantity P m+1 The expected value under E i,Pn+1 is the quantum bit q m+1 In When the quantum bit q n+1 In the observable quantity P n+1 The expected value below.
[0030] In some examples, based on the first expected value set and the second expected value set, respectively determining the final expected values of the n quantum bits in the initial quantum neural network under the respective corresponding observables includes:
[0031] Using the formula , respectively calculate the quantum bits q1 to q n The final expected value in the initial quantum neural network E PX ,in, E i (1) is the quantum bit q in the first quantum neural network m In observableO i The expected value under c i For the observable O i and quantum states The one-to-one corresponding eigenvalues, is the quantum bit q in the first quantum neural network x In the observable quantity P x The expected value under is the quantum bit q in the second quantum neural network m+1 In When the quantum bit q x+1 In the observable quantity P x+1 The expected value below.
[0032] In some examples, selecting two final expected values from the final expected value set according to the structure of the quantum circuit in the initial quantum neural network and performing binary classification on the digital image according to the two final expected values includes:
[0033] Based on the last two final expected values in the final expected value set, the digital image is classified into two categories.
[0034] In some examples, the observable O i The observable set formed by O i}={ I,I,X,X,Y,Y,Z,Z}, the quantum state The quantum state set formed = , where I is the unit matrix, X is the matrix corresponding to the quantum Pauli-X gate, Y is the matrix corresponding to the quantum Pauli-Y gate, and Z is the matrix corresponding to the quantum Pauli-Z gate.
[0035] In a second aspect, a distributed computing device based on quantum bit cutting provided by an embodiment of the present invention includes:
[0036] The cutting module is configured to cut the initial quantum neural network into multiple quantum neural networks according to the number of quantum bits in the initial quantum neural network, wherein the multiple quantum neural networks include at least a first quantum neural network and a second quantum neural network.
[0037] The first acquisition module is configured to perform a first quantum gate series operation on each quantum bit in the first quantum neural network based on the first quantum neural network, and respectively obtain the expected value of each quantum bit in the first quantum neural network under the respective corresponding observable quantity after the first quantum gate series operation is performed, so as to obtain a first expected value set.
[0038] The second acquisition module is configured to perform a second quantum gate series operation on each quantum bit in the second quantum neural network based on the second quantum neural network, and respectively obtain the expected value of each quantum bit in the second quantum neural network under the respective corresponding observable quantity after the second quantum gate series operation is performed, so as to obtain a second expected value set.
[0039] The determination module is configured to determine the final expected values of the n quantum bits in the initial quantum neural network under their respective corresponding observables based on the first expected value set and the second expected value set, and obtain a final expected value set.
[0040] The classification module is configured to select two final expected values from the final expected value set according to the structure of the quantum circuit in the initial quantum neural network and perform binary classification on the digital image according to the two final expected values.
[0041] In a third aspect, an electronic device provided by an embodiment of the present invention includes a processor and a memory storing computer program instructions, wherein when the processor executes the computer program instructions, it implements the distributed computing method based on quantum bit cutting as described in the first aspect.
[0042] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present invention stores computer instructions, which, when executed by a processor, implement the distributed computing method based on quantum bit cutting as described in the first aspect.
[0043] Compared with the prior art, the distributed computing method, device, storage medium and electronic device based on quantum bit cutting provided by the embodiments of the present invention have the following beneficial effects:
[0044] (1) It can accommodate a large number of quantum bits, enabling direct support of large-scale quantum neural networks on NISQ devices;
[0045] (2) It requires a lower number of quantum bits, is easier to physically implement, and improves the quality of calculation, that is, it improves the accuracy of binary classification of digital images;
[0046] (3) The training efficiency of quantum neural networks is improved, that is, the efficiency of binary classification of digital images is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings in the embodiment of the present invention are briefly introduced below.
[0048] Figure 1 It is a flowchart of a distributed computing method based on quantum bit cutting provided according to an embodiment of the present invention.
[0049] Figure 2 It is a schematic diagram of an initial quantum neural network circuit and a single cut provided according to an embodiment of the present invention.
[0050] Figure 3 It is based on Figure 2 The schematic diagram of the first quantum neural network circuit obtained after cutting the initial quantum neural network is shown.
[0051] Figure 4 According to the present invention Figure 2 Schematic diagram of the second quantum neural network circuit obtained after cutting the initial quantum neural network shown.
[0052] Figure 5 This is a schematic diagram of the structure of a distributed computing device based on quantum bit cutting.
[0053] Figure 6 It is a schematic diagram of an initial quantum neural network circuit and two cuts provided according to an embodiment of the present invention.
[0054] Figure 7 According to the present invention Figure 6 Schematic diagram of the third quantum neural network circuit obtained after cutting the initial quantum neural network shown.
[0055] Figure 8 It is based on Figure 6 Schematic diagram of the fourth quantum neural network circuit obtained after cutting the initial quantum neural network shown.
[0056] Fig. 9 According to the present invention Figure 6 Schematic diagram of the fifth quantum neural network circuit obtained after cutting the initial quantum neural network shown.
[0057] Fig.10 is a principle block diagram of an electronic device as a classic electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present invention clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present invention. The exemplary embodiments provided herein are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] In this document, terms such as first, second, third, etc. are only used to distinguish one entity (or operation) from another entity (or operation), but not to require or imply any order or relationship between these entities (or operations).
[0060] The following is a brief description of concepts, technical terms and other related contents that may be involved in the embodiments of the present invention.
[0061] In classical computing, the basic unit of information is a bit, which has only two values: "0" or "1". In quantum computing, the basic unit of information is a quantum bit (Qubit). Based on the laws of quantum mechanics, a quantum bit has two basic states: and , a Qubit can be a linear combination of two basis states, often called a superposition state, which is mathematically expressed as: |ψ>=a|0>+b|1>. Among them, |ψ> is a quantum state, a and b are two complex numbers that satisfy |a| 2 +|b| 2 =1, so it is also called probability amplitude. In classical computing, circuits are usually used to implement calculations, and the circuits include logic gates. Correspondingly, quantum neural networks and quantum gates are used in quantum computing to control quantum information to implement quantum computing. Any quantum gate can be represented by a unitary matrix.
[0062] The quantum gates commonly used in quantum computing include single-Qubit gates and multi-Qubit gates. Among them, single-Qubit gates include quantum R x Gate, Quantum R y Gate, Quantum R z gate, quantum Z gate, quantum Pauli-X gate, quantum Pauli-Z gate, etc. z Gate as an example, quantum R z The full name of the gate is Rotation z-axis gate, which is a single qubit operation that rotates an angle θ (radians) around the z-axis. z The gate matrix is represented as The full name of the Z gate is the Zadamard gate, which can transform a ground state qubit into a superposition state qubit. The full name of the quantum Z gate is the Pauli-Z gate. The Pauli-Z gate is a single qubit operation that rotates π radians around the Z axis from the perspective of vector space or the Bloch sphere model. The quantum X gate is also called the NOT gate, which can be used to invert the qubit (from the perspective of vector space or the Bloch sphere model, it is an inversion or rotation around the x-axis). radians), i.e. , which can be physically represented by the symbol or Its matrix form is: In quantum neural networks, the matrix representation of the quantum Z gate is:
[0063] ; The quantum Z gate is a parameterized quantum gate, and the rotation angle of the quantum Z gate can be changed as needed; the matrix representation of the quantum CNOT gate is: .
[0064] An example of a multi-Qubit gate is the quantum CNOT gate. The full name of the quantum CNOT gate is the Control NOT gate, which is a two-Qubit operation, where the first Qubit is usually called the control Qubit and the second Qubit is called the target Qubit. The CNOT gate is represented in the ground state: when the control Qubit is in the state When the control Qubit is in state , the target Qubit remains unchanged.
[0065] In the field of quantum computing, a quantum neural network is a quantum computing model that represents a circuit that operates quantum bits in an abstract sense. The circuit includes quantum bits, circuits (timelines), and various logic gates, and the measured values are finally read out through quantum measurements.
[0066] Since each quantum gate that makes up the quantum neural network can be represented by a matrix, the effect of the quantum gate on the quantum bit in the quantum neural network is called an operation, which can be expressed as the matrix product between the various quantum gates.
[0067] Distributed quantum computing refers to the combination of multiple quantum computing nodes, connected through a network, to jointly execute complex quantum algorithms. Quantum circuit splitting is an important technology in distributed quantum computing. It can split a large-scale quantum neural network into multiple small-scale nodes. Combining these small-scale nodes can achieve the same computing task more stably and with higher quality. Therefore, it is one of the feasible methods to execute large-scale quantum neural networks on current NISQ devices.
[0068] Example 1 Figure 1 1 is a flow chart of a distributed computing method based on quantum bit cutting according to an embodiment of the present invention, and the distributed computing method based on quantum bit cutting includes the following steps:
[0069] S101, according to the number of quantum bits in the initial quantum neural network, cutting the initial quantum neural network into multiple quantum neural networks, wherein the multiple quantum neural networks include a first quantum neural network and a second quantum neural network.
[0070] In some examples, the first quantum neural network includes m quantum bits q1 to q m and m subcircuits, one subcircuit corresponds to one quantum bit, the first subcircuit includes the first quantum rotation gate, the second subcircuit includes the second quantum rotation gate and the first quantum CNOT gate, the third subcircuit includes the third quantum rotation gate and the second quantum CNOT gate, and so on, the mth subcircuit includes the mth quantum rotation gate and the m-1th quantum CNOT gate; the second quantum neural network includes n-m+1 quantum bits q m+1 To q n+1 And n-m+1 sub-circuits, the m+1th sub-circuit includes the m+1th quantum rotation gate and the mth quantum CNOT gate, the m+2th sub-circuit includes the m+2th quantum rotation gate and the m+1th quantum CNOT gate, and so on, the n-m+1th sub-circuit includes the n-m+1th quantum rotation gate and the nmth quantum CNOT gate.
[0071] Specifically, in Figure 2 middle," The symbol " represents the bit cutting point, and n is the number of quantum bits in the initial quantum neural network. In particular, the quantum neural networks cut from the initial quantum neural network include but are not limited to the first quantum neural network and the second quantum neural network. According to the needs of actual problem solving, the initial quantum neural network can be cut into three or four or more quantum neural networks.
[0072] S102, based on the first quantum neural network, performing a first quantum gate series operation on each quantum bit in the first quantum neural network, respectively obtaining expected values of each quantum bit in the first quantum neural network under its corresponding observable after the first quantum gate series operation is performed, and obtaining a first expected value set.
[0073] In some examples, the step specifically includes:
[0074] The quantum bits q1 to q m Initialize to state.
[0075] The angle encoding method is adopted to encode the quantum bits q1 to q m Perform the first quantum rotating gate operation.
[0076] Specifically, Figure 2 or Figure 3 As shown, in the quantum bit q 1, q2,...q m Apply a quantum R y The door will be the classic data Corresponding to the encoding of quantum bit q 1,q2,...q m On the quantum bit q 1, q2,...q m Perform the first quantum rotating gate operation.
[0077] For the quantum bits q1 to q1 after the first quantum rotating gate operation is performed m , using the first quantum neural network, repeatedly performing a first quantum gate series of sub-operations, wherein the first quantum gate series of sub-operations includes:
[0078] For quantum bits q1 to q m Perform the second quantum rotating gate operation.
[0079] Specifically, in the quantum bit q 1, q2,...q m Again, a quantum R y The gate will have trainable parameters Corresponding to the encoding of quantum bit q 1, q2,...q m On the quantum bit q 1, q2,...q m Perform the second quantum rotating gate operation.
[0080] The quantum bit q1 after the second rotation gate operation is used as the control quantum bit of the first quantum CNOT gate, the quantum bit q2 after the second quantum rotation gate operation is used as the target quantum bit of the first quantum CNOT gate, and the quantum CNOT gate operation is performed on the quantum bit q2.
[0081] The quantum bit q2 that has undergone the quantum CNOT gate operation is used as the control quantum bit of the second quantum CNOT gate, and the quantum bit q3 that has undergone the second quantum rotation gate operation is used as the target quantum bit of the second quantum CNOT gate, and the quantum CNOT gate operation is performed on the quantum bit q3.
[0082] By analogy, the m-1th quantum bit after the m-2th quantum CNOT gate operation is used as the control quantum bit of the m-1th quantum CNOT gate, and the quantum bit after the second quantum rotation gate operation is used as the q m is the target qubit of the m-1th quantum CNOT gate, and for qubit q m Perform a quantum CNOT gate operation.
[0083] Measure the quantum bits q1 to q1 respectively after repeatedly executing the first series of quantum gate sub-operations. m The corresponding expected values are obtained for quantum bits q1 to q m-1 The expected value of the corresponding observableE P1 to E Pm-1 , generating the first expected value subset and the last quantum bit q in the first quantum neural network m In observable O i Expected value under E i , generate the second expected value subset, where, E P1 The quantum bit q1 is measured in the observable P The expected value of 1, E Pm-1 is the quantum bit q m-1 In observable P m-1 The first expected value set includes the first expected value subset and the second expected value subset, and the observable O i is the quantum Pauli gate, i is a positive integer not greater than 8.
[0084] In some examples, the observable O i The observable set formed by O i}={ I,I,X,X,Y,Y,Z,Z}, where I is the unit matrix, X is the matrix corresponding to the quantum Pauli-X gate, Y is the matrix corresponding to the quantum Pauli-Y gate, and Z is the matrix corresponding to the quantum Pauli-Z gate.
[0085] Specifically, the expected value E = , for The conjugate transpose of P 1 、P 2... P m-1 are all "2×2" square matrices and can be one of the four Pauli matrices ( I, X, Y, Z ),For example, P 1 or P 2... or P m-1 =Z, or it can be a combination of a series of Pauli matrices, for example, P 1 or P 2... or P m-1=0.3X+0.7Z.
[0086] S103, based on the second quantum neural network, performing a second quantum gate series operation on each quantum bit in the second quantum neural network, respectively obtaining the expected value of each quantum bit in the second quantum neural network after performing the second quantum gate series operation under the respective corresponding observables, and obtaining a second expected value set.
[0087] In some examples, the step specifically includes:
[0088] The quantum bits q m+1 To q n+1 Initialize to state;
[0089] The angle encoding method is adopted to encode the quantum bit q m+2 To q n+1 Perform the first quantum rotating gate operation;
[0090] The quantum bits q m+1 Prepared into quantum state , where the quantum state is the observable O i eigenvectors below;
[0091] For each quantum bit q in each quantum state m+1 and the quantum bit q after the first quantum rotating gate operation m+2 To q n+1 , using the second quantum neural network, repeatedly performing a second series of quantum gate sub-operations, wherein the second series of quantum gate sub-operations include:
[0092] For quantum bit q m+1 Perform a quantum gate rotation gate operation.
[0093] The quantum bit q before the revolving door operation m+1 As the control qubit of the mth quantum CNOT gate, the qubit q m+2 As the target qubit of the mth quantum CNOT gate, the qubit q m+2 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation m+2 Perform the second quantum rotating gate operation.
[0094] Specifically, Figure 2 or Figure 4 As shown, in the quantum bit q m+2, q m+3 ...q n+1 Apply a quantumR y The door will be the classic data Corresponding to the encoding of quantum bit q m+2, q m+3 ...q n+1 On the quantum bit q m+2 To q n+1 Perform the first quantum rotating gate operation; on the quantum bit q m+1, q m+2 ...q n+1 Again, a quantum R y The gate will have trainable parameters Corresponding to the encoding of quantum bit q m+1, q m+2 ...q n+1 On the quantum bit q m+1 Perform quantum gate rotation gate operation on quantum bit q m+2, q m+3 ...q n+1 Perform the second quantum gate rotation gate operation.
[0095] The quantum bit q that has been operated by the quantum CNOT gate m+2 As the m+1th quantum
[0096] The control qubit of the CNOT gate will be the qubit q that has been operated by the first quantum rotation gate. m+3 As the target qubit of the m+1th quantum CNOT gate, the qubit q m+3 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation m+3 Perform the second quantum rotating gate operation; and so on, the quantum bit q n As the control qubit of the nmth quantum CNOT gate, the qubit q n+1 As the target qubit of the nmth quantum CNOT gate, the qubit q n+1 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation n+1 Perform the second quantum rotating gate operation.
[0097] Measure the quantum bit q after repeatedly executing the second series of quantum gate sub-operations m+1 To q n+1 The corresponding expectation value is obtained as the quantum bit q m+1 To q n+1 The expected value of the corresponding observable E i,Pm+1 toE i,Pn+1 , generate the second expected value set, where, E i,Pm+1 is the quantum bit q m+1 In When the quantum bit q m+1 In the observable quantity P m+1 The expected value under E i,Pn+1 is the quantum bit q m+1 In When the quantum bit q n+1 In the observable quantity P n+1 The expected value below.
[0098] In some examples, the quantum state The quantum state set formed by , .
[0099] S104, based on the first expected value set and the second expected value set, respectively determine the final expected values of the n quantum bits in the initial quantum neural network under their respective corresponding observable quantities to obtain a final expected value set.
[0100] In some examples, the step specifically includes:
[0101] Using the formula (1)
[0102] Calculate the quantum bits q1 to q respectively n The final expected value in the initial quantum neural network E ZX In formula (1), is the quantum bit q in the first quantum neural network m In observable O i The expected value under C i For the observable O i and quantum states The one-to-one corresponding eigenvalues, is the quantum bit q in the first quantum neural network x In the observable quantity P x The expected value under is the quantum bit q in the second quantum neural network m+1 In When the quantum bit q x+1 In the observable quantity P x+1 The expected value below.
[0103] Specifically, the quantum bit qm (i.e., the quantum state of the cutting point) It can be decomposed into a linear combination of the eigenvectors of the Pauli matrices I, X, Y, and Z, namely:
[0104] It can be seen that in In the case of can be decomposed into a linear combination of 8 terms, among which Represents the computational quantum state The expected value under the observable quantity I; Representing quantum states The outer product of is the matrix form of the quantum state, is the vector form of the quantum state.
[0105] Each of the above 8 items contains the observable quantity O i (Tr item and multiplied matrices), quantum states (the corresponding vector of the quantum state matrix after the Tr term), the eigenvalue c i (The coefficient before the Tr term) Information of the three.
[0106] Thus, we can obtain the observable quantity O i , quantum state and the eigenvalue c i The corresponding relationship is:
[0107] Therefore, the observable quantity O i Divided into 8 situations, . Accordingly, the quantum state Divided into 8 situations, ; Correspondingly, the eigenvalue c i Divided into 8 situations, .
[0108] S105, selecting two final expected values from the final expected value set according to the structure of the quantum circuit in the initial quantum neural network and performing binary classification on the digital image according to the two final expected values.
[0109] In some examples, the step specifically includes:
[0110] Based on the last two final expected values in the final expected value set, the digital image is classified into two categories.
[0111] Specifically, the final expected value selected is different depending on the quantum circuit structure in the initial quantum neural network. Figure 2As shown in the initial quantum neural network, since the quantum circuit corresponding to the initial quantum neural network passes all information down to the last two bits through multiple quantum CNOT gates, the final expected value corresponding to the last two bits in the initial quantum neural network is selected to realize the binary classification of digital images.
[0112] Example 2 Figure 5 As shown, the distributed computing device based on quantum bit cutting provided by an embodiment of the present invention includes: a cutting module, which is configured to cut the initial quantum neural network into multiple quantum neural networks according to the number of quantum bits in the initial quantum neural network, wherein the multiple quantum neural networks include at least a first quantum neural network and a second quantum neural network.
[0113] The first acquisition module is configured to perform a first quantum gate series operation on each quantum bit in the first quantum neural network based on the first quantum neural network, and respectively obtain the expected value of each quantum bit in the first quantum neural network under the respective corresponding observable quantity after the first quantum gate series operation is performed, so as to obtain a first expected value set.
[0114] The second acquisition module is configured to perform a second quantum gate series operation on each quantum bit in the second quantum neural network based on the second quantum neural network, and respectively obtain the expected value of each quantum bit in the second quantum neural network under the respective corresponding observable quantity after the second quantum gate series operation is performed, so as to obtain a second expected value set.
[0115] The determination module is configured to determine, based on the first expected value set and the second expected value set, respectively the final expected values of the n quantum bits in the initial quantum neural network under the respective corresponding observable quantities.
[0116] Embodiment 3 The handwritten digital image classification problem is an important problem in the field of image processing. One embodiment of the present invention is to solve the image binary classification problem of handwritten digits 3 and 6 in the MNIST dataset. Samples of digits 3 and 6 and their corresponding labels are extracted from the MNIST dataset as a training set, and each sample is a grayscale image composed of 25 pixels.
[0117] The distributed computing method based on quantum bit cutting provided by the present invention is applied to solve the above-mentioned image binary classification problem. First, a quantum neural network with 25 quantum bits and a circuit depth of 39 is constructed. Then, bit cutting is performed at the 13th quantum bit to split into two quantum neural networks with 13 quantum bits. For each quantum bit in the first quantum neural network, the last bit q is measured respectively. 13 In 8 observables O iExpected value under ; For the first quantum bit in the second quantum neural network, prepare the same 8 observables as above O i One-to-one correspondence between 8 quantum states , in each quantum state, measure the last two bits q in the second quantum neural network respectively 25 and q 26 The expected value under the observable Z Finally, according to and Calculate the expected value of the last two bits in the initial quantum neural network under the observable quantity Z , expected value It can be used as the basis for binary classification of images.
[0118] The specific steps are described as follows:
[0119] Step 1: Encode each pixel with a quantum bit to obtain the initial quantum neural network. According to the number of quantum bits n=25, take , the initial quantum neural network is cut into the first quantum neural network and the second quantum neural network. The first quantum neural network contains m=13 quantum bits q1 to q 13 The second quantum neural network contains n-m+1=25-13+1=13 quantum bits q 14 To q 26 ;
[0120] Step 2: Transfer quantum bits q1 to q 13 The quantum state is initialized to ;
[0121] Step 3: Use angle encoding to encode the quantum bits q1 to q 13 Apply quantum R y The gate samples the pixels in Encoded into each quantum bit separately;
[0122] Step 4: In qubits q1 to q 13 Repeat three times by quantum R y The quantum gate operation consisting of the gate and the quantum CNOT gate, that is, the quantum bit q1 to q 13 Repeat the first quantum gate series operation three times;
[0123] Step 5: Measure the qubit q 13 In 8 observables O i Expected value under ;
[0124] Step 6: Separately convert the quantum bits q 14 To q 26 The quantum state is initialized to ;
[0125] Step 7: Use angle encoding to encode the quantum bit q 15 To q 26 Apply one on each R y The gate will sample the pixels Encoded into quantum bits q 15 To q 26 superior;
[0126] Step 8: On the qubit q 14 8 initial states were prepared ;
[0127] Step 9: In the 8 cases, in the quantum bit q 14 To q 26 Repeat three times by quantum R y The quantum gate combination consisting of a gate and a quantum CNOT gate, that is, for the quantum bit q 14 To q 26 Repeat the second quantum gate series operation three times;
[0128] Step 10: For 8 cases, measuring the quantum bit q in the second quantum neural network respectively 25 ,q 26 The expected value under the observable Z , ;
[0129] Step 11: Calculate the last two quantum bits q in the initial quantum neural network separately 24 ,q 25 Expected value E 24 , E 25 , the calculation formula is as follows:
[0130] (2)
[0131] In formula (2), c i For the observable O i and quantum states The one-to-one corresponding eigenvalues, Representing the quantum bit q in the first quantum neural network 13In observable O i The expected value under Represents the quantum bit q in the second quantum neural network 14 In When the quantum bit q in the second quantum neural network is 25 The expected value under the observable quantity Z, Represents the quantum bit q in the second quantum neural network 14 In When the quantum bit q in the second quantum neural network is 26 The expected value under the observable Z.
[0132] Step 12: If , then the handwritten digital image is determined to be the number 3; otherwise, the handwritten digital image is determined to be the number 6.
[0133] Through a bit cutting, the original quantum neural network is split into two quantum neural networks. The two quantum neural networks form a distributed quantum neural network, which can equivalently obtain the expected value of each quantum bit of the original quantum neural network, thereby achieving the same function as the original quantum neural network. If the bit cutting is continued on the two nodes respectively, it can be further split into several smaller-scale quantum neural networks.
[0134] The distributed computing method based on quantum bit cutting proposed in the present invention is used to solve the binary classification problem of the images of handwritten digits 3 and 6 in the MNIST data set. The initial quantum neural network containing 25 quantum bits and a circuit depth of 39 is split into a software model containing 2 quantum neural networks, each node containing 13 quantum bits, the circuit depth of the first node is 20, and the maximum circuit depth of the second node is 22. After 2 rounds of training, the software model can achieve a classification accuracy of 91.10%, each round of training takes about 1 hour and 30 minutes, and the total training takes about 3 hours.
[0135] In contrast, since the initial quantum neural network contains 25 quantum bits, the data calculation burden of the corresponding model is too large, and each round of training takes much longer than 24 hours, so the training cannot be completed within the effective time. In addition, there are some other algorithm examples for solving similar image binary classification problems: the centralized quantum neural network model built and trained in TensorFlow Quantum also performs binary classification on images of handwritten digits 3 and 6 in the MNIST dataset, with an accuracy rate of only 90.42%; the centralized quantum neural network model built and trained in TensorCircuit performs binary classification on images of handwritten digits 1 and 5 in the MNIST dataset, with an accuracy rate of only 72.00%. The most important point is that the related work is all based on centralized quantum neural networks. Under the premise of adopting the same encoding method, the number of quantum bits required is relatively large, which is not easy to physically realize.
[0136] In summary, the distributed computing method based on quantum bit cutting provided by the present invention has lower requirements on the number of quantum bits, from 25 to 13; the line depth is shallower, from 39 to no more than 22, which is easier to implement on NISQ devices; and it has a faster computing speed, and the total time for model training is reduced from more than 24 hours to about 3 hours; at the same time, it has higher computing quality, and the classification accuracy rate reaches 91.10%, which is higher than the related work. Therefore, the distributed computing method based on quantum bit cutting proposed by the present invention can accurately complete the task of binary classification of digital images.
[0137] Example 4 In Example 3, a bit cutting operation was applied to split a large-scale initial quantum neural network containing n quantum bits into two small-scale quantum neural networks containing m and n-m+1 quantum bits respectively.
[0138] This scheme uses two bit-cutting operations to split a large-scale initial quantum neural network containing n quantum bits into three small-scale quantum neural networks containing m, k, and nm-k+2 quantum bits respectively. By adding one bit-cutting operation, this scheme can solve the image binary classification problem more efficiently. The overall circuit structure of the initial quantum neural network corresponding to the quantum computing method provided by this scheme is as follows Figure 6 The circuit structures of the quantum neural network obtained by two bit cuttings are shown as follows. Figure 7 , 89. Under this scheme, the specific steps of the distributed computing method based on quantum bit cutting provided by the embodiment of the present invention are as follows: Step 1: According to the number of quantum bits n of the large-scale initial quantum neural network, the large-scale initial quantum neural network is cut into a quantum neural network including a third quantum neural network, a fourth quantum neural network and a fifth quantum neural network, wherein the third quantum neural network includes m quantum bits, the fourth quantum neural network includes k quantum bits, and the fifth quantum neural network includes nm-k+2 quantum bits, wherein, , .
[0139] Step 2: Initialize each qubit in the third quantum neural network to state.
[0140] Step 3: Use angle encoding to perform the first quantum rotating gate operation on each quantum bit in the third quantum neural network.
[0141] Step 4: Repeat the operation of quantum R on each qubit in the third quantum neural network. y The quantum gate composed of the gate and the quantum CNOT gate is operated p times, and the execution process of each time is: 1,1 To q1, m Perform the second quantum rotating gate operation;
[0142] The quantum bit q1,1 after the second rotation gate operation is used as the control quantum bit of the first quantum CNOT gate, the quantum bit q1,2 after the second quantum rotation gate operation is used as the target quantum bit of the first quantum CNOT gate, and the quantum CNOT gate operation is performed on the quantum bit q1,2;
[0143] The quantum bit q1,2 after the quantum CNOT gate operation is used as the control quantum bit of the second quantum CNOT gate, the quantum bit q1,3 after the second quantum rotation gate operation is used as the target quantum bit of the second quantum CNOT gate, and the quantum CNOT gate operation is performed on the quantum bit q1,3;
[0144] By analogy, the quantum bit q1 after the m-2th quantum CNOT gate operation, m-1 As the control qubit of the m-1th quantum CNOT gate, the qubit after the second quantum rotation gate operation is q1. m is the target qubit of the m-1th quantum CNOT gate, for qubit q1, m Perform quantum CNOT gate operation.
[0145] Step 5: Measure the qubits of the first node In their respective observable Expected value under .
[0146] Step 6: Measure the quantum bit q1 of the first node, m In the observable quantity O i The expected value under i There are 8 situations in total. , I, X, Y, Z are 4 quantum Pauli gates, and a total of 8 expected values are obtained by measurement .
[0147] Step 7: Initialize each qubit in the fourth quantum neural network to state.
[0148] Step 8: Use angle encoding to encode each quantum bit in the fourth quantum neural network Apply an R y The door will be the classic data Encoded into quantum bits On the quantum bit Perform the first quantum rotating gate operation.
[0149] Step 9: Qubit q in the fourth quantum neural network 2,1 Preparation of quantum states , Corresponding to the 8 observable quantities O in step 6 i respective eigenvectors.
[0150] Step 10: For The 8 cases are repeated r times for all quantum bits in the fourth quantum neural network by the quantum CNOT gate and quantum R y The quantum gate operation composed of the gate, each quantum gate operation is as follows:
[0151] For quantum bit q 2,1 Perform a quantum gate rotation gate operation.
[0152] The quantum bit q before the revolving door operation 2,1 As the control qubit, the qubit q that has undergone the first quantum rotation gate operation is 2,2 As the target quantum bit, the quantum bit q 2,2 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation 2,2 Perform the second quantum rotating gate operation.
[0153] The quantum bit q that has been operated by the quantum CNOT gate 2,2As the control qubit, the qubit q that has undergone the first quantum rotation gate operation is 2,3 As the target quantum bit, the quantum bit q 2,3 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation 2,3 Perform the second quantum rotating gate operation; and so on, the quantum bit q 2,k-1 As the control qubit, the qubit q that has undergone the first quantum rotation gate operation is 2,k As the target quantum bit, the quantum bit q 2,k Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation 2,k Perform the second quantum rotating gate operation.
[0154] Step 11: For 8 cases to measure the quantum bits in the fourth quantum neural network In the corresponding observable Expected value under .
[0155] Step 12: For 8 cases, measuring the last quantum bit q in the fourth quantum neural network respectively 2,k In the observable quantity O j The expected value under j There are 8 situations in total. , a total of 8 expected values were obtained .
[0156] Step 13: Initialize each quantum bit in the fifth quantum neural network to .
[0157] Step 14: Use angle encoding to encode the quantum bits in the fifth quantum neural network A quantum R is applied to each y The door will be the classic data Encoded into quantum bits On the quantum bit Perform the first quantum revolving door.
[0158] Step 15: Qubit q in the fifth quantum neural network 3,1 Preparation of quantum states ,in, Corresponding to the 8 observable quantities O in step 12 j respective eigenvectors.
[0159] Step 16: For In the 8 cases, each quantum bit in the fifth quantum neural network is repeatedly executed t times by the quantum CNOT gate and the quantum R y The quantum gate operation consists of a gate, where each quantum gate operation is as follows:
[0160] For quantum bit q 3,1 Perform quantum gate revolving door operations;
[0161] The quantum bit q before the revolving door operation 3,1 As the control qubit, the qubit q that has undergone the first quantum rotation gate operation is 3,2 As the target quantum bit, the quantum bit q 2,2 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation 3,2 Perform the second quantum rotating gate operation;
[0162] The quantum bit q that has been operated by the quantum CNOT gate 3,2 As the control qubit, the qubit q that has undergone the first quantum rotation gate operation is 3,3 As the target quantum bit, the quantum bit q 3,3 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation 3,3 Perform the second quantum rotating gate operation; and so on, the quantum bit q 3,n-m-k+1 As the control qubit, the qubit q that has undergone the first quantum rotation gate operation is 3,n-m-k+2 As the target quantum bit, the quantum bit q 3,n-m-k+2 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation 3,n-m-k+2 Perform the second quantum rotating gate operation.
[0163] Step 17: For 8 cases to measure the quantum bits in the fifth quantum neural network In their respective observable Expected value under .
[0164] Step 18: Calculate the n quantum bits of the large-scale initial quantum neural network in the observable Expected value under , the calculation formula is as follows:
[0165] (3)
[0166] In formula (3), E Px (1) is the quantum bit q in the third quantum neural network1,x In the observable quantity P x The expected value under i (1) is the quantum bit q in the third quantum neural network 1,m In observable The expected value under i,j (2) is the quantum bit q in the fourth quantum neural network 2,1 In quantum state When the quantum bit q 2,k In the observable quantity O j The expected value under is the quantum bit q in the fourth quantum neural network 2,1 In quantum state When each quantum bit is in its corresponding observable quantity P x-m+1 The expected value under is the quantum bit q in the fifth quantum neural network 3,1 In quantum state When each quantum bit is in its corresponding observable quantity P x-m-k+2 The expected value under i is the 8 observable quantities O in step 6 i The corresponding eigenvalues are, , c j Corresponding to the 8 observable quantities O in step 12 j Their respective eigenvalues, .
[0167] At this point, this scheme has split the large-scale initial quantum neural network into three nodes through two bit cuts. The three together constitute a distributed quantum neural network, which can equivalently obtain the expected value of each quantum bit of the initial quantum neural network, thereby achieving the same function as the original quantum neural network.
[0168] This solution is applied to solve the problem of solving the binary classification of images of handwritten digits 3 and 6 in the MNIST data set in Example 3. Then, in the original quantum neural network containing 25 bits, the 9th and 17th bits are cut and split into three quantum neural networks, each of which contains 9 quantum bits. Finally, the expected values of the 8th and 9th quantum bits of the third quantum neural network under their respective corresponding observables are measured. According to the following formula, the expected values E of the last two quantum bits in the original quantum neural network under the observable Z can be obtained: Z24 、E Z25 :
[0169] (4)
[0170] like , then it is determined that the handwritten digital image is the number 3, otherwise, it is determined that the handwritten digital image is the number 6.
[0171] In formula (4), E i (1) is the quantum bit q in the third quantum neural network 1,m In the observable quantity O i The expected value under i,j (2) is the quantum bit q in the fourth quantum neural network 2,1 In quantum state When the quantum bit q 2,k In the observable quantity O j The expected value under is the quantum bit q in the fifth quantum neural network 3,1 In quantum state When , the expected value of the 8th quantum bit in the fifth quantum neural network under the observable quantity Z is, is the quantum bit q in the fifth quantum neural network 3,1 In quantum state When , the expected value of the 9th quantum bit in the fifth quantum neural network under the observable quantity Z.
[0172] This scheme is applied to solve the binary classification problem of handwritten digits 3 and 6 in the MNIST dataset. The initial quantum neural network with 25 qubits and a circuit depth of 48 is split into a software model with three nodes. Each node contains 9 qubits. The circuit depth of the first node is 16, the maximum circuit depth of the second node is 20, and the maximum circuit depth of the third node is 18. After two rounds of training, the classification accuracy of each quantum neural network can reach 92.80%. Each round of training takes about 15 minutes, and the total training takes about 30 minutes.
[0173] Obviously, compared with the technical solution recorded in Example 3, this solution has a lower requirement for the number of quantum bits of the computing nodes (each quantum neural network after cutting), from 13 to 9; the accuracy of the binary classification of digital images is improved from 91.10% to 92.80%; the total training time of the quantum neural network is shortened again, from about 3 hours to about 30 minutes, which improves the training efficiency. Therefore, this solution further improves the performance of the technical solution in Example 3, and can efficiently complete the image binary classification problem in Example 3.
[0174] Figure 7 In, O i is an observable quantity, which is divided into 8 cases: .
[0175] Figure 8 middle, Representation and Figure 7 The observable quantity O shown i The corresponding eigenvectors are divided into 8 cases: ,in, , O j is an observable quantity, which is divided into 8 cases: .
[0176] Fig. 9 middle, Representation and Figure 8 The observable quantity O shown j The corresponding eigenvectors are divided into 8 cases: ,in, .
[0177] A classic computer used to implement an electronic device is, for example, any electronic device that can provide a user interface and has a processing host, such as a classic personal computer, an industrial computer, a workstation, etc. Fig.10 As shown, Fig.10 6 is a principle block diagram of an electronic device as a classic electronic device according to an embodiment of the present invention. The electronic device includes a processor 601 and a memory 602 storing computer program instructions.
[0178] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0179] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (Zard DisZamiltonian Drive, ZDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0180] The memory may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the distributed computing method based on quantum bit cutting provided according to an embodiment of the present invention.
[0181] In one example, the electronic device may further include a communication interface 603 and a bus 610. Fig.10 As shown, the processor 601, the memory 602, and the communication interface 603 are connected and communicate with each other via a bus 610. The electronic device in the embodiment of the present application may be a server or other electronic device, or may be a cloud server.
[0182] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0183] Bus 610 includes hardware, software or both, and couples the components of online data traffic billing equipment to each other. For example, but not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (ZT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnect (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. Where appropriate, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0184] The embodiment of the present invention also provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are executed by the processor, the aforementioned distributed computing method based on quantum bit cutting is implemented. Wherein, the computer-readable storage medium is, for example, a classical computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device, or a storage medium for storing quantum information and readable by a quantum computer, such as a quantum random access memory (QRAM). QRAM can be regarded as a quantum version of RAM in a classical computer. Through QRAM, a quantum superposition state containing information can be created. Compared with RAM, which needs to be read one by one, superimposed data can be read with superimposed addresses. QRAM can be implemented in physical ways such as optics, semiconductor quantum dots, superconducting circuits, ion traps, etc.
[0185] The flowcharts and / or block diagrams of the methods, devices, systems, and computer program products of the embodiments of the present invention are described above by way of example, and various aspects of the related aspects are described. It should be understood that each box or combination thereof in the flowchart and / or block diagram may be implemented by computer program instructions, or may be implemented by dedicated hardware that performs a specified function or action, or may be implemented by a combination of dedicated hardware and computer instructions. For example, these computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to form a machine that enables these instructions executed by such a processor to enable the implementation of the functions / actions specified in each box or combination thereof in the flowchart and / or block diagram. Such a processor may be a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit.
[0186] The functional blocks shown in the structural block diagram of the embodiment of the present invention can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required task. The program or code segment can be stored in a memory, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0187] It should be noted that the present invention is not limited to the specific configurations and processes described above or shown in the figures. The above is only a specific implementation mode of the present invention. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the described system, device, module or unit can refer to the corresponding process in the method embodiment without further description. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be covered within the protection scope of the present invention.
Claims
1. A distributed computing method based on quantum bit cutting, It is characterized in that The following steps are involved: According to the number of quantum bits in the initial quantum neural network, the initial quantum neural network is cut into a plurality of quantum neural networks, wherein the plurality of quantum neural networks at least include a first quantum neural network and a second quantum neural network; Based on the first quantum neural network, performing a first series of quantum gate operations on each quantum bit in the first quantum neural network, respectively obtaining expected values of each quantum bit in the first quantum neural network under respective corresponding observables after the first series of quantum gate operations are performed, and obtaining a first expected value set; Based on the second quantum neural network, performing a second series of quantum gate operations on each quantum bit in the second quantum neural network, respectively obtaining expected values of each quantum bit in the second quantum neural network under respective corresponding observables after performing the second series of quantum gate operations, and obtaining a second expected value set; Based on the first expected value set and the second expected value set, respectively determining the final expected values of the n quantum bits in the initial quantum neural network under the respective corresponding observable quantities to obtain a final expected value set; According to the structure of the quantum circuit in the initial quantum neural network, two final expected values are selected from the final expected value set and the digital image is binary classified according to the two final expected values.
2. The distributed computing method based on quantum bit cutting according to claim 1, Features: The first quantum neural network includes m quantum bits q 1 To q m and m subcircuits, one subcircuit corresponds to one quantum bit, the first subcircuit includes a first quantum rotating gate, the second subcircuit includes a second quantum rotating gate and a first quantum CNOT gate, the third subcircuit includes a third quantum rotating gate and a second quantum CNOT gate, and so on, the mth subcircuit includes an mth quantum rotating gate and an m-1th quantum CNOT gate; the second quantum neural network includes n-m+1 quantum bits q m+1 To q n+1 And n-m+1 sub-circuits, the m+1th sub-circuit includes the m+1th quantum rotation gate and the mth quantum CNOT gate, the m+2th sub-circuit includes the m+2th quantum rotation gate and the m+1th quantum CNOT gate, and so on, the n-m+1th sub-circuit includes the n-m+1th quantum rotation gate and the nmth quantum CNOT gate.
3. The distributed computing method based on quantum bit cutting according to claim 2, It is characterized in that Based on the first quantum neural network, a first quantum gate series operation is performed on each quantum bit in the first quantum neural network, and the expected value of each quantum bit in the first quantum neural network after the first quantum gate series operation is performed under the respective corresponding observable quantity is obtained, and the first expected value set includes: The quantum bits q 1 To q m Initialize to state; The angle encoding method is adopted to encode the quantum bit q 1 To q m Perform the first quantum rotating gate operation; For the quantum bit q that has completed the first quantum rotating gate operation 1 To q m , using the first quantum neural network, repeatedly performing a first quantum gate series of sub-operations, wherein the first quantum gate series of sub-operations includes: For quantum bits q 1 To q m Perform the second quantum rotating gate operation; The quantum bit q that undergoes the second rotating gate operation 1 As the control qubit of the first quantum CNOT gate, the qubit q 2 As the target qubit of the first quantum CNOT gate, the qubit q 2 Perform quantum CNOT gate operations; The quantum bit q that has been operated by the quantum CNOT gate 2 As the control qubit of the second quantum CNOT gate, the qubit q 3 As the target qubit of the second quantum CNOT gate, the qubit q 3 Perform quantum CNOT gate operations; By analogy, the m-1th quantum bit after the m-2th quantum CNOT gate operation is used as the control quantum bit of the m-1th quantum CNOT gate, and the quantum bit after the second quantum rotation gate operation is used as the q m is the target qubit of the m-1th quantum CNOT gate, and for qubit q m Perform quantum CNOT gate operations; Measure the quantum bit q after repeatedly executing the first series of quantum gate sub-operations 1 To q m The corresponding expectation value is obtained as the quantum bit q 1 To q m-1 The expected value of the corresponding observable E P1 to E Pm-1 , generating the first expected value subset and the last quantum bit q in the first quantum neural network m In observable O i Expected value under E i , generate the second expected value subset, where, E P1 is the quantum bit q 1 In the observable quantity P 1 The expected value under E Pm-1 is the quantum bit q m-1 In observable P m-1 The first expected value set includes the first expected value subset and the second expected value subset, and the observable O i is the quantum Pauli gate, i is a positive integer not greater than 8.
4. The distributed computing method based on quantum bit cutting according to claim 3, It is characterized in that Based on the second quantum neural network, a second quantum gate series operation is performed on each quantum bit in the second quantum neural network, and the expected value of each quantum bit in the second quantum neural network after the second quantum gate series operation is performed under the respective corresponding observable quantity is obtained, and the second expected value set includes: The quantum bits q m+1 To q n+1 Initialize to state; The angle encoding method is adopted to encode the quantum bit q m+2 To q n+1 Perform the first quantum rotating gate operation; The quantum bits q m+1 Prepared into quantum state , where the quantum state For observable eigenvectors below; For each quantum state The quantum bit q m+1 and the quantum bit q after the first quantum rotating gate operation m+2 To q n+1 , using the second quantum neural network, repeatedly performing a second series of quantum gate sub-operations, respectively, wherein the second series of quantum gate sub-operations include: For quantum bit q m+1 Perform quantum gate revolving door operations; The quantum bit q before the revolving door operation m+1 As the control qubit of the mth quantum CNOT gate, the qubit q m+2 As the target qubit of the mth quantum CNOT gate, the qubit q m+2 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation m+2 Perform the second quantum rotating gate operation; The quantum bit q that has been operated by the quantum CNOT gate m+2 As the control qubit of the m+1th quantum CNOT gate, the qubit q m+3 As the target qubit of the m+1th quantum CNOT gate, the qubit q m+3 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation m+3 Perform the second quantum rotating gate operation; and so on, the quantum bit q n As the control qubit of the nmth quantum CNOT gate, the qubit q n+1 As the target qubit of the nmth quantum CNOT gate, the qubit q n+1 Perform quantum CNOT gate operation on the quantum bit q after the quantum CNOT gate operation n+1 Perform the second quantum rotating gate operation; Measure the quantum bit q after repeatedly executing the second series of quantum gate sub-operations m+1 To q n+1 The corresponding expectation value is obtained as the quantum bit q m+1 To q n+1 The expected value of the corresponding observable E i,Pm+1 to E i,Pn+1 , generate the second expected value set, where, E i,Pm+1 is the quantum bit q m+1 In When the quantum bit q m+1 In the observable quantity P m+1 The expected value under E i,Pn+1 is the quantum bit q m+1 In When the quantum bit q n+1 In the observable quantity P n+1 The expected value below.
5. The distributed computing method based on quantum bit cutting according to claim 4, It is characterized in that Based on the first expected value set and the second expected value set, respectively determining the final expected values of the n quantum bits in the initial quantum neural network under the respective corresponding observable quantities includes: Using the formula , respectively calculate the quantum bit q 1 To q n The final expected value in the initial quantum neural network E PX ,in, E i (1) is the quantum bit q in the first quantum neural network m In observable O i The expected value under c i For the observable O i and quantum states The one-to-one corresponding eigenvalues, is the quantum bit q in the first quantum neural network x In the observable quantity P x The expected value under is the quantum bit q in the second quantum neural network m+1 In When the quantum bit q x+1 In the observable quantity P x+1 The expected value below.
6. The distributed computing method based on quantum bit cutting according to claim 5, It is characterized in that According to the structure of the quantum circuit in the initial quantum neural network, two final expected values are selected from the final expected value set and the digital image is classified into two categories according to the two final expected values. Based on the last two final expected values in the final expected value set, the digital image is classified into two categories.
7. The distributed computing method based on quantum bit cutting according to claim 5, It is characterized in that The observable O i The observable set formed by O i }={ I,I,X,X,Y,Y,Z,Z }, the quantum state The quantum state set formed = , where I is the unit matrix, X is the matrix corresponding to the quantum Pauli-X gate, Y is the matrix corresponding to the quantum Pauli-Y gate, and Z is the matrix corresponding to the quantum Pauli-Z gate.
8. A distributed computing device based on quantum bit cutting, It is characterized in that include: A cutting module is configured to cut the initial quantum neural network into a plurality of quantum neural networks according to the number of quantum bits in the initial quantum neural network, wherein the plurality of quantum neural networks at least include a first quantum neural network and a second quantum neural network; A first acquisition module is configured to perform a first quantum gate series operation on each quantum bit in the first quantum neural network based on the first quantum neural network, and respectively obtain the expected value of each quantum bit in the first quantum neural network under the respective corresponding observable after the first quantum gate series operation is performed, so as to obtain a first expected value set; A second acquisition module is configured to perform a second quantum gate series operation on each quantum bit in the second quantum neural network based on the second quantum neural network, and respectively obtain the expected value of each quantum bit in the second quantum neural network after the second quantum gate series operation is performed under the respective corresponding observables, to obtain a second expected value set; A determination module is configured to determine, based on the first expected value set and the second expected value set, final expected values of the n quantum bits in the initial quantum neural network under the respective corresponding observables to obtain a final expected value set; The classification module is configured to select two final expected values from the final expected value set according to the structure of the quantum circuit in the initial quantum neural network and perform binary classification on the digital image according to the two final expected values.
9. A computing device, It is characterized in that It comprises a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the distributed computing method based on quantum bit cutting as described in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the distributed computing method based on quantum bit cutting described in any one of claims 1 to 7.
Citation Information
Patent Citations
Cancer cell image recognition device and equipment based on quantum gate circuit neural networks
CN108921049A
Design method and system of quantum convolutional neural network based on quantum circuit
CN116341666A
