Methods, apparatus, media and electronic devices for solving linear equation systems

CN116402152BActive Publication Date: 2026-08-14ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

近年来,量子计算领域的一个非常重要的成果是量子线性系统算法,其中最著名的当属Harrow、Hassidim和Lloyd于2009年共同提出的HHL算法,但是该算法随着输入矩阵条件数的增大,求解线性系统问题的复杂度会随之提高,导致量子求解线性系统问题加速效果消失

Benefits of technology

[0086]与现有技术相比,本发明提供的一种线性方程组求解方法,通过多项式预处理器对原线性方程组中的矩阵和向量进行处理,以得到新的线性方程组,新的线性方程组中的矩阵的条件数小于原线性方程组中的矩阵的条件数,从而降低了输入矩阵的条件数,进而降低了线性系统问题的复杂度,然后再对新的线性方程组进行求解,得到共同的未知量,从而实现了量子求解线性系统问题的加速效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116402152B_ABST
    Figure CN116402152B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, medium, and electronic device for solving linear equation systems. The invention uses a polynomial preprocessor to process matrix A and vector b in the original linear equation system Ax = b to obtain a new linear equation system A′x = b′, and the condition number κ of matrix A′ in the new linear equation system is... A′ The condition number κ is less than that of matrix A in the original system of linear equations. A This reduces the condition number of the input matrix, thereby reducing the complexity of the linear system problem. Then, the new linear equations are solved to obtain the common unknown x, thus achieving the acceleration effect of quantum solution of linear system problems.
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 relates to a method, apparatus, medium and electronic device for solving linear equations. Background Technology

[0002] Solving systems of linear systems is central to many scientific and engineering problems, and the classic algorithms for solving such problems are collectively known as linear system algorithms. In recent years, a significant achievement in quantum computing has been quantum linear system algorithms, the most famous of which is the HHL algorithm proposed by Harrow, Hassidim, and Lloyd in 2009. However, as the condition number of the input matrix increases, the complexity of solving linear system problems increases, causing the speedup effect of quantum computing on linear system problems to disappear. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, medium, and electronic device for solving linear equations, aiming to reduce the complexity of linear system problems and achieve the acceleration effect of quantum solving of linear system problems.

[0004] One embodiment of the present invention provides a method for solving a system of linear equations, the method comprising:

[0005] Obtaining a system of linear equations Matrix in sum vector The It is an unknown quantity;

[0006] In the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ;

[0007] Based on the matrix and the vector Constructed system of linear equations Solve for the unknown quantity .

[0008] Optionally, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector ,include:

[0009] Prepare the vector quantum state and based on polynomial functions and the matrix Deterministic polynomial The As the independent variable;

[0010] Based on the polynomial Constructing operators and the polynomial With the matrix Multiply to obtain a matrix ;

[0011] The operator Acting on the quantum state Above, we obtain the quantum state. The quantum state For vectors The corresponding quantum state.

[0012] Optionally, the polynomial-based function and the matrix Deterministic polynomial Previously, the method also included:

[0013] Obtaining approximate functions with parameters And determine the parameterized approximate function. Domain;

[0014] Select from the defined domain Approximate deviation points and the aforementioned Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system ,in The T is an integer greater than 0, and T is any natural number in the domain.

[0015] Solve the system of linear equations The approximate function containing parameters is obtained. The values ​​of the parameters;

[0016] The target approximation function is determined based on the values ​​of the parameters, and the polynomial function is determined based on the target approximation function. .

[0017] Optionally, determining the target approximation function based on the values ​​of the parameters includes:

[0018] Substitute the values ​​of the parameters into the approximate function containing the parameters. In this process, an initial approximate function is obtained;

[0019] Determine the extreme points of the absolute value of the difference between the initial approximation function and T;

[0020] If the extreme point is the same as the If all approximate deviation points are equal within the accuracy requirement, then the initial approximation function is determined as the target approximation function;

[0021] If the extreme point is the same as the If the approximate deviation points are not equal within the accuracy requirement, then the extreme point is taken as the new extreme point. Approximate deviation points, and the execution step described above. Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system .

[0022] Optionally, the step of determining the polynomial function based on the target approximation function... ,include:

[0023] Based on the target approximation function and the polynomial function relational formula Determine the polynomial function The .

