A quantum processing method and related apparatus for computer tasks

By iteratively solving the residual equations and utilizing the quantum state-to-classical data module, the problem of large solution errors in linear equations on mesoscale quantum computers was solved, achieving accurate solutions in noisy environments and enhancing the quantum computer's ability to solve real-world problems.

CN120671860BActive Publication Date: 2026-11-17ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410313292.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2026-11-17
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

On noisy quantum computers at the mesoscale, quantum noise interference exists during quantum computing, which makes it impossible to accurately solve linear equations and produces large errors.

Method used

By iteratively solving the residual equation system, the preset solution is updated using quantum circuits until the residual vector of the linear equation system satisfies the preset convergence condition. Combined with the quantum state to classical data conversion module, the influence of noise is reduced, and accurate solution is achieved.

Benefits of technology

Accurate solutions to linear equations were achieved on a mesoscale noisy quantum computer, reducing quantum noise errors and improving the ability of quantum computers to solve real-world problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671860B_ABST
    Figure CN120671860B_ABST
Patent Text Reader

Abstract

This invention discloses a quantum processing method and related apparatus for computer tasks, belonging to the field of quantum computing technology. The method includes: acquiring task data; wherein the task data includes a system of linear equations and a preset solution to the system of linear equations, the system of linear equations describing the computer task to be processed; if the residual vector of the system of linear equations does not satisfy a preset convergence condition in the current iteration step, a quantum circuit for solving the residual equations of the current iteration step is constructed, and the quantum circuit is run to obtain the quantum state of the solution to the residual equations; wherein the residual equations are determined by the coefficient matrix and residual vector of the system of linear equations; the preset solution is updated according to the quantum state to obtain a new residual vector; until the new residual vector satisfies the preset convergence condition, the preset solution corresponding to the residual vector is taken as the target solution of the system of linear equations, and the target solution is taken as the processing result of the computer task. Thus, by iteratively solving the residual equations, the error caused by quantum noise in the quantum processing of the computer task is reduced, thereby enabling accurate solutions to the system of linear equations on current mesoscale noisy quantum computers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of quantum computing technology, and in particular to a quantum processing method and related apparatus for computer tasks. Background Technology

[0002] Solving linear equations is a common problem in many scientific and technological fields and physical scenarios (e.g., fluid mechanics, finance, biology, chemistry). Research on how to quickly and accurately solve linear equations has demonstrated significant theoretical and applied value, leading to the development of many effective techniques and methods for solving linear equations. For example, in the field of CFD (Computational Fluid Dynamics), linear equations representing changes in fluid state can be constructed based on various discretization mathematical methods. This allows for numerical experiments, computer simulations, and analytical studies of fluid mechanics problems, including calculating the temperature, density, and other state information of the fluid at different locations in a steady state.

[0003] Quantum computers are physical devices that perform high-speed mathematical and logical operations, store and process quantum information, following the laws of quantum mechanics. Because of their significantly higher efficiency in processing mathematical problems compared to conventional computers—for example, reducing the time to crack encryption keys from hundreds of years to hours—quantum computers have become a key technology under research. Quantum linear solvers are mathematical tools that use quantum computers to accelerate the solution of linear equations. Compared to classical solvers, the quantum algorithms they use can replace classical algorithms, providing exponential speedup.

[0004] Therefore, quantum computers can be used to solve many real-world mathematical or physical problems. For example, the flow process of a fluid system can be modeled to construct a large-scale computer task for solving linear equations. Then, a quantum linear solver can be used to run a quantum linear algorithm to obtain the state information of the fluid system at each moment. However, on current NISQ (Noisy Intermediate Scale Quantum) computers, real qubits have not yet fully reached the performance of logical qubits. Significant quantum noise interference exists during quantum computing, and large errors are generated during quantum processing, making it impossible to obtain accurate solutions to linear equations. Summary of the Invention

[0005] The purpose of this invention is to provide a quantum processing method and related apparatus for computer tasks, which aims to reduce the error caused by quantum noise in the quantum processing of computer tasks by iteratively solving the residual equation system, thereby enabling accurate solution of linear equation systems on current mesoscale noisy quantum computers.

[0006] One embodiment of the present invention provides a quantum processing method for computer tasks, the method comprising:

[0007] Acquire task data; wherein the task data includes a system of linear equations and a preset solution to the system of linear equations, the system of linear equations being used to describe the computer task to be processed;

[0008] In the process of iteratively solving the computer task based on the linear equation system, the preset solution is updated based on the quantum state representing the solution of the residual equation system until the residual vector of the linear equation system satisfies the preset convergence condition.

[0009] Optionally, the quantum state representing the solution to the residual equation system is obtained by the following method:

[0010] In each iteration step, the residual equation system is determined based on the coefficient matrix of the linear equation system and the residual vector corresponding to the preset solution;

[0011] Construct a quantum circuit for solving the residual equations;

[0012] Running the quantum circuit yields the quantum states of the solution to the residual equation system.

