Quantum circuit-based simulation method, device, equipment and readable storage medium

By projecting linear equations onto a predefined subspace and using quantum circuits to construct qubit evolution operations, the problem of high computational complexity in large-scale grid nodes is solved, and efficient solutions to fluid dynamic states are achieved.

CN118940649BActive Publication Date: 2025-12-09ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310526333.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2025-12-09
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

Existing technologies have high computational complexity when solving linear equations with large-scale grid nodes in computational fluid dynamics, resulting in low efficiency for deterministic states.

Method used

By projecting the linear equation system onto a predefined subspace, the evolution operation of the qubit is constructed using the Chebyshev polynomial corresponding to the inverse matrix of A2 based on the quantum circuit. The value of X2 is measured and then restored to the dimension of X1, reducing the computational complexity.

Benefits of technology

It improves the efficiency of deterministic states, reduces computational complexity, and enables efficient solving of large-scale linear equation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940649B_ABST
    Figure CN118940649B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a quantum circuit-based simulation method and device, equipment and readable storage medium, relating to the technical field of quantum computing, obtaining a first linear equation system A1X1=B1; X1 represents a physical quantity to be solved in a target system; projecting the first linear equation system to a preset subspace to obtain a second linear equation system A2X2=B2; the dimension of the preset subspace is less than that of X1; performing an evolution operation of a quantum state on a quantum bit based on a constructed quantum circuit, and measuring the quantum bit to obtain a final value of X2; the quantum circuit is constructed based on a Chebyshev polynomial corresponding to an inverse matrix of A2; the input of the quantum circuit contains the initial state of the quantum bit corresponding to B2; and the final value of X2 is restored to the dimension of X1 to obtain a final value of X1. In this way, the complexity of the calculation can be reduced, and the efficiency of determining the physical quantity can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of quantum computing, and particularly relates to a simulation method and device based on a quantum circuit, equipment and a readable storage medium. BACKGROUND

[0002] With the development of random computer technology, different systems can be simulated and analyzed by using the computing advantages of the random computer technology, and a linear equation set of the system can be constructed. By solving the linear equation set, information of the system in a stable state can be obtained. For example, in CFD (Computational Fluid Dynamics), numerical experiments, computer simulation and analysis research can be performed on fluid mechanics problems based on various discretization mathematical methods. For example, by using CFD, state information such as temperature and density of fluid at different positions in a stable state can be calculated.

[0003] In the prior art, in the process of simulating fluid motion by using computational fluid dynamics, a linear equation set AX=B needs to be solved, that is, X is obtained; X represents the state of the fluid, and A represents a coefficient matrix. In the calculation process, A must be inverted, and the dimension of the coefficient matrix is linearly related to the grid nodes constructed for the fluid. When the scale of the grid nodes is very large, the calculation of inverting the coefficient matrix is very complex, which increases the complexity of the calculation and leads to low efficiency of determining the state. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a simulation method and device based on a quantum circuit, equipment and a readable storage medium, which can reduce the complexity of the calculation and improve the efficiency of determining the physical quantity. The specific technical solutions are as follows:

[0005] In a first aspect, the embodiments of the present application provide a simulation method based on a quantum circuit, which comprises the following steps:

[0006] obtaining a first linear equation set A1X1=B1 to be solved; X1 represents a physical quantity to be solved of a target system;

[0007] projecting the first linear equation set A1X1=B1 to be solved to a preset subspace to obtain a second linear equation set A2X2=B2 to be solved; wherein the dimension of the preset subspace is less than the dimension of X1;

[0008] performing an evolution operation of a quantum state on a quantum bit based on the constructed quantum circuit, and measuring the quantum bit to obtain a final value of X2; wherein the quantum circuit is constructed based on a Chebyshev polynomial corresponding to an inverse matrix of A2; and the input of the quantum circuit contains an initial state of a quantum bit corresponding to B2.

[0009] reducing the final value of X2 to the dimension of X1 to obtain the final value of X1.

[0010] Optionally, the target system represents a fluid, X1 represents a difference between a fluid state to be solved at a time and a fluid state to be solved at a previous time in each grid cell of a discretized network of the fluid; B1 represents a residual quantity related to the fluid state to be solved at the previous time and coordinate information of the grid cell; and A1 represents a coefficient matrix related to the fluid state to be solved at the previous time and the coordinate information of the grid cell.

[0011] Optionally, before the evolution operation of the quantum state on the quantum bits is performed based on the constructed quantum circuit and the quantum bits are measured to obtain the final value of X2, the method further comprises:

[0012] based on a first formula, constructing each order of Chebyshev polynomials corresponding to the inverse matrix of A2;

[0013] The first formula is:

[0014]

[0015] wherein,

[0016]

[0017] A2 -1 represents the inverse matrix of A2; represents the g-th order of Chebyshev polynomials corresponding to the inverse matrix of A2; b=κ 2 log(κ / ∈), κ represents a condition number; ∈ represents a preset precision value; and C represents a combination number.

[0018] Optionally, the quantum circuit comprises a first Oracle and a second Oracle.

[0019] The first Oracle is configured to implement, based on a quantum walk algorithm, encoding each order of Chebyshev polynomials corresponding to the inverse matrix of A2 to an amplitude of an initial state of quantum bits corresponding to B2.

[0020] The second Oracle is configured to implement, based on an operator linear combination algorithm and an encoding result of the first Oracle, encoding a weighted sum of orders of Chebyshev polynomials corresponding to the inverse matrix of A2 to the amplitude of the initial state of the quantum bits corresponding to B2.

[0021] Optionally, the input of the quantum circuit further comprises a first number of first auxiliary quantum bits and a second number of second auxiliary quantum bits.

[0022] The first Oracle is configured to implement encoding each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bits corresponding to B2 based on a second algorithm;

[0023] The second algorithm is:

[0024] wherein, The operator is configured to implement the mapping from |0 m >|B2> to ; Π|Φ ⊥ >=0, d represents the sparsity of A2; represents the element in the jth row and the kth column of A2, and satisfies N represents the dimension of A2; The operator is configured to implement the mapping from |0 m >|ψ j > to T|ψ j >; represents the computational tensor product; I represents the unit matrix; |0 m > represents the second auxiliary quantum bits; |B2> represents the initial state of the quantum bits corresponding to B2; represents the Hermitian conjugate operator; W g represents the W operator corresponding to the gth order of the Chebyshev polynomials;

[0025] The second Oracle is configured to implement encoding the weighted sum of each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bits corresponding to B2 based on a third algorithm;

[0026] The third algorithm is:

[0027] wherein, the G operator is configured to implement the mapping from |0 r >|0 m >|B2> to , |Ψ ⊥ > is orthogonal to T|j>; |0 r > represents the first auxiliary quantum bits; α=∑ g α g .

[0028] Optionally, the first number is determined based on a fourth algorithm, and the fourth algorithm is:

[0029] r=logM

[0030] Wherein, r represents the first number, M represents the order of the Chebyshev polynomial corresponding to the inverse matrix of A2;