[0024] Optionally, if the parameterized approximation function If it is an odd function, then the... If the parameterized approximate function If it is an even function, then the... The As a parameter, the It is an integer greater than or equal to 0.

[0025] Optionally, the polynomial-based Constructing operators ,include:

[0026] The polynomial was prepared by quantum signal processing (QSP). Corresponding operator .

[0027] Optionally, the matrix-based and the vector Constructed system of linear equations Solve for the unknown quantity ,include:

[0028] Based on the matrix Determine the operators required for the HHL algorithm ;

[0029] The vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state that takes the value;

[0030] Determine the unknown quantity based on the target quantum state. The solution results are as follows.

[0031] Optionally, the matrix-based Determine the operators required for the HHL algorithm ,include:

[0032] Determine the operators required for the HHL algorithm ;

[0033] The operator The operator is determined by expanding according to the Jacobi-Anger expansion formula. The exponential expansion of the operator The exponential expansion is:

[0034] ,

[0035] in, yes The first-order Bessel function of the first kind, yes Chebyshev polynomials of the first kind of order;

[0036] reserve The operator of order precision The exponential expansion, The operator of order precision The exponential expansion is:

[0037] ,

[0038] in,

[0039] ,

[0040] ,

[0041] ;

[0042] The preparation of the QSP Corresponding operator and stated Corresponding operator ;

[0043] Linear merging of LCUs via unitary operations and the aforementioned and stated Construct the operator .

[0044] Another embodiment of the present invention provides a device for solving a system of linear equations, the device comprising:

[0045] Acquisition unit, used to acquire linear equation systems Matrix in sum vector The It is an unknown quantity;

[0046] Processing unit, used in the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ;

[0047] Calculation unit, used for calculating based on the matrix and the vector Construct a new system of linear equations Solve for the unknown quantity .

[0048] Optionally, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector In this respect, the processing unit is specifically used for:

[0049] Prepare the vector quantum state and based on polynomial functions and the matrix Deterministic polynomial The As the independent variable;

[0050] Based on the polynomial Constructing operators and the polynomial With the matrix Multiply to obtain a matrix ;

[0051] The operator Acting on the quantum state Above, we obtain the quantum state. The quantum state For vectors The corresponding quantum state.

[0052] Optionally, in the polynomial-based function and the matrix Deterministic polynomial Previously, the processing unit was also used for:

[0053] Obtaining approximate functions with parameters And determine the parameterized approximate function. Domain;

[0054] Select from the defined domain Approximate deviation points and the aforementioned Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system ,in The T is an integer greater than 0, and T is any natural number in the domain.

[0055] Solve the system of linear equations The approximate function containing parameters is obtained. The values ​​of the parameters;

[0056] The target approximation function is determined based on the values ​​of the parameters, and the polynomial function is determined based on the target approximation function. .

[0057] Optionally, in determining the target approximation function based on the values ​​of the parameters, the processing unit is specifically used for:

[0058] Substitute the values ​​of the parameters into the approximate function containing the parameters. In this process, an initial approximate function is obtained;

[0059] Determine the extreme points of the absolute value of the difference between the initial approximation function and T;

[0060] If the extreme point is the same as the If all approximate deviation points are equal within the accuracy requirement, then the initial approximation function is determined as the target approximation function;

[0061] If the extreme point is the same as the If the approximate deviation points are not equal within the accuracy requirement, then the extreme point is taken as the new extreme point. Approximate deviation points, and the execution step described above. Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system .

[0062] Optionally, in determining the polynomial function based on the target approximation function... In this respect, the processing unit is specifically used for:

[0063] Based on the target approximation function and the polynomial function relational formula Determine the polynomial function The .

[0064] Optionally, if the parameterized approximation function If it is an odd function, then the... If the parameterized approximate function If it is an even function, then the... The As a parameter, the It is an integer greater than or equal to 0.

[0065] Optionally, in the case based on the polynomial Constructing operators In this respect, the processing unit is specifically used for:

[0066] The polynomial was prepared by quantum signal processing (QSP). Corresponding operator .

[0067] Optionally, in the case based on the matrix and the vector Constructed system of linear equations Solve for the unknown quantity In this respect, the computing unit is specifically used for:

[0068] Based on the matrix Determine the operators required for the HHL algorithm ;

[0069] The vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state that takes the value;