[0013] Optionally, updating the preset solution of the linear equation system in the previous iteration step based on the quantum state representing the solution of the residual equation system, until the residual vector of the linear equation system satisfies the preset convergence condition, includes:

[0014] If the residual vector of the linear equation system does not satisfy the preset convergence condition in the current iteration step, a quantum circuit for solving the residual equation system in the current iteration step is constructed, and the quantum circuit is run to obtain the quantum state of the solution of the residual equation system.

[0015] The preset solution is updated according to the quantum state to obtain a new residual vector; until the new residual vector satisfies the preset convergence condition, the preset solution corresponding to the residual vector is taken as the target solution of the linear equation system, and the target solution is taken as the processing result of the computer task.

[0016] Optionally, the quantum state of the solution to the residual equation system is a noisy quantum state, and updating the preset solution based on the quantum state includes:

[0017] The noisy quantum state is converted into classical data using a pre-built quantum state to classical data module;

[0018] The sum of the classical data and the preset solution of the current iteration step is used as the preset solution for the next iteration step.

[0019] Optionally, the step of converting the noisy quantum state into classical data using a pre-built quantum state-to-classical data module includes:

[0020] Update the transformation coefficients corresponding to the current iteration step in the quantum-to-classical data module;

[0021] The product of the state vector corresponding to the noisy quantum state and the transformation coefficient is used as the classical data.

[0022] Optionally, the transformation coefficient corresponding to the current iteration step is jointly determined by the coefficient matrix of the linear equation system, the residual vector of the current iteration step, and the state vector corresponding to the noisy quantum state.

[0023] Optionally, the transformation coefficient L corresponding to the current iteration step is calculated based on the following formula:

[0024]

[0025] Where, r k z represents the k-th term in the residual vector r of the current iteration step. k Let z represent the k-th term in the intermediate vector z, which is the product of the coefficient matrix of the linear equation system and the state vector corresponding to the noisy quantum state of the current iteration step.

[0026] Optionally, the quantum circuit obtains the quantum state of the solution to the residual equation system by running at least one of the variable quantum linear algorithm, quantum discrete adiabatic linear algorithm, CKS algorithm, or HHL algorithm.

[0027] Optionally, the preset convergence condition includes: the 2-norm of the residual vector of the current iteration step is not greater than a preset precision parameter.

[0028] Another embodiment of the present invention provides a quantum processing apparatus for computer tasks, the apparatus comprising:

[0029] An acquisition module is used to acquire task data; wherein, the task data includes a system of linear equations and a preset solution to the system of linear equations, and the system of linear equations is used to describe the computer task to be processed;

[0030] The processing module is used to update the preset solution based on the quantum state representing the solution of the residual equation system during the iterative solution of the computer task based on the linear equation system, until the residual vector of the linear equation system satisfies the preset convergence condition.

[0031] Another embodiment of the present invention provides a storage medium storing a computer program, wherein the computer program is configured to execute the method described in any of the above embodiments when running.

[0032] Another embodiment of the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the methods described in any of the above embodiments.

[0033] Compared with the prior art, the present invention provides a quantum processing method and related apparatus for computer tasks, which can acquire task data including a system of linear equations and a preset solution of the system of linear equations; and in the process of iteratively solving the computer task based on the system of linear equations, in each iteration step, a quantum circuit for solving the residual system of equations for the current iteration step is constructed; thereby, the preset solution of the system of linear equations is iteratively updated based on the quantum state of the solution of the residual system of equations until the residual vector satisfies the preset convergence condition, and the target solution of the system of linear equations can be obtained, thereby determining the processing result of the computer task.

[0034] This scheme transforms the quantum states of the solutions to the residual equations into high-quality classical data. By continuously updating the preset solutions to the linear equations using the solutions of the residual equations, the influence of quantum noise on the classical solutions is continuously reduced during the iteration process. This improves the quantum linear solver's resistance to quantum noise, reduces the errors caused by quantum noise, and enables the quantum linear solver to run successfully on current mesoscale noisy quantum computers, achieving accurate solutions to the linear equations. This further enhances the ability of quantum computers to solve real-world problems. Attached Figure Description

[0035] Figure 1 A network block diagram of a quantum processing system for computer tasks provided in an embodiment of the present invention;

[0036] Figure 2 A flowchart illustrating a quantum processing method for a computer task provided in an embodiment of the present invention;

[0037] Figure 3 This is a flowchart illustrating a specific method for updating a preset solution according to an embodiment of the present invention.

[0038] Figure 4 A specific flowchart for converting noisy quantum states into classical data is provided in this embodiment of the invention;

[0039] Figure 5 A schematic diagram illustrating the convergence process of a residual vector as provided in an embodiment of the present invention;

[0040] Figure 6 A schematic diagram of the structure of a quantum processing device for computer tasks provided in an embodiment of the present invention;

