Solution method of time-space nonlinear differential equation, air flow rate prediction method
By constructing a composite loss function and using a variable quantum algorithm to optimize the problem, the problem of high resource consumption in solving nonlinear differential equations by quantum computers is solved, and an efficient solution process is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
- Filing Date
- 2024-12-04
- Publication Date
- 2026-06-12
AI Technical Summary
Existing quantum computers consume excessive resources, especially hardware and time, when solving nonlinear differential equations, resulting in low efficiency.
By constructing evolutionary loss functions, initial value loss functions, and boundary loss functions, the problem of solving nonlinear differential equations is transformed into an optimization problem of composite loss functions. The solution is obtained using a variable quantum algorithm, which requires only one quantum state tomography process to obtain numerical solutions at multiple time points.
This reduces the resource consumption of quantum computers in solving nonlinear differential equations and improves the efficiency and speed of solving them.
Smart Images

Figure CN122196314A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum computing technology, and in particular to a method for solving spatiotemporal nonlinear differential equations, a method for predicting airflow velocity, and related devices. Background Technology
[0002] Nonlinear differential equations are a class of mathematical equations that describe the dynamic behavior of nonlinear systems. Solving nonlinear differential equations is of great value in many important fields and disciplines, such as aerospace, weather forecasting, chemistry, and control. Many governing equations for dynamic / thermodynamic systems are nonlinear differential equations, and the simulation process for these systems is essentially the process of solving nonlinear differential equations.
[0003] Quantum state tomography (QST) is a technique for determining the state of a quantum system. It reconstructs the density matrix of the system by measuring multiple observables. QST is a fundamental problem in quantum information and a necessary step in quantum information processing. Through QST, it is possible to verify whether quantum operations such as the preparation and manipulation of quantum states are effectively performed.
[0004] Currently, quantum computers solve nonlinear differential equations using a local linearization method. This involves first discretizing the nonlinear differential equation and then iteratively solving each discretized equation. In this method, the solution at each time step is obtained iteratively, and a quantum state tomography process is required at each time step to extract the solution from the quantum state. Each quantum state tomography requires copying the quantum states of all qubits for information acquisition, thus consuming hardware resources such as multiple qubits. The quantum state tomography algorithm is then used to reconstruct the quantum states of these qubits, resulting in significant hardware and time resource consumption. For example, reconstructing the quantum states of 8 qubits using the most common maximum likelihood estimation method can take several weeks. Therefore, reducing the resource consumption of quantum computers in solving spatiotemporal nonlinear differential equations is a technical problem that needs to be solved. Summary of the Invention
[0005] This application provides a method for solving spatiotemporal nonlinear differential equations, a method for predicting airflow velocity, and related devices, which can reduce the resource consumption of quantum computers in solving spatiotemporal nonlinear differential equations.
[0006] The first aspect of this application provides a method for solving differential equations containing spatiotemporal nonlinearity, including:
[0007] The first Hamiltonian is determined based on the spatiotemporal nonlinear differential equation, the second Hamiltonian is determined based on the initial value conditions of the spatiotemporal nonlinear differential equation, and the third Hamiltonian is determined based on the boundary conditions of the spatiotemporal nonlinear differential equation.
[0008] The specific form of the first Hamiltonian is determined according to the encoding method and discrete format of the unknowns in the spatiotemporal nonlinear differential equation, and the specific forms of the second and third Hamiltonians are determined according to the encoding method.
[0009] The evolution loss function is determined according to the specific form of the first Hamiltonian, the initial value loss function is determined according to the specific form of the second Hamiltonian, and the boundary loss function is determined according to the specific form of the third Hamiltonian.
[0010] The composite loss function is determined based on the evolution loss function, the initial value loss function, and the boundary loss function;
[0011] When the value of the composite loss function satisfies the convergence criterion, the quantum state of the proposed circuit used to encode the vector corresponding to the unknown quantity is extracted using quantum state tomography, and the unknown quantity is obtained.
[0012] Optionally, the encoding method is as follows:
[0013]
[0014] Where |ψ> represents the quantum state of the proposed circuit used to encode the vector u corresponding to the unknown quantity, and the component of vector u at position x at time t is... l is the mode length scaling factor when converting classical data to a quantum state, T is the maximum time step of the simulation, and X is the maximum spatial location of the simulation. To and Irrelevant quantities.
[0015] Optionally, the spatiotemporal nonlinear differential equation is a one-dimensional Bogle equation, the discrete scheme is a first-order explicit time scheme, and the specific form of the first Hamiltonian is: in:
[0016]
[0017] in:
[0018]
[0019] Optionally, the specific form of the second Hamiltonian is: in:
[0020]
[0021] Optionally, the third Hamiltonian includes a fourth Hamiltonian corresponding to the left boundary condition and a fifth Hamiltonian corresponding to the right boundary condition, wherein the specific form of the fourth Hamiltonian is: in:
[0022]
[0023] The specific form of the fifth Hamiltonian is as follows: in:
[0024]
[0025] A second aspect of this application provides an air velocity prediction method, including:
[0026] The dynamic viscosity of air within the target area is obtained, and the Bogle equation is determined based on the dynamic viscosity. The Bogle equation is a spatiotemporal nonlinear partial differential equation describing the change of velocity with time and space.
[0027] The spatiotemporal nonlinear partial differential equation is solved according to the solution method of the spatiotemporal nonlinear differential equation as described in any of the first aspects, and the relationship between air velocity and time and space is obtained.
[0028] Predict the air velocity at the target time within the target area based on the relationship between air velocity and time and space.
[0029] A third aspect of this application provides a device for solving spatiotemporal nonlinear differential equations, comprising:
[0030] The Hamiltonian determination unit is used to determine the first Hamiltonian based on the spatiotemporal nonlinear differential equation, the second Hamiltonian based on the initial value conditions of the spatiotemporal nonlinear differential equation, and the third Hamiltonian based on the boundary conditions of the spatiotemporal nonlinear differential equation.
[0031] The Hamiltonian specific form determination unit is used to determine the specific form of the first Hamiltonian according to the encoding method and discrete format of the unknowns in the spatiotemporal nonlinear differential equation, and to determine the specific form of the second Hamiltonian and the specific form of the third Hamiltonian according to the encoding method.
[0032] The loss function determination unit is used to determine the evolution loss function according to the specific form of the first Hamiltonian, the initial value loss function according to the specific form of the second Hamiltonian, and the boundary loss function according to the specific form of the third Hamiltonian.
[0033] The loss function determination unit is further configured to determine a composite loss function based on the evolution loss function, the initial value loss function, and the boundary loss function;
[0034] The unknown quantity solving unit is used to extract the quantum state of the proposed circuit used to encode the vector corresponding to the unknown quantity by using quantum state tomography when the value of the composite loss function satisfies the convergence judgment condition, so as to obtain the unknown quantity.
[0035] A fourth aspect of this application provides an air velocity prediction device, comprising:
[0036] The data acquisition unit is used to acquire the dynamic viscosity of air in the target area and determine the Bogle equation based on the dynamic viscosity. The Bogle equation is a spatiotemporal nonlinear partial differential equation describing the change of velocity with time and space.
[0037] The equation solving unit is used to solve the spatiotemporal nonlinear partial differential equation as described in any of the first aspects, and to obtain the relationship between air velocity and time and space.
[0038] An air velocity prediction unit is used to predict the air velocity at a target time within the target area based on the relationship between the air velocity and the changes in air velocity over time and space.
[0039] A fifth aspect of this application provides an electronic device, including: a processor and a memory;
[0040] The processor is connected to a memory, wherein the memory is used to store computer programs and the processor is used to invoke the computer programs to execute the methods as described in the first or second aspect of the embodiments of this application.
[0041] A sixth aspect of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the methods described in the first or second aspect of this application.
[0042] The method for solving spatiotemporal nonlinear differential equations, the method for predicting airflow velocity, and related devices provided in this application construct an evolutionary loss function based on the spatiotemporal nonlinear differential equations, an initial value loss function based on initial value conditions, and a boundary loss function based on boundary conditions. These evolutionary loss functions, initial value loss functions, and boundary loss functions are then used as a composite loss function, transforming the problem of solving spatiotemporal nonlinear differential equations into an optimization problem concerning the composite loss function. This optimization problem can be solved using a variable quantum algorithm, as described in the proposed circuit of this application. When using the variable quantum algorithm to solve the optimization problem of the composite loss function, only one quantum state tomography process needs to be performed on the proposed circuit to obtain a set of numerical solutions for the equations at consecutive time steps. This avoids the problem of existing methods requiring quantum state tomography at every time step, thereby reducing the resource consumption of quantum computers in solving time-dependent nonlinear differential equations. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 An example system block diagram for predicting air velocity using spatiotemporal nonlinear differential equations is shown in one embodiment of this application;
[0045] Figure 2 A flowchart illustrating a solution method for spatiotemporal nonlinear differential equations provided in one embodiment of this application is shown.
[0046] Figure 3 This illustration shows a schematic diagram of a high-efficiency hardware proposed circuit structure according to an embodiment of this application;
[0047] Figure 4 A migration circuit U provided in one embodiment of this application is shown. ↑ Structural diagram;
[0048] Figure 5 A migration circuit U provided in one embodiment of this application is shown. ↓ Structural diagram;
[0049] Figure 6 A circuit U provided in one embodiment of this application is shown. a Structural diagram;
[0050] Figure 7A schematic diagram of the observation circuit for an arbitrary polynomial function provided in one embodiment of this application is shown;
[0051] Figure 8 A flowchart illustrating an air velocity prediction method according to an embodiment of this application is shown.
[0052] Figure 9 A schematic diagram of the structure of a device for solving spatiotemporal nonlinear differential equations provided in one embodiment of this application is shown;
[0053] Figure 10 A schematic diagram of the structure of an air velocity prediction device provided in one embodiment of this application is shown;
[0054] Figure 11 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown. Detailed Implementation
[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0056] Classical computers use transistors to encode information in binary data, such as bits, where each bit can represent a value of 1 or 0. These 1s and 0s act as switches to drive the functions of a classical computer. If there are n bits of data, there are 2^n possible classical states, and one state is represented at a time.
[0057] Quantum computers use quantum processors that operate on data represented by qubits, also known as quantum bits. A single qubit can represent the classical binary states "0" or "1", or a superposition of "0" and "1". Because it can represent a superposition of "0" and "1", a qubit can represent both "0" and "1" states simultaneously. For example, if there are n bits of data, then 2^n qubits can represent n bits of data. n A quantum state can be represented simultaneously. Furthermore, qubits in a superposition can be correlated with each other, a phenomenon known as entanglement, where the state of one qubit (whether 1, 0, or both) depends on the state of another qubit, and more information can be encoded within two entangled qubits. Based on the principles of superposition and entanglement, qubits enable quantum computers to perform functions that might be relatively complex and time-consuming for classical computers.
[0058] Please refer to Figure 1This illustrates an example system block diagram provided by one embodiment of this application for predicting airflow velocity using spatiotemporal nonlinear differential equations. System 100 may be a hybrid computing system comprising a combination of one or more quantum computers, quantum systems, and / or classical computers. Figure 1 In the example shown, system 100 may include a quantum system 110 and a classical computer 120. In one implementation, the quantum system 110 and the classical computer 120 may be configured to communicate via one or more wired and / or wireless connections (e.g., wireless networks). The quantum system 110 may include a quantum chipset consisting of one or more quantum chips, comprising various hardware components for processing data encoded in qubits. The quantum chipset may be a quantum computing core surrounded by infrastructure to protect the quantum chips from electromagnetic noise sources, mechanical vibration sources, heat sources, and other noise sources that can degrade the performance of the quantum chips. The classical computer 120 may be electronically integrated with the quantum system 110 via any suitable wired and / or wireless electronic connection.
[0059] exist Figure 1 In the example shown, quantum system 110 can be any suitable set of components capable of performing quantum operations on a physical system. Quantum operations, such as quantum gate operations, manipulate the quantum states of qubits to evolve and / or become entangled. Figure 1 In the illustrated example embodiment, the quantum system 110 may include a measurement and control unit 111, an interface 112, and a quantum chip 113. In some embodiments, all or part of each of the measurement and control unit 111, interface 112, and quantum chip 113 may be located in a cryogenic environment to facilitate the performance of quantum operations. The quantum chip 113 may be any hardware capable of processing information using quantum states. This hardware may include multiple qubits and means for coupling or entanglement of the qubits to process information using quantum states. Qubits may include, but are not limited to, charge qubits, flux qubits, phase qubits, spin qubits, and ion qubits. The quantum chip may include a set of quantum logic gates configured to perform quantum logic operations on the qubits stored in a quantum register. The quantum gates may include one or more single-qubit gates, two-qubit gates, and / or other multi-qubit gates.
[0060] The measurement and control unit 111 can be any combination of digital computing devices capable of performing quantum computing (e.g., executing quantum circuits) in conjunction with interface 112. This digital computing device may include a digital processor and memory for storing and executing quantum instructions using interface 112. The digital computing device may also include a communication protocol device for receiving instructions and sending the results of the performed quantum computing to a classical computer. Additionally, the digital computing device may include a communication interface having interface 112. In one embodiment, the measurement and control unit 111 may be configured to receive classical instructions (e.g., from classical computer 120) and convert these classical instructions into measurement and control instructions for interface 112. The measurement and control instructions provided by the measurement and control unit 111 to interface 112 may be, for example, digital signals indicating which quantum gates in a quantum gate array need to be applied to the qubits to perform a specific function. Interface 112 may be configured to convert these digital signals into analog signals (e.g., analog pulses of microwave pulses), which can be used to apply quantum gates to the qubits to manipulate the interactions between the qubits.
[0061] Interface 112 may be a classical-quantum interface, comprising a combination of devices capable of receiving instructions from the integrated measurement and control unit 111 and converting those instructions into a means for implementing quantum operations. In one embodiment, interface 112 may convert instructions from the integrated measurement and control unit 111 into drive signals capable of driving or manipulating qubits, and / or applying quantum gates to qubits. Additionally, interface 112 may be configured to convert signals received from the quantum chip 113 into digital signals capable of being processed and transmitted by the integrated measurement and control unit 111. Devices included in interface 112 may include, but are not limited to, digital-to-analog converters, analog-to-digital converters, waveform generators, attenuators, amplifiers, optical fibers, lasers, and filters. Interface 112 may further include circuitry configured to measure multiple qubits after the application of quantum gates, wherein the measurements may produce results represented in classical bits. Each measurement performed by interface 112 may be read out to a device connected to the quantum system 110, such as a classical computer 120. The multiple measurement results provided by interface 112 may represent probabilistic results.
[0062] The classical computer 120 can include hardware components such as a processor and storage devices (e.g., including memory devices and classical registers) for processing data encoded in classical bits. In one embodiment, the classical computer 120 can be configured to provide the quantum system 110 with various control signals, instructions, and data encoded in classical bits. Further, quantum states measured by the quantum system 110 can be read out by the classical computer 120, and the classical computer 120 can store the measured quantum states as classical bits in classical registers. In one embodiment, the classical computer 120 can be any suitable combination of computer-executable hardware and / or computer-executable software capable of executing the preparation module 121 to perform quantum computation using data stored in the data storage module 122 as part of the construction and computation. The data storage module 122 can be a repository for data to be analyzed using quantum computing algorithms and the results of that analysis. The preparation module 121 can be a program or module capable of preparing classical data from the data storage module 122 as part of a quantum circuit implementation. Preparation module 121 can be instantiated as part of a larger algorithm, such as an application programming interface (API) function call, or by resolving hybrid classical-quantum computing into aspects of quantum and classical computing. For example, preparation module 121 can generate instructions for creating quantum circuits using quantum gates. In an embodiment, such instructions can be stored by the measurement and control unit 111 and can be instantiated by components of interface 112 to execute, enabling quantum operations of quantum gates to be performed on quantum chip 113.
[0063] The classic computer 120 may be a laptop computer, desktop computer, vehicle-integrated computer, smart mobile device, tablet device, and / or any other suitable classic computing device. Additionally or alternatively, the classic computer 120 may also operate as part of a cloud computing service model, such as Software as a Service (SaaS), Platform as a Service (PaaS), or Infrastructure as a Service (IaaS). The classic computer 120 may also reside in a cloud computing deployment model, such as a private cloud, community cloud, public cloud, or hybrid cloud.
[0064] Please refer to Figure 2 This illustration shows a flowchart of a method for solving spatiotemporal nonlinear differential equations according to an embodiment of this application. This method can be applied to computer devices, which refer to electronic devices with data computing and processing capabilities. The method may include the following steps:
[0065] Step 201: Determine the first Hamiltonian based on the spatiotemporal nonlinear differential equation, determine the second Hamiltonian based on the initial value conditions of the spatiotemporal nonlinear differential equation, and determine the third Hamiltonian based on the boundary conditions of the spatiotemporal nonlinear differential equation.
[0066] For example, the general form of a time-dependent nonlinear differential equation can be:
[0067]
[0068] Here, the unknown variable u is a function of time t and space x. It is a function of the unknown variable u.
[0069] Numerical solution of equation (1) yields a vector of discrete solutions at discrete time points. in Let represent the solution at position x at time t, where t∈[0,T] and x∈[0,X], and vector u is the vector corresponding to the unknown u.
[0070] Step 202: Determine the specific form of the first Hamiltonian according to the encoding method and discretization format of the unknowns in the spatiotemporal nonlinear differential equation, and determine the specific forms of the second Hamiltonian and the third Hamiltonian according to the encoding method.
[0071] For example, the encoding method is as follows:
[0072]
[0073] Where |ψ> represents the quantum state of the proposed circuit used to encode the vector u corresponding to the unknown quantity, and the component of vector u at position x at time t is... l is the mode length scaling factor when converting classical data to a quantum state, T is the maximum time step of the simulation, and X is the maximum spatial location of the simulation. To and Irrelevant quantities.
[0074] For example, the one-dimensional Bogle equation is:
[0075]
[0076] right Use first-order explicit format. and Discretizing using the central scheme, the discrete form of the Burgers equation can be written as follows:
[0077]
[0078] After sorting, we get
[0079]
[0080] According to equation (5), we can obtain:
[0081] The specific form of the first Hamiltonian is: in:
[0082]
[0083] in:
[0084]
[0085] For example, the specific form of the second Hamiltonian is: in:
[0086]
[0087] For example, the third Hamiltonian includes a fourth Hamiltonian corresponding to the left boundary condition and a fifth Hamiltonian corresponding to the right boundary condition. The specific form of the fourth Hamiltonian is as follows: in:
[0088]
[0089] The specific form of the fifth Hamiltonian is as follows: in:
[0090]
[0091] Step 203: Determine the evolution loss function according to the specific form of the first Hamiltonian, determine the initial value loss function according to the specific form of the second Hamiltonian, and determine the boundary loss function according to the specific form of the third Hamiltonian.
[0092] The loss function, also known as the cost function, is a function used in optimization problems to measure the difference between predicted and actual values. The design of the loss function is crucial to the performance of the trained model because it guides the adjustment of model parameters. The values of the objective loss function, constraint loss function, and composite loss function can be solved using traditional computational methods or quantum computing methods; no particular method is specified here.
[0093] The evolutionary loss function is:
[0094]
[0095] Among them, L m This is the evolutionary loss function.
[0096] The initial loss function is:
[0097]
[0098] Among them, L i Let be the evolutionary loss function.
[0099]
[0100] |v> represents an irrelevant quantum state.
[0101]
[0102] If and only if The above expression is 0. Therefore, when L i When =0, there must be The initial conditions are satisfied.
[0103] Wherein, the boundary loss function is
[0104] L b =L l +L r (15)
[0105] Here L l express The corresponding left boundary loss function, L r express The corresponding right boundary loss function.
[0106]
[0107] in,
[0108]
[0109] in,
[0110]
[0111] Step 204: Determine the composite loss function based on the evolution loss function, the initial value loss function, and the boundary loss function.
[0112] For example, the composite loss function is:
[0113] L = L m +aL i +bL b (20)
[0114] Where a, b>0 are weighting factors, representing the evolutionary loss function L in the composite loss function L. m Initial value loss function L i and boundary loss function L b The weights they occupy. In actual calculations, we take a, b ≥ 1, indicating that the initial value loss function has a larger weight in the composite loss function. Obviously, as a, b → +∞, we have
[0115]
[0116] In other words, the optimal solution at this point approximates the true solution. However, in practice, if a or b is too large, it will lead to L... m Information is overwhelmed (equivalent to during L training) m This introduces significant background noise, making training difficult. Therefore, in practice, it is necessary to select appropriate weight coefficients a and b. For example, a, b = 5, 10, 15, 20, or other values can be selected, without limitation here.
[0117] Step 205: When the value of the composite loss function satisfies the convergence judgment condition, the quantum state of the proposed circuit used to encode the vector corresponding to the unknown quantity is extracted using quantum state tomography, and the unknown quantity is obtained.
[0118] The convergence criterion is a standard used to determine whether the algorithm has found the optimal solution or is close to the optimal solution. The convergence criterion may include at least one of the following: the change in the objective function value is less than a first preset threshold in a consecutive preset number of iterations; the change in the parameters is less than a second preset threshold in a consecutive preset number of iterations; the gradient norm of the objective function is less than a third preset threshold; the relative rate of change of the objective function value is less than a fourth preset threshold; and the maximum number of iterations. The preset thresholds are manually set in advance.
[0119] Quantum State Tomography (QST) is a method for determining unknown quantum states. It reconstructs the quantum state by selecting a complete set of measurement bases and performing independent measurements on the qubits in each base.
[0120] The proposed circuit can be, for example, U θ It can be expressed as θ = {θ0, θ1, ..., θ} M-1 Let θ be the M parameters in the proposed circuit, typically M < N, to achieve dimensionality reduction in the optimization problem. By continuously optimizing θ using the loss function, we can find the unknown quantity that satisfies the constraints. Then, we can extract this unknown quantity using quantum state tomography.
[0121] As can be seen, the solution method for spatiotemporal nonlinear differential equations provided in this application constructs an evolutionary loss function based on the spatiotemporal nonlinear differential equations, an initial value loss function based on initial value conditions, and a boundary loss function based on boundary conditions. These evolutionary loss functions, initial value loss functions, and boundary loss functions are then used as a composite loss function, thus transforming the solution problem of spatiotemporal nonlinear differential equations into an optimization problem concerning the composite loss function. The optimization problem of the composite loss function can be solved using a variable quantum algorithm, i.e., the proposed circuit in this application. When using the variable quantum algorithm to solve the optimization problem of the composite loss function, only one quantum state tomography process needs to be performed on the proposed circuit to obtain a set of numerical solutions for the equations at consecutive time steps. This avoids the problem of existing methods requiring quantum state tomography at every time step, thereby reducing the resource consumption of quantum computers in solving time-dependent nonlinear differential equations.
[0122] In some embodiments, the proposed circuit is a high-efficiency hardware proposed circuit, which is composed of a single quantum rotating gate and a dual quantum logic gate, wherein the rotation parameter of the single quantum rotating gate is a variable parameter.
[0123] The single-quantum rotation logic gate may include at least one of the following: R X Door, R Y Door, R Z Gates, specifically dual quantum logic gates, can include at least one of the following: CNOT gates, CZ gates, SWAP gates, or other forms of single-quantum rotation gates and dual quantum logic gates, without limitation herein. For example... Figure 3 As shown, Figure 3 A schematic diagram of a proposed high-efficiency hardware circuit structure according to an embodiment of this application is shown. It includes i+1 qubits and k layers of quantum logic gates, each layer of quantum logic gates consisting of R acting on each qubit. Y It consists of a gate and a CNOT gate acting on adjacent qubits, where θ is R Y The rotation parameters of the gate are also the variable parameters of the proposed circuit.
[0124] As can be seen, the high-efficiency hardware proposed circuit provided in this application consists of a single quantum rotating gate and a dual quantum logic gate. Both the single quantum logic gate and the dual quantum logic gate can be directly implemented on a real quantum computer, making it machine-friendly.
[0125] In some embodiments, the value of the composite loss function can be solved using quantum computing methods. Therefore, the method further includes:
[0126] Construct the observation circuit for the composite loss function, and calculate the value of the composite loss function based on the observation circuit.
[0127] Specifically, for the initial value loss function L in the composite loss function i Because of u 0 Since the initial conditions are known, we can obtain |u 0 > Encoding circuit U u0 In addition, there are circuits for preparing quantum states |ψ>, which are proposed to be U. θ .because Furthermore, H2 is a Hermitian matrix that can always be decomposed into a linear combination of unitary matrices; therefore, L... i After unfolding, you get
[0128]
[0129] Each of the above four items can be observed using the Hadamard-Test circuit, thus enabling the observation of the initial value loss function. For the boundary loss function L in the composite loss function... b The same observation can be performed using the Hadamard-Test circuit, which will not be elaborated upon again.
[0130] For the evolutionary loss function L in the composite loss function m First, we will introduce two types of migration circuits U ↑ and U ↓ See Figure 4 and Figure 5 Each of these illustrates a migration circuit U provided in one embodiment of this application. ↑ and U ↓ A schematic diagram of the structure. Migration circuit U ↑ To apply a NOT gate to each qubit, except for the NOT gate that applies to the least significant qubit, all other NOT gates are controlled by all the least significant qubits preceding the qubit they apply. (Transfer circuit U) ↓ To apply a NOT gate to each qubit, except for the NOT gate that applies to the least significant qubit, the other NOT gates are virtually controlled by all the least significant qubits preceding the qubit they apply.
[0131] For a quantum state Migration circuit U ↑ Its function is as follows
[0132]
[0133] Migration circuit U ↓ Its function is
[0134]
[0135] For the evolutionary loss function, we don't care. The value at the boundary, that is, we don't care about u. 0 , u0 and uX The value of is such that for x∈[1,X-1] and t∈[1,T], it can be considered that we have .
[0136]
[0137] Finally, it's necessary to avoid the influence of boundary values and unwanted quantum states during observation. This is where the auxiliary bit comes into play, and circuit U can be used. a See Figure 6 It illustrates a circuit U provided in one embodiment of this application. a A structural diagram.
[0138] After U a Afterwards, the quantum state |ψ> becomes
[0139]
[0140] Obviously, quantum state U a The product of |ψ> with any other quantum state |φ>|0> depends only on the first term above (the bold part).
[0141] Hamiltonian corresponding to evolutionary loss function
[0142]
[0143] Therefore, the evolutionary loss function can be written as:
[0144] L m =<ψ|T1|ψ>+<ψ|T2|ψ>+<ψ|T3|ψ>+<ψ|T4|ψ>(28)
[0145] The first term <ψ|T1|ψ> can be observed using the Hadamard-Test circuit.
[0146] The second term, <ψ|T2|ψ>, expands to:
[0147]
[0148] The third and fourth items, when expanded, are:
[0149]
[0150] It can be seen that the second to fourth terms are all polynomial functions, which can be observed using an observation circuit for any polynomial function. The observation circuit for any polynomial function can be obtained by sequentially applying a Hadamard gate to an auxiliary quantum register, applying a first quantum logic gate (virtually controlled by the auxiliary quantum register) to a first target quantum register, applying a second quantum logic gate (actually controlled by the auxiliary quantum register) to the first target quantum register, applying a third quantum logic gate (actually controlled by the auxiliary quantum register) to the second target quantum register, applying a NOT gate (actually controlled by the auxiliary and first target quantum registers) to the second target quantum register, and finally applying a Hadamard gate to an auxiliary quantum register. The first, second, and third quantum logic gates are used to encode the unknowns or coefficients of unknowns in the arbitrary polynomial function.
[0151] See Figure 7 This diagram illustrates the structural schematic of an observation circuit for an arbitrary polynomial function provided in one embodiment of this application. For example, the function to be observed is...
[0152]
[0153] The first quantum logic gate is U x The auxiliary quantum register acts as a virtual control over the first target quantum register, used to encode the unknown quantity x, U. x |0>=|x>;The second quantum logic gate is U y The auxiliary quantum register acts as a control over the first target quantum register, used to encode the unknown quantity y, U. y |0>=|y>;The third quantum logic gate is U z and U w U z The auxiliary quantum register acts as a control over the first second target quantum register, used to encode the unknown quantity z, U. z |0>=|z>;U z The corresponding NOT gate is controlled by the auxiliary quantum register and the first target quantum register, which in turn act on the first second target quantum register; U w The auxiliary quantum register acts as a control over the second target quantum register, used to encode the unknowns w and U. w |0>=|w>,U w The corresponding NOT gate is controlled by the auxiliary quantum register and the first target quantum register, which in turn control the second target quantum register.
[0154] In some embodiments, the method further includes:
[0155] When the value of the composite loss function does not meet the convergence criterion, the gradient of the composite loss function is calculated using the finite difference method.
[0156] The proposed circuit is updated based on the training step size, the gradient of the composite loss function, and gradient descent, and the value of the composite loss function is calculated based on the updated proposed circuit.
[0157] The finite difference method is a mathematical method primarily used in numerical analysis and engineering calculations to approximate the rate of change of differential equations or functions. The basic idea of the finite difference method is to replace the derivative with the difference quotient of the function values, thereby transforming the differential equation into an algebraic equation.
[0158] Gradient descent is a commonly used first-order optimization algorithm for solving unconstrained optimization problems, especially for minimizing functions. Its basic idea is to progressively update the parameters along the negative direction of the objective function's gradient to gradually approach the function's local or global minimum.
[0159] It should be noted that the use of the difference method to calculate the gradient of the loss function is only one example of this application. Other methods can also be used, such as the shift-parameter rule (SPR). Similarly, the use of the gradient descent method to calculate the gradient of the loss function is only one example of this application. Other methods can also be used, and no further limitations are imposed.
[0160] Specifically, calculating the gradient of the composite loss function using the finite difference method includes:
[0161] Determine the first value of the variable parameter in the proposed circuit;
[0162] The sum of the first value and the difference step size is used as the second value and assigned to the variable parameter in the proposed circuit, and the value of the composite loss function is calculated according to the observation circuit of the composite loss function;
[0163] Determine the difference between the value of the composite loss function under the second value and the first value;
[0164] The gradient of the composite loss function is determined by the quotient of the difference between the values of the composite loss function and the difference step size.
[0165] For example, let's assume the variable parameter in the circuit takes the value θ. i The value of the composite loss function L(θ) is calculated based on the observation circuit of the composite loss function. i ); θ i With Δ t The sum is assigned as the second value to the variable parameter in the proposed circuit, and the value of the composite loss function L(θ) is calculated based on the observation circuit of the composite loss function. i +Δ t The gradient of the composite loss function is:
[0166]
[0167] Specifically, updating the proposed circuit based on the training step size, the gradient of the composite loss function, and gradient descent includes:
[0168] The difference between the first value and the product of the training step size and the gradient of the composite loss function is used as the value of the variable parameter in the proposed circuit for the next iteration.
[0169] For example, the current iteration number is t, the next iteration number is t+1, and the first value of the variable parameter in the proposed circuit is θ. t If the training step size is λ, then the values of the variable parameters in the proposed circuit for the next iteration are:
[0170]
[0171] It should be noted that Δ t Both the training step size λ and the training step size are preset and used as known input parameters.
[0172] Air velocity prediction is a technique based on physical models, statistical methods, or a combination of both to estimate the speed of airflow at a future moment or over a period of time. In environmental science and meteorology, accurate air velocity prediction is crucial for weather forecasting. Changes in air velocity directly affect phenomena such as wind speed, temperature distribution, humidity variations, and pollutant dispersion, thus influencing weather patterns and climate change research. In building design and indoor environmental control, understanding air velocity helps optimize air conditioning system design, ensuring indoor air quality and thermal comfort. For example, in hospital operating rooms, appropriate air velocity can reduce the risk of infection and improve patient safety. In certain industrial production processes, such as the drying of tobacco leaves in curing barns, controlling air velocity directly affects product quality and production efficiency. Properly adjusting air velocity can accelerate moisture evaporation, increase drying speed, and maintain product quality. For transportation vehicles, especially airplanes and automobiles, air velocity prediction is crucial for vehicle performance evaluation and optimized design. For example, an aircraft's airspeed indicator measures the aircraft's speed relative to the surrounding air, which is essential for flight safety and performance. The effectiveness of a car's radiator is also affected by air velocity; good airflow helps dissipate heat more effectively, ensuring normal engine operation. In the field of wind power generation, predicting wind speed (i.e., air velocity) plays a crucial role in wind farm site selection, turbine layout, and power generation estimation. Accurate wind speed prediction can maximize wind energy conversion efficiency and reduce resource waste.
[0173] In summary, air velocity prediction is not only crucial for scientific research but also directly impacts all aspects of daily life and industrial production, thus possessing significant practical value. Given the complexity and variability of atmospheric data, achieving rapid air velocity prediction is a pressing technical problem that needs to be solved. Based on this, this application proposes an air velocity prediction method.
[0174] Please refer to Figure 8 This illustration shows a flowchart of an airflow velocity prediction method according to an embodiment of this application. The method can be applied to computer equipment, which refers to electronic devices capable of data calculation and processing. The method may include the following steps:
[0175] Step 801: Obtain the dynamic viscosity of the air in the target area, and determine the Bogle equation based on the dynamic viscosity. The Bogle equation is a spatiotemporal nonlinear partial differential equation describing the change of velocity with time and space.
[0176] Step 802: Solve the spatiotemporal nonlinear partial differential equation according to the solution method of the spatiotemporal nonlinear differential equation to obtain the relationship between air velocity and time and space.
[0177] Step 803: Predict the air velocity at the target time within the target area based on the relationship between the air velocity and the changes in time and space.
[0178] For example, the one-dimensional Bogle equation is:
[0179]
[0180] Here, the unknown quantity u is the air velocity, which varies with time t and space x, and ν is the dynamic viscosity of the air, which is usually a constant. The target region is x∈[0,X], and the target time is t∈[0,T].
[0181] It can be seen that if the dynamic viscosity of air is known, it can be solved using the above-mentioned method of solving nonlinear differential equations involving time and space, thereby achieving rapid prediction of air velocity at the target time within the target area.
[0182] For example, the solution method for this spatiotemporal nonlinear differential equation specifically includes the following steps:
[0183] The first Hamiltonian is determined based on the spatiotemporal nonlinear differential equation, the second Hamiltonian is determined based on the initial value conditions of the spatiotemporal nonlinear differential equation, and the third Hamiltonian is determined based on the boundary conditions of the spatiotemporal nonlinear differential equation.
[0184] The specific form of the first Hamiltonian is determined according to the encoding method and discrete format of the unknowns in the spatiotemporal nonlinear differential equation, and the specific forms of the second and third Hamiltonians are determined according to the encoding method.
[0185] The evolution loss function is determined according to the specific form of the first Hamiltonian, the initial value loss function is determined according to the specific form of the second Hamiltonian, and the boundary loss function is determined according to the specific form of the third Hamiltonian.
[0186] The composite loss function is determined based on the evolution loss function, the initial value loss function, and the boundary loss function;
[0187] When the value of the composite loss function satisfies the convergence criterion, the quantum state of the proposed circuit used to encode the vector corresponding to the unknown quantity is extracted using quantum state tomography, and the unknown quantity is obtained.
[0188] For example, the encoding method is as follows:
[0189]
[0190] Where |ψ> represents the quantum state of the proposed circuit used to encode the vector u corresponding to the unknown quantity, and the component of vector u at position x at time t is... l is the mode length scaling factor when converting classical data to a quantum state, T is the maximum time step of the simulation, and X is the maximum spatial location of the simulation. To and Irrelevant quantities.
[0191] For example, the spatiotemporal nonlinear differential equation is a one-dimensional Bogle equation, the discrete scheme is a first-order explicit time scheme, and the specific form of the first Hamiltonian is: in:
[0192]
[0193] in:
[0194]
[0195] For example, the specific form of the second Hamiltonian is: in:
[0196]
[0197] For example, the third Hamiltonian includes a fourth Hamiltonian corresponding to the left boundary condition and a fifth Hamiltonian corresponding to the right boundary condition. The specific form of the fourth Hamiltonian is as follows: in:
[0198]
[0199] The specific form of the fifth Hamiltonian is as follows: in:
[0200]
[0201] Figure 9 A schematic diagram of a solution apparatus for spatiotemporal nonlinear differential equations according to an embodiment of this application is shown. The apparatus includes:
[0202] Hamiltonian determination unit 901 is used to determine a first Hamiltonian based on a spatiotemporal nonlinear differential equation, a second Hamiltonian based on the initial value conditions of the spatiotemporal nonlinear differential equation, and a third Hamiltonian based on the boundary conditions of the spatiotemporal nonlinear differential equation.
[0203] The Hamiltonian specific form determination unit 902 is used to determine the specific form of the first Hamiltonian according to the encoding method and discrete format of the unknowns in the spatiotemporal nonlinear differential equation, and to determine the specific form of the second Hamiltonian and the specific form of the third Hamiltonian according to the encoding method.
[0204] The loss function determination unit 903 is used to determine the evolution loss function according to the specific form of the first Hamiltonian, the initial value loss function according to the specific form of the second Hamiltonian, and the boundary loss function according to the specific form of the third Hamiltonian.
[0205] The loss function determination unit 903 is further configured to determine a composite loss function based on the evolution loss function, the initial value loss function, and the boundary loss function;
[0206] The unknown quantity solving unit 904 is used to extract the quantum state of the proposed circuit used to encode the vector corresponding to the unknown quantity by using quantum state tomography when the value of the composite loss function satisfies the convergence judgment condition, so as to obtain the unknown quantity.
[0207] Figure 10 A schematic diagram of an air velocity prediction device according to an embodiment of this application is shown. The device includes:
[0208] The data acquisition unit 1001 is used to acquire the dynamic viscosity of air in the target area and determine the Bogle equation based on the dynamic viscosity. The Bogle equation is a spatiotemporal nonlinear partial differential equation describing the change of velocity with time and space.
[0209] The equation solving unit 1002 is used to solve the spatiotemporal nonlinear partial differential equation according to the solution method of the spatiotemporal nonlinear differential equation, and obtain the relationship between air velocity and time and space.
[0210] Air velocity prediction unit 1003 is used to predict the air velocity at a target time within the target area based on the relationship between the air velocity and the changes in time and space.
[0211] Figure 11 The diagram illustrates the structure of a computer device provided in one embodiment of this application, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the functions of the computer system in any of the above embodiments, namely, the method for solving spatiotemporal nonlinear differential equations or the method for predicting airflow velocity.
[0212] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform the functions of the computer system containing the method for solving spatiotemporal nonlinear differential equations or the method for predicting airflow velocity in any of the above embodiments.
[0213] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the functions of the computer system containing the method for solving spatiotemporal nonlinear differential equations or the method for predicting airflow velocity in any of the above embodiments.
[0214] It is understood that the specific examples in this application are only intended to help those skilled in the art better understand the implementation methods of this application, and are not intended to limit the scope of the invention.
[0215] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this application in any way.
[0216] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.
[0217] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0218] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0219] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0220] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0221] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.
[0222] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0223] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0224] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0225] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0226] The above are merely specific embodiments of this application, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this invention should be determined by the scope of the claims.
Claims
1. A method for solving differential equations containing spatiotemporal nonlinearity, characterized in that, include: The first Hamiltonian is determined based on the spatiotemporal nonlinear differential equation, the second Hamiltonian is determined based on the initial value conditions of the spatiotemporal nonlinear differential equation, and the third Hamiltonian is determined based on the boundary conditions of the spatiotemporal nonlinear differential equation. The specific form of the first Hamiltonian is determined according to the encoding method and discrete format of the unknowns in the spatiotemporal nonlinear differential equation, and the specific forms of the second and third Hamiltonians are determined according to the encoding method. The evolution loss function is determined according to the specific form of the first Hamiltonian, the initial value loss function is determined according to the specific form of the second Hamiltonian, and the boundary loss function is determined according to the specific form of the third Hamiltonian. The composite loss function is determined based on the evolution loss function, the initial value loss function, and the boundary loss function; When the value of the composite loss function satisfies the convergence criterion, the quantum state of the proposed circuit used to encode the vector corresponding to the unknown quantity is extracted using quantum state tomography, and the unknown quantity is obtained.
2. The method according to claim 1, characterized in that, The encoding method is as follows: Where |ψ> represents the quantum state of the proposed circuit used to encode the vector u corresponding to the unknown quantity, and the component of vector u at position x at time t is... l is the mode length scaling factor when converting classical data to a quantum state, T is the maximum time step of the simulation, and X is the maximum spatial location of the simulation. To and Irrelevant quantities.
3. The method according to claim 2, characterized in that, The spatiotemporal nonlinear differential equation is a one-dimensional Bogle equation, the discrete scheme is a first-order explicit time scheme, and the specific form of the first Hamiltonian is: in: in:
4. The method according to claim 2, characterized in that, The specific form of the second Hamiltonian is: in:
5. The method according to claim 2, characterized in that, The third Hamiltonian includes a fourth Hamiltonian corresponding to the left boundary condition and a fifth Hamiltonian corresponding to the right boundary condition. The specific form of the fourth Hamiltonian is as follows: in: The specific form of the fifth Hamiltonian is as follows: in:
6. A method for predicting airflow velocity, characterized in that, The method includes: The dynamic viscosity of air within the target area is obtained, and the Bogle equation is determined based on the dynamic viscosity. The Bogle equation is a spatiotemporal nonlinear partial differential equation describing the change of velocity with time and space. The method for solving the spatiotemporal nonlinear differential equation according to any one of claims 1-5 is used to solve the spatiotemporal nonlinear partial differential equation to obtain the relationship between air velocity and time and space. Predict the air velocity at the target time within the target area based on the relationship between air velocity and time and space.
7. A device for solving spatiotemporal nonlinear differential equations, characterized in that, include: The Hamiltonian determination unit is used to determine the first Hamiltonian based on the spatiotemporal nonlinear differential equation, the second Hamiltonian based on the initial value conditions of the spatiotemporal nonlinear differential equation, and the third Hamiltonian based on the boundary conditions of the spatiotemporal nonlinear differential equation. The Hamiltonian specific form determination unit is used to determine the specific form of the first Hamiltonian according to the encoding method and discrete format of the unknowns in the spatiotemporal nonlinear differential equation, and to determine the specific form of the second Hamiltonian and the specific form of the third Hamiltonian according to the encoding method. The loss function determination unit is used to determine the evolution loss function according to the specific form of the first Hamiltonian, the initial value loss function according to the specific form of the second Hamiltonian, and the boundary loss function according to the specific form of the third Hamiltonian. The loss function determination unit is further configured to determine a composite loss function based on the evolution loss function, the initial value loss function, and the boundary loss function; The unknown quantity solving unit is used to extract the quantum state of the proposed circuit used to encode the vector corresponding to the unknown quantity by using quantum state tomography when the value of the composite loss function satisfies the convergence judgment condition, so as to obtain the unknown quantity.
8. An air velocity prediction device, characterized in that, include: The data acquisition unit is used to acquire the dynamic viscosity of air in the target area and determine the Bogle equation based on the dynamic viscosity. The Bogle equation is a spatiotemporal nonlinear partial differential equation describing the change of velocity with time and space. The equation solving unit is used to solve the spatiotemporal nonlinear partial differential equation according to the solution method of any one of claims 1-5, and obtain the relationship between air velocity and time and space. An air velocity prediction unit is used to predict the air velocity at a target time within the target area based on the relationship between the air velocity and the changes in air velocity over time and space.
9. An electronic device, characterized in that, include: Processor and memory; The processor is connected to a memory, wherein the memory is used to store a computer program, and the processor is used to invoke the computer program to perform the method as described in claims 1-5 or 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, perform the method as described in claims 1-5 or 6.