[0070] Determine the unknown quantity based on the target quantum state. The solution results are as follows.

[0071] Optionally, in the case based on the matrix Determine the operators required for the HHL algorithm In this respect, the computing unit is specifically used for:

[0072] Determine the operators required for the HHL algorithm ;

[0073] The operator The operator is determined by expanding according to the Jacobi-Anger expansion formula. The exponential expansion of the operator The exponential expansion is:

[0074] ,

[0075] in, yes The first-order Bessel function of the first kind, yes Chebyshev polynomials of the first kind of order;

[0076] reserve The operator of order precision The exponential expansion, The operator of order precision The exponential expansion is:

[0077] ,

[0078] in,

[0079] ,

[0080] ,

[0081] ;

[0082] The preparation of the QSP Corresponding operator and stated Corresponding operator ;

[0083] Linear merging of LCUs via unitary operations and the aforementioned and stated Construct the operator .

[0084] 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 preceding claims when running.

[0085] 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 method described in any of the preceding claims.

[0086] Compared with existing technologies, the present invention provides a method for solving linear equation systems, which uses a polynomial preprocessor to process the original linear equation system. Matrix in sum vector Processing is performed to obtain a new system of linear equations. The matrix in the new system of linear equations condition number Smaller than the matrix in the original system of linear equations condition number This reduces the condition number of the input matrix, thereby reducing the complexity of the linear system problem. Then, the new system of linear equations is solved to obtain the common unknowns. This achieves an acceleration effect in solving linear system problems using quantum mechanics. Attached Figure Description

[0087] Figure 1 A hardware structure block diagram of a computer terminal for a method of solving a system of linear equations provided in an embodiment of the present invention;

[0088] Figure 2 A flowchart illustrating a method for solving a system of linear equations provided in an embodiment of the present invention;

[0089] Figure 3 A construction operator provided in an embodiment of the present invention Quantum circuit diagram;

[0090] Figure 4 This is a schematic diagram of a linear equation solving device provided in an embodiment of the present invention. Detailed Implementation

[0091] 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.

[0092] The present invention first provides a method for solving linear equation systems, which can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.

[0093] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a method of solving a system of linear equations provided in an embodiment of the present invention. (See diagram below.) Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing methods for solving linear equations are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0094] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the linear equation system solution method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0095] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0096] It's important to note that a true quantum computer has a hybrid structure, comprising two main parts: a classical computer responsible for performing classical computations and control, and a quantum device responsible for running quantum programs to achieve quantum computation. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can run on a quantum computer, supporting operations on quantum logic gates and ultimately enabling quantum computing. Specifically, a quantum program is a sequence of instructions that operates on quantum logic gates according to a specific timing order.

[0097] In practical applications, due to limitations in the development of quantum device hardware, quantum computing simulations are typically required to verify quantum algorithms, quantum applications, and so on. Quantum computing simulation is the process of simulating the execution of a quantum program corresponding to a specific problem using a virtual architecture (i.e., a quantum virtual machine) built with the resources of a conventional computer. Typically, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in this embodiment of the invention is a program written in a classical language that represents qubits and their evolution, where qubits, quantum logic gates, etc., related to quantum computing all have corresponding classical code representations.

[0098] Quantum circuits, also known as quantum logic circuits, are a manifestation of quantum programming and are the most commonly used general-purpose quantum computing model. They represent circuits that operate on qubits under an abstract concept. They consist of qubits, circuits (timelines), and various quantum logic gates, and the results are often read out through quantum measurement operations.

[0099] Unlike traditional circuits that use metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as being connected by time. That is, the state of a quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated on.

[0100] A quantum program corresponds to a total quantum circuit. The quantum program described in this invention refers to this total quantum circuit, where the total number of qubits in the total quantum circuit is the same as the total number of qubits in the quantum program. This can be understood as follows: a quantum program can consist of a quantum circuit, measurement operations on the qubits within the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution process of a quantum program is the process of executing all the quantum logic gates according to a certain timing order. It should be noted that the timing order refers to the chronological order in which individual quantum logic gates are executed.