[0041] Figure 7This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0042] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0043] Figure 1 This is a network block diagram of a quantum processing system for computer tasks provided in an embodiment of the present invention. The quantum processing system for computer tasks may include a network 110, a server 120, a wireless device 130, a client 140, storage 150, a classical computing unit 160, a quantum computing unit 170, and may also include additional memory, a classical processor, a quantum processor, and other devices not shown.

[0044] Network 110 is a medium used to provide communication links between various devices and computers connected together within a quantum processing system for computing tasks, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof, and the connection method can be wired, wireless communication links, or fiber optic cables.

[0045] Server 120, wireless device 130, and client 140 are conventional data processing systems that may contain data and application programs or software tools that perform conventional computational processes. Client 140 may be a personal computer or a network computer, so the data may also be provided by server 120. Wireless device 130 may be a smartphone, tablet, laptop, smart wearable device, etc. Storage unit 150 may include database 151, which can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.

[0046] The classical computing unit 160 (quantum computing unit 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 162 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application program 163 (application program 173). The application program 163 (application program 173) may be used to implement a quantum algorithm compiled by the quantum processing method for computer tasks provided in the embodiments of the present invention.

[0047] Any data or information stored or generated in the classical computing unit 160 (quantum computing unit 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0048] It should be noted that a true quantum computer has a hybrid structure, which includes at least... Figure 1 The system consists of two main parts: the classical computing unit 160, which is responsible for performing classical calculations and control; and the quantum computing unit 170, which is responsible for running quantum programs to achieve quantum computing.

[0049] The aforementioned classical computing unit 160 and quantum computing unit 170 can be integrated into a single device or distributed across two different devices. For example, a first device including the classical computing unit 160 runs a classical computer operating system, providing quantum application development tools and services, as well as the storage and network services required for quantum applications. Users develop quantum programs using the quantum application development tools and services on the second device, and send these quantum programs to a second device including the quantum computing unit 170 via the network services. The second device runs a quantum computer operating system, which parses and compiles the quantum program's code into instructions that the quantum processor 170 can recognize and execute. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on these instructions.

[0050] The computing units of the classic processor 161 within the classic computing unit 160 are based on CMOS transistors on a silicon chip. These computing units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, the number of such computing units in a silicon chip is sufficient; currently, a single classic processor 161 contains tens of thousands of computing units. Given this sufficient number and the fixed selectable computing logic of the CMOS transistors (e.g., AND logic), computational performance is achieved by combining a large number of CMOS transistors with a limited set of logic functions during operation.

[0051] In the quantum computing unit 170, the basic computing unit of the quantum processor 171 is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its available usage time and is not always readily available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is one of the representative indicators of its performance. Each qubit performs computational functions through on-demand configured logical functions. Given the limited number of qubits and the diverse logical functions available in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), X gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum computing requires combining a limited number of qubits with diverse logical function combinations to achieve computational effects.

[0052] Based on these differences, the design of classical logic functions applied to CMOS transistors and the design of quantum logic functions applied to qubits are significantly and fundamentally different. The design of classical logic functions applied to CMOS transistors does not need to consider the individuality of CMOS transistors. For example, the representation of a CMOS transistor in a silicon chip is its individual identifier, location, and usable time of each CMOS transistor. Therefore, classical algorithms composed of classical logic functions only express the operational relationship of the algorithm, not the algorithm's dependence on individual CMOS transistors.

[0053] Quantum logic functions applied to qubits need to consider the individuality of each qubit, such as its position within the quantum chip, its relationship with surrounding qubits, and the duration of its usable time. Therefore, quantum algorithms composed of quantum logic functions not only express the computational relationships within the algorithm but also its dependence on the individual qubits.

[0054] A quantum chip can include qubits and channels for controlling them. Quantum logic gates are implemented using analog signals. Different combinations of analog signals are applied to the qubits through these channels, thereby creating quantum circuits with different functions to process data. Therefore, the design of quantum logic functions in the qubits (including the design of whether qubits are used and the design of the efficiency of each qubit) is crucial for improving the computational performance of quantum computers and requires special design. This is the unique characteristic of quantum algorithms based on quantum logic functions, and it is fundamentally and significantly different from classical algorithms based on classical logic functions. The aforementioned design considerations for qubits are technical problems that ordinary computing devices do not need to consider or address.

[0055] Current noisy intermediate-scale quantum (NISQ) computers exhibit two main characteristics: first, a relatively small number of physical qubits, typically not exceeding 1000; and second, the physical qubits have not yet fully achieved the performance of logical qubits, resulting in significant quantum noise interference during quantum computation. Consequently, when using an NISQ computer to run a quantum linear algorithm (QLA) to solve linear equations, the influence of quantum noise leads to substantial errors in the quantum computation process, making it impossible to obtain an accurate solution to the linear equations.

[0056] To address the aforementioned problems, a fault-tolerant quantum linear algorithm with significant resistance to quantum noise can be designed, enabling quantum processing of computer tasks on current mesoscale noisy quantum computers and achieving accurate solutions to systems of linear equations. This invention provides a quantum processing method for computer tasks, comprising the following steps:

[0057] First, obtain the task data;

[0058] The task data includes a system of linear equations and a preset solution to the system of linear equations, which is used to describe the computer task to be processed.

[0059] Furthermore, during the iterative solution of the computer task based on the linear equation system, the preset solution is updated based on the quantum state representing the solution of the residual equation system until the residual vector of the linear equation system satisfies the preset convergence condition.

[0060] For details, see Figure 2 The above method may include the following steps:

[0061] Step 201, Obtain task data;

[0062] In the quantum processing scheme for computer tasks provided in this embodiment of the invention, firstly, task data of the computer task to be processed can be obtained. The task data includes a system of linear equations and a preset solution of the system of linear equations. The system of linear equations can be used to describe the computer task to be processed.

[0063] Specifically, the aforementioned computer task to be processed can be a computational task constructed after mathematical modeling or simulation of a problem to be solved in a real physical scenario. For example, it can be a CFD (Computational Fluid Dynamics) simulation analysis task for a fluid system. Specific steps may include: constructing a corresponding numerical network based on the fluid system, spatially discretizing the fluid system, and then constructing a set of linear equations reflecting the flow of the fluid system using methods such as the finite difference method, finite element method, spectral element method, or finite volume method. The solution to the linear equations reflects the flow parameters of the mesh cells of the fluid system at a certain moment. Then, by using a quantum computer to process the CFD simulation analysis task of the fluid system, the obtained solution can be used to continuously update the state of the fluid system. This approach can be applied to multiple technical fields such as aircraft aerodynamic design, weather forecasting, and building environmental analysis.

[0064] Correspondingly, the aforementioned computer tasks to be processed can also be solution-type tasks involving solving linear equation systems in fields such as finance, biology, and chemistry. These linear equation systems can be used to determine the optimal solution to portfolio optimization problems, or to determine chemical products and chemical equilibrium problems between compounds, etc., which will not be elaborated further here.

[0065] The preset solution to the linear equation system can be any pre-set initial solution. That is, the preset solution can be understood as an initial noisy solution to the linear equation system. In subsequent task processing, the error in the preset solution can be continuously mitigated through the scheme in this embodiment of the invention, and finally the target solution that meets the conditions can be obtained. For example, the preset solution can be a solution vector, in which all elements can be zero, that is, the initial preset solution can be a zero vector.

[0066] In one implementation, to improve the accuracy of the preset solution, thereby reducing the quantum processing time of the computer task and improving computational efficiency, the aforementioned linear equations can be solved in advance using quantum or classical computation. The preset solution obtained is closer to the target solution than the zero vector. For example, a randomized quantum circuit corresponding to the aforementioned linear equations can be constructed based on a variational quantum linear algorithm. This randomized quantum circuit can then be trained and its loss function reduced. After training, the randomized quantum circuit can be run to perform quantum state evolution, and the expected value of each qubit can be measured. By processing the expected value, the preset solution of the linear equations can be obtained.

[0067] Furthermore, it can be determined whether the residual vector of the linear equation system satisfies the preset convergence condition in the current iteration step.

[0068] Specifically, this scheme is mainly based on iteratively solving the residual equation system to reduce the error caused by quantum noise in the quantum processing of computer tasks. Then, it can be determined whether the residual vector corresponding to the preset solution in the initial iteration step satisfies the preset convergence condition.

[0069] For example, the system of linear equations used to describe the computer task to be processed can be represented as Ax = b, where A is the coefficient matrix of the system of linear equations, b is the right-hand side term of the system of linear equations, and x is the unknown quantity to be solved. Then, when the preset solution of the initial iteration step is x0, the residual vector r0 = b - Ax0 can be calculated, and it can be determined whether the residual vector r0 satisfies the preset convergence condition.

[0070] As one embodiment of the present invention, the preset convergence condition may include: the 2-norm of the residual vector of the current iteration step is not greater than a preset precision parameter.

[0071] Specifically, in the field of solving linear equation systems, the preset convergence condition can generally consider various norms of the residual vector, such as L0 norm, L1 norm, infinity norm, or Lp norm. In this embodiment, the 2-norm of the residual vector can be calculated using common methods, and its value can be determined to be no greater than a preset precision parameter. Specifically, the formula for calculating the 2-norm of the residual vector r is:

[0072]

[0073] Where, r i Let represent the i-th term in the residual vector r. In other feasible implementations, various other norms of the residual vector can be considered, and different preset convergence conditions can be set, which will not be elaborated here.