[0031] The second number is determined based on a fifth algorithm, and the fifth algorithm is:

[0032] m = log4N

[0033] M represents the second number.

[0034] Optionally, the measuring the quantum bits to obtain the final value of X2 includes:

[0035] When the registers corresponding to the first auxiliary quantum bit and the second auxiliary quantum bit are both in the state |0>, the measurement result of the register corresponding to the quantum bit corresponding to B2 is obtained.

[0036] Based on the obtained measurement result, the final value of X2 is obtained.

[0037] Optionally, the obtaining the final value of X2 based on the obtained measurement result includes:

[0038] Based on the obtained measurement result, the current candidate value of X2 is obtained.

[0039] Based on the current candidate value of X2, the residual quantity corresponding to the second linear equation group to be solved is calculated.

[0040] If the calculated residual quantity satisfies the first termination condition, the final value of X2 is determined based on the current candidate value of X2.

[0041] If the calculated residual quantity does not satisfy the first termination condition, iterative operation is performed based on the calculated residual quantity, and the final value of X2 is determined based on the result of the iterative operation.

[0042] Optionally, the reducing the final value of X2 to the dimension of X1 to obtain the final value of X1 includes:

[0043] According to a sixth algorithm, the final value of X2 is reduced to the dimension of X1 to obtain the final value of X1; and the sixth algorithm is:

[0044] X1 = X 0 + V D X2

[0045] Wherein, X 0 represents the initial solution when projection is performed; V D represents a set of bases of the predetermined subspace determined when projection is performed.

[0046] In a second aspect, the embodiment of the application provides a quantum circuit-based simulation device, the device comprising:

[0047] an acquisition module, configured to acquire a first linear equation group A1X1=B1; X1 represents a physical quantity to be solved by a target system;

[0048] a projection module, configured to project the first linear equation group to a preset subspace to obtain a second linear equation group A2X2=B2; wherein a dimension of the preset subspace is less than a dimension of X1;

[0049] an evolution module, configured to perform an evolution operation of a quantum state on a quantum bit based on the constructed quantum circuit, and measure the quantum bit to obtain a final value of X2; wherein the quantum circuit is constructed based on a Chebyshev polynomial corresponding to an inverse matrix of A2; an input of the quantum circuit contains an initial state of a quantum bit corresponding to B2;

[0050] a reduction module, configured to reduce the final value of X2 to the dimension of X1 to obtain a final value of X1.

[0051] Optionally, the target system represents a fluid, X1 represents a difference between a fluid state to be solved at a time and a fluid state to be solved at a previous time in a discretized network of the fluid; B1 represents a residual quantity related to the fluid state to be solved at the previous time and coordinate information of a grid cell; and A1 represents a coefficient matrix related to the fluid state to be solved at the previous time and the coordinate information of the grid cell.

[0052] Optionally, the apparatus further comprises:

[0053] a construction module, configured to, before the evolution operation of the quantum state on the quantum bit based on the constructed quantum circuit and the measurement of the quantum bit to obtain the final value of X2, construct each order of a Chebyshev polynomial corresponding to an inverse matrix of A2 based on a first formula.

[0054] The first formula is:

[0055]

[0056] wherein,

[0057]

[0058] A2 -1 represents an inverse matrix of A2; represents an g-th order of a Chebyshev polynomial corresponding to the inverse matrix of A2; b=κ 2 log(κ / ∈), κ represents a condition number; ∈ represents a preset precision value; and C represents a combination number.

[0059] Optionally, the quantum circuit comprises a first Oracle and a second Oracle.

[0060] The first Oracle is configured to implement encoding each order of Chebyshev polynomials corresponding to the inverse matrix of A2 into an amplitude of an initial state of quantum bits corresponding to B2 based on a quantum walk algorithm.

[0061] The second Oracle is configured to implement encoding a weighted sum of orders of Chebyshev polynomials corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bits corresponding to B2 based on an operator linear combination algorithm and the encoding result of the first Oracle.

[0062] Optionally, the input of the quantum circuit further comprises a first number of first auxiliary quantum bits and a second number of second auxiliary quantum bits.

[0063] The first Oracle is configured to implement encoding each order of Chebyshev polynomials corresponding to the inverse matrix of A2 into an amplitude of an initial state of quantum bits corresponding to B2 based on a second formula.

[0064] The second formula is:

[0065] wherein, The operator is configured to implement a mapping from |0 m >|B2> to ; Π|Φ ⊥ >= 0, d represents a sparsity of A2; represents an element in the jth row and the kth column of A2, and satisfies N represents a dimension of A2; The operator is configured to implement a mapping from |0 m >|ψ j > to T|ψ j >; represents a computational tensor product; I represents a unit matrix; |0 m > represents the second number of second auxiliary quantum bits; |B2> represents an initial state of quantum bits corresponding to B2; represents a Hermitian conjugate operator; W g represents a W operator corresponding to the gth order of the Chebyshev polynomials;

[0066] The second Oracle is configured to implement encoding a weighted sum of orders of Chebyshev polynomials corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bits corresponding to B2 based on a third formula.

[0067] The third formula is:

[0068] wherein the G operator is used to implement the mapping from |0 r >|0 m >|B2> to |Ψ , |Ψ ⊥ > is orthogonal to T|j>; |0 r > represents the first number of first auxiliary qubits; α=∑ g α g .

[0069] Optionally, the first number is determined based on a fourth algorithmic expression, the fourth algorithmic expression being:

[0070] r=logM

[0071] wherein r represents the first number, and M represents an order of a Chebyshev polynomial corresponding to an inverse matrix of A2;

[0072] The second number is determined based on a fifth algorithmic expression, the fifth algorithmic expression being:

[0073] m=log4N

[0074] m represents the second number.

[0075] Optionally, the evolution module comprises:

[0076] a measurement module configured to measure the qubits to obtain a measurement result of a register corresponding to the qubits of B2 when registers corresponding to the first auxiliary qubits and the second auxiliary qubits are in a state of |0>;

[0077] a generating submodule configured to obtain a final value of X2 based on the obtained measurement result.

[0078] Optionally, the generating submodule is specifically configured to obtain a current candidate value of X2 based on the obtained measurement result.

[0079] based on the current candidate value of X2, calculate a residual quantity corresponding to the second linear equation system to be solved;

[0080] if the calculated residual quantity satisfies a first termination condition, determine the final value of X2 based on the current candidate value of X2;

[0081] if the calculated residual quantity does not satisfy the first termination condition, perform an iterative operation based on the calculated residual quantity, and determine the final value of X2 based on a result of the iterative operation.

[0082] Optionally, the restoring module is specifically configured to restore the final value of X2 to a dimension of X1 to obtain a final value of X1 according to a sixth algorithmic expression, the sixth algorithmic expression being:

[0083] X1=X 0 +V D X2

[0084] wherein, X 0 represents an initial solution when projection is performed; V D represents a set of bases of the preset subspace determined when projection is performed.