[0101] It's important to note that in classical computing, the most basic unit is the bit, and the most fundamental control mode is the logic gate. Circuit control can be achieved through combinations of logic gates. Similarly, the way to process qubits is through quantum logic gates. Quantum logic gates enable the evolution of quantum states and are the foundation of quantum circuits. Quantum logic gates include single-qubit gates, such as Hadamard gates (H-gates), Pauli-X gates (X-gates), Pauli-Y gates (Y-gates), Pauli-Z gates (Z-gates), RX gates, RY gates, RZ gates, etc.; and multi-qubit gates, such as CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc. Quantum logic gates are generally represented using unitary matrices, which are not only matrix forms but also operations and transformations. Generally, the effect of a quantum logic gate on a quantum state is calculated by left-multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state.

[0102] See Figure 2 , Figure 2 This is a flowchart illustrating a method for solving a system of linear equations according to an embodiment of the present invention. It may include the following steps:

[0103] Step 201: Obtain the system of linear equations Matrix in sum vector The It is an unknown quantity;

[0104] In applied mathematics and scientific and engineering computing, the mathematical models of many problems can be described by systems of linear equations. For example, the problem of simulating the electromagnetic properties of a target can be transformed into solving matrix equations by discretizing the electromagnetic field differential equations using numerical algorithms such as the method of moments and the finite element method. Other examples include solving the Navier-Stokes equations in fluid mechanics and lattice gauge theory in quantum chromodynamics (QCD).

[0105] A linear system is a mathematical model that consists of linear operators and simultaneously satisfies superposition and homogeneity (also known as homogeneity). Currently, linear systems are central to many scientific and engineering fields. For the system of linear equations to be processed... Obtain the matrix respectively sum vector The element information and dimensions, where the matrix It can be a coefficient matrix, which is one of the many types of matrices. Simply put, a coefficient matrix is ​​a matrix formed by assembling the coefficients of a system of linear equations to calculate the solution to the system. Coefficient matrices are often used to represent the mathematical relationships between items.

[0106] Step 202: In the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ;

[0107] In numerical analysis and linear algebra, matrices condition number Defined as:

[0108]

[0109] in, Each is a matrix norm and matrix The norm of the inverse matrix.

[0110] The condition number of a matrix describes its ability to stretch and compress vectors. A larger condition number increases the complexity of solving linear system problems, causing the speedup effect of quantum computing on linear system problems to disappear. Therefore, to achieve a solution performance far exceeding that of ordinary quantum solvers for linear system problems, a preprocessor is needed to optimize the matrix. sum vector To reduce the condition number of the matrix, the preprocessor used in this embodiment of the invention is a polynomial preprocessor.

[0111] The preset threshold can be 1, 10, 100, 1000, 10000, or other values, which are not limited here.

[0112] Step 303: Based on the matrix and the vector Construct a new system of linear equations Solve for the unknown quantity .

[0113] After processing the matrix through a polynomial preprocessor sum vector Processing yields a matrix. sum vector Then, the matrix condition number Smaller than matrix condition number The matrix can then be solved using a conventional quantum solver. sum vector Construct a new system of linear equations Unknown quantities in .

[0114] Compared with existing technologies, the present invention provides a method for solving linear equation systems, which uses a polynomial preprocessor to process the original linear equation system. Matrix in sum vector Processing is performed to obtain a new system of linear equations. The matrix in the new system of linear equations condition number Smaller than the matrix in the original system of linear equations condition number This reduces the condition number of the input matrix, thereby reducing the complexity of the linear system problem. Then, the new system of linear equations is solved to obtain the common unknowns. This achieves an acceleration effect in solving linear system problems using quantum mechanics.

[0115] In a specific embodiment provided by the present invention, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector Aspects, including:

[0116] Step 2021: Prepare the vector quantum state and based on polynomial functions and the matrix Deterministic polynomial The As the independent variable;

[0117] Step 2022: Based on the polynomial Constructing operators and the polynomial With the matrix Multiply to obtain a matrix ;

[0118] Step 2023: The operator Acting on the quantum state Above, we obtain the quantum state. The quantum state For vectors The corresponding quantum state.

[0119] Among them, quantum state The For vectors Dimensions. Operator Acting on quantum states Above, we obtain the quantum state. quantum state .

[0120] Furthermore, in the context of polynomial functions... and the matrix Deterministic polynomial Previously, the method also included:

[0121] Step 2023: Obtain the approximate function with parameters And determine the parameterized approximate function. Domain;