[0074] Taking the initial iteration step's preset solution as x0 as an example, after calculating the residual vector r0, we can calculate the 2-norm of the initial iteration step's residual vector r0 as ‖r0‖2, and determine whether ‖t0‖2 is not greater than the preset precision parameter ∈, where the preset precision parameter ∈ can be 10. -4 10 -5 Or 10 -6 The following are not specifically limited. If ||r0||2 is not greater than the preset precision parameter ∈, the residual vector r0 can be considered to satisfy the preset convergence condition and has converged. The preset solution x0 can be directly used as the target solution of the linear equation system. If ||r0||2 is greater than the preset precision parameter ∈, the residual vector r0 can be considered to not satisfy the preset convergence condition and has not yet converged. The preset solution needs to be continuously updated in multiple iteration steps using the following method until the 2-norm of the residual vector is not greater than the preset precision parameter ∈ in a certain iteration step. Then, the preset solution corresponding to the residual vector can be used as the target solution of the linear equation system.

[0075] If the residual vector of the linear equation system does not satisfy the preset convergence condition in the current iteration step, then step 202 can be executed to construct a quantum circuit for solving the residual equation system in the current iteration step, and run the quantum circuit to obtain the quantum state of the solution of the residual equation system.

[0076] The quantum state representing the solution to the residual equation system can be obtained by the following method:

[0077] In each iteration step, the residual equation system is determined based on the coefficient matrix of the linear equation system and the residual vector corresponding to the preset solution;

[0078] Construct a quantum circuit for solving the residual equations; run the quantum circuit to obtain the quantum state of the solution to the residual equations.

[0079] Specifically, in a given iteration step, if the residual vector of the linear equation system does not satisfy the preset convergence condition, the residual equation system corresponding to the current iteration step can be determined. This residual equation system is determined by the coefficient matrix A and the residual vector r of the linear equation system. For example, if the residual vector r0 corresponding to the preset solution x0 of the initial iteration step does not satisfy the preset convergence condition, the residual equation system Ay = r0 corresponding to the computer task can be established, where y is the unknown quantity in the residual equation system, which is the residual required for the preset solution x0 of the linear equation system.

[0080] Therefore, based on any quantum linear algorithm, a quantum circuit can be constructed to solve the residual equation system Ay=r0, and the quantum circuit can be run on a real quantum computer to execute the quantum linear algorithm, ultimately obtaining the quantum state |y> of the solution to the residual equation system Ay=r0.

[0081] As one embodiment of the present invention, the quantum circuit can obtain the quantum state of the solution of the residual equation system by running at least one of the variable quantum linear algorithm, quantum discrete adiabatic linear solution algorithm, CKS algorithm or HHL algorithm.

[0082] Specifically, variational quantum linear algorithms, quantum discrete adiabatic linear algorithms, the CKS algorithm, and the HHL algorithm are all commonly used quantum linear algorithms in the field of quantum computing, and will not be described in detail here. As is known to those skilled in the art, based on different formats of the residual equations to be solved and different quantum chips in a real quantum computer, a suitable quantum linear algorithm can be selected to solve the aforementioned residual equations. Based on any of the above quantum linear algorithms, a real quantum computer can calculate and solve the residual equations and obtain the quantum states of the solutions to the residual equations.

[0083] Then, step 203 is executed to update the preset solution based on the quantum state, resulting in a new residual vector. The process then returns to the step of determining whether the residual vector of the linear equation system in the current iteration satisfies the preset convergence condition.

[0084] Specifically, the quantum states of the solutions to the residual equations can be transformed into classical form data, which can then be used to update the preset solution. For example, if the classical form of the solution to the residual equations in the initial iteration step is y0, the preset solution for the next iteration step can be updated from x0 to x0+y0, and the residual vector r1 = bA(x0+y0) for the next iteration step can be calculated. Then, it can be determined whether the residual vector r1 satisfies the preset convergence condition. This process is repeated iteratively until the residual vector of a certain iteration step satisfies the preset convergence condition.

[0085] Accordingly, if the residual vector of the linear equation system satisfies the preset convergence condition in the current iteration step, step 204 can be executed, taking the preset solution corresponding to the residual vector as the target solution of the linear equation system, and taking the target solution as the processing result of the computer task.

[0086] Specifically, through the scheme provided by the embodiments of the present invention, the influence of quantum noise on the classical solution is continuously reduced in each iteration step, the residual vector gradually shrinks until convergence, and the preset solution gradually approaches the target solution. Therefore, if the residual vector of a certain iteration step satisfies the preset convergence condition, the preset solution corresponding to the residual vector can be taken as the target solution of the linear equation system, and the target solution can be taken as the processing result of the aforementioned computer task.

[0087] As can be seen, in the solution provided by the embodiments of the present invention, by converting the quantum state of the solution of the residual equation system into high-quality classical data, and using the solution of the residual equation system to continuously update the preset solution of the linear equation system, the influence of quantum noise on the classical solution is continuously reduced during the iteration process, thereby improving the resistance of the quantum linear solver to quantum noise, reducing the error caused by quantum noise, and enabling the quantum linear solver to run successfully on current mesoscale noisy quantum computers, achieving accurate solution of the linear equation system, and further enhancing the ability of quantum computers to solve real-world problems.

