A method and device for solving nonlinear partial differential equations based on quantum circuits
Through the method based on quantum circuits, the problem of high complexity in solving nonlinear partial differential equations in the prior art is solved, and an efficient solution process is realized, filling the technical gap in the field of quantum computing.
Patent Information
- Application Number
- CN202110301271.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-22
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-03-22
AI Technical Summary
The existing methods for solving nonlinear partial differential equations are complex, and the time to solve the exact solution is long and difficult to calculate. There is a lack of effective quantum algorithms to reduce complexity and difficulty.
Using a quantum circuit-based method, the initial conditions and boundary conditions are obtained, the nonlinear partial differential equation is discrete and differential format is used to construct the quantum state evolution quantum circuit of the non-zero element position information and function information of the Jacques matrix, and the quantum state evolution quantum circuit is used to Quantum algorithm determines the solution to nonlinear partial differential equations.
The complexity and difficulty of solving nonlinear partial differential equations are reduced, and efficient solutions are achieved using the characteristics of quantum computing, filling the relevant technical gaps in the field of quantum computing.
Smart Images

Figure CN115114569B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum computing technology, and in particular to a method and device for solving nonlinear partial differential equations based on quantum circuits. Background Art
[0002] The study of differential equations for application purposes or against the background of problems in other disciplines such as physics and mechanics is not only one of the most important contents in traditional applied mathematics, but also an important part of contemporary mathematics. It is an important bridge between mathematical theory and practical applications.
[0003] Currently, the main focus of differential equation research is nonlinear differential equations, particularly nonlinear partial differential equations. Many significant problems in natural science and engineering technology can be attributed to the study of nonlinear partial differential equations. Mathematical models in many areas of real life can be described using nonlinear partial differential equations. Many fundamental equations in important disciplines such as physics and mechanics are themselves nonlinear partial differential equations. Therefore, the study of how to accurately and quickly solve nonlinear partial differential equations has demonstrated significant theoretical and applied value. Quantum computing is a new type of computing method that uses a computational framework based on quantum mechanics theory. When solving some problems, quantum computing can exponentially accelerate the performance of optimal classical algorithms.
[0004] Existing methods for solving nonlinear partial differential equations are complex, time-consuming and computationally difficult to obtain exact solutions.
[0005] Based on this, it is necessary to propose an effective quantum algorithm for solving nonlinear partial differential equations, which can be used to solve nonlinear partial differential equations, reduce the complexity and difficulty of solving nonlinear partial differential equations, and fill the gaps in related technologies. Summary of the Invention
[0006] The purpose of the present invention is to provide a method and device for solving nonlinear partial differential equations based on quantum circuits to address the shortcomings of the existing technology. It can realize the solution technology of nonlinear partial differential equations using quantum algorithms, reduce the complexity and difficulty of solving nonlinear partial differential equations, and fill the relevant technical gaps in the field of quantum computing.
[0007] One embodiment of the present application provides a method for solving nonlinear partial differential equations based on quantum circuits, comprising:
[0008] Obtain information about initial conditions, boundary conditions, and the nonlinear partial differential equations to be processed;
[0009] According to the preset discrete format and difference format, the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed are discretized to obtain the discretized nonlinear equation system;
[0010] According to the nonlinear equation group, determining the non-zero element position information of the corresponding Jacobian matrix;
[0011] Quantum circuits representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group are constructed respectively, and the solution of the nonlinear partial differential equation is determined through each of the quantum circuits.
[0012] In the above-mentioned method for solving nonlinear partial differential equations based on quantum circuits, preferably, the nonlinear equation group includes:
[0013] Obtain a first vector x constructed by the independent variables of the nonlinear equations and a second vector F(x) constructed by the dependent variables, wherein the N is the dimension of the nonlinear equation system.
[0014] In the above-mentioned method for solving nonlinear partial differential equations based on quantum circuits, preferably, the Jacobian matrix is specifically:
[0015]
[0016] Among them, i=1, 2,…, N; j=1, 2,…, N.
[0017] In the above-mentioned method for solving nonlinear partial differential equations based on quantum circuits, preferably, determining the solution of the nonlinear partial differential equations through each of the quantum circuits specifically includes:
[0018] Determine the initial approximate solution x of the nonlinear system of equations 0 and a preset precision value ∈, constructing a sub-quantum circuit representing the quantum state evolution of an approximate solution to a nonlinear equation system based on each of the quantum circuits, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit;
[0019] updating a current approximate solution according to the quantum state of the sub-quantum circuit, determining a state estimation parameter of the nonlinear equation group, and determining a magnitude relationship between the state estimation parameter and the preset precision value;
[0020] If the state estimation parameter is greater than the preset precision value, returning to the steps of: constructing a sub-quantum circuit representing the quantum state evolution of the approximate solution of the nonlinear equation system, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit until the state estimation parameter is less than or equal to the preset precision value;
[0021] The solution of the nonlinear equation group is determined according to the final quantum state of the evolved sub-quantum circuit as the solution of the nonlinear partial differential equation.
[0022] As described above, a method for solving nonlinear partial differential equations based on quantum circuits, wherein preferably, the quantum circuit representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation system includes: Oracle f1 、OracleO f2 ;
[0023] Among them, the Oracle f1 For extracting the subscript information of the independent variable in the i-th function of the nonlinear equation system, the Oracle f1 The role is:
[0024] O f1 |i,j>=|i,f(i,j)>
[0025] Where i = 1, 2, ..., N, j = 1, 2, ..., d, f(i, j) represents f i (x) is the subscript of the j-th variable, and d is the sparsity of the Jacobian matrix;
[0026] The Oracle f2 For calculating the value of the ith function of the nonlinear equations, the Oracle f2 The role is:
[0027] O f2 |i>|x (i) >|0>=|i>|x (i) >|f i (x (i) )>
[0028] Where, i=1,2,..,N.
[0029] As described above, a method for solving nonlinear partial differential equations based on quantum circuits, wherein preferably, the sub-quantum circuits representing the quantum state evolution of the approximate solution of the nonlinear equation system are constructed based on each of the quantum circuits, including: Oracle A1 、OracleO A2 and OracleO b , wherein the OracleO A1 、OracleO A2 Based on Oracle f1 、OracleO f2 Build; the OracleO A1 、OracleOA2 and OracleO b Used to implement:
[0030] O A1 |j,l>=|j,h(j,l)〉
[0031]
[0032]
[0033] Among them, h(j,l) represents the column number of the lth non-zero element in the jth row of matrix A, C b is the norm of F(x), the matrix |F′(x)| max is the maximum value of the elements of the Jacobian matrix F′(x).
[0034] In the above-mentioned method for solving nonlinear partial differential equations based on quantum circuits, preferably, determining the state estimation parameters of the nonlinear equation group includes:
[0035] According to the pre-built quantum data structure for accessing quantum data, the quantum states and the x represented by the first layer leaf nodes distributed and stored in the quantum data structure are determined. i and f i (x) address information; wherein the quantum data structure is a binary tree structure;
[0036] According to the address information, the data stored in the leaf node is transferred to the next layer of leaf nodes through the quantum circuit until the quantum state data f corresponding to the address information is output at the root node in the binary tree structure. k (x), to determine the state estimation parameters Where n=log2N.
[0037] Another embodiment of the present application provides a device for solving nonlinear partial differential equations based on quantum circuits, the device comprising:
[0038] An acquisition module is used to obtain information of initial conditions, boundary conditions and nonlinear partial differential equations to be processed;
[0039] A discretization module is used to discretize the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discretization format and difference format to obtain a discretized nonlinear equation system;
[0040] A determination module, configured to determine non-zero element position information of a corresponding Jacobian matrix according to the nonlinear equation group;
[0041] An evolution module is used to construct quantum circuits representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group, and determine the solution of the nonlinear partial differential equation through each of the quantum circuits.
[0042] In the above-mentioned device for solving nonlinear partial differential equations based on quantum circuits, preferably, the determining module includes:
[0043] An acquisition unit is used to obtain a first vector x constructed by the independent variables of the nonlinear equation group and a second vector F(x) constructed by the dependent variables, wherein the N is the dimension of the nonlinear equation system.
[0044] In the above-mentioned device for solving nonlinear partial differential equations based on quantum circuits, preferably, the determination module includes a Jacobian matrix unit, which is specifically used to implement:
[0045]
[0046] Among them, i=1, 2,…, N; j=1, 2,…, N.
[0047] In the above-mentioned device for solving nonlinear partial differential equations based on quantum circuits, preferably, the evolution module specifically includes:
[0048] A measuring unit for determining an initial approximate solution x to the nonlinear system of equations 0 and a preset precision value ∈, constructing a sub-quantum circuit representing the quantum state evolution of an approximate solution to a nonlinear equation system based on each of the quantum circuits, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit;
[0049] an updating unit, configured to update a current approximate solution according to the quantum state of the sub-quantum circuit, determine a state estimation parameter of the nonlinear equation group, and determine a magnitude relationship between the state estimation parameter and the preset precision value;
[0050] a judgment unit, configured to, if the state estimation parameter is greater than the preset precision value, return to executing the steps of: constructing a sub-quantum circuit representing the quantum state evolution of the approximate solution of the nonlinear equation system, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit, until the state estimation parameter is less than or equal to the preset precision value;
[0051] A determination unit is used to determine the solution of the nonlinear equation group according to the final quantum state of the evolved sub-quantum circuit as the solution of the nonlinear partial differential equation.
[0052] As described above, a nonlinear partial differential equation solving device based on quantum circuits, wherein, preferably, the evolution module includes: Oracle f1 Unit, OracleO f2 unit;
[0053] Among them, the Oracle f1 The unit is used to extract the subscript information of the independent variable in the i-th function of the nonlinear equation system, and the Oracle f1 The role is:
[0054] O f1 |i,j>=|i,f(i,j)>
[0055] Where i = 1, 2, ..., N, j = 1, 2, ..., d, f(i, j) represents f i (x) is the subscript of the j-th variable, and d is the sparsity of the Jacobian matrix;
[0056] The Oracle f2 The unit is used to calculate the value of the i-th function of the nonlinear equation system, and the Oracle f2 The role is:
[0057] O f2 |i>|x (i) 〉|0>=|i>|x (i) >|f i (x (i) )>
[0058] Where, i=1,2,..,N.
[0059] As described above, a nonlinear partial differential equation solving device based on quantum circuit, wherein, preferably, the measuring unit includes Oracle A1 Unit, OracleO A2 Unit and OracleO b Unit, wherein the OracleO A1 、OracleO A2 Based on Oracle f1 、OracleO f2 Build; the OracleO A1 、OracleO A2 and OracleO b Used to implement:
[0060] O A1 |j,l>=|j,h(j,l)>
[0061]
[0062]
[0063] Among them, h(j,l) represents the column number of the lth non-zero element in the jth row of matrix A, C b is the norm of F(x), the matrix |F′(x)| max is the maximum value of the elements of the Jacobian matrix F′(x).
[0064] In the above-mentioned device for solving nonlinear partial differential equations based on quantum circuits, preferably, the updating unit includes:
[0065] The access unit is used to determine the quantum state and x represented by the first layer leaf node distributed and stored in the quantum data structure according to the pre-built quantum data structure for accessing quantum data. i and f i (x) address information; wherein the quantum data structure is a binary tree structure;
[0066] The output unit is used to transfer the data stored in the leaf node to the next layer of leaf nodes through the quantum circuit according to the address information, until the quantum state data f corresponding to the address information is output at the root node in the binary tree structure. k (x), to determine the state estimation parameters Where n=log2N.
[0067] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when run.
[0068] Yet another embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above methods.
[0069] Compared with the prior art, the present invention first obtains information on initial conditions, boundary conditions and the nonlinear partial differential equation to be processed, and discretizes the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discrete format and difference format to obtain a discretized nonlinear equation group. According to the nonlinear equation group, the nonzero element position information of the corresponding Jacobian matrix is determined, and quantum circuits representing the quantum state evolution of the nonzero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group are constructed respectively. The solution of the nonlinear partial differential equation is determined through each quantum circuit. By utilizing the relevant characteristics of quantum, the technology of calculating nonlinear partial differential equations using quantum algorithms can be realized, thereby reducing the complexity and difficulty of solving nonlinear partial differential equations and filling the relevant technical gaps in the field of quantum computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 This is a hardware structure block diagram of a computer terminal for a method for solving nonlinear partial differential equations based on quantum circuits provided by an embodiment of the present invention;
[0071] Figure 2 1 is a flow chart of a method for solving nonlinear partial differential equations based on quantum circuits provided by an embodiment of the present invention;
[0072] Figure 3 A schematic diagram of a discrete format provided by an embodiment of the present invention;
[0073] Figure 4 Schematic diagram of a quantum circuit of T provided by an embodiment of the present invention;
[0074] Figure 5 is a schematic diagram of a quantum circuit for a walking operator W provided in an embodiment of the present invention;
[0075] Figure 6 Schematic diagram of a quantum circuit for implementing a quantum linear solver provided by an embodiment of the present invention;
[0076] Figure 7 It is a structural schematic diagram of a nonlinear partial differential equation solving device based on quantum circuits provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0077] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention.
[0078] The embodiment of the present invention first provides a method for solving nonlinear partial differential equations based on quantum circuits. The method can be applied to electronic devices such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0079] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal for a method for solving nonlinear partial differential equations based on quantum circuits provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0080] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the implementation of a nonlinear partial differential equation solution method based on quantum circuits in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by a communications provider of a computer terminal. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0082] It's important to note that a true quantum computer has a hybrid architecture, consisting of two main components: a classical computer, responsible for performing classical computations and control, and a quantum device, responsible for running quantum programs and thus achieving quantum computations. A quantum program is a sequence of instructions written in a quantum language, such as QRunes, that can be executed on a quantum computer. This supports quantum logic gate operations and ultimately enables quantum computations. Specifically, a quantum program is a sequence of instructions that operate quantum logic gates in a specific time sequence.
[0083] In practical applications, due to the limitations of the development of quantum device hardware, quantum computing simulations are usually required to verify quantum algorithms, quantum applications, and the like. Quantum computing simulation is the process of simulating the operation of quantum programs corresponding to specific problems using a virtual architecture (i.e., a quantum virtual machine) built with the resources of an ordinary computer. Generally, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in the embodiments of the present invention is a program written in a classical language to characterize quantum bits and their evolution, in which quantum bits, quantum logic gates, and the like related to quantum computing are represented by corresponding classical codes.
[0084] Quantum circuits, as a manifestation of quantum programs, also known as quantum logic circuits, are the most commonly used general quantum computing model. They represent circuits that operate on quantum bits in an abstract concept. They are composed of quantum bits, circuits (timelines), and various quantum logic gates. Finally, the results often need to be read out through quantum measurement operations.
[0085] Unlike traditional circuits, which are connected by metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as connected by time. In other words, the state of the quantum bit naturally evolves over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated.
[0086] A quantum program as a whole corresponds to a single quantum circuit. The quantum program described in this disclosure refers to this quantum circuit, where the total number of qubits in this quantum circuit is the same as the total number of qubits in the quantum program. A quantum program can be understood as consisting of a quantum circuit, measurement operations on the qubits in the quantum circuit, registers storing the measurement results, and control flow nodes (jump instructions). A quantum circuit can contain tens, hundreds, or even thousands of quantum logic gate operations. The execution of a quantum program is the process of executing all quantum logic gates in a specific time sequence. It should be noted that the time sequence refers to the chronological order in which individual quantum logic gates are executed.
[0087] 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, quantum logic gates are used to manipulate qubits. Quantum logic gates enable the evolution of quantum states. Quantum logic gates are the foundation of quantum circuits. Quantum logic gates include single-bit quantum logic 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, and RZ gates; and multi-bit quantum logic gates such as CNOT gates, CR gates, iSWAP gates, and Toffoli gates. Quantum logic gates are generally represented using unitary matrices. Unitary matrices are not only a matrix form but also a type of operation and transformation. The effect of a quantum logic gate on a quantum state is typically calculated by multiplying the unitary matrix on the left by the matrix corresponding to the quantum state's right vector.
[0088] Those skilled in the art will understand that in classical computers, the basic unit of information is the bit, which has two states, 0 and 1. The most common physical implementation method is to represent these two states by the level of the voltage. In quantum computing, the basic unit of information is the quantum bit, which also has two states, 0 and 1, denoted as |0〉 and |1〉. However, it can be in a superposition of the two states, which can be represented as Here, a and b are complex numbers representing the amplitudes (probability amplitudes) of the |0> and |1> states, which are not present in classical bits. After measurement, the state of the qubit collapses to a certain state (eigenstate, here |0> and |1> states), where the probability of collapsing to |0> is |a| 2 , the probability of collapsing to |1> is |b| 2 ,|a| 2 +|b| 2 =1, |> is the Dirac symbol.
[0089] Quantum state refers to the state of quantum bits. Its eigenstate is represented by binary in quantum algorithms (or quantum programs). For example, a group of quantum bits is q0, q1, q2, which represent the 0th, 1st, and 2nd quantum bits. The order from high to low is q2q1q0. The quantum state of this group of quantum bits is 2 3 The eight eigenstates (defined states) are: |000>, |001>, |010>, |011>, |100>, |101>, |110>, and |111>. Each eigenstate corresponds to a qubit. For example, in the |000> state, 000 corresponds to q2q1q0 from the highest bit to the lowest bit. In short, a quantum state is a superposition of eigenstates. When the probability amplitude of other states is 0, it is in one of the defined eigenstates.
[0090] See also Figure 2 , Figure 2 A schematic flow chart of a method for solving nonlinear partial differential equations based on quantum circuits provided in an embodiment of the present invention may include the following steps:
[0091] S201: Obtain information on initial conditions, boundary conditions, and the nonlinear partial differential equation to be processed.
[0092] Nonlinear partial differential equations are an important branch of modern mathematics. Both in theory and in practical applications, they are used to describe problems in fields such as mechanics, control processes, ecological and economic systems, chemical circulation systems, and epidemiology. Using nonlinear partial differential equations to describe problems can fully consider the effects of space, time, and time lags, and thus more accurately reflect reality.
[0093] There are generally multiple solutions to nonlinear partial differential equations, but when solving specific physical problems, the required solution must be selected from them. Therefore, additional conditions, namely initial conditions and boundary conditions, must also be known.
[0094] Exemplarily, the nonlinear partial differential equation of the nonlinear first-order diffusion problem is obtained as:
[0095]
[0096] in,
[0097] g(u,x,t)=-1+xsin(u(x,t))
[0098] f(x,t)=2e 2t [x 2 -1+xx 2 ]sin(e 2t (e 2 -1)),
[0099] The initial conditions are: u(-1,t)=0,t>0, and the boundary conditions are u(x,0)=x 2 -1,-1 <x<1。
[0100] S202: Discretize the initial conditions, boundary conditions, and the nonlinear partial differential equation to be processed according to a preset discrete format and differential format to obtain a discretized nonlinear equation system.
[0101] Specifically, according to the preset discrete format and difference format, to solve the nonlinear partial differential equation, it is necessary to first discretize the calculation area, that is, divide the spatially continuous calculation area into many sub-areas, and determine the nodes in each area to generate a grid. Then, the nonlinear partial differential equation is discretized on the grid, that is, the equation in the partial differential format is converted into a set of algebraic equations at each node.
[0102] For example, see Figure 3 , Figure 3 A schematic diagram of a discrete format provided by an embodiment of the present invention, where the ellipse represents the current position and the triangle represents the position of the previous step. Continuing with the above example, the initial conditions and boundary conditions are:
[0103]
[0104] Discretize the original continuous nonlinear partial differential equation as follows:
[0105]
[0106] And define the symbol u i,j =u(x i ,t j ), and the differential form of time and space:
[0107]
[0108] Thus we get the discretized nonlinear equations:
[0109]
[0110] S203: Determine non-zero element position information of the corresponding Jacobian matrix according to the nonlinear equation group.
[0111] Specifically, the nonlinear equation system includes: obtaining a first vector x constructed by the independent variables of the nonlinear equation system and a second vector F(x) constructed by the dependent variables, wherein the N is the dimension of the nonlinear equation system.
[0112] The Jacobian matrix is specifically:
[0113]
[0114] Among them, i=1, 2,…, N; j=1, 2,…, N.
[0115] For example, following the above example, for the obtained discretized nonlinear equation system, its Jacobian matrix is a sparse square matrix of N1×N2 dimensions, and its non-zero element positions are regular, and the column positions of the non-zero elements in the m=N1×j+i row are:
[0116]
[0117] S204: Constructing quantum circuits representing the quantum state evolution of non-zero element position information of the Jacobian matrix and function information corresponding to the nonlinear equation group, respectively, and determining the solution of the nonlinear partial differential equation through each of the quantum circuits.
[0118] Specifically, the quantum circuit representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equations includes: Oracle f1 、OracleO f2 ;
[0119] Among them, the Oracle f1 For extracting the subscript information of the independent variable in the i-th function of the nonlinear equation system, the Oracle f1 The role is:
[0120] O f1 |i,j>=|i,f(i,j)>
[0121] Where i = 1, 2, ..., N, j = 1, 2, ..., d, f(i, j) represents f i The subscript of the jth variable of (x) is the sparsity of the Jacobian matrix, that is, the number of non-zero elements in any row and column of F′(x) does not exceed d;
[0122] The Oracle f2 For calculating the value of the ith function of the nonlinear equations, the Oracle f2 The role is:
[0123] O f2 |i>|x (i) 〉|0>=|i>|x (i) >|f i (x (i) )>
[0124] Where i = 1, 2, .., N, and the value of f(i, j) is determined by the difference format, x (i) Indicates that in f i The relevant x in (x) j .
[0125] The sub-quantum circuits for constructing quantum state evolution representing approximate solutions of nonlinear equations based on each of the quantum circuits include: Oracle A1 、OracleO A2 and OracleO b , wherein the OracleO A1 、OracleO A2 Based on Oracle f1、OracleO f2 Build; the OracleO A1 、OracleO A2 and OracleO b Used to implement:
[0126] O A1 |j,l>=|j,h(j,l)>
[0127]
[0128]
[0129] Among them, h(j,l) represents the column number of the lth non-zero element in the jth row of matrix A, C b is the norm of F(x), the matrix |F′(x)| max is the maximum value of the elements of the Jacobian matrix F′(x).
[0130] Determining the solution of the nonlinear partial differential equation by each of the quantum circuits specifically includes:
[0131] S2041: Determine the initial approximate solution x of the nonlinear equation system 0 and a preset precision value ∈, constructing a sub-quantum circuit representing the quantum state evolution of an approximate solution to a nonlinear equation system based on each of the quantum circuits, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit.
[0132] Specifically, first determine the initial approximate solution x of the nonlinear equations 0 (as an approximation of the true solution) and a preset precision value ∈, where the value of ∈ can be customized according to user needs, and is generally set to 10 -6 .
[0133] Construct a sub-quantum circuit that represents the quantum state evolution of the approximate solution of the nonlinear equation system, that is, construct a sub-quantum circuit that includes the above-mentioned Oracle functional module, perform quantum state evolution operations on the sub-quantum circuit, and measure the quantum state of the evolved sub-quantum circuit.
[0134] S2042: updating a current approximate solution according to the quantum state of the sub-quantum circuit, determining a state estimation parameter of the nonlinear equation group, and judging a magnitude relationship between the state estimation parameter and the preset precision value.
[0135] Specifically, the initial approximate solution x of the nonlinear equations has been determined 0(as an approximation of the true solution), and then update and iterate according to the quantum state sampling results of the sub-quantum circuit. Assuming that the iteration reaches the kth step, the current approximate solution is updated to obtain x k ,F(x k ), thus according to
[0136] x k+1 =x k -[F′(x k )] -1 F(x k )
[0137] In this process, it is necessary to solve a system of linear equations
[0138] F′(x k )Δx k =-F(x k )
[0139] The above formula can be transformed into
[0140] x k+1 =x k +Δx k
[0141] Iterate continuously until F(x k+1 ) is less than the given preset precision value.
[0142] Specifically, in each iteration, a linear system needs to be constructed
[0143] AΔx=-|b>
[0144] Based on the constructed |b>, A and the corresponding Oracle, the Quantum Linear System Solver (QLSS) is used to solve the linear system. The input of QLSS is OracleO b , O A1 and O A2 , solve the linear system by QLSS to obtain its normalized solution |Δx>, where
[0145] Determining state estimation parameters of the nonlinear equation system includes:
[0146] According to the pre-built quantum data structure for accessing quantum data, the quantum states and the x represented by the first layer leaf nodes distributed and stored in the quantum data structure are determined. i and f i (x) address information; wherein the quantum data structure is a binary tree structure.
[0147] Preset|M F> is quantum data, which is used to convert classical data into quantum data (serving as an intermediate storage for converting classical data into quantum data), |M F The data structure of > is a binary tree structure. The distribution is determined and stored in the quantum data structure |M F >The quantum state of the first layer leaf node and its x i and f i (x) address information. Specifically, |M F >In quantum data, each node stores x i and f i (x), in each internal node, save the relevant x from the next layer i and f i The square root of the sum of the squares of (x), so the root node stores ‖x‖ and ‖F(x)‖. In each iteration of solving the nonlinear equation system, the data structure |M is updated F >The leaf nodes in the relevant data about x and F(x), then |M F >The internal nodes in the quantum data are also automatically updated.
[0148] Specifically, given an N-dimensional quantum data |M F 〉, which has the following properties:
[0149] In Quantum Data | M F >, extract x i ,The process can be expressed as:
[0150] O M1 |M F >|i〉|0〉=|M F >|i>|x i >,i=0,1,…,N-1
[0151] In Quantum Data | M F >, extract f i (x), the process can be expressed as:
[0152] O M2 |M F >|i>|0>=|M F >|i〉|f i (x)>,i=0,1,…,N-1
[0153] In Quantum Data | M F 〉, extract the norm of the x sequence in the quantum data structure. The process can be expressed as:
[0154] O M3 |M F 〉|i〉|j>=|M F>|i>|j>|d ijx >,i=0,1,…,n; j=0,1,…,2 i -1
[0155] In Quantum Data | M F >, extract the norm of the F(x) sequence in the quantum data structure. The process can be expressed as:
[0156] O M4 |M F >|i>|j>=|M F >|i>|j>|d ijy >,i=0,1,…,n; j=0,1,…,2 i -1
[0157] Among them, O M1 , O M2 , O M3 , O M4 Are Oracle modules that can achieve specific functions, d ijx d ijy Represents x stored in the node i and f i (x), and d 00x =‖x‖,d 00y =‖F(x)‖.
[0158] According to the address information, the data stored in the leaf node is transferred to the next layer of leaf nodes through the quantum circuit until the quantum state data f corresponding to the address information is output at the root node in the binary tree structure. k (x), to determine the state estimation parameters Among them, n=log2N, and finally determine the relationship between the state estimation parameter ‖F(x)‖ and the preset accuracy value ∈.
[0159] S2043: If the state estimation parameter is greater than the preset precision value, returning to the steps of constructing a sub-quantum circuit representing the quantum state evolution of the approximate solution of the nonlinear equation system, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit until the state estimation parameter is less than or equal to the preset precision value.
[0160] Specifically, if ‖F(x)‖>∈, the process returns to step S2041 until the state estimation parameter ‖F(x)‖ is less than or equal to the preset accuracy value ∈.
[0161] Specifically, assume that k steps of iteration have been performed and |M has been updated F (xk )>, using the Oracle module in solving linear systems Respectively Input the quantum linear system solver to obtain |Δx k >, using the quantum state sampling algorithm to obtain And calculate |Δx k >normalization constant Update |M F (x k )> to |M F (x k+1 )>, and finally judge the relationship between the state estimation parameter ‖F(x)‖ and the preset accuracy value ∈. At this time, if ||F(x k+1 )||>∈, then return to step S2041 and continue the iterative process of k+1 steps until the state estimation parameter ||F(x k+1 )||≤∈.
[0162] It should be noted that the quantum state sampling algorithm is used to obtain And calculate |Δx k >normalization constant in:
[0163]
[0164]
[0165] from The changed f can be calculated i (x), and update f i (x).
[0166] S205: Determine a solution to the nonlinear equation group according to the final quantum state of the evolved sub-quantum circuit as a solution to the nonlinear partial differential equation.
[0167] Specifically, if ‖F(x)‖<∈, stop the iteration and obtain the quantum data|M that meets the iteration stop condition F >, obtaining the final quantum state of the evolved sub-quantum circuit, which preserves the solution of the nonlinear equation group as the solution of the nonlinear partial differential equation.
[0168] In quantum applications, an oracle or combination of oracles is constructed, and the internal principles of this oracle or combination represent the process flow of the present invention. Specifically, an oracle can be understood as a module (similar to a black box) that performs a specific function in a quantum algorithm, and specific implementation methods will be used for specific problems.
[0169] Currently, existing quantum circuit construction can only utilize existing single quantum logic gates, double quantum logic gates, etc., which usually have the following problems:
[0170] For quantum circuits with more complex functions, the number of qubits required is very large. Simulating them on a classical computer consumes a huge amount of memory space, requires a large number of logic gates, and takes a very long time. Furthermore, some complex algorithms are difficult to implement using quantum circuits.
[0171] Based on this, we use Oracle simulation to implement specific complex functions and realize controlled and transposed conjugate operations. The parameters that users pass into Oracle can include: Oracle name (used to identify the functional purpose of Oracle, such as A1 ), quantum bits, matrix elements, etc.
[0172] The advantage of this approach is that the oracle is treated as a known module, eliminating the need to focus on its internal implementation details. This makes the representation of quantum applications, such as quantum circuits, very simple and clear. Since the classically simulated oracle functional modules can be equated with quantum logic gates, the constructed quantum circuits are simplified, saving runtime memory space and accelerating the simulation verification of quantum algorithms.
[0173] It should be noted that solving a linear system is equivalent to solving the inverse of the coefficient matrix. This application provides a method for solving the inverse of an approximate matrix through a linear combination of algorithms, and uses a linear combination of Chebyshev polynomials to approximate the inverse of the matrix.
[0174] See also Figure 4 , Figure 4 A schematic diagram of a quantum circuit about T provided in an embodiment of the present invention. It can be understood by those skilled in the art that H represents an H gate, O A1 , O A2 , M represents Oracle with different functions, T module represents the overall functional module of H gate and Oracle combination, and the function of T module is to transform |j> into |Ψ j >. Moreover, the matrix obtained as input to the T module is an N-order matrix. The constructed T module can be equivalent to a quantum logic gate in the quantum circuit, and its matrix form is: ∑ j∈[N] |Ψ j ><j|, where <j| is the left vector of the quantum state.
[0175] Specifically, use the H gate to construct a superposition state:
[0176] O A1 To implement the transformation:
[0177] O A2 Implement the transformation:
[0178] Executed by A jl The controlled M operator, that is, M implements the transformation:
[0179]
[0180] Where M can be defined as:
[0181]
[0182] Use O again A2 , encode |A jl >’s quantum bits are recycled and output as |0>.
[0183] It should be noted that the schematic diagram only shows part of the quantum circuits related to the present application. The symbols and connection relationships in the figure are only for illustration and do not constitute a limitation of the present invention.
[0184] See also Figure 5 , Figure 5 A schematic diagram of a quantum circuit for a walking operator W provided in an embodiment of the present invention. Those skilled in the art will appreciate that any simple function can be linearly approximated as a linear combination of other functions, and the inverse function of a matrix can be approximated using Chebyshev polynomials. Specifically, as follows:
[0185]
[0186] besides
[0187] In this application, we need to find the inverse matrix, which satisfies O(‖A -1 -F‖)=∈. The linear combination is:
[0188]
[0189] Here g(x) is 2∈,
[0190] In D κ :=(-1,-1 / κ)∪(1 / κ,1). is a Chebyshev polynomial of the first kind.
[0191] Quantum walk: In order to realize Chebyshev polynomials, it is necessary to carry out it in the quantum walk framework.
[0192] Because quantum walks are performed in space Some states in Above, define a mapping from arrive
[0193]
[0194] And the walk operator:
[0195]
[0196] Operator S executes The flip operation of the product state in . So we have:
[0197]
[0198] is a Chebyshev polynomial of the first kind.
[0199] It should be noted that, as mentioned above |Ψ j >, using a combination of vertical lines and angle brackets to describe a quantum state, indicating that the quantum state is a vector (called a state vector, basis vector, etc.), |Ψ j > indicates a right arrow, <Ψ j | indicates the left arrow.
[0200] For example, Figure 5 As shown, the quantum circuit of the wandering operator W is explained. S can be constructed from a group of swap operations (e.g. a SWAP gate, Figure 5 The two symbols marked with bold X in the quantum bit represent a SWAP gate), and the rest is
[0201] To build It is necessary to construct the unitary operator form of T and define the unitary operator T u Should meet:
[0202] T u |j>|0>=|Ψ j >
[0203] So we have:
[0204]
[0205] in,
[0206]
[0207] And: K=2|0><0|-I 2N .
[0208] See also Figure 6 , Figure 6 A schematic diagram of a quantum circuit for implementing a quantum linear solver provided by an embodiment of the present invention.
[0209] Specifically, such as Figure 6 In the quantum circuit diagram shown, V and T represent Oracles with different functions. represents the transposed conjugate, T represents the overall functional module T of the H gate and each Oracle combination, and the function of the T module is to transform |j> into | j >. Moreover, the matrix of the input to the T module is an N-order matrix. The constructed T module can be equivalent to a quantum logic gate in the quantum circuit, and its matrix form is: ∑ j∈[N] |Ψ j ><j|, where <j| is the left vector of the quantum state. Figure 6 The quantum circuit shown can execute the quantum state from |b> to |A -1 b> quantum state evolution, specifically, run the entire quantum circuit and measure |j> and |anc>. When |j> and |anc> both collapse to |0>, we can get | -1 b>.
[0210] A quantum oracle is a black box that represents a transition in a quantum state. A typical example of a quantum oracle is the linear system: O|x〉|0>=|x>|f(x)>, where the computation of f(x) uses the first quantum register as input and the second quantum register as output. Another example is QRAM, which can be considered an oracle. Many quantum algorithms use oracles, but their implementation is not critical; it can be decomposed into quantum gates or implemented as a QRAM. In QPanda, an "Oracle" function can be used to define an oracle. An oracle is considered to have a user-provided name.
[0211] It can be seen that this application discretizes the nonlinear partial differential equations and converts them into matrix and vector information of the nonlinear system, and encodes them into quantum states, links the classical data structure with the quantum state in the quantum field, and performs the evolution operation of encoding the classical data structure into the quantum state to obtain the quantum state of the evolved quantum circuit. It can utilize the superposition characteristics of quantum to accelerate the solution of nonlinear partial differential equations with higher complexity and expand the simulation application scenarios of quantum computing.
[0212] Compared with the prior art, the present invention first obtains information on initial conditions, boundary conditions and the nonlinear partial differential equation to be processed, and discretizes the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discrete format and difference format to obtain a discretized nonlinear equation group. According to the nonlinear equation group, the nonzero element position information of the corresponding Jacobian matrix is determined, and quantum circuits representing the quantum state evolution of the nonzero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group are constructed respectively. The solution of the nonlinear partial differential equation is determined through each quantum circuit. By utilizing the relevant characteristics of quantum, the technology of calculating nonlinear partial differential equations using quantum algorithms can be realized, thereby reducing the complexity and difficulty of solving nonlinear partial differential equations and filling the relevant technical gaps in the field of quantum computing.
[0213] See also Figure 7 , Figure 7 A schematic diagram of a nonlinear equation solving device based on quantum circuits provided by an embodiment of the present invention, Figure 2 The process shown in the figure may include:
[0214] An acquisition module 701 is used to acquire information of initial conditions, boundary conditions and the nonlinear partial differential equation to be processed;
[0215] The discretization module 702 is used to discretize the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discretization format and difference format to obtain a discretized nonlinear equation system;
[0216] A determination module 703 is configured to determine non-zero element position information of a corresponding Jacobian matrix according to the nonlinear equation group;
[0217] The evolution module 704 is used to construct quantum circuits representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group, and determine the solution of the nonlinear partial differential equation through each of the quantum circuits.
[0218] Specifically, the determination module includes:
[0219] An acquisition unit is used to obtain a first vector x constructed by the independent variables of the nonlinear equation group and a second vector F(x) constructed by the dependent variables, wherein the N is the dimension of the nonlinear equation system.
[0220] Specifically, the determination module includes a Jacobian matrix unit, which is specifically used to implement:
[0221]
[0222] Among them, i=1, 2,…, N; j=1, 2,…, N.
[0223] Specifically, the evolution module includes:
[0224] A measuring unit for determining an initial approximate solution x to the nonlinear system of equations 0 and a preset precision value ∈, constructing a sub-quantum circuit representing the quantum state evolution of an approximate solution to a nonlinear equation system based on each of the quantum circuits, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit;
[0225] an updating unit, configured to update a current approximate solution according to the quantum state of the sub-quantum circuit, determine a state estimation parameter of the nonlinear equation group, and determine a magnitude relationship between the state estimation parameter and the preset precision value;
[0226] a judgment unit, configured to, if the state estimation parameter is greater than the preset precision value, return to executing the steps of: constructing a sub-quantum circuit representing the quantum state evolution of the approximate solution of the nonlinear equation system, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the evolved sub-quantum circuit, until the state estimation parameter is less than or equal to the preset precision value;
[0227] A determination unit is used to determine the solution of the nonlinear equation group according to the final quantum state of the evolved sub-quantum circuit as the solution of the nonlinear partial differential equation.
[0228] Specifically, the evolution module includes: Oracle f1 Unit, OracleO f2 unit;
[0229] Among them, the Oracle f1 The unit is used to extract the subscript information of the independent variable in the i-th function of the nonlinear equation system, and the Oracle f1 The role is:
[0230] O f1 |i,j>=|i,f(i,j)>
[0231] Where i = 1, 2, ..., N, j = 1, 2, ..., d, f(i, j) represents f i (x) is the subscript of the j-th variable, and d is the sparsity of the Jacobian matrix;
[0232] The Oracle f2 The unit is used to calculate the value of the i-th function of the nonlinear equation system, and the Oracle f2 The role is:
[0233] O f2 |i>|x(i) >|0>=|i>|x (i) >|f i (x (i) )>
[0234] Among them, =1,2,..,N.
[0235] Specifically, the measurement unit includes OracleO A1 Unit, OracleO A2 Unit and OracleO b Unit, wherein the OracleO A1 、OracleO A2 Based on Oracle f1 、OracleO f2 Build; the OracleO A1 、OracleO A2 and OracleO b Used to implement:
[0236] O A1 |j,l>=|j,h(j,l)>
[0237]
[0238]
[0239] Among them, h(j,l) represents the column number of the lth non-zero element in the jth row of matrix A, C b is the norm of F(x), the matrix |F′(x)| max is the maximum value of the elements of the Jacobian matrix F′(x).
[0240] Specifically, the updating unit includes:
[0241] The access unit is used to determine the quantum state and x represented by the first layer leaf node distributed and stored in the quantum data structure according to the pre-built quantum data structure for accessing quantum data. i and f i (x) address information; wherein the quantum data structure is a binary tree structure;
[0242] The output unit is used to transfer the data stored in the leaf node to the next layer of leaf nodes through the quantum circuit according to the address information, until the quantum state data f corresponding to the address information is output at the root node in the binary tree structure. k (x), to determine the state estimation parameters Where n=log2N.
[0243] Compared with the prior art, the present invention first obtains information on initial conditions, boundary conditions and the nonlinear partial differential equation to be processed, and discretizes the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discrete format and difference format to obtain a discretized nonlinear equation group. According to the nonlinear equation group, the nonzero element position information of the corresponding Jacobian matrix is determined, and quantum circuits representing the quantum state evolution of the nonzero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group are constructed respectively. The solution of the nonlinear partial differential equation is determined through each quantum circuit. By utilizing the relevant characteristics of quantum, the technology of calculating nonlinear partial differential equations using quantum algorithms can be realized, thereby reducing the complexity and difficulty of solving nonlinear partial differential equations and filling the relevant technical gaps in the field of quantum computing.
[0244] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when running.
[0245] Specifically, in this embodiment, the above-mentioned storage medium may be configured to store a computer program for performing the following steps:
[0246] S201: Obtaining information on initial conditions, boundary conditions, and the nonlinear partial differential equation to be processed;
[0247] S202: discretizing the initial conditions, boundary conditions, and the nonlinear partial differential equation to be processed according to a preset discretization format and difference format to obtain a discretized nonlinear equation system;
[0248] S203: Determine non-zero element position information of a corresponding Jacobian matrix according to the nonlinear equation group;
[0249] S204: Constructing quantum circuits representing the quantum state evolution of non-zero element position information of the Jacobian matrix and function information corresponding to the nonlinear equation group, respectively, and determining the solution of the nonlinear partial differential equation through each of the quantum circuits.
[0250] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0251] Compared with the prior art, the present invention first obtains information on initial conditions, boundary conditions and the nonlinear partial differential equation to be processed, and discretizes the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discrete format and difference format to obtain a discretized nonlinear equation group. According to the nonlinear equation group, the nonzero element position information of the corresponding Jacobian matrix is determined, and quantum circuits representing the quantum state evolution of the nonzero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group are constructed respectively. The solution of the nonlinear partial differential equation is determined through each quantum circuit. By utilizing the relevant characteristics of quantum, the technology of calculating nonlinear partial differential equations using quantum algorithms can be realized, thereby reducing the complexity and difficulty of solving nonlinear partial differential equations and filling the relevant technical gaps in the field of quantum computing.
[0252] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.
[0253] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0254] Specifically, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0255] S201: Obtaining information on initial conditions, boundary conditions, and the nonlinear partial differential equation to be processed;
[0256] S202: discretizing the initial conditions, boundary conditions, and the nonlinear partial differential equation to be processed according to a preset discretization format and difference format to obtain a discretized nonlinear equation system;
[0257] S203: Determine non-zero element position information of a corresponding Jacobian matrix according to the nonlinear equation group;
[0258] S204: Constructing quantum circuits representing the quantum state evolution of non-zero element position information of the Jacobian matrix and function information corresponding to the nonlinear equation group, respectively, and determining the solution of the nonlinear partial differential equation through each of the quantum circuits.
[0259] Compared with the prior art, the present invention first obtains information on initial conditions, boundary conditions and the nonlinear partial differential equation to be processed, and discretizes the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discrete format and difference format to obtain a discretized nonlinear equation group. According to the nonlinear equation group, the nonzero element position information of the corresponding Jacobian matrix is determined, and quantum circuits representing the quantum state evolution of the nonzero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group are constructed respectively. The solution of the nonlinear partial differential equation is determined through each quantum circuit. By utilizing the relevant characteristics of quantum, the technology of calculating nonlinear partial differential equations using quantum algorithms can be realized, thereby reducing the complexity and difficulty of solving nonlinear partial differential equations and filling the relevant technical gaps in the field of quantum computing.
[0260] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the scope of implementation of the present invention is not limited to what is shown in the drawings. Any changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which do not exceed the spirit covered by the description and drawings, should be within the scope of protection of the present invention.
Claims
1. A method for solving nonlinear partial differential equations based on quantum circuits, characterized in that: include: Obtain information on initial conditions, boundary conditions, and nonlinear partial differential equations to be processed; According to the preset discrete format and difference format, the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed are discretized to obtain a discretized nonlinear equation group; According to the nonlinear equation group, determining the non-zero element position information of the corresponding Jacobian matrix; Respectively construct quantum circuits representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group, and construct sub-quantum circuits representing the quantum state evolution of the approximate solution of the nonlinear equation group based on each of the quantum circuits, and determine the solution of the nonlinear partial differential equation by executing the sub-quantum circuits; wherein: the quantum circuit representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group includes: Oracle 、Oracle ; wherein the Oracle For extracting the nonlinear equations The Oracle The role is: ;in , N is the dimension of the nonlinear equation system, j=1,2,...,d, express No. The subscript of a variable, is the sparsity of the Jacobian matrix; the Oracle For calculating the nonlinear equations The value of the function, the Oracle The role is: ;in ; wherein the sub-quantum circuits for constructing quantum state evolution representing approximate solutions of nonlinear equations based on each of the quantum circuits include: Oracle 、Oracle and Oracle , wherein the Oracle 、Oracle Oracle-based 、Oracle Build; the Oracle 、Oracle and Oracle Used to achieve: ; ; ;in, Representation Matrix No. Line The column numbers of the non-zero elements, for The norm of the matrix , is the Jacobian matrix The maximum value of the elements.
2. The method according to claim 1, characterized in that The nonlinear equations include: Get the first vector constructed by the independent variables of the nonlinear equation system and the second vector constructed from the dependent variable , wherein the , is the dimension of the nonlinear system of equations.
3. The method according to claim 2, characterized in that The Jacobian matrix is specifically: Among them, i=1, 2,…, N; j=1, 2,…, N.
4. The method according to claim 3, characterized in that Determining the solution of the nonlinear partial differential equation by each of the quantum circuits specifically includes: Determine an initial approximate solution to the nonlinear system of equations and preset precision values , constructing a sub-quantum circuit representing the quantum state evolution of the approximate solution of the nonlinear equations based on each of the quantum circuits, performing a quantum state evolution operation on the sub-quantum circuit, and measuring the quantum state of the sub-quantum circuit after evolution; updating the current approximate solution according to the quantum state of the sub-quantum circuit, determining the state estimation parameters of the nonlinear equation group, and judging the magnitude relationship between the state estimation parameters and the preset precision value; If the state estimation parameter is greater than the preset precision value, return to execute: construct a sub-quantum circuit representing the quantum state evolution of the approximate solution of the nonlinear equation group, perform a quantum state evolution operation on the sub-quantum circuit, and measure the quantum state of the evolved sub-quantum circuit until the state estimation parameter is less than or equal to the preset precision value; According to the final quantum state of the evolved sub-quantum circuit, the solution of the nonlinear equation group is determined as the solution of the nonlinear partial differential equation.
5. The method according to claim 4, characterized in that Determining the state estimation parameters of the nonlinear equation group includes: According to a pre-constructed quantum data structure for accessing quantum data, the quantum states and the quantum states represented by the first-layer leaf nodes distributed and stored in the quantum data structure are determined. and The address information of the quantum data structure is a binary tree structure; According to the address information, the data stored in the leaf node is transferred to the next layer of leaf nodes through the quantum circuit until the quantum state data corresponding to the address information is output at the root node in the binary tree structure. , to determine the state estimation parameters ,in, .
6. A device for solving nonlinear partial differential equations based on quantum circuits, characterized in that: include: An acquisition module, used for acquiring information of initial conditions, boundary conditions and nonlinear partial differential equations to be processed; A discretization module is used to discretize the initial conditions, boundary conditions and the nonlinear partial differential equation to be processed according to a preset discretization format and difference format to obtain a discretized nonlinear equation group; A determination module, used for determining non-zero element position information of a corresponding Jacobian matrix according to the nonlinear equation group; An evolution module is used to construct quantum circuits representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group, respectively, and construct sub-quantum circuits representing the quantum state evolution of the approximate solution of the nonlinear equation group based on each of the quantum circuits, and determine the solution of the nonlinear partial differential equation by executing the sub-quantum circuits; wherein: the quantum circuit representing the quantum state evolution of the non-zero element position information of the Jacobian matrix and the function information corresponding to the nonlinear equation group includes: Oracle 、Oracle ; wherein the Oracle For extracting the nonlinear equations The Oracle The role is: ;in , N is the dimension of the nonlinear equation system, j=1,2,...,d, express No. The subscript of a variable, is the sparsity of the Jacobian matrix; the Oracle For calculating the nonlinear equations The value of the function, the Oracle The role is: ;in ; wherein the sub-quantum circuits for constructing quantum state evolution representing approximate solutions of nonlinear equations based on each of the quantum circuits include: Oracle 、Oracle and Oracle , wherein the Oracle 、Oracle Oracle-based 、Oracle Build; the Oracle 、Oracle and Oracle Used to achieve: ; ; ;in, Representation Matrix No. Line The column numbers of the non-zero elements, for The norm of the matrix , is the Jacobian matrix The maximum value of the elements.
7. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 5 when executed.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Numerical simulation method of compound multijunction solar cell
CN106339561A
Computational platform for quantum structures
US20200125986A1