[0085] In a third aspect, the embodiment of the present application provides a quantum computer device, comprising a quantum circuit and a register, and the quantum computer device realizes the method described above when running.

[0086] In a fourth aspect, the embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program realizes the method steps described above when executed by a processor.

[0087] The embodiment of the present application has the following beneficial effects:

[0088] The simulation method based on a quantum circuit provided by the embodiment of the present application obtains a first linear equation set to be solved A1X1=B1; X1 represents a physical quantity to be solved of a target system; the first linear equation set to be solved is projected to a preset subspace to obtain a second linear equation set to be solved A2X2=B2; wherein, the dimension of the preset subspace is less than the dimension of X1; an evolution operation of a quantum state is performed on a quantum bit based on a constructed quantum circuit, and the quantum bit is measured to obtain a final value of X2; wherein, the quantum circuit is constructed based on a Chebyshev polynomial corresponding to an inverse matrix of A2; the input of the quantum circuit contains an initial state of a quantum bit corresponding to B2; and the final value of X2 is restored to the dimension of X1 to obtain a final value of X1.

[0089] Based on the above processing, since X2 can be obtained based on the inverse matrix of A2 and B2, the quantum circuit is constructed based on the Chebyshev polynomial corresponding to the inverse matrix of A2, and the input of the quantum circuit contains the initial state of the quantum bit corresponding to B2, therefore, after evolution, the value of X2 can be obtained based on the measurement result of the quantum bit. Correspondingly, the final value of X2 can also be restored to the dimension of X1, and the value of X1 can also be obtained. Since the dimension of the preset subspace is less than the dimension of X1, the complexity of calculation can be reduced based on the quantum circuit to solve the second linear equation set to be solved, and the efficiency of determining the state can be improved.

[0090] Of course, implementing any product or method of the present application does not necessarily require all the advantages described above to be achieved at the same time. BRIEF DESCRIPTION OF DRAWINGS

[0091] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some embodiments of the present application, and other embodiments can be obtained by those skilled in the art based on these drawings.

[0092] Figure 1 A flow chart of a simulation method based on a quantum circuit provided for an embodiment of the present application;

[0093] Figure 2 A schematic diagram of a quantum circuit provided for an embodiment of the present application;

[0094] Figure 3 A structural diagram of a simulation device based on a quantum circuit provided for an embodiment of the present application. DETAILED DESCRIPTION

[0095] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art based on the present application belong to the scope of protection of the present application.

[0096] CFD problems are generally related to solving a series of equations with numerical methods. Among them, the CFD solver needs to time-integrate the partial derivative equations, so it needs to use time increments to iterate to calculate small changes in the system and stop when the system becomes stable. In this problem setting, the calculation is generally performed by SU2 (The Standford University Unstructured suite, a high-precision partial differential equation solver developed by Stanford University) in the classical algorithm. When simulating CFD, starting from the mathematical model, the following elements need to be defined, including: numerical grid, discretization method, numerical scheme and solution method.

[0097] Numerical grid: The grid is a discrete representation of the spatial continuum domain of the problem. Each spatial point is considered as a node and a volume defined by a set of neighboring nodes defines a grid cell. In the case of a structured grid, each node and grid cell is uniquely identified by a set of indices. The standard method to solve the above fluid dynamics equations is the FVM (Finite volume method). In the FVM method, the numerical grid is divided into a number of grid cells, the local volume associated with each grid cell is considered and the integral conservation law is applied. This law states that the change of all variables U of the fluid within a volume Ω depends only on the flux F on its surface S. The FVM can automatically satisfy the conservation properties of the fluid mechanics equations. This conservation equation can be written as follows:

[0098]

[0099] After the spatial continuum domain is discretized, the mathematical operators of the equations to be solved must also be discretized, this approximation of the equations is achieved through numerical schemes. Two types of numerical schemes are considered: the time integration scheme and the spatial scheme. The time integration scheme refers to the modeling of the time integration of the variables to be solved starting from the initial state of the fluid, while the spatial scheme represents the spatial gradient of these variables to be solved.

[0100] Based on the discretized numerical schemes and solution methods described above, the numerical grid of the space needs to be solved. In two dimensions, each spatial point is a node, identified by a set of indices. A grid is formed by the set of nodes connected by their nearest neighbors. In the discretized representation of equation (1), the differential operation is replaced by a numerical approximation and the implicit Euler scheme is chosen to handle the time derivative. Equation (1) is discretized as:

[0101]

[0102] U n is the fluid state of all grid cells at the n-th time (n-th integration), U n i , i = 0, 1, 2, …, N-1, U i = (p, pu, p v, E) i represents the fluid state of the i-th grid cell, p represents the fluid density, u and v represent the two components of the fluid velocity in two-dimensional coordinates, E represents the total energy per unit mass of the fluid, b n (U n ) represents the residual quantity at the n-th time, and it is a function related to U n .

[0103] Let ΔU n = U n+1 - U n ​Then:

[0104]

[0105] Substitute equation (3) into equation (2), we get:

[0106]

[0107] where δ i,i′ δ j,j′ is a parameter related to the coordinate information of the grid cell.

[0108] In addition then equation (4) is equivalent to:

[0109] A(U n )ΔU n = -b n (U n ) (5)

[0110] where A(U n ) represents the coefficient matrix at the nth time, that is, the Jacobian matrix at the nth time, and it is a function related to U n .

[0111] A(U n ) is abbreviated as A n , and -b n (U n ) is abbreviated as b n , so an iterative problem of solving a linear system A n ΔU n = b n is obtained. When the number of grid cells is N, the dimension of U n is 4N, and when solving, the initial state of the fluid of the N network cells is obtained to get U 0 , A 0 and b 0 are calculated according to U 0 , A 0 (U 1 -U 0 ) = b 0 is solved to get U 1 , A 1 and b 1 are calculated to get U 2 , and so on. The iteration is stopped when b n tends to 0. In this case, a method for solving a linear system of the form A n ΔU n = b n is needed, where ΔU n = U n+1-U n .

[0112] A n may be understood as A1 in the present application, ΔU n may be understood as X1 in the present application, b n may be understood as B1 in the present application.

[0113] In the classical scheme, the implicit Euler solver has linear complexity, A n is a sparse matrix, which must be inverted in the calculation process. The calculation of the inverse of the matrix is very complex, and an iterative method must be used. The classical solution method uses a multi-grid method, the dimension of the sparse matrix is linearly related to the grid nodes, and the running time has a good linear relationship with the number of grid elements, and the implementation will be very difficult.

[0114] The embodiment of the present application provides a simulation method based on a quantum circuit, which can be realized by an electronic device with quantum computing capability, such as a quantum computer, or can be realized by a classical computer simulating quantum computing. Referring to Figure 1 , Figure 1 The embodiment of the present application provides a flowchart of a simulation method based on a quantum circuit, which comprises the following steps:

[0115] S101: obtaining a first linear equation group A1X1=B1; X1 represents a physical quantity to be solved in the target system.