[0088] As one embodiment of the present invention, such as Figure 3 As shown, the quantum state of the solution to the residual equation system is a noisy quantum state. Updating the preset solution based on the quantum state may include the following steps:

[0089] Step 301: The noisy quantum state is converted into classical data using a pre-built quantum state to classical data module.

[0090] Specifically, in step 202 above, a quantum circuit for solving the residual equations can be constructed, and the quantum circuit can be run to obtain the quantum states of the solutions to the residual equations. Since this quantum circuit operates on a real quantum computer, it is also subject to quantum noise interference during the quantum computation process, and the quantum states of the solutions to the residual equations obtained in the final measurement may be noisy quantum states. Therefore, a dedicated quantum state to classical data conversion module can be constructed, which can convert the quantum states of the solutions to the residual equations into high-quality classical data.

[0091] In one implementation, such as Figure 4 As shown, the process of converting the noisy quantum state into classical data using a pre-built quantum state to classical data module may include the following steps:

[0092] Step 3011: Update the conversion coefficients corresponding to the current iteration step in the quantum state to classical data module;

[0093] The transformation coefficient corresponding to the current iteration step can be jointly determined by the coefficient matrix of the linear equation system, the residual vector of the current iteration step, and the state vector corresponding to the noisy quantum state.

[0094] Specifically, in each iteration step, as is known to those skilled in the art, the above-mentioned transformation of the noisy quantum state |y> into classical data y using the pre-constructed quantum state to classical data module can be understood as: calculating the product of the state vector |y> corresponding to the noisy quantum state and the transformation coefficient L corresponding to the iteration step, and using the vector corresponding to the product L|y> as the classical form of the solution to the residual equation system, i.e., y = L|y>.

[0095] Correspondingly, in different stages of the above iterative process, the residual vector r i and based on residual vector r i The constructed residual equation system Ay=r i Differences exist in all cases, and the interference of quantum noise in each iteration step is not entirely the same. Therefore, the noisy quantum state |y> obtained through quantum circuit calculation and measurement reflects the aforementioned characteristics of that iteration step and the influence of quantum noise. Thus, the transformation coefficient L, constructed based on the coefficient matrix of the linear equation system, the residual vector of the current iteration step, and the state vector corresponding to the noisy quantum state, can comprehensively consider the influence of various factors in the current iteration step, ensuring that the classical data y obtained through the quantum state to classical data conversion module satisfies ||r||. i -Ay‖2≤‖r i ‖2, that is, the residual vector continuously shrinks during the iterative process, thus constructing a fault-tolerant quantum linear algorithm with significant resistance to quantum noise, which can continuously reduce the influence of quantum noise on the classical solution and ultimately achieve an exact solution to the linear equation system.

[0096] In one specific implementation, the transformation coefficient L corresponding to the current iteration step can be calculated based on the following formula:

[0097]

[0098] Where, r k z represents the k-th term in the residual vector r of the current iteration step. k Let z represent the k-th term in the intermediate vector z, which is the product of the coefficient matrix of the linear equation system and the state vector corresponding to the noisy quantum state of the current iteration step.

[0099] Specifically, in order to transform the quantum state |y> of the solution of the residual equation system into high-quality classical data y, it is necessary to update the transformation coefficient L corresponding to the current iteration step in the pre-constructed quantum state to classical data module in each iteration step.

[0100] Therefore, in order to minimize the residual vector during the iterative process, i.e., ||r|| i -Ay‖2≤‖r i ‖2. First, we need to determine the conversion coefficient L to satisfy:

[0101] L = argmin ||r i -LA|y>‖2

[0102] To facilitate calculation and representation, we can set an intermediate vector z = A|y>, and omit the index i corresponding to each iteration step, transforming the above formula into:

[0103]

[0104] The above formula is equivalent to finding the minimum value of the function f, and therefore equivalent to finding the solution when the derivative of the function f is 0, that is:

[0105]

[0106] Therefore, we can calculate that:

[0107] Step 3012: The product of the state vector corresponding to the noisy quantum state and the transformation coefficient is used as the classical data.

[0108] Step 302: The sum of the classical data and the preset solution of the current iteration step is used as the preset solution for the next iteration step.

[0109] Accordingly, in each iteration step, the residual vector r can first be calculated, and the state vector |y> corresponding to the noisy quantum state can be obtained. Its product with the coefficient matrix A of the linear equation system is then calculated to obtain the intermediate vector z = A|y>. Based on the terms in the residual vector r and the intermediate vector z, combined with the above formula... Then the transformation coefficient L can be dynamically updated in each iteration step.

[0110] Then, by multiplying the transformation coefficient L by the state vector |y> corresponding to the noisy quantum state, we can obtain the classical form of the solution y of the residual equation system, which gives us the preset solution x for the current iteration step. i The update is performed by: calculating the classical data y for each iteration step and the preset solution x for the current iteration step. i The sum of x i +y, as the preset solution x for the next iteration step. i+1 .

