A weather prediction method, device, storage medium and electronic device
By constructing quantum circuits in weather forecasting and using the Runge-Kutta method and atmospheric control equations to process the set of meteorological variables, the problem of high computational complexity in CFD technology is solved, and the efficiency of weather forecasting is improved.
Patent Information
- Application Number
- CN202310950108.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-07-28
AI Technical Summary
Existing weather forecasting schemes based on CFD technology have high computational complexity, resulting in low forecasting efficiency.
The first and second meteorological variable sets for discrete nodes within the current region to be predicted are constructed and input into a quantum circuit based on the Runge-Kutta method and atmospheric control equations. The quantum circuit is used to perform calculations to obtain the increment set of meteorological variables to be predicted for each discrete node, and finally the predicted meteorological variables for the next time step are determined.
It reduces computational complexity and significantly improves the efficiency of weather forecasting.
Smart Images

Figure CN119439315B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of quantum computing technology, and in particular relates to a weather forecasting method, device, storage medium and electronic device. Background Technology
[0002] A quantum computer is a physical device that performs high-speed mathematical and logical operations, stores and processes quantum information in accordance with the laws of quantum mechanics. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Because of its ability to process mathematical problems more efficiently than ordinary computers—for example, reducing the time to crack RSA keys from hundreds of years to hours—quantum computers have become a key technology under research.
[0003] Weather forecasting is an important engineering application of computational fluid dynamics (CFD) technology. Due to the enormous scale of atmospheric systems, the number of grids and the computational load after gridding the atmospheric system are also extremely large. The computational complexity of simulation using CFD technology is high, resulting in low forecasting efficiency for current weather forecasting schemes. Summary of the Invention
[0004] The purpose of this invention is to provide a weather forecasting method, apparatus, storage medium, and electronic device, aiming to reduce computational complexity and improve the efficiency of current weather forecasting schemes based on CFD technology.
[0005] To achieve the above objectives, a first aspect of the present invention provides a weather forecasting method, the method comprising:
[0006] Construct a first set of meteorological variables and a second set of meteorological variables for each discrete node in the region to be predicted at the current time. The first set of meteorological variables includes the meteorological variables to be predicted for each discrete node, and the second set of meteorological variables includes the meteorological variables to be predicted for discrete nodes within a preset distance from each discrete node.
[0007] The first and second meteorological variable sets of each discrete node are input into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run to obtain the incremental set of meteorological variables to be predicted for each discrete node.
[0008] The predicted meteorological variables for the region to be predicted at the next moment are determined based on the increment set of the meteorological variables to be predicted for each discrete node.
[0009] In one possible implementation, the quantum circuit includes an encoding unit and a prediction correction unit; the step of inputting the first set of meteorological variables and the second set of meteorological variables of each discrete node into the quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and running it to obtain the incremental set of meteorological variables to be predicted for each discrete node includes:
[0010] The first set of meteorological variables and the second set of meteorological variables are encoded into the qubits of the first register of the quantum circuit based on the encoding unit.
[0011] Based on the prediction correction unit, the quantum state evolution of the qubits of the first register encoding the first meteorological variable set and the second meteorological variable set is performed to obtain the prediction gradient set and correction gradient set of the first meteorological variable set and the second meteorological variable set for each discrete node.
[0012] The incremental set of meteorological variables to be predicted for each discrete node is calculated based on the predicted gradient set and the corrected gradient set. The predicted correction unit includes multiple Oracle sub-units constructed based on the correction formula, which is obtained by solving the atmospheric control equations based on the Runge-Kutta method.
[0013] In one possible implementation, the quantum circuit further includes a second quantum register and a third register, and the prediction correction unit includes a first Oracle subunit, a second Oracle subunit, and a third Oracle subunit.
[0014] The first Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state of the second register evolves to the quantum state |G. j >|G k(j) >;
[0015] The second Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state |G| of the second register is... j >|G k(j) Evolving to a quantum state
[0016] The third Oracle subunit is used to perform quantum state evolution on the qubits of the first, second, and third registers, so that the quantum state of the third register evolves to the quantum state |j>|Δy. j >;
[0017] Among them, G j Let G represent the predicted gradient set of the meteorological variable to be predicted at discrete node j. k(j)This represents the predicted gradient set of the meteorological variables to be predicted for discrete nodes within a preset distance of discrete node j. This represents the set of predicted meteorological variables at discrete node j. Let j represent the set of predicted meteorological variables for discrete nodes within a preset distance from discrete node j. Let Δy represent the set of corrected gradients of the meteorological variable to be predicted at discrete node j. j This represents the increment set of the meteorological variables to be predicted for discrete node j.
[0018] In one possible implementation, the quantum circuit further includes a fourth Oracle subunit for performing decomputation operations on the quantum states of the first register and the second register.
[0019] In one possible implementation, the modified formula is:
[0020] y + =y n +ΔtG n
[0021]
[0022] Among them, y n Let G represent the set of meteorological variables for discrete nodes at time n, where Δt represents the interval between time n and the next time. n y represents the predicted gradient set of the set of meteorological variables at discrete nodes at time n. + G represents the set of predicted weather variables for the next moment. + This represents the set of corrected gradients for the meteorological variables to be predicted at discrete nodes at time n.
[0023] In one possible implementation, the quantum circuit further includes a fifth Oracle subunit, which is used to store the quantum state |j>|Δy corresponding to the increment set of the meteorological variables to be predicted in the third register. j >Evolved into Obtain the non-zero increment set Δy m .
[0024] In one possible implementation, after determining the predicted meteorological variables for the region to be predicted at the next time step based on the increment set of the meteorological variables to be predicted for each discrete node, the method further includes:
[0025] Update the predicted meteorological variables of the region to be predicted at the current time based on the predicted meteorological variables of the region to be predicted at the next time. Return to execute the steps of constructing the first set of meteorological variables and the second set of meteorological variables for each discrete node in the region to be predicted at the current time, and obtain the predicted meteorological variables of the region to be predicted at multiple times.
[0026] A second aspect of the present invention provides a weather forecasting device, the device comprising:
[0027] The construction module is used to construct a first set of meteorological variables and a second set of meteorological variables for each discrete node in the area to be predicted at the current time. The first set of meteorological variables includes the meteorological variables to be predicted for each discrete node, and the second set of meteorological variables includes the meteorological variables to be predicted for discrete nodes within a preset distance from each discrete node.
[0028] The input module is used to input the first set of meteorological variables and the second set of meteorological variables of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run it to obtain the incremental set of meteorological variables to be predicted for each discrete node.
[0029] The determination module is used to determine the predicted meteorological variables for the region to be predicted at the next time step based on the increment set of the meteorological variables to be predicted for each discrete node.
[0030] In one possible implementation, the quantum circuit includes an encoding unit and a prediction and correction unit; the input module is specifically used for:
[0031] The first set of meteorological variables and the second set of meteorological variables are encoded into the qubits of the first register of the quantum circuit based on the encoding unit.
[0032] Based on the prediction correction unit, the quantum state evolution of the qubits of the first register encoding the first meteorological variable set and the second meteorological variable set is performed to obtain the prediction gradient set and correction gradient set of the first meteorological variable set and the second meteorological variable set for each discrete node.
[0033] The incremental set of meteorological variables to be predicted for each discrete node is calculated based on the predicted gradient set and the corrected gradient set. The predicted correction unit includes multiple Oracle sub-units constructed based on the correction formula, which is obtained by solving the atmospheric control equations based on the Runge-Kutta method.
[0034] In one possible implementation, the quantum circuit further includes a second quantum register and a third register, and the prediction correction unit includes a first Oracle subunit, a second Oracle subunit, and a third Oracle subunit.
[0035] The first Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state of the second register evolves to the quantum state |G. j >|G k(j) >;
[0036] The second Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state |G| of the second register is... j >|G k(j) Evolving to a quantum state
[0037] The third Oracle subunit is used to perform quantum state evolution on the qubits of the first, second, and third registers, so that the quantum state of the third register evolves to the quantum state |j>|Δy. j >;
[0038] Among them, G j Let G represent the predicted gradient set of the meteorological variable to be predicted at discrete node j. k(j) This represents the predicted gradient set of the meteorological variables to be predicted for discrete nodes within a preset distance of discrete node j. This represents the set of predicted meteorological variables at discrete node j. Let j represent the set of predicted meteorological variables for discrete nodes within a preset distance from discrete node j. Let Δy represent the set of corrected gradients of the meteorological variable to be predicted at discrete node j. j This represents the increment set of the meteorological variables to be predicted for discrete node j.
[0039] In one possible implementation, the quantum circuit further includes a fourth Oracle subunit for performing decomputation operations on the quantum states of the first register and the second register.
[0040] In one possible implementation, the modified formula is:
[0041] y + =y n +ΔtG n
[0042]
[0043] Among them, y n Let G represent the set of meteorological variables for discrete nodes at time n, where Δt represents the interval between time n and the next time. n y represents the predicted gradient set of the set of meteorological variables at discrete nodes at time n. + G represents the set of predicted weather variables for the next moment. + This represents the set of corrected gradients for the meteorological variables to be predicted at discrete nodes at time n.
[0044] In one possible implementation, the quantum circuit further includes a fifth Oracle subunit, which is used to store the quantum state |j>|Δy corresponding to the increment set of the meteorological variables to be predicted in the third register. j >Evolved into Obtain the non-zero increment set Δy m .
[0045] In one possible implementation, the device further includes:
[0046] The update module is used to update the predicted meteorological variables of the area to be predicted at the current time based on the predicted meteorological variables of the area to be predicted at the next time. It returns to the steps of constructing the first set of meteorological variables and the second set of meteorological variables for each discrete node in the area to be predicted at the current time, so as to obtain the predicted meteorological variables of the area to be predicted at multiple times.
[0047] A third aspect of the present invention provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps of the method described in any one of the first aspects above when running.
[0048] A fourth aspect of the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps of the method described in any of the first aspects above.
[0049] Based on the above technical solution, a first set of meteorological variables and a second set of meteorological variables are constructed for each discrete node in the area to be predicted at the current moment. The first set of variables includes the meteorological variables to be predicted for each discrete node, and the second set of variables includes the meteorological variables to be predicted for discrete nodes at a preset distance from each discrete node. A reasonable data structure is designed, and a quantum circuit is designed based on this data structure. The first set of meteorological variables and the second set of meteorological variables are input into the quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run to obtain the incremental set of the meteorological variables to be predicted for each discrete node. The predicted meteorological variables for the area to be predicted at the next moment are determined based on the incremental set of the meteorological variables to be predicted for each discrete node. Compared with the classical CFD method, this invention reduces the computational complexity, has a significant acceleration effect on computation, and improves the efficiency of meteorological forecasting. Attached Figure Description
[0050] Figure 1 This is a hardware structure block diagram of a computer terminal for a weather forecasting method according to an exemplary embodiment.
[0051] Figure 2 This is a flowchart illustrating a weather forecasting method according to an exemplary embodiment.
[0052] Figure 3 This is a schematic diagram illustrating the iterative process of a weather forecasting method according to an exemplary embodiment.
[0053] Figure 4 This is a schematic diagram of a QRAM storage data structure according to an exemplary embodiment.
[0054] Figure 5 This is a schematic diagram of a quantum circuit according to an exemplary embodiment.
[0055] Figure 6 This is a block diagram illustrating a weather forecasting device according to an exemplary embodiment. Detailed Implementation
[0056] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0057] The present invention first provides a weather forecasting method, which can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0058] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a system network block diagram of a weather forecasting method provided in an embodiment of the present invention. The system applied to the weather forecasting method may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memory, classical processor, quantum processor and other devices not shown.
[0059] Network 110 is a medium that provides communication links between various devices and computers connected together in a system network used in meteorological forecasting methods. This includes, but is not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The connection method can be wired, wireless communication links, or fiber optic cables.
[0060] Server 120 and client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computational processes. Client 140 may be a personal computer or a network computer, so the data may also be provided by server 120. Wireless device 130 may be a smartphone, tablet, laptop, smart wearable device, etc. Storage unit 150 may include database 151, which can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.
[0061] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application program 162 (application program 173). The application program 162 (application program 173) may be used to implement a quantum algorithm compiled according to the meteorological forecasting method provided in the embodiments of the present invention.
[0062] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0063] It should be noted that a true quantum computer has a hybrid structure, which includes at least... Figure 1 The system consists of two main parts: the classical processing system 160, which is responsible for performing classical calculations and control; and the quantum processing system 170, which is responsible for running quantum programs and thus realizing quantum computing.
[0064] The aforementioned classical processing system 160 and quantum processing system 170 can be integrated into a single device or distributed across two different devices. For example, the first device, including the classical processing system 160, runs a classical computer operating system that provides quantum application development tools and services, as well as the storage and network services required for quantum applications. Users develop quantum applications using the quantum application development tools and services on the second device and send the quantum program to the second device, including the quantum processing system 170, via the network services. The second device runs a quantum computer operating system, which parses the code of the quantum program and compiles it into instructions that can be recognized and executed by the quantum computer control system. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on these instructions.
[0065] In the classic silicon-based processing system 160, the units of the classic processor 161 are CMOS transistors. These computing units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, the number of these computing units in a silicon chip is sufficient; currently, a classic processor contains tens of thousands of computing units. The sufficient number of computing units and the fixed selectable computing logic of the CMOS transistors, such as AND logic, allow for computational efficiency through a combination of numerous CMOS transistors and limited logic functions.
[0066] Unlike the logic units in the classical processing system 160, the basic computational unit of the quantum processor 171 in the quantum processing system 170 is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its available usage time and is not always readily available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is one of the representative indicators of its performance. Each qubit performs computational functions through on-demand configured logic functions. Given the limited number of qubits and the diverse logic functions available in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), X gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum computing requires combining a limited number of qubits with diverse combinations of logic functions to achieve computational effects.
[0067] Based on these differences, the design of logical functions applied to qubits (including the design of whether qubits are used and the design of the efficiency of each qubit's use) is crucial to improving the computational performance of quantum computers and requires specialized design. The aforementioned design considerations for qubits are technical problems that ordinary computing devices do not need to address. Therefore, this invention proposes a weather forecasting method, apparatus, storage medium, and electronic device for implementing weather forecasting in quantum computing, aiming to reduce computational complexity and improve weather forecasting efficiency.
[0068] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a weather forecasting method according to an exemplary embodiment, the method comprising:
[0069] S201. Construct the first set of meteorological variables and the second set of meteorological variables for each discrete node in the region to be predicted at the current time.
[0070] The first set of meteorological variables includes the meteorological variables to be predicted for each discrete node, and the second set of meteorological variables includes the meteorological variables to be predicted for discrete nodes within a preset distance from each discrete node.
[0071] In this embodiment of the invention, the area to be predicted can be gridded to obtain multiple discrete nodes within the area. The meteorological variables to be predicted for each discrete node constitute the first set of meteorological variables for that discrete node, and the meteorological variables to be predicted for discrete nodes within a preset distance from that discrete node constitute the second set of meteorological variables for that discrete node.
[0072] After the area to be predicted is gridded, the minimum distance between each discrete node is one unit length. If the preset distance is set to one unit length, the second set of meteorological variables for discrete node j consists of the meteorological variables to be predicted from the surrounding discrete nodes within one unit length of the discrete node. If the preset distance is set to two units, the second set of meteorological variables consists of the meteorological variables to be predicted from the surrounding discrete nodes within one unit length of the discrete node, and the meteorological variables to be predicted from the discrete nodes within one unit length of the surrounding discrete nodes.
[0073] S202. Input the first and second meteorological variable sets of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run it to obtain the incremental set of meteorological variables to be predicted for each discrete node.
[0074] Among them, the atmospheric control equations can be the equations in various meteorological forecasting models. Taking the current mainstream operational meteorological forecasting model worldwide, the Weather Research and Forecasting Model (WRF), as an example, the WRF model uses the (x,y,η) coordinate system, where x and y are plane coordinates and η is the height-pressure following coordinate, as defined in formula (1):
[0075]
[0076] Where, p d p represents the dry air pressure at any location within the height range of the computational domain. t p represents the maximum altitude air pressure in the computational domain. s It represents the air pressure at the Earth's surface.
[0077] The atmospheric control equations in the WRF model are in the form of equation (2):
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085] The two diagnostic equations are shown in formula (3):
[0086]
[0087]
[0088] In the (x,y,η) coordinate system, the specific forms of some operators in formula (2) are shown in formula (4):
[0089]
[0090]
[0091] The physical quantities represented by the symbols in the above formulas are shown in the table below:
[0092]
[0093]
[0094] The mathematical expression of the atmospheric control equations in the above embodiments is very complex, and can be simplified to the form of formula (5) using quasi-linear partial differential equations:
[0095]
[0096] Where y=[U,V,W,Θ,μ d [,φ,Q] is the set of meteorological variables in the WRF model, G=[G U ,…,G Q [] represents the gradient set of each meteorological variable to be predicted over time.
[0097] For formula (5), y and G need to be discretized in the computational domain space. Here, we will explain the meaning of the subscripts and superscripts of the symbols in the following embodiments.
[0098] For the meteorological variable set y, without considering any time and space discreteness, the meteorological variable set y also contains multiple specific meteorological variables to be predicted, such as U, V, W, ... These different types of meteorological variables to be predicted will be distinguished by the first subscript i∈[0,I] in the following examples.
[0099] Regarding spatial discreteness, the different discrete points will be distinguished by the second subscript j∈[0,J] in the following embodiments.
[0100] To address the temporal discreteness, the meteorological variable sets at different times will be distinguished using the superscript n∈[0,N] in the following examples.
[0101] Understandably, after defining it in the above way, it can be used Let G represent the set of first meteorological variables at discrete node j at time n. It is easy to derive that the function G can be expressed as... Here y i,k It is a discrete function The independent variable is f, where k∈[0,K], k=f k (j) represents the neighboring discrete point numbers required to perform the difference scheme, where j represents the current discrete point number. The function f k The form of f depends on the discretization scheme and the chosen difference scheme. For a given discretization scheme and difference scheme, f k The specific form is also determined. Considering that the range of values for i is finite, we can... The scope of the independent variable is extended to This can greatly improve the consistency of data encoding operations.
[0102] S203. Determine the predicted meteorological variables for the region to be predicted at the next moment based on the increment set of the meteorological variables to be predicted for each discrete node.
[0103] Based on the above technical solution, a first set of meteorological variables and a second set of meteorological variables are constructed for each discrete node in the area to be predicted at the current moment. The first set of variables includes the meteorological variables to be predicted for each discrete node, and the second set of variables includes the meteorological variables to be predicted for discrete nodes at a preset distance from each discrete node. A reasonable data structure is designed, and a quantum circuit is designed based on this data structure. The first set of meteorological variables and the second set of meteorological variables are input into the quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run to obtain the incremental set of the meteorological variables to be predicted for each discrete node. The predicted meteorological variables for the area to be predicted at the next moment are determined based on the incremental set of the meteorological variables to be predicted for each discrete node. Compared with the classical CFD method, this invention reduces the computational complexity, has a significant acceleration effect on computation, and improves the efficiency of meteorological forecasting.
[0104] In another embodiment of the present invention, after determining the predicted meteorological variables for the region to be predicted at the next moment based on the increment set of the predicted meteorological variables for each discrete node in step S203, the method further includes:
[0105] Update the predicted meteorological variables of the region to be predicted at the current time based on the predicted meteorological variables of the region to be predicted at the next time. Return to execute the steps of constructing the first set of meteorological variables and the second set of meteorological variables for each discrete node in the region to be predicted at the current time, and obtain the predicted meteorological variables of the region to be predicted at multiple times.
[0106] like Figure 3 As shown, Figure 3 This is a flowchart illustrating the meteorological forecasting method provided in an embodiment of the present invention. In this embodiment, the meteorological variable to be predicted, y, can be based on the current time t. tPredict the weather variables at time t+1, and then use the predicted weather variables at time t+t to update the weather variable y to be predicted at time t. t Iterative predictions are performed to obtain the predicted meteorological variables for multiple time points after time t.
[0107] In another embodiment of the present invention, the quantum circuit includes an encoding unit and a prediction correction unit; in step S202, the first and second meteorological variable sets of each discrete node are input into the quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run to obtain the incremental set of the meteorological variables to be predicted for each discrete node. Specifically, this can be implemented as follows:
[0108] Step 1: Encode the first and second meteorological variable sets into the qubits of the first register of the quantum circuit based on the encoding unit.
[0109] In this embodiment of the invention, the encoding unit uses QRAM (Quantum Random Access Memory) to achieve fast encoding.
[0110] Specifically, the quantum circuit also includes an address register. A finite number of H gates are used to act on the qubits of the address register, causing the quantum state |0> of the address register to evolve into |j>, where j is the address index of the first and second meteorological variable sets of the discrete node j in the QRAM.
[0111] Taking the second meteorological variable set as an example, which consists of the meteorological variables to be predicted from the surrounding discrete nodes k(j) within one unit length of the discrete node j, and the meteorological variables to be predicted from the discrete nodes z(j) within one unit length of the surrounding discrete nodes k(j), as follows: Figure 4 As shown, Figure 4 This is a data structure in QRAM, consisting of a three-level structure, with the smallest structural unit being [y]. j ,y k(j) ,y z(j) ].
[0112] Among them, y j Let y represent the first set of meteorological variables, containing I meteorological variables to be predicted. j =[y 0,j ,y 1,j ,…,y I,j ].
[0113] y k(j) This represents the meteorological variables to be predicted for the surrounding discrete nodes k(j) within one unit length of discrete node j. Each surrounding discrete node still includes I meteorological variables to be predicted, y k(j) Combined with y jIt can perform data computation of function G on discrete node j.
[0114] y z(j) Let y represent the meteorological variable to be predicted for a discrete node z(j) within one cell length of the surrounding discrete node k(j). k(j) Numerical computation of the function G.
[0115] The first and second meteorological variable sets of discrete node j stored in QRAM can be encoded onto the qubits of the first register, such that the quantum state of the qubits of the first register evolves from |0>|0>|0> to |y>. j >|y k(j) >|y z(j) >
[0116] Step 2: Based on the prediction correction unit, perform quantum state evolution on the qubits of the first register encoding the first and second meteorological variable sets to obtain the gradients and predicted meteorological variables of the first and second meteorological variable sets for each discrete node.
[0117] The prediction correction unit includes multiple Oracle sub-units constructed based on correction formulas, which are obtained by solving the atmospheric control equations using the Runge-Kutta method.
[0118] This invention uses the explicit Runge-Kutta method to solve the atmospheric control equations. First, the left-hand side of equation (5) is finitely divided as shown in equation (6):
[0119]
[0120] The superscripts n and n+Δt represent the current time and the next time, respectively. The processing on the right-hand side of formula (5) is the core of the Runge-Kutta method, which can be generally described by formula (7):
[0121]
[0122] In the above formula, km = Δt, and its goal is to estimate as many meteorological variables as possible within the range of [n, n+Δt]. Then, the weighted average of the evolution of all the estimated meteorological variables is used as the evolution of the estimated meteorological variable at time n, and finally the prediction of the meteorological variable at time n+Δt is completed. The more meteorological variables are estimated, the higher the accuracy of the final prediction.
[0123] Taking the second-order Runge-Kutta method as an example, formula (5) can be written as formula (8):
[0124] y n+Δt =y n +Δt(ω i G n+im +ωj G n+jm )
[0125] For G n+ip G n+jp In G n Performing a Taylor expansion at the given point and retaining only the first-order terms, we have formula (9):
[0126] G n+i p =G n +G n′ ·im
[0127] G n+jp =G n +G n′ ·jm
[0128] For y n+Δt In y n Performing a Taylor expansion at the given point and retaining only the second-order terms, we have formula (10).
[0129]
[0130] Substituting formulas (9) and (10) into the left and right sides of formula (8) respectively, we get formula (11):
[0131]
[0132] After comparing each item, formula (12) can be easily obtained:
[0133] ω i +ω j =1
[0134]
[0135] Let m = Δt, such that i,j are transformed into real numbers in [0,1]. Formula (12) is finally transformed into formula (13):
[0136] ω i +ω j =1
[0137]
[0138] The Runge-Kutta method in this embodiment of the invention is an explicit computation method. Taking the second-order scheme described above as an example, the solution process for each time step is as follows:
[0139] The first step is to calculate y. n+iΔt =y n +iΔtG n Thus, G is obtained. n+iΔt ;
[0140] The second step is to calculate y. n+jΔt =y n +jΔtG n Thus, G is obtained. n+jΔt ;
[0141] The third step is to calculate y. n+Δt =y n +Δt(ω i G n+iΔt +ω j G n+jΔt ), complete the calculation.
[0142] In practical applications, i = 0 is usually chosen to save on the computation in the first step. At this point, it is sufficient that ω0 = 1 - λ, ω j All solutions with λ = 0.5 and λj = 0.5 constitute a family of second-order Runge-Kutta schemes. In the following examples, we will focus on the specific scheme of λ = 0.5, j = 1, i = 0. Under this scheme, the above computational process can be optimized as follows:
[0143] The first step is to calculate y. + =y n +ΔtG n Thus, G is obtained. + ;
[0144] The second step is to correct... Complete the calculation.
[0145] The resulting correction formula is:
[0146] y + =y n +ΔtG n
[0147]
[0148] Among them, y n Let G represent the set of meteorological variables for discrete nodes at time n, where Δt represents the interval between time n and the next time. n y represents the predicted gradient set of the set of meteorological variables at discrete nodes at time n. + G represents the set of predicted weather variables for the next moment. + This represents the set of corrected gradients for the meteorological variables to be predicted at discrete nodes at time n.
[0149] Step 3: Calculate the increment set of the meteorological variables to be predicted for each discrete node based on the estimated gradient set and the corrected gradient set.
[0150] Specifically, the quantum circuit also includes a second quantum register and a third register, and the prediction correction unit includes a first Oracle subunit, a second Oracle subunit, and a third Oracle subunit.
[0151] The first Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state of the second register evolves to the quantum state |G corresponding to the gradient of the first and second meteorological variable sets. j >|G k(j) >
[0152] The second Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state |G of the second register is... j >|G k(j) Evolving to a quantum state
[0153] The third Oracle subunit is used to perform quantum state evolution on the qubits of the first, second, and third registers, so that the quantum state of the third register evolves to the quantum state |j>|Δy. j >
[0154] Among them, G j Let G represent the predicted gradient set of the meteorological variable to be predicted at discrete node j. k(j) This represents the predicted gradient set of the meteorological variables to be predicted for discrete nodes within a preset distance of discrete node j. This represents the set of predicted meteorological variables at discrete node j. Let j represent the set of predicted meteorological variables for discrete nodes within a preset distance from discrete node j. Let Δy represent the set of corrected gradients of the meteorological variable to be predicted at discrete node j. j This represents the increment set of the meteorological variables to be predicted for discrete node j.
[0155] Optionally, the quantum circuit also includes a fourth Oracle subunit, which is used to perform decomputation operations on the quantum states of the first and second registers.
[0156] like Figure 5 As shown, Figure 5 This is a schematic diagram of a quantum circuit provided in an embodiment of the present invention, in which a superposition state is constructed by acting on the qubits of the address register with a finite number of H gates:
[0157] O H |0>→|j>
[0158] The first and second sets of meteorological variables are encoded on the qubits of the first register based on QRAM:
[0159] Figure 5 China O G1 and O G2 Constitutes the first Oracle subunit, O G1 Algebraic computation is performed on the qubits of the first and second registers. The following quantum state evolution occurs:
[0160] O G1 |j>|y j >|y k(j) >|y z(j) >→|j>|y j >|y k(j) >|y z(j) >|G j >
[0161] O G1 The qubits acting on the first and second registers are transmitted via y. z(j) Algebraic calculations are performed to obtain G. k(j) The following quantum state evolution occurs:
[0162] O G2 |j>|y j >|y k(j) >|y z(j) >|G j >→|j>|y j >|y k(j) >|y z(j) >|G j >|G k(j) >
[0163] Figure 5 China O F1 O F2 and O G3 Constitutes the second Oracle subunit, O F1 The qubits acting on the first and second registers, based on y j G j and the corrected formula y + =y n +ΔtG n Perform algebraic calculations to obtain Achieve the following quantum state evolution:
[0164]
[0165] O F2 The qubits acting on the first and second registers are generated by y. k(j) and G k(j) Perform algebraic calculations to obtain the values at adjacent discrete nodes. Achieve the following quantum state evolution
[0166]
[0167] O G3 Based on the qubits acting on the first and second registers, Algebraic calculations can yield the following results. Achieve the following quantum state evolution:
[0168]
[0169] Figure 5 China O S For the third Oracle subunit, O S The qubits operating on the first, second, and third registers are based on y j G j , and formula Algebraic calculations can be performed to obtain the increment set Δy of the meteorological variables to be predicted at discrete node j. j The following quantum state evolution is achieved:
[0170]
[0171] O b The fourth Oracle subunit acts on the qubits of the first and second registers, representing an intermediate quantity of the non-target result stored in the first and second registers. Perform a decomputation operation to achieve the following quantum state evolution:
[0172]
[0173] In another embodiment of the present invention, the quantum circuit further includes a fifth Oracle subunit, which is used to store the quantum state |j>|Δy corresponding to the increment set of the meteorological variable to be predicted in the third register. j >Evolved into Obtain the non-zero increment set Δy m .
[0174] The quantum state |j>|Δy is obtained using the method described in the above embodiments. j Afterwards, the quantum state needs to be extracted into classical data. Theoretically, for a non-zero Δy... j All should be extracted if Δy holds for all j∈[0,J]. j If ≠0, then at least O(J) observations are needed to obtain all non-zero Δy. j The overall computational complexity is O(J), but there are some incremental sets Δy.j To maximize quantum advantage and further reduce computational complexity, the value is set to 0. For sets with non-zero increments Δy... m When the number M satisfies M << J, in order to further filter out non-zero Δy m It can be based on the five Oracle subunits including O T Perform the following operations:
[0175]
[0176] The quantum state |j>|Δy is about to be formed. j The information on the basis vectors is converted into information on the amplitude, where L = ... Using L ∞ When the tomography algorithm extracts amplitude information, the complexity will be reduced to The order of magnitude. At this point, the number of non-zero values is no greater than [a certain value]. The order of magnitude is such that the complexity of updating the QRAM data after each iteration step will not exceed [a certain value]. The order of magnitude. Ultimately, the computational complexity at each time step can be obtained as... This can further reduce computational complexity.
[0177] Based on the same inventive concept, embodiments of the present invention also provide a weather forecasting device, such as... Figure 6 As shown, the device includes:
[0178] The construction module 601 is used to construct a first meteorological variable set and a second meteorological variable set for each discrete node in the area to be predicted at the current time. The first meteorological variable set includes the meteorological variables to be predicted for each discrete node, and the second meteorological variable set includes the meteorological variables to be predicted for discrete nodes within a preset distance from each discrete node.
[0179] Input module 602 is used to input the first set of meteorological variables and the second set of meteorological variables of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run it to obtain the incremental set of meteorological variables to be predicted for each discrete node.
[0180] The determination module 603 is used to determine the predicted meteorological variables for the area to be predicted at the next moment based on the increment set of the meteorological variables to be predicted for each discrete node.
[0181] Optionally, the quantum circuit includes an encoding unit and a prediction correction unit; the input module 602 is specifically used for:
[0182] The first set of meteorological variables and the second set of meteorological variables are encoded into the qubits of the first register of the quantum circuit based on the encoding unit.
[0183] Based on the prediction correction unit, the quantum state evolution of the qubits of the first register encoding the first meteorological variable set and the second meteorological variable set is performed to obtain the prediction gradient set and correction gradient set of the first meteorological variable set and the second meteorological variable set for each discrete node.
[0184] The incremental set of meteorological variables to be predicted for each discrete node is calculated based on the predicted gradient set and the corrected gradient set; the predicted correction unit includes multiple Oracle sub-units constructed based on the correction formula, which is obtained by solving the atmospheric control equations based on the Runge-Kutta method.
[0185] Optionally, the quantum circuit further includes a second quantum register and a third register, and the prediction correction unit includes a first Oracle subunit, a second Oracle subunit, and a third Oracle subunit;
[0186] The first Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state of the second register evolves to the quantum state |G. j >|G k(j) >;
[0187] The second Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state |G| of the second register is... j >|G k(j) Evolving to a quantum state
[0188] The third Oracle subunit is used to perform quantum state evolution on the qubits of the first, second, and third registers, so that the quantum state of the third register evolves to the quantum state |j>|Δy. j >;
[0189] Among them, G j Let G represent the predicted gradient set of the meteorological variable to be predicted at discrete node j. k(j) This represents the predicted gradient set of the meteorological variables to be predicted for discrete nodes within a preset distance of discrete node j. This represents the set of predicted meteorological variables at discrete node j. Let j represent the set of predicted meteorological variables for discrete nodes within a preset distance from discrete node j. Let Δy represent the set of corrected gradients of the meteorological variable to be predicted at discrete node j. j This represents the increment set of the meteorological variables to be predicted for discrete node j.
[0190] Optionally, the quantum circuit further includes a fourth Oracle subunit, which is used to perform decomputation operations on the quantum states of the first register and the second register.
[0191] Optionally, the correction formula is:
[0192] y + =y n +ΔtG n
[0193]
[0194] Wherein, represents the set of meteorological variables for discrete nodes at time n, represents the interval between time n and the next time, represents the predicted gradient set of the set of meteorological variables for discrete nodes at time n, represents the predicted set of meteorological variables for the next time, and represents the corrected gradient set of the meteorological variables to be predicted for discrete nodes at time n.
[0195] Optionally, the quantum circuit further includes a fifth Oracle subunit, which is used to convert the quantum state |j>|Δy corresponding to the increment set of the meteorological variable to be predicted in the third register. j >Evolved into Obtain the non-zero increment set Δy m .
[0196] Optionally, the device further includes:
[0197] The update module is used to update the predicted meteorological variables of the area to be predicted at the current time based on the predicted meteorological variables of the area to be predicted at the next time. It returns to the steps of constructing the first set of meteorological variables and the second set of meteorological variables for each discrete node in the area to be predicted at the current time, so as to obtain the predicted meteorological variables of the area to be predicted at multiple times.
[0198] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0199] Another embodiment of the present invention provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in the above-described meteorological forecasting method embodiments when running.
[0200] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.
[0201] Another embodiment of the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps described in the above-described weather forecasting method embodiments.
[0202] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.
[0203] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0204] Step 1: Construct the first set of meteorological variables and the second set of meteorological variables for each discrete node in the region to be predicted at the current time.
[0205] Step 2: Input the first and second meteorological variable sets of each discrete node into the quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run it to obtain the incremental set of meteorological variables to be predicted for each discrete node.
[0206] Step 3: Determine the predicted meteorological variables for the region to be predicted at the next moment based on the increment set of the meteorological variables to be predicted for each discrete node.
[0207] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.
Claims
1. A weather forecasting method, characterized in that, The method includes: Construct a first set of meteorological variables and a second set of meteorological variables for each discrete node in the region to be predicted at the current time. The first set of meteorological variables includes the meteorological variables to be predicted for each discrete node, and the second set of meteorological variables includes the meteorological variables to be predicted for discrete nodes within a preset distance from each discrete node. The first and second meteorological variable sets of each discrete node are input into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run to obtain an incremental set of meteorological variables to be predicted for each discrete node. The quantum circuit includes a coding unit for encoding the first and second meteorological variable sets and a prediction correction unit for evolving the coding results. The prediction correction unit includes multiple Oracle sub-units constructed based on correction formulas, which are obtained by solving the atmospheric control equations based on the Runge-Kutta method. The predicted meteorological variables for the region to be predicted at the next moment are determined based on the increment set of the meteorological variables to be predicted for each discrete node.
2. The method according to claim 1, characterized in that, The process involves inputting the first and second meteorological variable sets of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and atmospheric control equations, and running it to obtain an incremental set of meteorological variables to be predicted for each discrete node, including: The first set of meteorological variables and the second set of meteorological variables are encoded into the qubits of the first register of the quantum circuit based on the encoding unit. Based on the prediction correction unit, the quantum state evolution of the qubits of the first register encoding the first meteorological variable set and the second meteorological variable set is performed to obtain the prediction gradient set and correction gradient set of the first meteorological variable set and the second meteorological variable set for each discrete node. The incremental set of meteorological variables to be predicted for each discrete node is calculated based on the predicted gradient set and the corrected gradient set. The predicted correction unit includes multiple Oracle sub-units constructed based on the correction formula, which is obtained by solving the atmospheric control equations based on the Runge-Kutta method.
3. The method according to claim 2, characterized in that, The quantum circuit also includes a second quantum register and a third register, and the prediction correction unit includes a first Oracle subunit, a second Oracle subunit, and a third Oracle subunit. The first Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state of the second register evolves to a quantum state. ; The second Oracle subunit is used to perform quantum state evolution on the qubits of the first and second registers, so that the quantum state of the second register... Evolving to a quantum state ; The third Oracle subunit is used to perform quantum state evolution on the qubits of the first, second, and third registers, so that the quantum state of the third register evolves to a quantum state. ; in, Let j represent the predicted gradient set of the meteorological variable to be predicted at the discrete node j. This represents the predicted gradient set of the meteorological variables to be predicted for discrete nodes within a preset distance of discrete node j. This represents the set of predicted meteorological variables at discrete node j. Let j represent the set of predicted meteorological variables for discrete nodes within a preset distance from discrete node j. Let j represent the set of corrected gradients for the meteorological variable to be predicted at the discrete node j. This represents the increment set of the meteorological variables to be predicted for discrete node j.
4. The method according to claim 3, characterized in that, The quantum circuit further includes a fourth Oracle subunit, which is used to perform decomputation operations on the quantum states of the first register and the second register.
5. The method according to claim 2, characterized in that, The corrected formula is: in, Let n represent the set of meteorological variables for discrete nodes at time n. This represents the interval between time n and the next time. Let n represent the predicted gradient set of the set of meteorological variables for discrete nodes at time n. This represents the set of predicted meteorological variables for the next moment. This represents the set of corrected gradients for the meteorological variables to be predicted at discrete nodes at time n.
6. The method according to claim 3, characterized in that, The quantum circuit also includes a fifth Oracle subunit, which is used to store the quantum states corresponding to the increment set of the meteorological variables to be predicted in the third register. Evolved into To obtain a non-zero increment set .
7. The method according to any one of claims 1-6, characterized in that, After determining the predicted meteorological variables for the region to be predicted at the next time step based on the increment set of the predicted meteorological variables for each discrete node, the method further includes: Update the predicted meteorological variables of the region to be predicted at the current time based on the predicted meteorological variables of the region to be predicted at the next time. Return to execute the steps of constructing the first set of meteorological variables and the second set of meteorological variables for each discrete node in the region to be predicted at the current time, and obtain the predicted meteorological variables of the region to be predicted at multiple times.
8. A weather forecasting device, characterized in that, The device includes: The construction module is used to construct a first set of meteorological variables and a second set of meteorological variables for each discrete node in the area to be predicted at the current time. The first set of meteorological variables includes the meteorological variables to be predicted for each discrete node, and the second set of meteorological variables includes the meteorological variables to be predicted for discrete nodes within a preset distance from each discrete node. An input module is used to input the first set of meteorological variables and the second set of meteorological variables of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run it to obtain an incremental set of meteorological variables to be predicted for each discrete node; the quantum circuit includes an encoding unit for encoding the first set of meteorological variables and the second set of meteorological variables and an estimation correction unit for evolving the encoding results, wherein the estimation correction unit includes multiple Oracle sub-units constructed based on correction formulas, the correction formulas being obtained by solving the atmospheric control equations based on the Runge-Kutta method; The determination module is used to determine the predicted meteorological variables for the region to be predicted at the next time step based on the increment set of the meteorological variables to be predicted for each discrete node.
9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 7 when it is run.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for acquiring real-time equivalent salt deposit density
CN114113929A
Meteorological prediction method based on variable component sub-line and related equipment
CN115144934A