[0116] S102: projecting the first linear equation group to be solved to a preset subspace to obtain a second linear equation group A2X2=B2; wherein the dimension of the preset subspace is less than the dimension of X1.

[0117] S103: performing an evolution operation of a quantum state on a quantum bit based on the constructed quantum circuit, and measuring the quantum bit to obtain the final value of X2.

[0118] Wherein, the quantum circuit is constructed based on the Chebyshev polynomials corresponding to the inverse matrix of A2; the input of the quantum circuit contains the initial state of the quantum bit corresponding to B2.

[0119] Specifically, first, the target quantum logic gate and the quantum bit and the timing of the action of the target quantum logic gate are determined based on the Chebyshev polynomials corresponding to the inverse matrix of A2 to obtain the quantum circuit; then B2 is encoded into the initial state of the quantum bit as the input of the quantum circuit; the encoded quantum bit is evolved through the target quantum logic gate, so that the initial state of the quantum bit evolves to the final state; then the quantum bit is measured to obtain the final state of the quantum bit; the final value of X2 is determined according to the final state of the quantum bit.

[0120] S104: reduce the final value of X2 to the dimension of X1 to obtain the final value of X1.

[0121] The intrinsic feature of quantum computing is quantum parallelism. In Hilbert space, the quantum state of a plurality of qubits is a vector, and each quantum operation is a transformation in this linear space. Therefore, if a description of an actual problem is encoded as a quantum state vector of a set of qubits, the solution of the problem can be achieved by performing an operation in parallel without iterating the state of each qubit in the set of qubits. Correspondingly, in this application, since X2 can be obtained based on the inverse matrix of A2 and B2, and the quantum circuit is constructed based on the Chebyshev polynomials corresponding to the inverse matrix of A2, and the input of the quantum circuit contains the initial state of the qubits corresponding to B2, therefore, after evolution, the value of X2 can be obtained based on the measurement result of the qubits. Correspondingly, the final value of X2 can also be reduced to the dimension of X1, and the value of X1 can also be obtained. Since the dimension of the preset subspace is smaller than the dimension of X1, the complexity of the calculation can be reduced based on the quantum circuit to solve the second linear equation set, and the efficiency of determining the state can be improved.

[0122] For step S101, the first linear equation set to be solved is for a target system. For example, for some large linear system, in the process of calculating the physical quantity of the large linear system, it is necessary to solve the corresponding linear sparse equation set, and then the linear sparse equation set can be taken as the first linear equation set to be solved to solve based on the method provided in this application.

[0123] In one embodiment, the target system can be a fluid, and correspondingly, the solution of the first linear equation set to be solved, i.e., the physical quantity to be solved, is the difference between the fluid state to be solved at a time and the fluid state to be solved at a previous time. That is, X1 represents the difference between the fluid state to be solved at a time and the fluid state to be solved at a previous time in each grid cell in the discretized network of the fluid; B1 represents a residual quantity related to the coordinate information of the grid cell and the fluid state to be solved at a previous time; and A1 represents a coefficient matrix related to the coordinate information of the grid cell and the fluid state to be solved at a previous time. For example, A1 represents a Jacobian matrix related to the coordinate information of the grid cell and the fluid state to be solved at a previous time. The above fluid state can include at least one of density, velocity and energy.

[0124] For step S102, in an implementation, the first linear equation set to be solved can be projected based on a preset subspace algorithm. For example, the subspace algorithm can be a Krylov subspace algorithm. According to the dimension of the preset subspace, the first linear equation set to be solved can be projected to the preset subspace by using the subspace algorithm, to obtain a second linear equation set to be solved with a smaller dimension. In an embodiment, the subspace algorithm used can be a Generalized Minimum Residual (GMRES) algorithm.

[0125] According to the Generalized Minimum Residual algorithm, for a linear problem A1X1=B1, where A1 is a non-singular full rank matrix with a dimension of D. If an initial solution x0 is given, there is an initial residual r0=B1-A1x0. If it is defined that: is a D-order Krylov subspace of the matrix A1 and the initial residual r0. In the Generalized Minimum Residual algorithm, the optimal criterion can be described as: finding such that

[0126] For any vector If there is a vector y that satisfies x=x (0) +V D y, V D represents a set of bases of the preset subspace, then Correspondingly, it can be obtained that A1V D y, and further, it is obtained that β=‖r0‖2.

[0127] where e1=[1, 0, …0] T , and in addition, since the column vectors of V D+1 are orthonormal, it is obtained that:

[0128]

[0129] Therefore, when D is not small, QR (orthogonal triangle) decomposition can be used for solving. Let be the QR decomposition of H D+1,D , where Q D+1 is an orthogonal matrix, and R D+1,D is an upper triangular matrix, and it is obtained that:

[0130]

[0131] where q1 is the first column of Q D+1 , and R D is the upper triangular matrix R D+1,Dthe first D rows of A. Thus, y can be obtained by solving the upper triangular system

[0132] βq1(1:D) = R D y

[0133] where q1(1:D) denotes a vector consisting of the first D elements of the q1 vector.

[0134] That is, the solution space of the generalized minimal residual method is The constraint space of the solution is The minimum norm criterion of which can be described as: finding such that

[0135] For example, based on the generalized minimal residual method, the first linear equation system to be solved is projected to a preset subspace, and A2 is H D+1,D , and B2 is βe1.

[0136] Correspondingly, after the final value of X2 is obtained, the final value of X2 can be restored to the dimension of X1 according to the sixth formula to obtain the final value of X1.

[0137] The sixth formula is:

[0138] X1 = X 0 + V D X2

[0139] where X 0 denotes the initial solution when projection is performed using the generalized minimal residual method; V D denotes a set of bases of the preset subspace determined when projection is performed using the generalized minimal residual method.

[0140] Since the operation amount and storage amount of each step of iteration of the generalized minimal residual method will increase with the increase of the number of iteration steps, when the number of iteration steps is large, the operation time and storage amount will greatly increase. Therefore, a restart strategy can also be used, that is, a maximum number of iteration steps is given, if the iteration does not converge after the number of iteration steps, an approximate solution is calculated, and the approximate solution is used as a new initial solution, and the generalized minimal residual method is executed again until convergence. That is, in the above process of restarting the generalized minimal residual method, the initial solution will be updated multiple times. Correspondingly, when restoration is performed based on the sixth formula, the initial solution at the last restart can be used.

[0141] For step S103, the digital encoding state can be converted into an analog encoding state based on a QRAM (Qquantum Random Access Machine). It can be understood that the analog encoding state refers to a state in which digital information is encoded on the amplitude of a quantum state. Based on this approach, the initial state of the quantum bit corresponding to B2 can be obtained.

[0142] Any simple function can be linearly approximated as a linear combination of other functions, so the inverse function of the matrix can be approximated by Chebyshev polynomials. It can be understood that each order of the Chebyshev polynomial corresponds to a term.

[0143] In one embodiment, before step S103 described above, the method can further include the following steps:

[0144] Based on the first formula, the Chebyshev polynomials of each order corresponding to the inverse matrix of A2 are constructed;

[0145] The first formula is:

[0146]

[0147] wherein,

[0148]

[0149] A2 -1 denotes the inverse matrix of A2; denotes the first kind of Chebyshev polynomials; b = κ 2 log(κ / ∈), κ denotes the condition number; ∈ denotes the preset accuracy value; C denotes the combination number; denotes the g-th order of the Chebyshev polynomials corresponding to the inverse matrix of A2. The Chebyshev polynomials determined based on the first formula contain g0+1 orders. It can be understood that for the function g(x), there is (referred to as a preset condition), wherein, denotes the first kind of Chebyshev polynomials. That is, the Chebyshev polynomials corresponding to the inverse matrix of A2 constructed based on the first formula described above also satisfy the preset condition.

[0150] Correspondingly, the quantum circuit includes a first Oracle and a second Oracle. The first Oracle is configured to implement encoding each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bits corresponding to B2 based on the quantum walk algorithm. The second Oracle is configured to implement encoding the weighted sum of each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bits corresponding to B2 based on the encoding result of the first Oracle and the operator linear combination algorithm.

[0151] where Oracle is a black box representing a transformation of a certain quantum state.

[0152] Based on the above manner, after the Chebyshev polynomials corresponding to the inverse matrix of A2 are determined, each order of the Chebyshev polynomials can be encoded into the amplitude of the initial state of the quantum bits corresponding to B2 based on the first Oracle, and then the Chebyshev polynomials corresponding to the inverse matrix of A2 (i.e., the weighted sum form of each order) can be encoded into the amplitude of the initial state of the quantum bits corresponding to B2 based on the second Oracle. In this way, since the input of the quantum circuit includes the initial state of the quantum bits corresponding to B2, the value of X2 can be obtained based on the measurement result of the final state of the quantum bits.

[0153] In one embodiment, the processing can also be performed by using other quantum bits in addition to the quantum bits representing the initial state of the quantum bits corresponding to B2, that is, the input of the quantum circuit also includes a first number of first auxiliary quantum bits and a second number of second auxiliary quantum bits.

[0154] Correspondingly, the first Oracle is configured to implement encoding each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bits corresponding to B2 based on the second formula. The second formula is:

[0155] where, The operator is configured to implement the mapping from |0 m > to ; and Π|Φ ⊥ > = 0. d represents the sparsity of A2; A 2jk represents the element in the jth row and the kth column of A2, and satisfies N represents the dimension of A2. The operator is configured to implement the mapping from |0 m > to T|ψ j >. j represents the calculation of the tensor product; and I represents the unit matrix. represents the definition of |0​m > represents a second number of second auxiliary qubits; |0 m | represents |0 m > corresponds to a left vector. |0 m <0 m | represents an operator, which can be referred to as a projection operator.

[0156] |B2> represents a quantum state of B2; represents a Hermitian conjugate operator. The S operator performs an inversion operation on a product state. |j> is a quantum state left vector. W g represents a W operator corresponding to the g-th order of Chebyshev polynomials. The right side of the second algorithm is also a result of encoding each order of the Chebyshev polynomials corresponding to the inverse matrix of A2, that is, by the W g operator, each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 can be encoded to an amplitude of an initial state of a quantum bit corresponding to B2.

[0157] The second Oracle is configured to implement encoding, based on a third algorithm, of a weighted sum of each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 to the amplitude of the initial state of the quantum bit corresponding to B2.

[0158] The third algorithm is:

[0159] wherein the G operator is configured to implement a mapping from |0 r |0 m |B2> to , |Ψ ⊥ > is orthogonal to T|j>; |0 r > represents a first number of first auxiliary qubits; α = ∑ g α g The right side of the third algorithm is also a result of encoding the weighted sum of each order of the Chebyshev polynomials corresponding to the inverse matrix of A2, that is, by the G operator, each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 can be encoded to the amplitude of the initial state of the quantum bit corresponding to B2.

[0160] In the embodiments of the present application, the Chebyshev polynomials corresponding to the inverse matrix of A2 can be determined based on the first algorithm, that is, each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 and the weight coefficients of each order can be obtained. In the above formula, α g represents a weight coefficient of the g-th order of the Chebyshev polynomials.

[0161] In the above formula, α denotes the first kind of Chebyshev polynomials, i.e., the Chebyshev polynomials contain the number of orders g0+1. For the first kind of Chebyshev polynomials, there is the following recursive relationship:

[0162]

[0163] The principle of encoding Chebyshev polynomials into quantum state amplitudes is described below:

[0164] For A2, when ‖A2‖ max ≤1, the quantum walk can be constructed by using

[0165] It includes:

[0166] The quantum walk space is defined, and the dimension of the walk space is 2N, i.e.:

[0167]

[0168] wherein, j∈[N].

[0169] Then, two operators T and S can be defined, wherein:

[0170]

[0171]

[0172] Based on the operators T and S, a quantum walk operator can be constructed:

[0173]

[0174] If the matrix is defined, max ≤1, it is obtained that ‖H‖≤1. Let |λ> be an eigenvector of H and λ be the corresponding eigenvalue, then the quantum walk operator has the following minimum block structure:

[0175]

[0176] When λ=±1, there is WT|λ>=λT|λ>. Then for any eigenvalue λ, the minimum block structure of W n is as follows:

[0177]

[0178] is an n-order second kind of Chebyshev polynomial.

[0179] Further, it can be obtained that:

[0180]

[0181] |λ ⊥ > indicates the direction orthogonal to T|λ>. When |λ|=1, we have W n T|λ>=λ n T|λ>. Then we can obtain:

[0182]

[0183] |ψ ⊥ > represents an unnormalized vector, and is orthogonal to T|j>. The above formula shows that the Chebyshev polynomial of matrix H can be encoded into the quantum state amplitude through multiple quantum walks.

[0184] Since the operator T is a A linear mapping, therefore, for any There exists a unitary operation that implements the following process:

[0185] |0 m >|ψ>→T|ψ>

[0186] That is, to achieve from |0 m Mapping from |ψ> to T|ψ>.

[0187] If the unitary operation record is Correspondingly, through This operation can achieve the following mapping:

[0188]

[0189] Where, |Φ ⊥ > Satisfies Π|Φ ⊥ >=0,

[0190] That is, through This operation enables the encoding of each order in a Chebyshev polynomial into the quantum state amplitude.

[0191] Furthermore, after encoding each order of the Chebyshev polynomial to the quantum state amplitude, the weighted summation form of each order can also be encoded to the quantum state amplitude, thus completing the encoding of the entire Chebyshev polynomial.

[0192] For example, given Among them, if It is a unitary matrix, α g >0, then A2 -1 It is usually a non-unitary matrix. Therefore, in order to simulate A2 -1 We can define two quantum gates, V and U, where:

[0193]

[0194]

[0195] wherein f = 2g + 1.