[0111] As can be seen, in this embodiment, a quantum state to classical data conversion module is pre-constructed, and the conversion coefficients are updated in real time in each iteration step. These conversion coefficients are jointly determined by the coefficient matrix of the linear equation system, the residual vector of the current iteration step, and the state vector corresponding to the noisy quantum state. Thus, in each iteration step, the quantum state of the solution of the residual equation system can be converted into high-quality classical data, causing the residual vector to shrink continuously during the iterative process. This continuously reduces the influence of quantum noise on the classical solution, constructing a fault-tolerant quantum linear algorithm with significant resistance to quantum noise. This improves the quantum linear solver's resistance to quantum noise, reduces the error caused by quantum noise, and enables the quantum linear solver to run successfully on current mesoscale noisy quantum computers, achieving accurate solutions to linear equation systems. This further enhances the ability of quantum computers to solve real-world problems.

[0112] In a specific embodiment of the quantum processing scheme for verifying the aforementioned computer task using a real quantum chip, a test was conducted using Origin QuantumCTek's 72-bit quantum chip "Wukong," and the verification results are as follows. Figure 5 As shown, the system of linear equations describing the computer task to be processed is Ax = b. Therefore, the information obtained from the task data can be as follows:

[0113]

[0114] Where A is the coefficient matrix of the above linear equation system, b is the right-hand side term of the above linear equation system, and x0 is the initial preset solution of the above linear equation system. The preset convergence condition of the iterative process is: the 2-norm of the residual vector of the current iteration step is not greater than the preset precision parameter ∈, ∈ = 0.0001.

[0115] The residual vector r0 = b - Ax0 corresponding to the initial preset solution x0 is:

[0116]

[0117] Correspondingly,

[0118] In the initial iteration step, a variable quantum linear algorithm can be used to construct the corresponding variable quantum circuit to solve the residual equation system Ay = r0. After the parameters in the aforementioned variable quantum circuit are trained and the loss function converges, the state vector corresponding to the quantum state of the solution to the residual equation system can be calculated as follows: Therefore, through the formula in the above embodiments The transformation coefficient corresponding to the initial iteration step can be calculated as L = 0.019926135461756322; furthermore, the classical form of the solution to the residual equation system can be calculated as follows: By updating the initial preset solution x0 using the aforementioned classic data y, we can obtain the preset solution for the next iteration step as follows:

[0119] Accordingly, in the first iteration step after the initial iteration step, Calculations show that ||r1||2>∈. Therefore, a variable quantum circuit is constructed again to solve the residual equation system Ay=r1. After the parameters in this variable quantum circuit are trained and the loss function converges, the state vector corresponding to the quantum state of the solution to the residual equation system can be calculated as follows: Therefore, through the formula in the above embodiments The transformation coefficient corresponding to the first iteration step can be calculated as L = 0.0031769302396448353; furthermore, the classical form of the solution to the residual equation system can be calculated as follows: By using the aforementioned classic data y to update the preset solution x1 of the first iteration step, we can obtain the preset solution x2 = x1 + y for the next iteration step.

[0120] And so on, such as Figure 5 As shown, in each iteration step, the 2-norm of the residual vector decreases significantly compared to the previous iteration step. Therefore, after 11 iterations, ||r|| 11 ‖2 is not greater than ∈, satisfying the preset convergence condition, thus obtaining the target solution.

[0121] As can be seen, the solution provided by the embodiments of the present invention can calculate the target solution of the linear equation system on a real quantum computer by establishing a residual equation system and iteratively updating the preset solution. Through a finite number of iterative calculations, not only is the error caused by quantum noise to the quantum linear solver mitigated, but the residual vector can also be quickly converged, improving the solution efficiency of the quantum linear solver, realizing the accurate solution of the linear equation system, and further enhancing the ability of quantum computers to solve real-world problems.

[0122] See Figure 6 , Figure 6 A quantum processing device for computer tasks is provided in an embodiment of the present invention, the device comprising:

[0123] Module 601 is used to acquire task data;

[0124] The task data includes a system of linear equations and a preset solution to the system of linear equations, wherein the system of linear equations is used to describe the computer task to be processed.

[0125] The processing module 602 is used to update the preset solution based on the quantum state representing the solution of the residual equation system during the process of iteratively solving the computer task based on the linear equation system, until the residual vector of the linear equation system satisfies the preset convergence condition.

[0126] The specific functions and effects of the quantum processing device for the aforementioned computer task can be explained by referring to other embodiments in this specification, and will not be repeated here. Each module in the quantum processing device for the aforementioned computer task can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in hardware or independently of the processor in the computer device, or it can be stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.

[0127] Please see Figure 7 This specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the quantum processing method for the computer task described in any of the above embodiments. Please refer to [link to documentation]. Figure 7 The computer device can be a classical computer or a quantum computer.

[0128] This specification also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform a quantum processing method for a computer task in any of the above embodiments.

