Distributed Quantum Computing Method, Apparatus, Device, and Medium
Through the distributed quantum computing method, complex problems are disassembled into small-scale subtasks and solved on multiple nodes, solving the problem of excessive demand for quantum resources in the existing technology, and improving computing efficiency and accuracy.
Patent Information
- Application Number
- CN202510281397.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-03-11
AI Technical Summary
In the era of noise-containing medium-scale quantum (NISQ), existing quantum algorithms require a large number of quantum resources in practical applications, making it difficult to efficiently solve classical computing problems.
The distributed quantum computing method is used to disassemble complex problems into multiple small-scale subtasks, and solve them on multiple computing nodes in serial or parallel manner to reduce the demand for quantum resources, and utilize the number of existing quantum bits to reduce the impact of line noise.
It improves computing accuracy and quantum fidelity, reduces the demand for quantum resources, and achieves efficient solution to classical computing problems.
Smart Images

Figure CN119783841B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing technology, and in particular to distributed quantum computing methods, devices, equipment and media. Background Art
[0002] Quantum algorithms are algorithms that run on quantum computers and represent a cutting-edge computing technology. They use properties such as quantum superposition and quantum entanglement in quantum mechanics to solve problems that are difficult to solve with traditional algorithms. Compared with classical algorithms, quantum algorithms use quantum bits (Qubit) as the basic carrier of information and can explore multiple possible solutions at the same time, thereby achieving significant superiority over classical computing on specific problems.
[0003] To date, researchers have developed a series of quantum algorithms and achieved remarkable results in many fields. For example, the Shor algorithm uses quantum parallelism to effectively factor large integers in polynomial time, which has brought revolutionary impacts to the field of cryptography; the Grover algorithm uses quantum search technology to achieve quadratic search efficiency in disordered databases; the Simon algorithm inspired quantum algorithms based on quantum computing's Fourier transform, which is used in the most famous Shor algorithm. These quantum algorithms all highlight the superiority of quantum computing in dealing with specific complex problems, and foreshadow broad application prospects for the future development of quantum computing technology.
[0004] Although quantum algorithms currently have unparalleled advantages over traditional computing when dealing with specific complex problems and have broad application prospects, in actual application scenarios, a large amount of quantum resources are required to implement the aforementioned various quantum algorithms to solve specific problems. For the current noisy intermediate-scale quantum (NISQ) era, the implementation of these quantum algorithms is very difficult due to the processing scale of current general-purpose quantum computers. Summary of the invention
[0005] In view of the technical problems existing in the prior art, the present invention proposes a distributed quantum computing method, device, equipment and medium to reduce the demand for quantum resources when solving classical computing problems in a quantum way.
[0006] In order to solve the above technical problems, according to one aspect of the present invention, the present invention provides a distributed quantum computing method, the method comprising the following steps:
[0007] Obtain the problem function to be solved, the number of computing nodes, and the number of domain qubits of each computing node, wherein the sum of the number of domain qubits of all computing nodes is equal to the number of original domain bits of the problem function to be solved;
[0008] Construct sub - problem functions corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved, where the domains of all sub - problem functions, when combined in a preset combination order, form the original domain of the function of the problem to be solved, and each sub - problem function includes a sub - problem solution to be obtained;
[0009] Construct quantum circuits for solving the sub - problem functions corresponding to each computing node;
[0010] Run the quantum circuits for solving the sub - problem functions to obtain the sub - problem solutions to be obtained;
[0011] Combine the corresponding sub - problem solutions in the preset combination order of the sub - problem function domains in the original domain of the function of the problem to be solved to obtain the solution of the function of the problem to be solved.
[0012] Optionally, the sub - problem function is a first problem function, and the number of range bits of the first problem function is equal to the number of original range bits of the function of the problem to be solved.
[0013] Optionally, the step of constructing sub - problem functions corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved includes:
[0014] Construct first problem functions corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved; the number of range bits of the first problem function is equal to the number of original range bits of the function of the problem to be solved;
[0015] Construct sub - problem functions with the number of range bits less than the number of original range bits of the function of the problem to be solved based on each first problem function, where the domain of the sub - problem function is the same as the domain of the first problem function, and map each first dependent variable value in the range of the first problem function to a sub - dependent variable value with the number of bits less than the number of bits of the original range of the function of the problem to be solved.
[0016] Optionally, the number of domain bits of the first problem function is 1, and / or the number of range bits of the sub - problem function is 1.
[0017] Optionally, the step of constructing first problem functions corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved includes:
[0018] Determine the same number of first bits as the domain bits of the first problem function from the bits of the original domain of the function of the problem to be solved according to the number of domain qubits of the computing node, and use the remaining second bits as the second domain bits; sequentially extract the first bit values from each original independent variable value of the original domain to form each first independent variable value of the first problem function, and all the first independent variable values form the domain of the first problem function of the target computing node;
[0019] Sequentially extract the second bit values from each original independent variable value of the original domain to form each second independent variable value, and all the second independent variable values form the second domain;
[0020] Combine each first independent variable value of the first problem function with each second independent variable value in the order of their respective bits in the original domain to form the original independent variable values in the original domain;
[0021] Obtain the original dependent variable values corresponding to the original independent variable values from the original range of the function of the problem to be solved as the first original dependent variable values;
[0022] Determine one first original dependent variable value as the first dependent variable value corresponding to the first independent variable value from the multiple first original dependent variable values corresponding to each first independent variable value according to the same value-taking function, where the first dependent variable values corresponding to each first independent variable value form the range of the first problem function of the target computing node.
[0023] Optionally, the step of constructing the first problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved further includes:
[0024] Sort all the computing nodes;
[0025] When determining the same number of first bits as the domain bits of the first problem function from the bits of the original domain of the function of the problem to be solved according to the number of domain qubits of the computing node, cut out the first bits with the same number as the number of domain qubits of each computing node from the bits of the original domain in the order from high to low or from low to high according to the sorting of the computing nodes to obtain the domain bits of the first problem function corresponding to each computing node.
[0026] Optionally, the input qubits corresponding to the quantum circuit for solving each sub-problem function include n j domain qubits and m j ancilla qubits, where the n jis the number of domain bits of the sub-problem function, and the number of domain bits of the sub-problem function is less than the number of original domain bits of the problem function to be solved; the m j is the number of range bits of the sub-problem function, and the number of range bits of the sub-problem function is less than or equal to the number of original range bits of the problem function to be solved; correspondingly, the steps of running the sub-problem function to solve the quantum circuit to obtain the corresponding sub-problem solution to be solved include:
[0027] Prepare the initial states of n j domain qubits and m j auxiliary qubits;
[0028] Based on the initial states of the n j domain qubits and m j auxiliary qubits, execute the sub-problem function to solve the quantum circuit, and measure the final states of the n j domain qubits;
[0029] Perform a tensor product calculation on the final states of the n j domain qubits to obtain the direct product state of the n j domain qubits, and the direct product state is the sub-problem solution to be solved;
[0030] Among them, the final states of the m j auxiliary qubits are the same as the initial states before executing the sub-problem function to solve the quantum circuit.
[0031] Optionally, the steps of respectively running the sub-problem function to solve the quantum circuit to obtain the sub-problem solution to be solved include: running multiple sub-problem function to solve the quantum circuits in a serial / parallel manner.
[0032] Optionally, when running multiple sub-problem function to solve the quantum circuits in a serial manner, after running the previous sub-problem function to solve the quantum circuit, prepare the initial states of the n j domain qubits of the next sub-problem function to solve the quantum circuit, and use the final states of the auxiliary qubits obtained after running the previous sub-problem function to solve the quantum circuit as the initial states of the auxiliary qubits of the next sub-problem function to solve the quantum circuit.
[0033] Optionally, the steps of combining the corresponding sub-problem solutions in the preset combination order of the domain of the sub-problem function in the original domain of the problem function to be solved to obtain the solution of the problem function to be solved include:
[0034] Perform a tensor product calculation on each sub-problem solution in turn according to the preset combination order of the domain of the sub-problem function in the original domain of the problem function to be solved, and the direct product state of the final states of the qubits corresponding to the number of original domain bits of the calculation result is used as the solution of the problem function to be solved.
[0035] To solve the above technical problems, according to another aspect of the present invention, the present invention also provides a distributed quantum computing device, which includes:
[0036] A parameter acquisition module, configured to acquire a problem function to be solved, the number of computing nodes, and the number of domain qubits of each computing node, wherein the sum of the number of domain qubits of all computing nodes is equal to the number of original domain bits of the problem function to be solved;
[0037] A sub-problem function construction module, configured to construct a sub-problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the problem function to be solved; when the domains of all sub-problem functions are combined together in a preset combination order, they form the original domain of the problem function to be solved, and each sub-problem function includes a sub-problem solution to be obtained;
[0038] A quantum circuit construction module, configured to construct a quantum circuit for solving the sub-problem function corresponding to each computing node;
[0039] An operation module, configured to send the quantum circuits for solving the sub-problem functions to the corresponding quantum computing modules respectively, and receive the measurement results returned by the quantum computing modules;
[0040] A calculation module, configured to calculate the sub-problem solutions to be obtained for the corresponding sub-problem functions based on the measurement results returned by the quantum computing modules when running the quantum circuits for solving the sub-problem functions; combine the corresponding sub-problem solutions in the preset combination order of the domain of the sub-problem function in the original domain of the problem function to be solved to obtain the solution of the problem function to be solved.
[0041] Optionally, the distributed quantum computing device further includes one or more quantum computing modules; when including one quantum computing module, the operation module sends the quantum circuits for solving multiple sub-problem functions to the quantum computing module in a serial manner, and when including multiple quantum computing modules, the operation module sends the constructed quantum circuits for solving multiple sub-problem functions to the multiple quantum computing modules in a serial and / or parallel manner; each quantum computing module runs the quantum circuit for solving the sub-problem function of the corresponding computing node and sends the measurement result to the processing device.
[0042] According to another aspect of the present invention, the present invention also provides an electronic device, including a processor and a memory, wherein computer instructions are stored in the memory, and when the processor runs the computer instructions, it executes the foregoing distributed quantum computing method.
[0043] According to another aspect of the present invention, the present invention further provides a computer-readable storage medium storing computer instructions, and when the computer instructions are run by a processor, the foregoing distributed quantum computing method is executed.
[0044] The present invention combines the concept of distributed computing with quantum algorithms, decomposes the solution task of complex classical computing problems that require intensive resources into a series of smaller-scale and more manageable subtasks. These subtasks can be assigned to one or more quantum computing modules and processed in a serial or parallel manner, achieving the efficient solution of classical computing problems. While reducing the demand for quantum resources, due to the reduction in the number of qubits applied, the impact of circuit noise on quantum states is also significantly reduced, thus improving the quantum fidelity and further improving the computational accuracy of the solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Next, the preferred embodiments of the present invention will be further described in detail with reference to the accompanying drawings, where:
[0046] Figure 1 is a flowchart of a distributed quantum computing method according to an embodiment of the present invention;
[0047] Figure 2 is a flowchart of a method for constructing a sub-problem function corresponding to a computing node according to an embodiment of the present invention;
[0048] Figure 3 is a flowchart of a method for constructing a first problem function corresponding to each computing node in the order from high to low according to an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of a known quantum circuit for a classical computing problem according to an embodiment of the present invention;
[0050] Figure 5 is a flowchart of running a sub-problem function to solve a quantum circuit;
[0051] Figure 6 is a schematic diagram of a quantum circuit for a problem to be solved according to an embodiment of the present invention;
[0052] Figure 7 is a schematic diagram of a quantum circuit for a problem to be solved according to another embodiment of the present invention;
[0053] Figure 8 is a schematic diagram of a quantum circuit of a Deutsch problem function according to an embodiment of the present invention;
[0054] Figure 9It is a flowchart of a method for calculating a problem to be solved based on multiple computing nodes and their quantum circuits according to an embodiment of the present invention;
[0055] Figure 10 It is a schematic diagram of a quantum circuit for solving a search problem function according to Application Embodiment 1 of the present invention;
[0056] Figure 11 It is a schematic diagram of a quantum circuit for solving a sub-problem function corresponding to a computing node according to Application Embodiment 2 of the present invention;
[0057] Figure 12 It is a schematic diagram of a quantum circuit for solving a Simon problem function according to Application Embodiment 2 of the present invention;
[0058] Figure 13 It is a schematic diagram of a quantum circuit for solving a BV problem function according to Application Embodiment 3 of the present invention;
[0059] Figure 14 It is a principle block diagram of a distributed quantum computing device according to an embodiment of the present invention;
[0060] Figure 15 It is a principle block diagram of a distributed quantum computing device according to another embodiment of the present invention;
[0061] Figure 16 It is a principle block diagram of a distributed quantum computing device according to yet another embodiment of the present invention;
[0062] Figure 17 It is a principle block diagram of an electronic device according to an embodiment of the present invention. Detailed implementation manners
[0063] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0064] In the following detailed description, reference is made to the various specification drawings that form a part of the present application and illustrate specific embodiments of the present application. In the drawings, like reference numerals describe generally similar components in different figures. The various specific embodiments of the present application are described in sufficient detail below so that those of ordinary skill in the relevant art and technology can implement the technical solutions of the present application. It should be understood that other embodiments may also be utilized or structural, logical, or electrical changes may be made to the embodiments of the present application. Additionally, the "first", "second", etc. in the technical feature names of the present invention are not used to indicate an order, but rather to distinguish different technical features with the same name.
[0065] In today's noisy intermediate-scale quantum (NISQ) era, compared to building a large-scale universal quantum computer, the technical path to realizing a small-scale quantum processor appears to be more practical and feasible. The concept of distributed quantum computing (DQC) is an innovative move that ingeniously combines the essence of distributed systems with quantum information processing technology. The implementation of this architecture relies on carefully designed distributed quantum algorithms to ensure its effectiveness in practical applications.
[0066] See Figure 1 , Figure 1 is a flowchart of a distributed quantum computing method according to an embodiment of the present invention for solving a classical computing problem P. The Boolean function corresponding to the classical computing problem P in the present invention is represented as fp: {0,1} n →{0,1} m , where n and m are natural numbers, and {0,1} n is called the function domain, n is the number of binary bits of the independent variable, simply referred to as the number of domain bits; {0,1} m is called the function range, and m is the number of binary bits of the dependent variable, simply referred to as the number of range bits. The method includes the following steps:
[0067] Step S1, obtain the function of the problem to be solved, the number of computing nodes, and the number of domain qubits of each computing node. Among them, the computing nodes in the present invention can also be referred to as computing tasks for completing one problem-solving. Multiple computing nodes are multiple computing tasks. Multiple computing tasks can be implemented serially by one quantum computing module or in parallel by multiple quantum computing modules. Each computing node includes at least qubits corresponding to the domain of the problem function, which are called the domain qubits of the computing node in the following description. Among them, the total number of domain qubits of all computing nodes is equal to the number of original domain bits of the problem function to be solved.
[0068] Step S2: Construct sub-problem functions corresponding to each computing node. Specifically, based on the number of domain qubits of each computing node and the original domain and original range of the problem function to be solved, construct sub-problem functions corresponding to each computing node. The domain of each sub-problem function is a sub-domain of the original domain. Each sub-problem function's domain has a unique position in the original domain. The positions of all sub-problem functions' domains in the original domain form a preset combination. When all sub-problem functions' domains are combined in the order of the preset combination, they form the original domain of the problem function to be solved. Each sub-problem function includes a sub-problem solution to be obtained. For ease of description, the sub-problem function is denoted as g j :{0,1} nj →{0,1} mj , where n j and m j are natural numbers, which are the number of domain bits and the number of range bits of the sub-problem function respectively. t is the number of computing nodes, and j is the computing node serial number.
[0069] Step S3: Construct quantum circuits for solving sub-problem functions corresponding to each computing node.
[0070] Step S4: Run the quantum circuits for solving sub-problem functions respectively to obtain the corresponding sub-problem solutions to be obtained.
[0071] Step S5: Combine the corresponding sub-problem solutions in the order of the positions of the sub-problem functions' domains in the original domain of the problem function to be solved to obtain the solution of the problem function to be solved.
[0072] In step S1, set the number of computing nodes to t, where the number of computing nodes t satisfies 2 ≤ t ≤ n. Based on the number of qubits of each computing node, determine the number of qubits n j that can be used for its domain, where j represents the serial number of any computing node, and j ∈ {0, 1,..., t - 1}. The sum of the number of domain qubits of all computing nodes is equal to the number of bits in the original domain of the problem function to be solved, that is, it satisfies
[0073] In an embodiment of step S2, the sub-problem function g j is a first problem function whose number of range bits is equal to the number of bits in the original range of the problem function to be solved, that is, m j = m. That is to say, the range of the sub-problem function g j is a sub-domain of the original range of the problem function to be solved. When constructing the first problem function corresponding to each computing node, refer to Figure 2 , Figure 2A flowchart of a method for constructing a first problem function corresponding to a computing node according to an embodiment of the present invention, which includes the following steps:
[0074] Step S21, divide the original domain of the problem function to be solved to obtain a composite domain. Specifically, according to the number of domain qubits of the computing node, the same number of first bits are determined from the bits of the original domain of the problem function to be solved as the domain bits of the first problem function, and the remaining second bits are used as the bits of the second domain; the first bit values are sequentially extracted from each original independent variable value of the original domain to form each first independent variable value of the first problem function, and all the first independent variable values form the domain of the first problem function of the computing node; the second bit values are sequentially extracted from each original independent variable value of the original domain to form each second independent variable value, and all the second independent variable values form the second domain. Among them, when determining the domain bits of the first problem function from the original domain bits of the problem function to be solved, any first bit in the original domain of the problem function to be solved can be used as the domain bit of the first domain of the first problem function, and the domain bits of the first domain of all the first problem functions corresponding to all the computing nodes do not repeat. The domain and the second domain of each first problem function constitute the composite domain.
[0075] Step S22, obtain the corresponding original dependent variable value as the first original dependent variable value from the original range of the problem function to be solved based on the composite domain. Specifically, a first independent variable value of the first problem function and each second independent variable value are combined together in the order of their respective bits in the original domain to form an original independent variable value in the original domain, and the corresponding original dependent variable value is obtained from the original range of the problem function to be solved as the first original dependent variable value.
[0076] Step S23, determine the range of the first problem function. Specifically, one first original dependent variable value is determined from the multiple first original dependent variable values corresponding to each first independent variable value according to the same value-taking function as the first dependent variable value corresponding to the first independent variable value, where the first dependent variable values corresponding to each first independent variable value form the range of the first problem function of the computing node.
[0077] In step S22 of this embodiment, a composite domain is obtained by combining the domain of the first problem function and the second domain. In one embodiment, the second domain serves as the first-level domain, and the domain of the first problem function is the second-level domain. For the composite function corresponding to the composite domain, the dependent variable obtained based on each independent variable in the first-level domain is a sub-function based on the second-level domain. The number of sub-functions is determined by the number of bits of the independent variable in the first-level domain; with a value of an independent variable in the second-level domain, that is, a first independent variable value in the domain of the first problem function, a unique original dependent variable value can be determined from the original range through the sub-function, which is named the first original dependent variable value in the present invention.
[0078] For example, taking the jth computing node Note j as the target computing node, the number of domain qubits available to it is denoted as n j . Then the domain of the corresponding first problem function is represented as {0, 1} nj , that is, the first independent variable bits of the first problem function total n j bits. Since the original domain of the problem function to be solved is {0, 1} n , that is, the original independent variable bits of the problem function to be solved total n bits, then the bits of the second independent variable in the second domain total n - n j bits. Therefore, the dependent variable value obtained based on each second independent variable value in the second domain is a sub-function, and the number of them is 2 (n-nj) . Each first independent variable value of each first problem function corresponds to 2 (n-nj) first original dependent variable values.
[0079] In step S23, when determining a first original dependent variable value as the first dependent variable value corresponding to the first independent variable value from the multiple first original dependent variable values corresponding to each first independent variable value according to the same value-taking function, the value-taking function used is adapted to the problem to be solved.
[0080] In addition, when the number t of computing nodes is greater than or equal to 2, when constructing the first problem functions corresponding to the t computing nodes, all the computing nodes can be sorted, and then according to the sorting of the computing nodes, in the bits of the original domain, in the order from high to low or from low to high, the first bits with the same number as the number of domain qubits of each computing node are respectively sliced out to obtain the domain bits of the first problem function corresponding to each computing node.
[0081] For example, see Figure 3 , Figure 3It is a flowchart of a method for constructing a first problem function corresponding to each computing node in order from high to low according to an embodiment of the present invention. The method includes the following steps:
[0082] Step S201, determine parameters. The parameters include the number of domain bits n, the number of range bits m, the number of computing nodes, and the number of qubits supported by the corresponding problem function to be solved. According to these parameters, determine the number of qubits n of the domain of each computing node j , and sort the computing nodes. The computing node number is represented by the letter j, where j ∈ {0, 1, …, t - 1}. Among them, the number of qubits n of each computing node for the domain j satisfies That is, the domain bits of the first problem function corresponding to each computing node are in one-to-one correspondence with the qubits of the computing node for the domain.
[0083] Step S202, construct the first first problem function corresponding to the 0th computing node, that is, the case where j = 0. The construction process of the first first problem function is as follows:
[0084] Step S2021, divide the original domain of the problem function to be solved to obtain multiple sub-functions. Specifically, as shown in Expression 1-1, select the last binary bits to divide the problem function to be solved, so as to obtain the following sub-functions, that is
[0085] where k represents the serial number of the sub-function, is an n j -bit binary number, m k represents the independent variable of the kth sub-function, and is also the first independent variable of the first problem function corresponding to the jth computing node; is the second independent variable composed of the remaining binary bits in the original domain except for the domain bits of the first problem function corresponding to the jth computing node, and can also be used as the binary representation of k. There are second independent variable values, and all the second independent variable values form the second domain.
[0086] From the above expressions, it can be seen that for the domain of the first problem function, the same first independent variable value is combined with second independent variable values respectively to form original independent variable values of the problem function to be solved, and then dependent variable values are determined from the original range of the problem function to be solved. For the sake of distinction, these dependent variable values are called the first original dependent variable values.
[0087] Step S2022, process the first original dependent variable value obtained based on multiple sub-functions through the value-taking function Sp to obtain the first dependent variable of the first problem function, as shown in Expression 1-2.
[0088] Among them, Among them, is the first independent variable of the j-th first problem function, and f j,0 (m j ) etc. are the first original dependent variable values corresponding to the first independent variable m j ; g j (m j ) is the corresponding first dependent variable, thus obtaining the first problem function of the j-th calculation node
[0089] Step S203, construct the first problem function corresponding to the j-th calculation node, that is, the case where j ∈ {1, 1, …, t - 2}. As shown in Expression 1-3, select the first and the last bit-elements from the original domain of the problem function to be solved to divide the problem function to be solved, and obtain the following sub-functions, that is
[0090] Among them, k represents the serial number of the sub-function, is an n j bit binary number, and m k represents the independent variable of the k-th sub-function and is also the first independent variable of the first problem function corresponding to the j-th calculation node; is the second independent variable composed of the remaining binary bit-elements in the original domain except for the domain bit-elements of the first problem function of the j-th calculation node, and can also be used as the binary representation of k. There are second independent variable values, and all the second independent variable values form the second domain.
[0091] It can be seen from the above expressions that corresponding to the domain of the first problem function, the same first independent variable value is respectively constructed with second independent variable values into original independent variable values, and then first original dependent variable values are obtained from the original range.
[0092] Then, process the first original dependent variable values obtained based on multiple sub-functions through the value-taking function Sp determined based on the problem function to be solved to obtain the first dependent variable of the first problem function, as shown in Expression 1-4.
[0093]
[0094] Among them, is the first independent variable value of the j-th first problem function, f j,0 (m j ) etc. are the first original dependent variable values corresponding to the first independent variable m j ; g j (m j ) is the corresponding first dependent variable, that is, the first problem function of the j-th calculation node is obtained
[0095] Step S204, construct the first problem function corresponding to the last calculation node, that is, the case of j = t - 1. For the last calculation node, as shown in Expression 1-5, select the first binary bits from the original domain of the problem function to be solved to divide the problem function to be solved, and obtain the following sub-functions, that is
[0096] Among them, k represents the serial number of the sub-function, is an n j -bit binary number, m k represents the independent variable of the k-th sub-function and is also the first independent variable of the first problem function corresponding to the j-th calculation node; is the second independent variable composed of the remaining binary bits in the original domain except the domain bits of the first problem function of the j-th calculation node, and can also be used as the binary representation of k. There are second independent variable values, and all the second independent variable values form the second domain.
[0097] It can be seen from the above expressions that corresponding to the domain of the first problem function, the same first independent variable value is combined with second independent variable values respectively to form original independent variable values of the problem function to be solved, and then first original dependent variable values are determined from the original range of the problem function to be solved.
[0098] Then, the first original dependent variable values obtained based on multiple sub-functions are processed by the value-taking function Sp to obtain the first dependent variable of the first problem function, as shown in Expression 1-6.
[0099] Among them, is a first independent variable value of the j-th first problem function, f j,0 (m j ) etc. are the first original dependent variable values corresponding to the first independent variable m j ; g j (mj ) is the corresponding first dependent variable, thereby obtaining the first problem function of the j-th computing node
[0100] In this embodiment, the number of domain bit elements n of the first problem function j is any value less than the number of original domain bit elements n. When n j takes the value of 1, at this time n first problem functions are obtained, and the number of qubits used for calculation in the corresponding computing node is 1. By running the corresponding quantum circuit n times, the corresponding sub-problem solutions are obtained. By increasing the number of runs, the demand for qubits used in the calculation can be minimized. The aforementioned value function Sp provides a composite technique, thereby enabling the processing of multiple first original dependent variable values to obtain the first dependent variable of the first problem function.
[0101] In another embodiment of step S2, the sub-problem function g j has a number of range bit elements less than the number of original range bit elements of the problem function to be solved, that is, m j < m. In this embodiment, first, a first problem function with the number of range bit elements equal to the number of original range bit elements of the problem function to be solved is constructed based on the number of domain qubits of the computing node, the original domain, and the original range of the problem function to be solved. The specific process is as described above Figure 2 and its description, which will not be repeated here. Then, according to the same domain of the sub-problem function and the domain of the first problem function, each first dependent variable value in the range of the first problem function is mapped to a sub-dependent variable value with a number of bit elements less than the number of bit elements of the original range of the problem function to be solved, thereby obtaining a sub-problem function with a number of range bit elements less than the number of original range bit elements of the problem function to be solved.
[0102] When mapping each first dependent variable value in the range of the first problem function to a sub-dependent variable value with a number of bit elements less than the number of bit elements of the original range of the problem function to be solved, first, determine the number of sub-problem range bit elements m according to the conditions that the number of range bit elements in the problem function to be solved needs to satisfy j , and m j < m, that is, the number of sub-problem range bit elements m j is less than the number of bit elements m of the original range of the problem function to be solved. Of course, if there is no requirement for the number of range bit elements in the problem function to be solved, a value less than m is randomly determined as m j .
[0103] Subsequently, each first dependent variable value is sequentially mapped to a sub-dependent variable value. During the mapping process, the mapping needs to be performed according to the relationship of the dependent variable values of the problem-solving function. For example, for the Simon problem function, there are two identical dependent variable values in its value range. Therefore, during the mapping process, it is necessary to compare whether the two dependent variable values are the same. If they are the same, their mapping values are the same; if they are different, the mapping values are different.
[0104] In this embodiment, the above-mentioned value range mapping reduces the number of auxiliary qubits corresponding to the value range in the quantum circuit, and further reduces the requirement for the number of qubits.
[0105] In this embodiment, the sub-problem function g j The number of value range bit elements m j is less than the number of original value range bit elements m of the problem to be solved, that is, m j < m. When the number of value range bit elements is 1, the required number of auxiliary qubits reaches the minimum, thus minimizing the requirement for the number of auxiliary qubits.
[0106] In the present invention, the problem to be solved is a classical computing problem, and there is at least one known quantum algorithm for solving it. The quantum algorithm has at least one corresponding quantum circuit. Refer to Figure 4 , Figure 4 is a schematic diagram of a known quantum circuit for a classical computing problem according to an embodiment of the present invention. The quantum circuit needs to calculate qubits and auxiliary qubits. As shown in the figure, there are n domain qubits corresponding to the domain bit elements for calculation, and m auxiliary qubits corresponding to the value range bit elements. The module is used to implement the quantum algorithm of the problem to be solved, which is composed of a series of quantum gates. In the output of the quantum circuit, the final state direct product state |ψ> corresponding to the n computing qubits is: |ψ> = |ψ0>|ψ1>…|ψ n-1 >, which corresponds to the solution of the classical computing problem, where |ψ i > represents the quantum state corresponding to the i-th computing qubit, and ψ i ∈{0, 1}, and the auxiliary bits return to the all-0 state.
[0107] The sub-problem function g j in the present invention satisfies the problem structure of the original classical computing problem function fp, but only has a smaller scale and fewer qubits are applied. Therefore, the quantum circuit corresponding to each sub-problem function g j has the same structure as the quantum circuit of the classical computing problem function fp. The quantum circuit of each sub-problem function g j includes a module for implementing the corresponding quantum algorithm corresponding to the final state direct product state |φ of the n j computing qubitsj > is: It corresponds to the sub - problem solution, where |ψ i > represents the i - th computational qubit, and |ψ i > ∈ {0, 1}, and the auxiliary qubits are reset to the all - 0 state.
[0108] See Figure 5 , Figure 5 is a flowchart of a quantum circuit for solving a sub - problem function according to an embodiment of the present invention. Among them, the steps of running the sub - problem function to solve the quantum circuit to obtain the corresponding sub - problem solution to be solved include:
[0109] Step S41, prepare the initial states of n j domain qubits and m j auxiliary qubits. In this embodiment, the initial state is the ground state 0 state.
[0110] Step S42, based on the n j domain qubits and m j auxiliary qubits in the initial state, execute the sub - problem function to solve the quantum circuit. After quantum circuit evolution, measure the final states of the n j domain qubits. Among them, the final states of the domain qubits are 0 state or 1 state.
[0111] Step S43, perform a tensor - product calculation on the final states |ψ j > of the n i domain qubits to obtain the direct - product state |φ j > of the n j domain qubits. The direct - product state |φ j > is the corresponding sub - problem solution.
[0112] Among them, the final states of the m j auxiliary qubits are the same as the initial state before executing the sub - problem function to solve the quantum circuit, that is, they return to the ground state 0 state.
[0113] Correspondingly, in step S5, according to the preset combination order of the sub - problem function domain in the original domain of the problem to be solved, perform a tensor - product calculation on the respective sub - problem solutions in turn. The direct - product state of the final states of the n domain qubits corresponding to the calculation result is used as the solution |ψ> of the problem function to be solved. That is: |ψ| = |φ0>|φ1>…|φ t-1 >.
[0114] See Figure 6 , Figure 6 is a schematic diagram of a quantum circuit of a problem to be solved according to an embodiment of the present invention. In this embodiment, t sub - problem functions g j, corresponding to t computing nodes respectively, the domain bit number of the sub-problem function g j is n j , and the range bit number is m j , that is, the number of domain qubits used for calculation in the corresponding computing node is n j , and the number of auxiliary qubits is m j . In this embodiment, multiple sub-problem functions are run in a serial manner to solve the quantum circuit. Each sub-problem function g j 's quantum circuit includes a module for implementing the corresponding quantum algorithm As shown in the figure to Based on Figure 3 and Figure 4 it can be known that since the final state of the auxiliary qubits after the evolution of the quantum circuit is the same as the initial state, when running the previous sub-problem function to solve the quantum circuit, only the initial states of the n j domain qubits of the next sub-problem function to solve the quantum circuit are prepared, and the final state of the auxiliary qubits obtained by running the previous sub-problem function to solve the quantum circuit is used as the initial state of the auxiliary qubits of the next sub-problem function to solve the quantum circuit.
[0115] By measuring the final state |ψ i > of each computing qubit of each sub-problem function to solve the quantum circuit, after performing a tensor product calculation on the final state |ψ i > of each computing qubit of each sub-problem function to solve the quantum circuit, the sub-problem solution |φ j > of the sub-problem solution is obtained. As shown in Figure 6 , there are t computing nodes in total, and each computing node is used to implement the solution of a sub-problem function. Thus, a total of t sub-problem solutions |φ j > are obtained, such as |φ0> to |φ t-1 > in the figure. Then, a tensor product calculation is performed on the respective sub-problem solutions |φ j > in sequence, that is: |ψ> = |φ0>|φ1>…|φ t-1 >. Thus, the solution |ψ> of the problem function to be solved is obtained.
[0116] In addition, it can be known that the initial state of the auxiliary qubits of each sub-problem function to solve the quantum circuit in this embodiment can also be the same as the initial state of the computing qubits, and can be re-prepared before each run of the module .
[0117] See Figure 7 , Figure 7 is a schematic diagram of a quantum circuit of a problem to be solved according to another embodiment of the present invention. In this embodiment, t sub-problem functions g j, corresponding to t computing nodes, such as computing node 0 to computing node t-1 in the figure. The sub-problem function g j has a domain bit number of n j , and a range number of m, that is, the number of domain qubits used for calculation in the corresponding computing node is n j , and the number of auxiliary qubits is m. In this embodiment, multiple sub-problem functions are run in parallel to solve the quantum circuit.
[0118] For the final state |ψ i > of each computing qubit of the quantum circuit for solving each sub-problem function, a tensor product calculation is performed to obtain the sub-problem solution |φ j > of the sub-problem solution. Then, a tensor product calculation is sequentially performed on the respective sub-problem solutions |φ j >, that is: |ψ> = |φ0>|φ1>…|φ t-1 >, thereby obtaining the solution |ψ> of the problem function to be solved.
[0119] The aforementioned Figure 6 and Figure 7 The quantum circuit in also applies to the case where the sub-problem function g j has a domain bit number of 1 and a range bit number of 1.
[0120] In another embodiment of step S2, when constructing the sub-problem function g j , when dividing the domain of the problem function to be solved, each bit is used as a domain bit of the sub-problem function, and the number of range bits is set to 1 through value range mapping, thereby constructing the sub-problem function g j : {0,1} → {0,1}. This is equivalent to the problem of determining whether a Boolean function is a balanced function or a constant function. The so-called balanced function means that for two input strings, the corresponding output strings are different, one is 0 and the other is 1. The so-called constant function means that for two input strings, the corresponding output strings are the same. Corresponding to the problem to be solved with a domain and a range of 1 bit each, for two independent variable values, if the dependent variable values are 0 and 1 respectively, that is, the two dependent variable values are different, then it is a balanced function. When the dependent variable values are the same, either 0 or 1, then it is a constant function. The function that realizes the problem of determining whether a Boolean function g j is a balanced function or a constant function is called the Deutsch problem function.
[0121] See Figure 8 , Figure 8 is a schematic diagram of the quantum circuit of the Deutsch problem function according to an embodiment of the present invention. The quantum circuit of the Deutsch problem function acts on a single qubit, and the module O hjIt is a quantum circuit unit for Oracle (a black-box function, or a query function), which can implement the calculation of the Deutsch problem function. The Oracle can perform the following operations:
[0122] Among them, the function h is encoded on the phase of the input qubit. Therefore, when h j (y) = 0, the phase of the input qubit remains unchanged. When h j (y) = 1, the phase of the input qubit flips. j (y) = 1, the phase of the input qubit flips.
[0123] In this quantum circuit, the initial input qubit is initialized to obtain the initial state |ψ0> as:
[0124] |ψ0> = |0>.
[0125] Apply the Hadamard gate to generate the superposition state |ψ1> as:
[0126]
[0127] The quantum state |ψ2> after passing through the quantum circuit unit of the Oracle is:
[0128]
[0129] If h j (y) = 0, the phase remains unchanged. If h j (y) = 1, the phase flips.
[0130] Apply the Hadamard gate to realize the conversion of phase information to amplitude, and the obtained quantum state |ψ3> is:
[0131] |ψ3> = H|φ2>.
[0132] The calculation result is:
[0133]
[0134] At this time, measure the qubit. If the measurement result is |0>, it can be known that h j (y) is a constant function. If the measurement result is |1>, it can be known that h j (y) is a balanced function.
[0135] Therefore, in this embodiment, the sub-problem solution |φ j > of each sub-problem function can be obtained by using the quantum circuit of the Deutsch problem function, and then the tensor product calculation is performed on the respective sub-problem solutions |φ j > in turn, that is:
[0136] |\psi\rangle = |\varphi_0\rangle|\varphi_1\rangle\cdots|\varphi t-1 >. Thus, the solution |\psi\rangle of the problem function to be solved is obtained.
[0137] Through the processing of step S2, the present invention constructs a corresponding sub-problem function for each computing node, reduces the number of qubits required by the computing node, and moreover, the embodiments of the present invention can flexibly construct the corresponding sub-problem function according to the number of qubits provided by the existing quantum computing module, and can make full use of the resources of the existing device.
[0138] For a specific classical computing problem P, in the case where there already exists a quantum algorithm for solving (i.e., module ), and the output final state is a direct product state, the present invention proposes a distributed quantum computing method. Taking the computing method as a model, it is no longer limited by quantum resources and can flexibly and efficiently solve the classical computing problem P according to the existing quantum resources, meeting the requirements of the NISQ era.
[0139] Compared with the original quantum algorithm, the distributed quantum computing method provided by the present invention requires fewer qubits on a single computing node, is more likely to be implemented in physical experiments, and since the number of qubits is small, the influence of circuit noise on the quantum state is also significantly reduced, thus improving the quantum fidelity and further improving the computing accuracy of the solution.
[0140] The combination mode of the quantum circuits used for computing in the present invention is flexible and changeable. When the number of qubits is small, a serial computing mode can be adopted. When the number of qubits is large, a parallel computing mode can be adopted, or a mode combining series and parallel can also be adopted, improving the computing efficiency on the premise of making full use of the existing quantum resources.
[0141] Figure 9 is a flowchart of a method for computing a problem to be solved based on multiple computing nodes and their quantum circuits according to an embodiment of the present invention. Combining Figure 6 with the quantum circuit shown, the method includes the following steps:
[0142] Step S101, let j = 0.
[0143] Step S102, generate the sub-problem function of the j-th computing node
[0144] Step S103, construct a corresponding quantum circuit based on each sub-problem function. The specific structure of the module in the quantum circuit is similar to the original quantum circuit module of the problem to be solved.
[0145] Step S104: Initialize the domain qubits and auxiliary qubits of the j-th computing node to the ground state. In one embodiment, the initialized ground state is the |0> state.
[0146] Step S105: Run the quantum circuit.
[0147] Step S106: Measure the final state of the domain qubits and calculate to obtain the sub-problem solution |φ j >.
[0148] Step S107: Determine whether j = t - 1 is satisfied. If it is satisfied, execute Step S108. If it is not satisfied, in Step S109, set j = j + 1 and return to Step S102.
[0149] Step S108: Perform a tensor product calculation on the sub-problem solutions |φ j > obtained from the t computing nodes in order. The calculation result obtained is the solution |ψ> of the function of the problem to be solved. |ψ> = |φ0>|φ1>…|φ t-1 >.
[0150] The foregoing method of the present invention is exemplarily illustrated below through application embodiments.
[0151] Application Embodiment 1
[0152] In this embodiment, the problem to be solved is a search problem, and its Boolean function is f P : {0, 1} n →{0, 1}, that is, the number of domain bits is n, and the number of range bits m = 1. Therefore, only 1 auxiliary qubit is required in its quantum circuit. The solution process of the search problem function is as follows:
[0153] First, construct the sub-problem function g j . The sub-problem function in this embodiment is where j is the computing node number, j = 0, 1, …, t - 1. The number of qubits supported by the computing node is n j +1, and the construction process is as Figure 3 shown. The value function Sp in this embodiment is the OR function. For example, for the sub-problem function of the 0-th node, each sub-dependent variable value is calculated through the OR function shown in the following Expression 2-1:
[0154]
[0155] where m j ∈{0, 1} nj , is a first independent variable of this sub-problem function, f j,0 (m j) etc. are corresponding to the first independent variable m j of the first primitive dependent variable values. In this embodiment, an OR operation is performed on multiple first primitive dependent variable values, and the result of the OR operation is used as the sub-dependent variable value of the sub-problem function.
[0156] Then construct Figure 10 the quantum circuit shown, and run the quantum circuit to obtain each sub-problem solution |φ j >>. Among them, Figure 10 is the schematic diagram of the quantum circuit for solving the search problem function according to Application Embodiment 1 of the present invention.
[0157] Finally, perform a tensor product calculation on all the sub-problem solutions in order to obtain the solution |ψ> of the search problem: |ψ> = |φ0>|φ1>…|φ t-1 >>.
[0158] Application Embodiment 2
[0159] In this embodiment, the problem to be solved is the Simon problem, and its corresponding Boolean function is f P :{0, 1} n →{0,1} m , m≥n - 1, and this function satisfies the following property: there exists an unknown string s∈{0, 1} n , such that for all independent variable values x, y∈{0, 1} n , there is f(x) = f(y) if and only if x = y or ( represents modulo 2 addition operation, or exclusive OR operation). In the process of solving the Simon problem function, the solution obtained by the method of the present invention is used as an intermediate value in the process of solving the Simon problem function. Multiple intermediate values are obtained by running the quantum circuit multiple times, and then the final solution is obtained based on the multiple intermediate values. The specific process is as follows:
[0160] First, construct the first problem function, and its construction process is as Figure 3 shown. The value-taking function S P is the maximum value-taking function or the minimum value-taking function. For example, each first dependent variable value of the first problem function g j of the j-th node is calculated by the maximum value-taking function shown in the following expression 2 - 2, where j = 0.
[0161] where m j ∈{0,1} nj , is a first independent variable of this first problem function, f j,0 (m j ) etc. are corresponding to the first independent variable m j of A first original dependent variable value. In this embodiment, a maximum value operation is performed on multiple first original dependent variable values, and the operation result is used as the first dependent variable value of the first problem function, thereby obtaining the first problem function g j .
[0162] In this embodiment, the range of the first problem function g j is mapped to obtain a sub-problem function h with fewer bit numbers in the range than the original range bit number of the problem function to be solved j . The sub-problem function h j has the same domain as the first problem function g j , and the number of range bits is less than the number of bits in the original range of the problem function to be solved. The mapping process is as follows: First, determine the number of range bits m j , for example, m j =n j -1. Then, according to the order of the first dependent variable values of the first problem function g j , the first first dependent variable value is mapped to a binary number with all bits being 0, and this binary number is the first sub-dependent variable value of the sub-problem function h j . When the current first dependent variable value is different from the previous first dependent variable value, the current sub-dependent variable value mapped is incremented by 1 at the lowest bit of the previous sub-dependent variable value. If the current first dependent variable value is the same as the previous first dependent variable value, the current sub-dependent variable value mapped is the same as the previous sub-dependent variable value. The following is a mapping relationship shown in Table 1 below, where m = 4, n j =4, m j =4 - 1 = 3.
[0163] Table 1
[0164] First dependent variable value (m = 4) <![CDATA[Value of the sub-dependent variable (m j = 3)]]> 1010 000 1010 000 1110 001 1110 001 0101 010 0101 010 …… ……
[0165] The aforementioned mapping process starts from the minimum value of the binary number and realizes incremental mapping by adding 1 at the lowest bit. The increment value for realizing the increment is a positive number, that is, the binary number 1 with the same number of bits. As shown in Table 1 above, the second second dependent variable value 000 is increased by 001 to obtain the third second dependent variable value 001, and the fourth second dependent variable value 001 is increased by 001 to obtain the fifth second dependent variable value 010. However, it can be known that the increment value can be other binary numbers that meet the conditions in addition to the binary number 001. The conditions described here are, for example, that the range after mapping conforms to the Simon problem function
[0166] In addition, the aforementioned mapping process can also start from the maximum value, that is, start from the binary number with all bits being 1. At this time, the increment value is a negative number, such as -001, so as to realize decremental mapping
[0167] In another embodiment, when mapping each first dependent variable value in the value range of the first problem function to a sub-dependent variable value of a sub-problem function with a number of bits less than the number of bits in the original value range of the problem function to be solved, each first dependent variable value is first mapped to a decimal value in sequence. During the mapping process, the same first dependent variable value is mapped to the same decimal value. Then, according to the determined number of bits in the value range of the sub-problem function, each decimal value is converted to the corresponding binary value in sequence, and the binary value is the sub-dependent variable value. For example, starting from the decimal value 0 in accordance with the order of the first dependent variable values, that is, mapping the first first dependent variable value to 0. When the current first dependent variable value is different from the previous one, the current decimal value for mapping is the previous decimal value plus 1. If the current first dependent variable value is the same as the previous one, the current decimal value for mapping is the same as the previous decimal number. As shown in the following mapping relationship in Table 2, where n j = 4, m j = 4 - 1 = 3.
[0168] Table 2
[0169] First dependent variable value (m = 4) Decimal number 1010 0 1010 0 1110 1 1110 1 0101 2 0101 2 …… ……
[0170] Then, according to the determined number of bits in the value range of the sub-problem function, each decimal value is converted to the corresponding binary value in sequence, as shown in Table 3.
[0171] Table 3
[0172] Decimal number Second dependent variable value (m = 3) 0 000 0 000 1 001 1 001 2 010 2 010 …… ……
[0173] In the foregoing embodiment, the first decimal value is 0, and the next different decimal value is an increment value of 1 added to the previous decimal value. However, it can be known that the increment value can be any value that fills the value range of the problem function to be solved. This embodiment starts from the minimum value 0 when mapping to the decimal value, and the increment value is positive, thus achieving an increasing mapping. Of course, it can also start from a maximum decimal value and set the increment value to be negative. For example, according to the number of bits m j in the second value range, set the first decimal value to 2 mj - 1, and the increment value to -1. As in the foregoing embodiment, m j = 3, then the first value is 2 3 - 1 = 7, so the decimal values obtained by mapping are 7 to 0 in sequence.
[0174] Then, a quantum circuit for each sub-problem function is constructed, as Figure 11 shown. Figure 11It is a schematic diagram of a quantum circuit for solving a sub-problem function corresponding to a computing node according to Application Embodiment 2 of the present invention. The qubits required by the computing node include n j qubits corresponding to the domain of the sub-problem function and m j qubits corresponding to the range. Among them, the module Bh j is a quantum circuit unit that can implement the Oracle (black box function, or query function) of the sub-problem function. The Oracle can implement This quantum circuit unit is the same as the quantum circuit unit used when solving the Simon problem in a quantum computing manner proposed by Daniel Simon. Those of ordinary skill in the art can know according to common knowledge in the industry or by referring to relevant literature, and will not be elaborated here.
[0175] The quantum circuits of all sub-problem functions are run in parallel, as Figure 12 shown. Figure 12 It is a schematic diagram of a quantum circuit for solving the Simon problem function according to Application Embodiment 2 of the present invention. Among them, for each quantum circuit corresponding to a sub-problem function, after running once and measuring the quantum state after running, a measurement value is obtained, and the measurement value is used as an intermediate result. For a computing node with n j domain qubits, after l = n j - 1 runs, n j - 1 measurement values are obtained. Based on the n j - 1 measurement values, a system of equations is constructed, and the local solution can be obtained by solving the system of equations.
[0176] The local solutions corresponding to the positions of the domains of the sub-problem functions in the domain of the Simon problem to be solved are combined in order to obtain the solution of the Simon problem function to be solved.
[0177] In this embodiment, the number of auxiliary qubits is reduced by the range mapping method, thereby further reducing the number of qubits used.
[0178] Application Embodiment 3
[0179] In this embodiment, the problem to be solved is the Bernstein-Vazirani problem (hereinafter referred to as the BV problem). For a Boolean function f P : {0, 1} n →{0, 1}, there exists s ∈ {0, 1} n such that the function fs relationship shown in the following Expression 2-3 holds:
[0180]
[0181] where x ∈ {0, 1}n Let s be the string to be solved, which is the final solution of the embodiment of this application. The solution process for the BV problem is as follows:
[0182] First, construct the sub-problem function g j Among them, t sub-problem functions are generated according to the number t of computing nodes and the problem function fs to be solved where m j ∈{0,1} nj , j is the computing node number, j = 0, 1, …, t - 1. Sn j is a substring, which is a part of the string s to be solved. The construction process is as Figure 3 shown and will not be elaborated here.
[0183] Then, construct the quantum circuit corresponding to each computing node, as Figure 13 shown, Figure 13 is a schematic diagram of the quantum circuit for solving the BV problem function according to Embodiment 3 of the application of the present invention. Among them, the quantum circuit is composed of t sub-circuits, each sub-circuit corresponds to a computing node, and the module Ofs in each computing node nj (m j ) implements the calculation shown in the following Expression 2-4:
[0184]
[0185] After running the quantum circuit, the quantum state is obtained. Then, through the measurement of the basis states {|0>, |1>}, the substring Sn j is obtained.
[0186] Finally, all the substrings Sn are combined in sequence j , and the string s to be solved is obtained. Among them, s = Sn0Sn1…Sn j …Sn t-1 .
[0187] On the other hand, the invention provides a distributed quantum computing device. Refer to Figure 14 , Figure 14 is a schematic block diagram of the distributed quantum computing device according to an embodiment of the present invention. The distributed quantum computing device (abbreviated as computing device) 10 in this embodiment is used to solve the classical computing problem P, and the classical computing problem function is f P :{0, 1} n →{0, 1} m, where \(n\) and \(m\) are natural numbers, which are the number of domain bits and the number of range bits of the classical computing problem function respectively. In this embodiment, the computing device 10 includes a parameter acquisition module 1, a sub-problem function construction module 2, a quantum circuit construction module 3, an operation module 4, and a calculation module 5. Among them, the parameter acquisition module 1 is used to acquire the problem function to be solved, the number of computing nodes, and the number of domain qubits of each computing node. The sum of the number of domain qubits of all computing nodes is equal to the number of original domain bits of the problem function to be solved. The sub-problem function construction module 2 is connected to the parameter acquisition module 1 and constructs sub-problem functions corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the problem function to be solved. When the domains of all sub-problem functions are combined together in a preset combination order, they constitute the original domain of the problem function to be solved. Each sub-problem function includes a sub-problem solution to be obtained. For specific details, please refer to the foregoing method description and will not be elaborated here. The quantum circuit construction module 3 is connected to the sub-problem function construction module 2 and is used to construct a quantum circuit for solving the sub-problem function corresponding to each computing node. The operation module 4 is connected to the quantum circuit construction module 3 and is used to send the quantum circuits for solving the sub-problem functions to the corresponding quantum computing modules respectively and receive the measurement results returned by the quantum computing modules. The calculation module 5 is connected to the operation module 4 and calculates the sub-problem solutions to be obtained for the corresponding sub-problem functions based on the measurement results returned by the quantum computing modules running the quantum circuits for solving the sub-problem functions. The sub-problem solutions to be obtained corresponding to each other are combined in the preset combination order of the domains of the sub-problem functions in the original domain of the problem function to be solved to obtain the solution of the problem function to be solved.
[0188] See Figure 15 , Figure 15 FIG. is a schematic block diagram of a distributed quantum computing device according to another embodiment of the present invention. The computing device 10 in this embodiment further includes a quantum computing module 6. In this embodiment, the sub-problem function construction module 2 constructs a plurality of sub-problem functions according to the number of qubits supported by the quantum computing module 6. Correspondingly, the quantum circuit construction module 3 constructs quantum circuits for solving corresponding to each sub-problem function, and the operation module 4 sequentially sends the quantum circuits for solving to the quantum computing module 6 in a serial manner. The quantum computing module 6 sequentially runs the quantum circuits for solving and sends the measured results to the operation module 4. The operation module 4 sends the measured results to the calculation module 5. The calculation module 5 obtains the sub-problem solutions to be obtained for the corresponding sub-problem functions based on the received measured results, and then combines the sub-problem solutions to be obtained corresponding to all sub-problem functions to obtain the solution of the problem function to be solved. According to this embodiment, a classical computing problem that previously required a large number of qubits can be solved by a quantum computing module 6 with a relatively small number of qubits.
[0189] See Figure 16 , Figure 16 is a schematic block diagram of a distributed quantum computing device according to another embodiment of the present invention. The computing device 10 in this embodiment includes a plurality of quantum computing modules, such as the first quantum computing module 71, the second quantum computing module 72, up to the t-th quantum computing module 7t in the figure. The processing device 10 is respectively connected to each quantum computing module. In one embodiment, the processing device 10 respectively constructs a plurality of corresponding sub-problem functions and corresponding quantum circuits for solving according to the number of qubits supported by each quantum computing module, and sequentially sends the quantum circuits for solving to the corresponding quantum computing modules in a parallel manner. Each quantum computing module runs the corresponding quantum circuit for solving and sends the measured result to the processing device 10. The processing device 10 obtains the solution of the problem function to be solved after processing. In this embodiment, a plurality of quantum computing modules run their respective quantum circuits for solving in parallel, effectively improving the processing efficiency. Of course, if it is impossible to complete the processing at one time based on the resources of the current plurality of quantum computing modules, one or more of the quantum computing modules can also be used to run the quantum circuits for solving a plurality of sub-problem functions in a serial and time-sharing manner.
[0190] Among them, Figure 14 the processing device 10 in [[ ]] can be implemented by a classical computing device, and the aforementioned quantum computing module 6, etc. can be a quantum simulator implemented by a classical computing device, or a real quantum machine.
[0191] On the other hand, an embodiment of the present invention also provides an electronic device. See Figure 17 , Figure 17 is a schematic block diagram of the structure of an electronic device according to an embodiment of the present invention. As shown in Figure 17 , the electronic device includes a processor and a memory. Computer instructions are stored in the memory, and when the processor runs the computer instructions, it executes the distributed quantum computing method provided by the present invention.
[0192] Specifically, the processor 601 may include a central processing unit (CPU) or a graphics processing unit (GPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The memory 602 may include a memory for data or instructions. For example, the memory 602 may be at least one of the following: a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, a universal serial bus (USB) drive, or other physical / tangible memory storage devices. Further, the memory 602 includes removable or non-removable (or fixed) media. Additionally, the memory 602 may be inside or outside the integrated gateway disaster recovery device. The memory 602 may be a non-volatile solid-state memory. In other words, generally, the memory 602 includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with executable instructions, and when the stored executable instructions are executed by the processor 601 (such as by one or more processors), the distributed quantum computing method in the embodiments of the present invention can be implemented.
[0193] In one example, Figure 17 the illustrated electronic device may further include a communication interface 603 and a bus 610. Among them, the processor 601, the memory 602, and the communication interface 603 are connected through the bus 610 to complete communication with each other. The communication interface 603 is mainly used to implement communication between various modules, devices, units, and / or devices in the electronic device.
[0194] The bus 610 includes hardware, software, or both, and can couple the components of the online data flow metering device to each other. For example, the bus may include at least one of the following: an accelerated graphics port (AGP) or other graphics buses, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industry standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable buses. The bus 610 may include one or more buses. Although the embodiments of the present invention describe or illustrate specific buses, the embodiments of the present invention may contemplate any suitable bus or interconnect method.
[0195] On the other hand, an embodiment of the present invention also provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the foregoing distributed quantum computing method is implemented. The computer-readable storage medium may be, for example, a classical computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. It may also be 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 the quantum version of RAM in a classical computer. Through QRAM, a quantum superposition state of information can be created. Compared with RAM that needs to read one by one, data in superposition can be read at superposed addresses. QRAM can be implemented in physical ways such as optics, semiconductor quantum dots, superconducting circuits, ion traps, etc.
[0196] The flowcharts and / or block diagrams of the methods and systems of the embodiments of the present invention are described above by way of example, and the relevant aspects are described. It should be understood that each block in the flowchart and / or block diagram, or a combination thereof, can be implemented by computer program instructions, or by dedicated hardware that performs a specified function or action, or by a combination of dedicated hardware and computer instructions. When implemented in hardware, it may be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional 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 via a data signal carried in a carrier wave on a transmission medium or a communication link. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0197] The above embodiments are only for illustrating the present invention and are not intended to limit the present invention. Those of ordinary skill in the relevant technical field can make various changes and modifications without departing from the scope of the present invention. Therefore, all equivalent technical solutions should also fall within the scope of the disclosure of the present invention.
Claims
1. A distributed quantum computing method, characterized in that, The method includes: Obtaining the function of the problem to be solved, the number of computing nodes, and the number of domain qubits of each computing node, where the sum of the number of domain qubits of all computing nodes is equal to the number of bits of the original domain of the function of the problem to be solved; Constructing a sub-problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved, where the sub-problem function is a first problem function, the number of bits of the range of the first problem function is equal to the number of bits of the original range of the function of the problem to be solved, the original domain of the function of the problem to be solved includes the domains of all sub-problem functions combined in a preset combination order, and each sub-problem function includes a sub-problem solution to be obtained; Constructing a quantum circuit for solving the sub-problem function corresponding to each computing node, where the structure of the quantum circuit for solving the sub-problem function is the same as the structure of the quantum circuit of the function of the problem to be solved; Running the quantum circuit for solving the sub-problem function to obtain the sub-problem solution to be obtained; Combining the corresponding sub-problem solutions in the preset combination order of the sub-problem function domain in the original domain of the function of the problem to be solved to obtain the solution of the function of the problem to be solved.
2. The distributed quantum computing method according to claim 1, wherein The step of constructing a sub-problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved includes: Constructing a first problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved, where the number of bits of the range of the first problem function is equal to the number of bits of the original range of the function of the problem to be solved; Constructing a sub-problem function with the number of bits of the range less than the number of bits of the original range of the function of the problem to be solved based on each first problem function, where the domain of the sub-problem function is the same as the domain of the first problem function, and each first dependent variable value in the range of the first problem function is mapped to a sub-dependent variable value with the number of bits less than the number of bits of the original range of the function of the problem to be solved.
3. The distributed quantum computing method according to claim 2, wherein The number of bits of the domain of the first problem function is 1, and / or the number of bits of the range of the sub-problem function is 1.
4. The distributed quantum computing method according to claim 1 or 2 or 3, characterized in that, The step of constructing a first problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the function of the problem to be solved includes: Determining the same number of first bits as the domain bits of the first problem function from the bits of the original domain of the function of the problem to be solved according to the number of domain qubits of the computing node, and the remaining second bits as the second domain bits; Sequentially extracting the first bit values from each original independent variable value in the original domain to form each first independent variable value of the first problem function of the computing node, and all the first independent variable values form the domain of the first problem function of the computing node; Sequentially extracting the second bit values from each original independent variable value in the original domain to form second independent variable values, and all the second independent variable values form the second domain; Combine each first independent variable value of the first problem function with each second independent variable value in the order of their respective bits in the original domain to form the original independent variable values in the original domain; Obtain the original dependent variable value corresponding to the original independent variable value from the original range of the problem function to be solved as the first original dependent variable value; Determine one first original dependent variable value from the multiple first original dependent variable values corresponding to each first independent variable value as the first dependent variable value corresponding to the first independent variable value according to the same value-taking function, wherein the first dependent variable values corresponding to each first independent variable value constitute the range of the first problem function of the computing node.
5. The distributed quantum computing method according to claim 4, wherein The step of constructing the first problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the problem function to be solved further includes: Sort all the computing nodes; When determining the same number of first bits as the domain bits of the first problem function from the bits of the original domain of the problem function to be solved according to the number of domain qubits of the computing node, cut out the first bits with the same number as the number of domain qubits of each computing node from the bits of the original domain in the order from high to low or from low to high according to the sorting of the computing nodes to obtain the domain bits of the first problem function corresponding to each computing node.
6. The distributed quantum computing method according to claim 1, wherein The input quantum bits of each sub-problem function for solving the quantum circuit include n j domain quantum bits and m j auxiliary quantum bits. Among them, the n j is the number of domain bits of the sub-problem function, and the number of domain bits of the sub-problem function is less than the number of original domain bits of the problem function to be solved; the m j is the number of range bits of the sub-problem function, and the number of range bits of the sub-problem function is less than or equal to the number of original range bits of the problem function to be solved; correspondingly, the steps of running the sub-problem function to solve the quantum circuit to obtain the solution of the sub-problem to be obtained include: Prepare the initial state of n j domain qubits and m j ancilla qubits; Based on the initial state of n j domain qubits and m j auxiliary qubits to execute the quantum circuit for solving the sub-problem function, and measure the final state of the n j domain qubits; For n j calculate the tensor product of the final states of n j domain qubits to obtain the direct product state of n domain qubits, which is the solution of the sub-problem to be solved; where m j final state of the auxiliary qubits is the same as the initial state before the quantum circuit for solving the sub-problem function is executed.
7. The distributed quantum computing method according to claim 1, characterized in that The step of running the sub-problem function solving quantum circuit to obtain the sub-problem solution to be sought includes: running multiple sub-problem function solving quantum circuits in a serial / parallel manner.
8. The distributed quantum computing method according to claim 7, wherein Steps for running multiple sub-problem functions to solve a quantum circuit in a serial manner, including: after running the previous sub-problem function to solve the quantum circuit, preparing the initial state of the n j domain qubits of the next sub-problem function to solve the quantum circuit, and using the final state of the auxiliary qubits obtained by running the previous sub-problem function to solve the quantum circuit as the initial state of the auxiliary qubits of the next sub-problem function to solve the quantum circuit.
9. The distributed quantum computing method according to claim 1, wherein The step of combining the corresponding sub-problem solutions in the preset combination order of the domain of the sub-problem function in the original domain of the problem function to be solved to obtain the solution of the problem function to be solved includes: Perform a tensor product calculation on their respective sub-problem solutions in turn according to the preset combination order of the domain of the sub-problem function in the original domain of the problem function to be solved, and use the direct product state of the final states of the qubits with the number of bits corresponding to the original domain of the calculation result as the solution of the problem function to be solved.
10. A distributed quantum computing device, characterized in that, The device includes: A parameter acquisition module configured to acquire the problem function to be solved, the number of computing nodes, and the number of domain qubits of each computing node, wherein the total number of domain qubits of all computing nodes is equal to the number of bits of the original domain of the problem function to be solved; A sub-problem function construction module configured to construct a sub-problem function corresponding to each computing node based on the number of domain qubits of each computing node, the original domain and the original range of the problem function to be solved, wherein the sub-problem function is the first problem function, the number of bits in the range of the first problem function is equal to the number of bits in the original range of the problem function to be solved, the original domain of the problem function to be solved includes the domains of all sub-problem functions combined in a preset combination order, and each sub-problem function includes a sub-problem solution to be sought; A quantum circuit construction module, configured to construct a quantum circuit for solving a sub-problem function corresponding to each computing node, wherein the structure of the quantum circuit for solving the sub-problem function is the same as the structure of the quantum circuit of the problem to be solved; An operation module, configured to separately send the quantum circuits for solving the sub-problem functions to corresponding quantum computing modules and receive the measurement results returned by the quantum computing modules; A calculation module, configured to calculate the solution of the sub-problem to be solved for the corresponding sub-problem function based on the measurement results returned by the quantum computing module when running the quantum circuit for solving the sub-problem function; combine the corresponding sub-problem solutions in the preset combination order of the domain of the sub-problem function in the original domain of the problem to be solved to obtain the solution of the problem to be solved function.
11. The distributed quantum computing device according to claim 10, wherein It includes one or more quantum computing modules; when including one quantum computing module, the operation module sends multiple quantum circuits for solving sub-problem functions to the quantum computing module in a serial manner, and when including multiple quantum computing modules, the operation module sends multiple quantum circuits for solving sub-problem functions to multiple quantum computing modules in a serial and / or parallel manner; Each quantum computing module runs the quantum circuit for solving the sub-problem function of the corresponding computing node and sends the measurement result to the operation module.
12. An electronic device, comprising a processor and a memory, characterized in that, Computer instructions are stored in the memory, and when the processor runs the computer instructions, it executes the distributed quantum computing method described in any one of claims 1-9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and when the computer instructions are run by the processor, it executes the distributed quantum computing method described in any one of claims 1-9.
Citation Information
Patent Citations
Distributed multi-target quantum search method and device, medium and equipment
CN118014095A
Machine learning mapping for quantum processing units
US11436519B1