[0196] α = ∑ g α g , and then the quantum gate and for the quantum gate

[0197]

[0198] It can be understood that, in the measurement, as long as the results of the m registers corresponding to the auxiliary quantum bit are |0 m >, the quantum state on the remaining registers can be obtained as Thus, the and its probability is (||A2 -1 |ψ>|| / α) 2 .

[0199] In addition, if A2 -1 is expressed as a linear combination of multiple matrices A2 -1 = ∑ i α i Z i , and each matrix Z i is not necessarily a unitary matrix, but can satisfy the following formula for any quantum state |ψ>:

[0200] U i |0 m >|ψ> = |0 m >Z i |ψ>+|Ψ ⊥ >

[0201] Then the unitary matrix satisfies the following formula:

[0202]

[0203] wherein U i is a unitary matrix. That is, based on the operator linear combination algorithm, for any matrix Y, as long as it can be expressed as a linear combination of several unitary matrices, the operation Y|ψ> can be realized through a quantum circuit, and the probability of such realization is (‖Y|ψ>‖ / α) 2 . Therefore, for A2 -1 corresponding to the Chebyshev polynomial, it can also be realized through a quantum circuit.

[0204] In addition, in the related art, the HHL algorithm can also be used to calculate the solution of a linear equation system, and the complexity is O[log(N)κ2 s 2 / ∈]. The method provided in this application uses an operator linear combination algorithm, a quantum walk algorithm, and Chebyshev inversion to obtain the solution to the linear equation system, with a complexity of O[s]. 2 κ 2 [log(N / ∈)], where s represents the maximum number of non-zero elements in each row or column of the coefficient matrix. It can be seen that the method provided in this application greatly optimizes the dependence of algorithm complexity on computational accuracy ∈, and can accelerate the solution speed for linear systems. Furthermore, this algorithm can be applied to current real quantum computers.

[0205] In this application, if A2 is a Hermitian matrix, and ||A2|| max If A2 is ≤1, then the process can be directly performed based on steps S103-S104 above. Correspondingly, if A2 is not Hermitian, the second system of linear equations to be solved can be transformed into a form containing Hermitian matrices as follows:

[0206]

[0207] Based on the above method, the form containing the Hermitian matrix corresponding to the second system of linear equations to be solved can be obtained, that is: Subsequently, based on S103-S104, according to Process it.

[0208] Additionally, if |A2| max If the value is greater than 1, A2 can be divided by its largest eigenvalue to update A2, and then processed according to the updated A2.

[0209] Accordingly, in one embodiment, measuring the qubits to obtain the final value of X2 includes: measuring the qubits to obtain the measurement results of the register corresponding to the qubit corresponding to B2 when the registers corresponding to the first auxiliary qubit and the second auxiliary qubit are both in the |0> state. Based on the obtained measurement results, the final value of X2 is obtained.

[0210] In this embodiment, after measurement, the measurement results of the registers corresponding to the first and second auxiliary qubits (which can be called auxiliary registers) and the register corresponding to the qubit B2 (which can be called the target register) can be obtained. If the measurement results of the auxiliary registers are all |0>, it indicates that the measurement result of the target register represents A2. -1 Acted on a quantum state |0 r >|0 m Based on the result of >|b>, the final value of X2 can be determined.

[0211] For example, the final value of X2 can be obtained by multiple measurements, calculating the expectation value of the real part of the determined state obtained by multiple measurements, and obtaining the final value of X2 based on the expectation value. It can be understood that the expectation value obtained at this time is proportional to B2, and subsequently, the product of the expectation value and a obtained when constructing the Chebyshev polynomial can be calculated to obtain the final value of X2. -1 B2, and subsequently, the product of the expectation value and a obtained when constructing the Chebyshev polynomial can be calculated to obtain the final value of X2.

[0212] In an embodiment, based on the obtained measurement result of the register corresponding to the quantum bit corresponding to B2, the final value of X2 is obtained, including: based on the obtained measurement result, obtaining the current candidate value of X2; based on the current candidate value of X2, calculating the residual quantity corresponding to the second linear equation set to be solved; if the calculated residual quantity satisfies the first termination condition, determining the final value of X2 based on the current candidate value of X2; otherwise, performing iterative operation based on the calculated residual quantity, and determining the final value of X2 based on the result of the iterative operation.

[0213] In the embodiments of the present application, for A2X2=B2, after obtaining one expectation value (i.e., the current candidate value of X2) by measurement, the product of the current candidate value of X2 and A2 can be calculated, and the difference (i.e., the residual quantity) between the product and B2 can be calculated. If the difference is less than a preset threshold (i.e., the above-mentioned preset accuracy value), it can be determined that the first termination condition is satisfied, and the current candidate value of X2 is determined as the final value of X2.

[0214] Otherwise, a second linear equation set A2X3=B3 is constructed, where B3 represents the residual quantity calculated last time, and the current candidate value of X3 is calculated again based on the manner of steps S103-S104, and it is continuously judged whether the current candidate value of X3 satisfies the first termination condition; if yes, the sum value of the current candidate value of X2 and the current candidate value of X3 is calculated as the final value of X2; if no, a second linear equation set A2X4=B4 is constructed, where B4 represents the residual quantity calculated last time, and the current candidate value of X4 is calculated again based on the manner of steps S103-S104, and it is continuously judged whether the current candidate value of X4 satisfies the first termination condition. In this way, the iterative operation is continued until the residual quantity calculated satisfies the first termination condition.

[0215] In an embodiment, the first number is determined based on a fourth formula: r=logM. Wherein, r represents the first number, and M represents the number of terms (i.e., the number of orders (which can be referred to as order number)) contained in the Chebyshev polynomial corresponding to the inverse matrix of A2.

[0216] The second number is determined based on a fifth formula: m=log4N. m represents the second number, and N represents the dimension of A2.

[0217] In one embodiment, the final value of X2 can also be reduced to the dimension of X1 based on the subspace algorithm to obtain a current candidate value of X1; a residual quantity corresponding to the first linear equation set to be solved is calculated based on the current candidate value of X1; if the calculated residual quantity satisfies the second termination condition, the current candidate value of X1 is determined as the final value of X1.

[0218] In the embodiments of the present application, the final value of X2 is reduced to the dimension of X1 based on the subspace algorithm to obtain a current candidate value of X1, then the product of the current candidate value of X1 and A1 can be calculated, and the difference (i.e. residual quantity) between the product and B1 is calculated, if the difference is less than the preset threshold (i.e. the above-mentioned preset accuracy value), it can be determined that the second termination condition is satisfied, and the current candidate value of X1 is determined as the final value of X1.

[0219] Referring to Figure 2 , Figure 2 A schematic diagram of a quantum circuit provided by the embodiments of the present application is shown.