[0129] This specification also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform a quantum processing method for any of the computer tasks described in the above embodiments.

[0130] It is understood that the specific examples in this specification are only intended to help those skilled in the art better understand the implementation methods described herein, and are not intended to limit the scope of the invention.

[0131] It is understood that in the various embodiments of this specification, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this specification in any way.

[0132] It is understood that the various implementation methods described in this specification can be implemented individually or in combination, and the implementation methods in this specification are not limited in this respect.

[0133] Unless otherwise stated, all technical and scientific terms used in the embodiments of this specification have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this specification. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0134] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0135] It is understood that the memory in the embodiments of this specification may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0136] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.

[0137] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0138] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0140] In addition, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0141] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this specification, in essence, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0142] The above description is merely a specific embodiment of this specification, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A quantum processing method of a computer task, characterized by, The method includes: Acquire task data; wherein the task data includes a system of linear equations and a preset solution to the system of linear equations, the system of linear equations being used to describe the computer task to be processed; In the process of iteratively solving the computer task based on the linear equation system, the preset solution is updated based on the quantum state representing the solution of the residual equation system until the residual vector of the linear equation system satisfies the preset convergence condition; wherein, the quantum state of the solution of the residual equation system is a noisy quantum state; The step of updating the preset solution based on the quantum state includes: updating a transformation coefficient corresponding to a current iteration step of the quantum state to classical data module; taking a product of a state vector corresponding to the noisy quantum state and the transformation coefficient as the classical data; taking a sum of the classical data and a preset solution of the current iteration step as a preset solution of a next iteration step; the transformation coefficient corresponding to the current iteration step is calculated based on the following formula: in, Represents the residual vector of the current iteration step. The first in item, Represents the intermediate vector The first in Term, intermediate vector It is the product of the coefficient matrix of the linear equation system and the state vector corresponding to the noisy quantum state of the current iteration step.

2. The method as described in claim 1, characterized in that, The quantum state representing the solution to the residual equation system is obtained by the following method: In each iteration step, the residual equation system is determined based on the coefficient matrix of the linear equation system and the residual vector corresponding to the preset solution; Construct a quantum circuit for solving the residual equations; Running the quantum circuit yields the quantum states of the solution to the residual equation system.

3. The method as described in claim 1, characterized in that, The process of updating the preset solution of the linear equation system in the previous iteration step based on the quantum state representing the solution of the residual equation system, until the residual vector of the linear equation system satisfies the preset convergence condition, includes: If the residual vector of the linear equation system does not satisfy the preset convergence condition in the current iteration step, a quantum circuit for solving the residual equation system in the current iteration step is constructed, and the quantum circuit is run to obtain the quantum state of the solution of the residual equation system. The preset solution is updated according to the quantum state to obtain a new residual vector; until the new residual vector satisfies the preset convergence condition, the preset solution corresponding to the residual vector is taken as the target solution of the linear equation system, and the target solution is taken as the processing result of the computer task.

4. The method as described in claim 1, characterized in that, The transformation coefficient corresponding to the current iteration step is jointly determined by the coefficient matrix of the linear equation system, the residual vector of the current iteration step, and the state vector corresponding to the noisy quantum state.

5. The method according to any one of claims 1-4, characterized in that, The quantum circuit obtains the quantum state of the solution to the residual equation system by running at least one of the variable quantum linear algorithm, quantum discrete adiabatic linear solution algorithm, CKS algorithm or HHL algorithm.

6. The method according to any one of claims 1-4, characterized in that, The preset convergence condition includes: the 2-norm of the residual vector in the current iteration step is not greater than a preset precision parameter.

7. A quantum processing device for computer tasks, characterized in that, The device includes: An acquisition module is used to acquire task data; wherein, the task data includes a system of linear equations and a preset solution to the system of linear equations, and the system of linear equations is used to describe the computer task to be processed; The processing module is used to update the preset solution based on the quantum state representing the solution of the residual equation system during the iterative solution of the computer task based on the linear equation system, until the residual vector of the linear equation system satisfies the preset convergence condition; wherein the quantum state of the solution of the residual equation system is a noisy quantum state; The step of updating the preset solution based on the quantum state includes: Update the transformation coefficients corresponding to the current iteration step in the quantum state to classical data module; multiply the state vector corresponding to the noisy quantum state by the transformation coefficients to obtain the classical data; sum the classical data with the preset solution of the current iteration step to obtain the preset solution for the next iteration step; the transformation coefficients corresponding to the current iteration step... Calculated based on the following formula: in, Represents the residual vector of the current iteration step. The first in item, Represents the intermediate vector The first in Term, intermediate vector It is the product of the coefficient matrix of the linear equation system and the state vector corresponding to the noisy quantum state of the current iteration step.

8. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1-6 when it is run.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Quantum computing simulation platform and linear equation set quantum solving simulation method and system

    CN112232512A

  • Quantum circuit-based nonlinear equation set solving method and device

    CN114969629A