[0122] Step 2024: Select from the defined domain Approximate deviation points and the aforementioned Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system ,in The T is an integer greater than 0, and T is any natural number in the domain.

[0123] Step 2025: Solve the system of linear equations. The approximate function containing parameters is obtained. The values ​​of the parameters;

[0124] Step 2026: Determine the target approximation function based on the values ​​of the parameters;

[0125] Step 2027: Determine the polynomial function based on the target approximation function. .

[0126] Wherein, if the parameterized approximate function If it is an odd function, then the... If the parameterized approximate function If it is an even function, then the... The As a parameter, the It is an integer greater than or equal to 0. Here, we use a parameterized approximation function. Take an even function as an example.

[0127] Wherein, the parameterized approximation function domain , The maximum absolute value of the eigenvalues ​​of matrix A. Let be the minimum absolute value of the eigenvalues ​​of matrix A. The magnitude relationship of the approximate deviation points is as follows: < <···< < The arrangement can be either arithmetic or not; no restriction is made here.

[0128] in, 3D linear equation system It can be solved One unknown .

[0129] Among them, the approximate function containing parameters and deviation amplitude The relational expression can be It can also be The solutions obtained by both The signs are opposite.

[0130] Specifically, in determining the target approximation function based on the values ​​of the parameters, the following are included:

[0131] Step 2026a: Substitute the values ​​of the parameters into the approximate function containing the parameters. In this process, an initial approximate function is obtained;

[0132] Step 2026b: Determine the extreme points of the absolute value of the difference between the initial approximation function and T;

[0133] Step 2026c: If the extreme point is related to the... If all approximate deviation points are equal within the accuracy requirement, then the initial approximation function is determined as the target approximation function;

[0134] Step 2026d: If the extreme point is related to the... If the approximate deviation points are not equal within the accuracy requirement, then the extreme point is taken as the new extreme point. Approximate deviation points, and the execution step described above. Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system .

[0135] The precision requirement can be, for example, that the three decimal places are the same. If the three decimal places of the extreme point and its corresponding approximate deviation point are the same, then the two are determined to be equal within the precision requirement. Of course, it is not limited to three decimal places. It can also be one before the decimal point, two after the decimal point, five after the decimal point, seven after the decimal point, or other values. There is no limitation here.

[0136] Specifically, in determining the polynomial function based on the target approximation function... Aspects, including:

[0137] Step 2027a: Based on the target approximation function and the polynomial function relational formula Determine the polynomial function .

[0138] Specifically, in the case based on the polynomial Constructing operators Aspects, including:

[0139] Step 2021a: Prepare the polynomial using quantum signal processing (QSP). Corresponding operator .

[0140] Quantum signal processing (QSP) guarantees that quantum operators of polynomial mappings defined on the real number field can be prepared if and only if the polynomial is an odd function or an even function (i.e., the polynomial is of all odd or all even order).

[0141] In a specific embodiment provided by the present invention, the matrix-based and the vector Constructed system of linear equations Solve for the unknown quantity ,include:

[0142] Step 2031: Based on the matrix Determine the operators required for the HHL algorithm ;

[0143] Step 2032 will use the vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state that takes the value;

[0144] Step 2033: Determine the unknown quantity based on the target quantum state. The solution results are as follows.

[0145] Specifically, in the matrix Determine the operators required for the HHL algorithm Aspects, including:

[0146] Step 2031a: Determine the operator required for HHL ;

[0147] Step 2031b: The operator The operator is determined by expanding according to the Jacobi-Anger expansion formula. The exponential expansion of the operator The exponential expansion is:

[0148] ,

[0149] in, yes The first-order Bessel function of the first kind, yes Chebyshev polynomials of the first kind of order;

[0150] Step 2031c: Retain The operator of order precision The exponential expansion, The operator of order precision The exponential expansion is:

[0151] ,

[0152] in,

[0153] ,

[0154] ,

[0155] ;

[0156] Step 2031d: Prepare the QSP Corresponding operator and stated Corresponding operator ;

[0157] Step 2031e: Linearly merge LCUs and the aforementioned unitary operations and stated Construct the operator .

[0158] Among them, when When it is a positive integer, there is , ,therefore It is an even function. It is an odd function. Therefore, the operator... It can also be prepared using QSP. When the operator is prepared... Operators can then be constructed using linear combination of unitary operators (LCU). .like Figure 3 As shown, Figure 3 A construction operator provided in an embodiment of the present invention The quantum circuit diagram.