[0220] reg.a represents a register corresponding to the first number of first auxiliary quantum bits, and r represents the first number; reg.b represents a register corresponding to the second number of second auxiliary quantum bits, and m represents the second number. The initial state of the first auxiliary quantum bit and the second auxiliary quantum bit is |0>. reg.c represents a register corresponding to the quantum bit corresponding to B2, and |b> represents the initial state of the quantum bit corresponding to B2. The operator W g 、 and V simulate the inverse matrix of A2 to evolve, and finally when the register corresponding to the first auxiliary quantum bit and the register corresponding to the second auxiliary quantum bit are measured as |0>, the result of the register corresponding to the quantum bit corresponding to B2 can be obtained, i.e. |X> in the figure, and the solution of the second linear equation set to be solved can be obtained.

[0221] Based on the same inventive concept, the embodiments of the present application also provide a quantum circuit-based simulation device, referring to Figure 3 , Figure 3 A structural diagram of a quantum circuit-based simulation device provided by the embodiments of the present application is shown. The device comprises:

[0222] The acquisition module 301 is configured to acquire a first linear equation set to be solved A1X1=B1; X1 represents a physical quantity to be solved in a target system;

[0223] The projection module 302 is configured to project the first linear equation set to be solved to a preset subspace to obtain a second linear equation set to be solved A2X2=B2; wherein the dimension of the preset subspace is less than the dimension of X1;

[0224] an evolution module 303, configured to perform an evolution operation on the quantum bits based on the constructed quantum circuit, and measure the quantum bits to obtain a final value of X2; wherein the quantum circuit is constructed based on the Chebyshev polynomials corresponding to the inverse matrix of A2; and the input of the quantum circuit comprises initial states of the quantum bits corresponding to B2.

[0225] a reduction module 304, configured to reduce the final value of X2 to the dimension of X1 to obtain a final value of X1.

[0226] Optionally, the target system represents a fluid, X1 represents a difference between a fluid state at a time and a fluid state at a previous time in a discretized network of the fluid; B1 represents a residual quantity related to the fluid state at the previous time and coordinate information of a grid cell; and A1 represents a coefficient matrix related to the fluid state at the previous time and the coordinate information of the grid cell.

[0227] Optionally, the apparatus further comprises:

[0228] an evolution module 303, configured to perform an evolution operation on the quantum bits based on the constructed quantum circuit, and measure the quantum bits to obtain a final value of X2; wherein the quantum circuit is constructed based on the Chebyshev polynomials corresponding to the inverse matrix of A2; and the input of the quantum circuit comprises initial states of the quantum bits corresponding to B2.

[0229] The first formula is:

[0230]

[0231] wherein,

[0232]

[0233] A2 -1 represents the inverse matrix of A2; represents the g-th order of the Chebyshev polynomials corresponding to the inverse matrix of A2; b=κ 2 log(κ / ∈), κ represents a condition number; ∈ represents a preset precision value; and C represents a combination number.

[0234] Optionally, the quantum circuit comprises a first Oracle and a second Oracle.

[0235] The first Oracle is configured to encode each order of the Chebyshev polynomials corresponding to the inverse matrix of A2 to an amplitude of an initial state of the quantum bits corresponding to B2 based on a quantum walk algorithm.

[0236] The second Oracle is used to encode the weighted sum of each order of the Chebyshev polynomial corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bit corresponding to B2, based on the operator linear combination algorithm and the encoding result of the first Oracle.

[0237] Optionally, the input of the quantum circuit further includes a first number of first auxiliary qubits and a second number of second auxiliary qubits;

[0238] The first Oracle is used to encode each order of the Chebyshev polynomial corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bit corresponding to B2 based on the second formula.

[0239] The second formula is:

[0240] in, Operators are used to implement the transition from |0 m >|B2> to The mapping; Π|Φ ⊥ >=0, d represents the sparsity of A2; A 2jk Let A represent the element in row j and column k of A2, which satisfies N represents the dimension of A2; Operators are used to implement the transition from |0 m >|ψ j >To T|ψ j > mapping; Indicates the computation of tensor products; I represents the identity matrix; |0 m > represents the second number of second auxiliary qubits; |B2> represents the initial state of the qubit corresponding to B2; W represents the Hermitian conjugate operator; g The W operator represents the g-th order of the Chebyshev polynomial;

[0241] The second Oracle is used to encode the weighted sum of each order of the Chebyshev polynomial corresponding to the inverse matrix of A2 into the amplitude of the initial state of the qubit corresponding to B2 based on the third formula.

[0242] The third formula is:

[0243] The G operator is used to implement the transition from |0 r >|0 m >|B2> to The mapping, |Ψ ⊥ > Orthogonal to T|j>; |0 rindicates the first number of first auxiliary qubits; a = å g a g .

[0244] Optionally, the first number is determined based on a fourth algorithm, and the fourth algorithm is:

[0245] r = log M

[0246] wherein r indicates the first number, and M indicates an order of a Chebyshev polynomial corresponding to an inverse matrix of A2;

[0247] The second number is determined based on a fifth algorithm, and the fifth algorithm is:

[0248] m = log 4N

[0249] m indicates the second number.

[0250] Optionally, the evolution module 303 comprises:

[0251] The measurement module is configured to measure the quantum bits to obtain a measurement result of a register of a quantum bit corresponding to B2 when registers corresponding to the first auxiliary qubits and the second auxiliary qubits are in a |0> state.

[0252] The generating submodule is configured to obtain a final value of X2 based on the obtained measurement result.

[0253] Optionally, the generating submodule is specifically configured to obtain a current candidate value of X2 based on the obtained measurement result.

[0254] Based on the current candidate value of X2, a residual quantity corresponding to the second linear equation system to be solved is calculated.

[0255] If the calculated residual quantity satisfies a first termination condition, a final value of X2 is determined based on the current candidate value of X2.

[0256] If the calculated residual quantity does not satisfy the first termination condition, an iterative operation is performed based on the calculated residual quantity, and a final value of X2 is determined based on a result of the iterative operation.

[0257] Optionally, the restoring module is specifically configured to restore the final value of X2 to a dimension of X1 to obtain a final value of X1 according to a sixth algorithm; and the sixth algorithm is:

[0258] X1 = X 0 + V D X2

[0259] wherein X 0 indicates an initial solution when the projection is performed; and VD a set of bases representing the preset subspace determined when the projection is performed.

[0260] The embodiments of the present application further provide a quantum computer device, comprising: a quantum circuit and a register, and the quantum computer device realizes the method described above when running.

[0261] In another embodiment of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps of the method described above.