[0159] Build in this way The success rate After amplitude estimation and amplitude amplification, the success rate can be increased to [a higher percentage]. This will occur during subsequent QPE processes. A controlled The success rate of the entire process is [missing information]. ,in Therefore when When it approaches 1, the entire algorithm process is close to 1.

[0160] Specifically, in the process of setting the vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. Regarding the target quantum state, the values ​​taken include:

[0161] Step 2032a: Prepare quantum states ;

[0162] Step 2032b: Evolve the initial quantum state to include the unknowns through quantum phase estimation (QPE) and controlled rotation operations. The target quantum state to be taken, wherein the quantum logic gate required in the QPE is the... Specifically, the HHL algorithm requires three registers, each containing at least one qubit. Before executing the HHL algorithm, these three registers need to be initialized, meaning the qubits in each register are initialized to... Then, the third register is accessed using a general method. Convert to vector quantum state Then, in step 2023: the operator... Acting on the quantum state Above, we obtain the quantum state. , wherein the quantum state .

[0163] In the HHL algorithm, the quantum phase estimation (QPE) operation specifically involves sequentially applying an H gate to the second register, and then applying a controlled U gate to both the second and third registers. The gate operates on the second register. The gate is a quantum logic gate corresponding to the Fourier transform. The quantum state is transformed through the QPE operation. Evolving to a quantum state ,in Eigenvalues ​​obtained from QPE The estimated value;

[0164] The controlled operation specifically involves applying a controlled R gate to a first register and a second register, where the second register is the control bit and the first register is the controlled bit, through the quantum state. sub-quantum state A controlled rotation operation is performed on the quantum state of the auxiliary bit to obtain the quantum state. ;

[0165] The first register is measured, and when the quantum state of the first register is At that time, a quantum state is obtained. ;

[0166] The quantum state is obtained by inverse QPE operation. Evolved to include the unknown quantity The target quantum state with the value .

[0167] Specifically, the unknown quantity is determined based on the target quantum state. The solution result, i.e., the unknown quantity Values .

[0168] Practical verification has shown that the linear equation solving method including a polynomial preprocessor provided in this embodiment of the invention is effective for matrix equations. condition number The optimization factor is That is, the condition number optimization factor and the input polynomial. The order of is linearly related. The overall solution complexity is O(n log n). Compared to the HHL solution complexity The optimization degree is It is evident that, with As the value increases, the optimization level increases linearly. When... hour, At this point, the solution complexity of the linear equation system solving method including a polynomial preprocessor provided in this embodiment of the invention is reduced to a minimum. .

[0169] See Figure 4 , Figure 4 This is a schematic diagram of a linear equation solving device provided in an embodiment of the present invention. Figure 2 The process shown can include:

[0170] Acquisition unit 401 is used to acquire linear equation systems. Matrix in sum vector The It is an unknown quantity;

[0171] Processing unit 402, used in the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ;

[0172] Calculation unit 403, used for calculating based on the matrix and the vector Construct a new system of linear equations Solve for the unknown quantity .

[0173] Optionally, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector In this regard, the processing unit 402 is specifically used for:

[0174] Prepare the vector quantum state and based on polynomial functions and the matrix Deterministic polynomial The As the independent variable;

[0175] Based on the polynomial Constructing operators and the polynomial With the matrix Multiply to obtain a matrix ;

[0176] The operator Acting on the quantum state Above, we obtain the quantum state. The quantum state For vectors The corresponding quantum state.

[0177] Optionally, in the polynomial-based function and the matrix Deterministic polynomial Previously, the processing unit 402 was also used for:

[0178] Obtaining approximate functions with parameters And determine the parameterized approximate function. Domain;

[0179] Select from the defined domain Approximate deviation points and the aforementioned Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system ,in The T is an integer greater than 0, and T is any natural number in the domain.

[0180] Solve the system of linear equations The approximate function containing parameters is obtained. The values ​​of the parameters;

[0181] The target approximation function is determined based on the values ​​of the parameters, and the polynomial function is determined based on the target approximation function. .

[0182] Optionally, in determining the target approximation function based on the values ​​of the parameters, the processing unit 402 is specifically used for:

[0183] Substitute the values ​​of the parameters into the approximate function containing the parameters. In this process, an initial approximate function is obtained;

[0184] Determine the extreme points of the absolute value of the difference between the initial approximation function and T;

[0185] If the extreme point is the same as the If all approximate deviation points are equal within the accuracy requirement, then the initial approximation function is determined as the target approximation function;

[0186] If the extreme point is the same as the If the approximate deviation points are not equal within the accuracy requirement, then the extreme point is taken as the new extreme point. Approximate deviation points, and the execution step described above. Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system .

[0187] Optionally, in determining the polynomial function based on the target approximation function... In this regard, the processing unit 402 is specifically used for:

[0188] Based on the target approximation function and the polynomial function relational formula Determine the polynomial function The , wherein For the matrix The norm of the largest eigenvalue.

[0189] Optionally, if the parameterized approximation function If it is an odd function, then the... If the parameterized approximate function If it is an even function, then the... The As a parameter, the It is an integer greater than or equal to 0.

[0190] Optionally, in the case based on the polynomial Constructing operators In this regard, the processing unit 402 is specifically used for:

[0191] The matrix Assign a value to the independent variable To obtain the polynomial ;

[0192] The polynomial was prepared by quantum signal processing (QSP). Corresponding operator .

[0193] Optionally, in the case based on the matrix and the vector Constructed system of linear equations Solve for the unknown quantity In this respect, the computing unit 403 is specifically used for:

[0194] Based on the matrix Determine the operators required for the HHL algorithm ;

[0195] The vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state that takes the value;

[0196] Determine the unknown quantity based on the target quantum state. The solution results are as follows.

[0197] Optionally, in the case based on the matrix Determine the operators required for the HHL algorithm In this respect, the computing unit 403 is specifically used for:

[0198] Determine the operators required for the HHL algorithm ;

[0199] The operator The operator is determined by expanding according to the Jacobi-Anger expansion formula. The exponential expansion of the operator The exponential expansion is:

[0200] ,

[0201] in, yes The first-order Bessel function of the first kind, yes Chebyshev polynomials of the first kind of order;

[0202] reserve The operator of order precision The exponential expansion, The operator of order precision The exponential expansion is:

[0203] ,

[0204] in,

[0205] ,

[0206] ,

[0207] ;

[0208] The preparation of the QSP Corresponding operator and stated Corresponding operator ;

[0209] Linear merging of LCUs via unitary operations and the aforementioned and stated Construct the operator .

[0210] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the method embodiments described above when running.

[0211] Specifically, in this embodiment, the storage medium can be configured to store a computer program for performing the following steps:

[0212] Obtaining a system of linear equations Matrix in sum vector The It is an unknown quantity;

[0213] In the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ;

[0214] Based on the matrix and the vector Construct a new system of linear equations Solve for the unknown quantity .

[0215] Specifically, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0216] 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 steps in any of the method embodiments described above.

[0217] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.

[0218] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0219] Obtaining a system of linear equations Matrix in sum vector The It is an unknown quantity;

[0220] In the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ;

[0221] Based on the matrix and the vector Construct a new system of linear equations Solve for the unknown quantity .

[0222] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.

Claims

1. A method for solving a system of linear equations, characterized in that, The method includes: Obtaining a system of linear equations Matrix in sum vector The It is an unknown quantity; In the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ; Based on the matrix and the vector Construct a new system of linear equations Solve for the unknown quantity The matrix-based and the vector Constructed system of linear equations Solve for the unknown quantity Including: based on the matrix Determine the operators required for the HHL algorithm ; the vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state is taken; the unknown quantity is determined based on the target quantum state. The solution result; the vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state for the value includes: preparing the quantum state. The initial quantum state is evolved to include the unknowns through quantum phase estimation (QPE) operations and controlled rotation operations. The target quantum state to be taken, wherein the quantum logic gate required in the QPE is the... The quantum phase estimation (QPE) operation specifically involves sequentially applying the H gate to the second register, and then applying the controlled U gate to both the second and third registers. The gate operates on the second register. The gate is a quantum logic gate corresponding to the Fourier transform; Wherein, the matrix is ​​processed by a polynomial preprocessor sum vector Processing yields a matrix. sum vector ,include: Prepare the vector quantum state and based on polynomial functions and the matrix Deterministic polynomial The As the independent variable; The polynomial was prepared by quantum signal processing (QSP). Corresponding operator and the polynomial With the matrix Multiply to obtain a matrix ; The operator Acting on the quantum state Above, we obtain the quantum state. The quantum state For vectors The corresponding quantum state.

2. The method as described in claim 1, characterized in that, The polynomial function and the matrix Deterministic polynomial Previously, the method also included: Obtaining approximate functions with parameters And determine the parameterized approximate function. Domain; Select from the defined domain Approximate deviation points and the aforementioned Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system ,in The T is an integer greater than 0, and T is any natural number in the domain. Solve the system of linear equations The approximate function containing parameters is obtained. The values ​​of the parameters; The target approximation function is determined based on the values ​​of the parameters, and the polynomial function is determined based on the target approximation function. .

3. The method as described in claim 2, characterized in that, The determination of the target approximation function based on the values ​​of the parameters includes: Substitute the values ​​of the parameters into the approximate function containing the parameters. In this process, an initial approximate function is obtained; Determine the extreme points of the absolute value of the difference between the initial approximation function and T; If the extreme point is the same as the If all approximate deviation points are equal within the accuracy requirement, then the initial approximation function is determined as the target approximation function; If the extreme point is the same as the If the approximate deviation points are not equal within the accuracy requirement, then the extreme point is taken as the new extreme point. Approximate deviation points, and the execution step described above. Substituting the approximate deviation points into the parameterized approximate function and deviation amplitude From the composed relation, we obtain 3D linear equation system .

4. The method as described in claim 2, characterized in that, The polynomial function is determined based on the target approximation function. ,include: Based on the target approximation function and the polynomial function relational formula Determine the polynomial function The .

5. The method according to any one of claims 2-4, characterized in that, If the parameterized approximation function If it is an odd function, then the... ; If the parameterized approximation function If it is an even function, then the... The As a parameter, the It is an integer greater than or equal to 0.

6. The method as described in claim 1, characterized in that, The matrix Determine the operators required for the HHL algorithm ,include: Determine the operators required for the HHL algorithm ; The operator The operator is determined by expanding according to the Jacobi-Anger expansion formula. The exponential expansion of the operator The exponential expansion is: , in, yes The first-order Bessel function of the first kind, yes Chebyshev polynomials of the first kind of order; reserve The operator of order precision The exponential expansion, The operator of order precision The exponential expansion is: , in, , , ; The preparation of the via QSP and stated ; Linear merging of LCUs via unitary operations and the aforementioned and stated Construct the operator .

7. A device for solving a system of linear equations, characterized in that, The device includes: Acquisition unit, used to acquire linear equation systems Matrix in sum vector The It is an unknown quantity; Processing unit, used in the matrix condition number When the value exceeds a preset threshold, the matrix is ​​processed by a polynomial preprocessor. sum vector Processing yields a matrix. sum vector The matrix condition number Smaller than the matrix condition number ; Calculation unit, used for calculating based on the matrix and the vector Construct a new system of linear equations Solve for the unknown quantity The matrix-based and the vector Constructed system of linear equations Solve for the unknown quantity Including: based on the matrix Determine the operators required for the HHL algorithm ; the vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state is taken; the unknown quantity is determined based on the target quantum state. The solution result; the vector corresponding quantum state and the operator The input is fed into the HHL algorithm to determine the unknown quantity. The target quantum state for the value includes: preparing the quantum state. The initial quantum state is evolved to include the unknowns through quantum phase estimation (QPE) operations and controlled rotation operations. The target quantum state to be taken, wherein the quantum logic gate required in the QPE is the... The quantum phase estimation (QPE) operation specifically involves sequentially applying the H gate to the second register, and then applying the controlled U gate to both the second and third registers. The gate operates on the second register. The gate is a quantum logic gate corresponding to the Fourier transform; Wherein, the matrix is ​​processed by a polynomial preprocessor sum vector Processing yields a matrix. sum vector ,include: Prepare the vector quantum state and based on polynomial functions and the matrix Deterministic polynomial The As the independent variable; The polynomial was prepared by quantum signal processing (QSP). Corresponding operator The polynomial With the matrix Multiply to obtain a matrix ; The operator Acting on the quantum state Above, we obtain the quantum state. The quantum state For vectors The corresponding quantum state.

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 to 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 as described in any one of claims 1 to 6.