[0262] It should be noted that, in the present document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0263] Each of the embodiments in the present specification is described in a relevant manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly explains the difference from other embodiments. Especially, for the device, quantum computer device, and computer readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0264] The above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A simulation method based on quantum circuits, characterized in that, The method includes: Obtain the first set of linear equations to be solved, A1X1=B1; X1 represents the physical quantity to be solved in the target system; The first system of linear equations to be solved is projected onto a preset subspace to obtain a second system of linear equations to be solved, A2X2=B2; wherein the dimension of the preset subspace is smaller than the dimension of X1; The quantum circuit is used to perform quantum state evolution operations on the qubit and measure the qubit to obtain the final value of X2; wherein the quantum circuit is constructed based on the Chebyshev polynomial corresponding to the inverse matrix of A2; the input of the quantum circuit contains the initial state of the qubit corresponding to B2; The final value of X2 is restored to the dimension of X1 to obtain the final value of X1; The quantum circuit includes a first oracle and a second oracle; the input of the quantum circuit also includes a first number of first auxiliary qubits and a second number of second auxiliary qubits. The first Oracle is used to encode each order of the Chebyshev polynomial corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bit corresponding to B2 based on the second formula. The second formula is: in, Operators are used to implement the transition from |0 m >|B2> to The mapping; Π|Φ ⊥ >=0, S:=S|j,k>=|k,j>; T:=∑ j∈[N] |ψ j > <j|, d represents the sparsity of A2; A 2jk Let A represent the element in row j and column k of A2, which satisfies N represents the dimension of A2; Operators are used to implement the transition from |0 m >|ψ j >To T|ψ j > mapping; Indicates the computation of tensor products; I represents the identity matrix; |0 m > represents the second number of second auxiliary qubits; |B2> represents the initial state of the qubit corresponding to B2; W represents the Hermitian conjugate operator; g The W operator represents the g-th order of the Chebyshev polynomial; Let g represent the g-th order of the Chebyshev polynomial corresponding to the inverse matrix of A2; The second Oracle is used to encode the weighted sum of each order of the Chebyshev polynomial corresponding to the inverse matrix of A2 into the amplitude of the initial state of the qubit corresponding to B2 based on the third formula. The third formula is: The G operator is used to implement the transition from |0 r >|0 m >|B2> to The mapping, |Ψ ⊥ > Orthogonal to T|j>; |0 r > represents the first number of first auxiliary qubits; α=∑ g α g .

2. The method according to claim 1, characterized in that, The target system represents a fluid. X1 represents the difference between the fluid state at one time and the previous time in the discretized network of the fluid. B1 represents the residual related to the fluid state at the previous time and the coordinate information of the grid cell. A1 represents the coefficient matrix related to the fluid state at the previous time and the coordinate information of the grid cell.

3. The method according to claim 1, characterized in that, Before performing quantum state evolution operations on the qubit based on the constructed quantum circuit and measuring the qubit to obtain the final value of X2, the method further includes: Based on the first formula, construct each order of the Chebyshev polynomial corresponding to the inverse matrix of A2; The first formula is: in, A2 -1 Represent the inverse matrix of A2; Let g represent the g-th order of the Chebyshev polynomial corresponding to the inverse matrix of A2; b = κ 2 log(κ / ∈), where κ represents the condition number; ∈ represents the preset precision value; and C represents the number of combinations.

4. The method according to claim 1, characterized in that, The first number is determined based on the fourth formula, which is: r = logM Where r represents the first number, and M represents the order of the Chebyshev polynomial corresponding to the inverse matrix of A2; The second number is determined based on the fifth formula, which is: m = log₄N m represents the second number.

5. The method according to claim 1, characterized in that, The measurement of the qubit to obtain the final value of X2 includes: The qubits are measured to obtain the measurement results of the register corresponding to the qubit B2 when the registers corresponding to the first auxiliary qubit and the second auxiliary qubit are both in the |0> state; Based on the obtained measurement results, the final value of X2 is obtained.

6. The method according to claim 5, characterized in that, The final value of X2 is obtained based on the measurement results, including: Based on the obtained measurement results, the current alternative values ​​for X2 are obtained; Based on the current alternative values ​​of X2, calculate the residuals corresponding to the second system of linear equations to be solved; If the calculated residual satisfies the first termination condition, then the final value of X2 is determined based on the current candidate value of X2. If the calculated residual does not meet the first termination condition, then iterative calculation is performed based on the calculated residual, and the final value of X2 is determined based on the result of the iterative calculation.

7. The method according to claim 1, characterized in that, The step of restoring the final value of X2 to the dimension of X1 to obtain the final value of X1 includes: According to the sixth formula, the final value of X2 is restored to the dimension of X1 to obtain the final value of X1; the sixth formula is: X1=X 0 +V D X2 Among them, X 0 V represents the initial solution when performing projection; D This represents a set of bases for the preset subspace determined during projection.

8. A quantum circuit-based simulation device, characterized in that, The device includes: The acquisition module is used to acquire the first linear equation system to be solved, A1X1=B1; X1 represents the physical quantity to be solved in the target system. The projection module is used to project the first system of linear equations to be solved onto a preset subspace to obtain a second system of linear equations to be solved, A2X2=B2; wherein the dimension of the preset subspace is smaller than the dimension of X1; An evolution module is used to perform quantum state evolution operations on qubits based on a constructed quantum circuit, and to measure the qubits to obtain the final value of X2; wherein the quantum circuit is constructed based on the Chebyshev polynomial corresponding to the inverse matrix of A2; the input of the quantum circuit includes the initial state of the qubit corresponding to B2; The restoration module is used to restore the final value of X2 to the dimension of X1, thus obtaining the final value of X1. The quantum circuit includes a first oracle and a second oracle; the input of the quantum circuit also includes a first number of first auxiliary qubits and a second number of second auxiliary qubits. The first Oracle is used to encode each order of the Chebyshev polynomial corresponding to the inverse matrix of A2 into the amplitude of the initial state of the quantum bit corresponding to B2 based on the second formula. The second formula is: in, Operators are used to implement the transition from |0 m >|B2> to The mapping; Π|Φ ⊥ >=0, S:=S|j,k>=|k,j>; T:=∑ j∈[N] |ψ j > <j|, d represents the sparsity of A2; A 2jk Let A represent the element in row j and column k of A2, which satisfies N represents the dimension of A2; Operators are used to implement the transition from |0 m >|ψ j >To T|ψ j > mapping; Indicates the computation of tensor products; I represents the identity matrix; |0 m > represents the second number of second auxiliary qubits; |B2> represents the initial state of the qubit corresponding to B2; W represents the Hermitian conjugate operator; g The W operator represents the g-th order of the Chebyshev polynomial; Let g represent the g-th order of the Chebyshev polynomial corresponding to the inverse matrix of A2; The second Oracle is used to encode the weighted sum of each order of the Chebyshev polynomial corresponding to the inverse matrix of A2 into the amplitude of the initial state of the qubit corresponding to B2 based on the third formula. The third formula is: The G operator is used to implement the transition from |0 r >|0 m >|B2> to The mapping, |Ψ ⊥ > Orthogonal to T|j>; |0 r > represents the first number of first auxiliary qubits; α=∑ g α g .

9. A quantum computing device, characterized in that, include: A quantum circuit and register, wherein the quantum computer device implements the method described in any one of claims 1-7 during operation.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.

Citation Information

Patent Citations

  • Computational fluid dynamics simulation method and device based on quantum algorithm, and equipment

    CN114091363A

  • Linear system solving method and device based on quantum circuit, medium and equipment

    CN116070707A