Meteorological prediction method and device, storage medium and electronic device
By using quantum circuits and Longekuta method to process the meteorological variable set in meteorological prediction, the problem of high complexity in meteorological prediction under CFD technology is solved, and more efficient meteorological prediction is achieved.
Patent Information
- Application Number
- CN202310950108.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2043-07-28
AI Technical Summary
The existing meteorological prediction scheme is based on CFD technology, with high computational complexity, resulting in low prediction efficiency.
By constructing the first and second meteorological variable sets of each discrete node in the area to be predicted at the current moment, and inputting them into the quantum circuit built on the Longguta method and the atmospheric control equations to run, each discrete is obtained The increment set of meteorological variables to be predicted at the node, and then determines the predicted meteorological variables at the next moment.
This reduces the computational complexity, significantly accelerates the meteorological prediction calculation, and improves the meteorological prediction efficiency.
Smart Images

Figure CN119439315A_ABST
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Quantum computers have become a key technology under research because they have the ability to process mathematical problems more efficiently than ordinary computers. For example, they can speed up the time to crack RSA keys from hundreds of years to a few hours.
[0003] Weather forecasting is an important engineering application scenario for computational fluid dynamics (CFD) technology. Since the atmospheric system is quite large, the number of grids and the amount of calculation after gridding the atmospheric system are also extremely large, and the computational complexity of simulation using CFD technology is relatively high, so the current weather forecasting scheme has a low prediction efficiency. Summary of the invention
[0004] The purpose of the present invention is to provide a weather forecasting method, device, storage medium and electronic device, aiming to reduce the computational complexity and improve the efficiency of the current weather forecasting scheme based on CFD technology.
[0005] In order to achieve the above object, a first aspect of an embodiment of the present invention provides a weather forecasting method, the method comprising:
[0006] Constructing a first meteorological variable set and a second meteorological variable set for each discrete node in the to-be-predicted area at the current moment, wherein the first meteorological variable set includes the to-be-predicted meteorological variables of each discrete node, and the second meteorological variable set includes the to-be-predicted meteorological variables of discrete nodes within a preset distance from each discrete node;
[0007] Inputting the first meteorological variable set and the second meteorological variable set of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and running the circuit to obtain an incremental set of meteorological variables to be predicted for each discrete node;
[0008] The predicted meteorological variables of the area to be predicted at the next moment are determined according to the incremental set of the meteorological variables to be predicted at each discrete node.
[0009] In a possible implementation, the quantum circuit includes an encoding unit and an estimation correction unit; the first meteorological variable set and the second meteorological variable set 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, including:
[0010] encoding the first meteorological variable set and the second meteorological variable set onto quantum bits of a first register of the quantum circuit based on the encoding unit;
[0011] Based on the estimation and correction unit, quantum state evolution is performed on the quantum bits of the first register encoding the first meteorological variable set and the second meteorological variable set to obtain an estimated gradient set and a corrected 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 estimated gradient set and the revised gradient set; the estimated revision unit includes a plurality of Oracle subunits constructed based on a revised formula, and the revised formula is obtained by solving the atmospheric control equations based on the Runge-Kutta method.
[0013] In a possible implementation, the quantum circuit further includes a second quantum register and a third register, and the estimation 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 quantum bits of the first register and the second register, 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 quantum bits of the first register and the second register so that the quantum state of the second register |G j >|G k(j) >Evolution to quantum state
[0016] The third Oracle subunit is used to perform quantum state evolution on the quantum bits of the first register, the second register and the third register, so that the quantum state of the third register evolves to a quantum state |j>|Δy j >
[0017] Among them, G j represents the estimated gradient set of the meteorological variable to be predicted at discrete node j, G k(j)represents the estimated gradient set of the meteorological variables to be predicted for discrete nodes within the preset distance of discrete node j, represents the set of estimated meteorological variables at discrete node j, represents the set of estimated meteorological variables of discrete nodes within the preset distance of discrete node j, represents the modified gradient set of the meteorological variable to be predicted at discrete node j, Δy j Represents the incremental set of meteorological variables to be predicted at discrete node j.
[0018] In a possible implementation, the quantum circuit further includes a fourth Oracle subunit, and the fourth Oracle subunit is used to perform a decomposition operation on the quantum states of the first register and the second register.
[0019] In a possible implementation, the correction formula is:
[0020] y + =y n +ΔtG n
[0021]
[0022] Among them, y n represents the meteorological variable set of discrete nodes at time n, Δt represents the interval between time n and the next time, G n Represents the estimated gradient set of the meteorological variable set of the discrete node at time n, y + represents the set of estimated meteorological variables at the next moment, G + Represents the set of corrected gradients of the meteorological variables to be predicted at the discrete nodes at time n.
[0023] In a possible implementation, the quantum circuit further includes a fifth Oracle subunit, which is used to convert the quantum state corresponding to the increment set of the meteorological variable to be predicted in the third register |j>|Δy j >Evolved into Get the non-zero increment set Δy m .
[0024] In a possible implementation, after determining the predicted meteorological variables of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted of each discrete node, the method further includes:
[0025] Based on the predicted meteorological variables of the area to be predicted at the next moment, the predicted meteorological variables of the area to be predicted at the current moment are updated, and the steps of constructing the first meteorological variable set and the second meteorological variable set for each discrete node in the area to be predicted at the current moment are returned to obtain the predicted meteorological variables of the area to be predicted at multiple moments.
[0026] According to a second aspect of an embodiment of the present invention, a weather forecasting device is provided, the device comprising:
[0027] A construction module, used to construct a first meteorological variable set and a second meteorological variable set for each discrete node in the to-be-predicted area at the current moment, wherein the first meteorological variable set includes the to-be-predicted meteorological variables of each discrete node, and the second meteorological variable set includes the to-be-predicted meteorological variables of discrete nodes within a preset distance from each discrete node;
[0028] An input module, used for inputting the first meteorological variable set and the second meteorological variable set of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and running the circuit to obtain an incremental set of meteorological variables to be predicted for each discrete node;
[0029] The determination module is used to determine the predicted meteorological variables of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted of each discrete node.
[0030] In a possible implementation, the quantum circuit includes an encoding unit and an estimation correction unit; the input module is specifically used to:
[0031] encoding the first meteorological variable set and the second meteorological variable set onto quantum bits of a first register of the quantum circuit based on the encoding unit;
[0032] Based on the estimation and correction unit, quantum state evolution is performed on the quantum bits of the first register encoding the first meteorological variable set and the second meteorological variable set to obtain an estimated gradient set and a corrected 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 estimated gradient set and the revised gradient set; the estimated revision unit includes a plurality of Oracle subunits constructed based on a revised formula, and the revised formula is obtained by solving the atmospheric control equations based on the Runge-Kutta method.
[0034] In a possible implementation, the quantum circuit further includes a second quantum register and a third register, and the estimation 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 quantum bits of the first register and the second register, 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 quantum bits of the first register and the second register so that the quantum state of the second register |G j >|G k(j) >Evolution to quantum state
[0037] The third Oracle subunit is used to perform quantum state evolution on the quantum bits of the first register, the second register and the third register, so that the quantum state of the third register evolves to a quantum state |j>|Δy j >
[0038] Among them, G j represents the estimated gradient set of the meteorological variable to be predicted at discrete node j, G k(j) represents the estimated gradient set of the meteorological variables to be predicted for discrete nodes within the preset distance of discrete node j, represents the set of estimated meteorological variables at discrete node j, represents the set of estimated meteorological variables of discrete nodes within the preset distance of discrete node j, represents the modified gradient set of the meteorological variable to be predicted at discrete node j, Δy j Represents the incremental set of meteorological variables to be predicted at discrete node j.
[0039] In a possible implementation, the quantum circuit further includes a fourth Oracle subunit, and the fourth Oracle subunit is used to perform a decomposition operation on the quantum states of the first register and the second register.
[0040] In a possible implementation, the correction formula is:
[0041] y + =y n +ΔtG n
[0042]
[0043] Among them, y n represents the meteorological variable set of discrete nodes at time n, Δt represents the interval between time n and the next time, G n Represents the estimated gradient set of the meteorological variable set of the discrete node at time n, y + represents the set of estimated meteorological variables at the next moment, G + Represents the set of corrected gradients of the meteorological variables to be predicted at the discrete nodes at time n.
[0044] In a possible implementation, the quantum circuit further includes a fifth Oracle subunit, which is used to convert the quantum state corresponding to the increment set of the meteorological variable to be predicted in the third register |j>|Δy j >Evolved into Get the non-zero increment set Δy m .
[0045] In a possible implementation manner, the device further includes:
[0046] The updating module is used to update the predicted meteorological variables of the area to be predicted at the current moment based on the predicted meteorological variables of the area to be predicted at the next moment, and returns to execute the steps of constructing the first meteorological variable set and the second meteorological variable set for each discrete node in the area to be predicted at the current moment to obtain the predicted meteorological variables of the area to be predicted at multiple moments.
[0047] According to a third aspect of an embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the methods described in the first aspect when running.
[0048] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps of any one of the methods described in the first aspect.
[0049] Based on the above technical scheme, by constructing a first meteorological variable set and a second meteorological variable set for each discrete node in the area to be predicted at the current moment, the first variable set includes the meteorological variables to be predicted of each discrete node, and the second variable set includes the meteorological variables to be predicted of discrete nodes at a preset distance from each discrete node; a reasonable data structure is designed, and a quantum circuit is designed based on the data structure, the first meteorological variable set and the second meteorological variable set 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; according to the incremental set of meteorological variables to be predicted for each discrete node, the predicted meteorological variables of the area to be predicted at the next moment are determined. Compared with the classical CFD method, the present invention reduces the computational complexity, has a significant accelerated computing effect, and improves the efficiency of meteorological prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 The present invention is a hardware structure block diagram of a computer terminal of a weather forecasting method according to an exemplary embodiment.
[0051] Figure 2 The present invention is a flow chart of a weather forecasting method according to an exemplary embodiment.
[0052] Figure 3 The invention is a schematic diagram of an iterative process of a weather forecasting method according to an exemplary embodiment.
[0053] Figure 4 FIG. 4 is a schematic diagram of a QRAM storage data structure according to an exemplary embodiment.
[0054] Figure 5 is a schematic diagram of a quantum circuit according to an exemplary embodiment.
[0055] Figure 6 The present invention is a block diagram of a weather forecasting device according to an exemplary embodiment. DETAILED DESCRIPTION
[0056] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0057] The embodiment of 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 describes it in detail by taking running on a computer terminal as an example. Figure 1 1 is a system network block diagram of a weather forecasting method provided by 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 memories, classical processors, quantum processors, and other devices not shown.
[0059] The network 110 is a medium that provides a communication link between various devices and computers connected together in the system network used for the weather forecasting method, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. The connection method may be wired, wireless communication links or optical fiber cables, etc.
[0060] The server 120 and the client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.
[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 162 (application 173). The application 162 (application 173) may be used to implement a quantum algorithm compiled by a meteorological forecasting method provided in an embodiment 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 program executed by it 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 is a hybrid structure, which includes at least Figure 1 There are two major parts in it: 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 calculations.
[0064] The classical processing system 160 and the quantum processing system 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum processing system 170 through the network services thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0065] In the classic processing system 160 based on silicon chips, the unit of the classic processor 161 is a CMOS tube. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and is available at any time. In addition, in the silicon chip, the number of such computing units is also sufficient. At present, the number of computing units in a classic processor is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, for example: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.
[0066] Unlike this logic unit in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a quantum bit, and the input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate) Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. In quantum computing, it is necessary to use limited quantum bits combined with a variety of logical functions to achieve the computing effect.
[0067] Based on these differences, the design of the logical function acting on the quantum bit (including the design of whether the quantum bit is used or not and the design of the efficiency of each quantum bit) is the key to improving the computing performance of the quantum computer, and requires special design. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. Based on this, in order to implement a weather forecasting method in quantum computing, the present invention proposes a weather forecasting method, device, storage medium and electronic device, aiming to reduce the computational complexity and improve the efficiency of weather forecasting.
[0068] like Figure 2 As shown, Figure 2 is a flow chart of a weather forecasting method according to an exemplary embodiment, the method comprising:
[0069] S201, constructing a first meteorological variable set and a second meteorological variable set for each discrete node in the area to be predicted at the current moment.
[0070] The first meteorological variable set includes the meteorological variables to be predicted of each discrete node, and the second meteorological variable set includes the meteorological variables to be predicted of discrete nodes within a preset distance from each discrete node.
[0071] In an embodiment of the present invention, the area to be predicted can be gridded to obtain multiple discrete nodes in the area, and the meteorological variables to be predicted of each discrete node constitute a first meteorological variable set of the discrete node, and the meteorological variables to be predicted of the discrete nodes within a preset distance from the discrete node constitute a second meteorological variable set of the discrete node.
[0072] After the area to be predicted is gridded, the minimum distance between each discrete node is 1 unit length. If the preset distance is set to 1 unit length, the second meteorological variable set of discrete node j is composed of the meteorological variables to be predicted of the surrounding discrete nodes within 1 unit length of the discrete node. If the preset distance is set to 2 units, the second meteorological variable set is composed of the meteorological variables to be predicted of the surrounding discrete nodes within 1 unit length of the discrete node, and the meteorological variables to be predicted of the discrete nodes within 1 unit length of the surrounding discrete nodes.
[0073] S202, inputting the first meteorological variable set and the second meteorological variable set of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and running the circuit to obtain an incremental set of meteorological variables to be predicted for each discrete node.
[0074] The atmospheric control equations can be the equations in various meteorological prediction models. Taking the Weather Research and Forecasting Model (WRF), the mainstream meteorological prediction business model in the world, as an example, the WRF model uses the (x, y, η) coordinate system, where x and y are plane coordinates and η is the height pressure tracking coordinate, which is defined as shown in formula (1):
[0075]
[0076] Among them, p d represents the dry air pressure at any position within the computational domain height range, p t represents the maximum altitude pressure in the computational domain, p s Indicates the surface air pressure.
[0077] The form of the atmospheric control equations in the WRF model is shown in formula (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 meanings of the symbols in the above formulas are shown in the following table:
[0092]
[0093]
[0094] The mathematical expression of the atmospheric control equations in the above embodiment is very complex and can be simplified to the form of formula (5) using a quasi-linear partial differential equation:
[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 evolving over time.
[0097] For formula (5), y and G need to be discretized in the computational domain space. Here, the meanings of the superscripts and subscripts of the symbols in the following embodiments are explained in advance.
[0098] For the meteorological variable set y, without considering any discreteness in time and space, the meteorological variable set y also includes 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 embodiments.
[0099] Regarding the spatial discretization, the numbers of different discrete points will be distinguished by the second subscript j∈[0,J] in the following embodiments.
[0100] With respect to temporal discreteness, meteorological variable sets at different times will be distinguished using the superscript n∈[0,N] in the following embodiments.
[0101] It is understandable that after the above definition, you can use represents the first meteorological variable set of discrete node j at the nth moment. It is easy to deduce that the function G can be expressed as Here i,k is the discretized function The independent variable, where k∈[0,K], k=f k (j) is the number of the adjacent discrete points required to execute the difference format, and j represents the current discrete point number. Function f k The form of f is related to the discrete scheme and the selected difference format. For a certain discrete scheme and difference format, f k The specific form of is also determined. Considering that the value range of i is limited, we can The range of the independent variable is extended to This can greatly improve the consistency of data encoding operations.
[0102] S203: Determine the predicted meteorological variables of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted of each discrete node.
[0103] Based on the above technical scheme, by constructing a first meteorological variable set and a second meteorological variable set for each discrete node in the area to be predicted at the current moment, the first variable set includes the meteorological variables to be predicted of each discrete node, and the second variable set includes the meteorological variables to be predicted of discrete nodes at a preset distance from each discrete node; a reasonable data structure is designed, and a quantum circuit is designed based on the data structure, the first meteorological variable set and the second meteorological variable set 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; according to the incremental set of meteorological variables to be predicted for each discrete node, the predicted meteorological variables of the area to be predicted at the next moment are determined. Compared with the classical CFD method, the present invention reduces the computational complexity, has a significant accelerated computing effect, and improves the efficiency of meteorological prediction.
[0104] In another embodiment of the present invention, after the above S203, determining the predicted meteorological variables of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted of each discrete node, further comprising:
[0105] Based on the predicted meteorological variables of the area to be predicted at the next moment, the predicted meteorological variables of the area to be predicted at the current moment are updated, and the steps of constructing the first meteorological variable set and the second meteorological variable set for each discrete node in the area to be predicted at the current moment are returned to obtain the predicted meteorological variables of the area to be predicted at multiple moments.
[0106] like Figure 3 As shown, Figure 3 The flow chart of the weather forecasting method provided in the embodiment of the present invention is as follows: tPredict the predicted meteorological variables at time t+1, and then use the predicted meteorological variables at time t+t to update the meteorological variables to be predicted y at time t t , perform iterative prediction and obtain the predicted meteorological variables at multiple moments after time t.
[0107] In another embodiment of the present invention, the quantum circuit includes a coding unit and an estimation correction unit; the above S202, inputs the first meteorological variable set and the second meteorological variable set of each discrete node into the quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and runs, to obtain the incremental set of meteorological variables to be predicted for each discrete node. Specifically, it can be implemented as follows:
[0108] Step 1: Encode the first meteorological variable set and the second meteorological variable set onto the quantum bits of the first register of the quantum circuit based on the encoding unit.
[0109] In the embodiment of the present invention, the encoding unit uses QRAM (Quantum Random Access Memory) to achieve fast encoding.
[0110] Specifically, the quantum circuit also includes an address register, which acts on the quantum bits of the address register through a finite number of H gates, so that the quantum state |0> of the address register evolves to |j>, where j is the address index of the first meteorological variable set and the second meteorological variable set of the discrete node j in the QRAM.
[0111] Take the second meteorological variable set consisting of the meteorological variables to be predicted of the surrounding discrete nodes k(j) within one unit length of the discrete node j, and the meteorological variables to be predicted of the discrete node z(j) within one unit length of the surrounding discrete node k(j) as an example, Figure 4 As shown, Figure 4 The data structure in QRAM includes three layers, and the smallest structural unit is [y j ,y k(j) ,y z(j) ].
[0112] Among them, y j represents the first meteorological variable set, which contains I meteorological variables to be predicted, so there is y j =[y 0,j ,y 1,j ,…,y I,j ].
[0113] y k(j) represents the meteorological variables to be predicted of the surrounding discrete nodes k(j) within 1 unit length of discrete node j. Each surrounding discrete node still includes I meteorological variables to be predicted, y k(j) Combined with jThe data calculation of function G on discrete node j can be realized.
[0114] y z(j) Represents the meteorological variable to be predicted of the discrete node z(j) within 1 unit length of the surrounding discrete node k(j), which can achieve y k(j) Numerical calculation of the function G.
[0115] The first meteorological variable set and the second meteorological variable set of the discrete node j stored in the QRAM can be encoded into the quantum bit of the first register, so that the quantum state of the quantum bit of the first register evolves from |0>|0>|0> to |y j >|y k(j) >|y z(j) >.
[0116] Step 2: Based on the estimation correction unit, the quantum state evolution of the quantum bits of the first register encoding the first meteorological variable set and the second meteorological variable set is performed to obtain the gradients and estimated meteorological variables of the first meteorological variable set and the second meteorological variable set of each discrete node.
[0117] Among them, the estimation correction unit includes multiple Oracle sub-units built based on the correction formula, and the correction formula is obtained by solving the atmospheric control equations based on the Runge-Kutta method.
[0118] The embodiment of the present invention uses the explicit Runge-Kutta method to solve the atmospheric control equations. First, the left side of formula (5) is differentiated as shown in formula (6):
[0119]
[0120] The superscripts n and n+Δt represent the current moment and the next moment respectively. The processing on the right 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. The goal is to estimate as many estimated meteorological variables as possible within the range of [n, n+Δt], and then take the weighted average of the evolution of all estimated meteorological variables as the evolution of the estimated meteorological variables at time n, and finally complete the prediction of the meteorological variables at time n+Δt. The more estimated meteorological variables, 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 Do Taylor expansion at and retain the first-order term, and 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 n+Δt In y n Do Taylor expansion at and retain the second-order term, and we have formula (10)
[0129]
[0130] Substituting formula (9) and formula (10) into the left and right ends of formula (8), we get formula (11):
[0131]
[0132] After comparing item by item, it is easy to get formula (12):
[0133] ω i +ω j =1
[0134]
[0135] Let m = Δt, so that i, j are transformed into real numbers within i, j∈[0,1]. Formula (12) is finally transformed into formula (13):
[0136] ω i +ω j =1
[0137]
[0138] The Runge-Kutta method in the embodiment of the present invention is an explicit calculation method. Taking the second-order format introduced above as an example, the solution process for each time step is:
[0139] The first step is to calculate y n+iΔt =y n +iΔtG n , thus we get G n+iΔt ;
[0140] The second step is to calculate y n+jΔt =y n +jΔtG n , thus we get G n+jΔt ;
[0141] Step 3: Calculate y n+Δt =y n +Δt(ω i G n+iΔt +ω j G n+jΔt ) to complete the calculation.
[0142] In practical applications, i = 0 is generally selected to save the amount of calculation in the first step. j =λ,λj=0.5 will form a family of second-order Runge-Kutta formats. In the following embodiments, the specific format of λ=0.5,j=1,i=0 will be selected for introduction. In this format, the above calculation process can be optimized as follows:
[0143] The first step is to calculate y + =y n +ΔtG n , thus we get G + ;
[0144] Step 2: Correction Complete the calculation.
[0145] The obtained correction formula is:
[0146] y + =y n +ΔtG n
[0147]
[0148] Among them, y n represents the meteorological variable set of discrete nodes at time n, Δt represents the interval between time n and the next time, G n Represents the estimated gradient set of the meteorological variable set of the discrete node at time n, y + represents the set of estimated meteorological variables at the next moment, G + Represents the set of corrected gradients of the meteorological variables to be predicted at the discrete nodes at time n.
[0149] Step 3: Calculate the incremental set of meteorological variables to be predicted for each discrete node based on the estimated gradient set and the revised gradient set.
[0150] Specifically, the quantum circuit further includes a second quantum register and a third register, and the estimation 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 quantum bits of the first register and the second register, so that the quantum state of the second register evolves to the quantum state corresponding to the gradient of the first meteorological variable set and the second meteorological variable set |G j >|G k(j) >.
[0152] The second Oracle subunit is used to perform quantum state evolution on the quantum bits of the first register and the second register so that the quantum state of the second register |G j >|G k(j) >Evolution to quantum state
[0153] The third Oracle subunit is used to perform quantum state evolution on the quantum bits of the first register, the second register, and the third register, so that the quantum state of the third register evolves to the quantum state |j>|Δy j >.
[0154] Among them, G j represents the estimated gradient set of the meteorological variable to be predicted at discrete node j, G k(j) represents the estimated gradient set of the meteorological variables to be predicted for discrete nodes within the preset distance of discrete node j, represents the set of estimated meteorological variables at discrete node j, represents the set of estimated meteorological variables of discrete nodes within the preset distance of discrete node j, represents the modified gradient set of the meteorological variable to be predicted at discrete node j, Δy j Represents the incremental set of meteorological variables to be predicted at discrete node j.
[0155] Optionally, the quantum circuit further includes a fourth Oracle subunit, and the fourth Oracle subunit is used to perform a decomposition operation on the quantum states of the first register and the second register.
[0156] like Figure 5 As shown, Figure 5 A schematic diagram of a quantum circuit provided by an embodiment of the present invention, in which a superposition state is constructed by acting on the quantum bits of the address register by a finite number of H gates:
[0157] O H |0>→|j>
[0158] The first meteorological variable set and the second meteorological variable set are encoded on the quantum bits of the first register based on QRAM:
[0159] Figure 5 Medium G1 and O G2 Constitute the first Oracle subunit, O G1 Acting on the quantum bits of the first and second registers to perform algebraic calculations The following quantum state evolution is performed:
[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 Acting on the quantum bits of the first and second registers, through y z(j) Implement algebraic calculation to get G k(j) , and the quantum state evolution is as follows:
[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 Medium F1 , O F2 and O G3 Constitute the second Oracle subunit, O F1 Acting on the quantum bits of the first and second registers, based on y j , G j And the modified formula y + =y n +ΔtG n Performing algebraic calculations, we get The following quantum state evolution is realized:
[0164]
[0165] O F2 Acting on the quantum bits of the first and second registers, y k(j) and G k(j) Perform algebraic calculations to obtain the Realize the following quantum state evolution
[0166]
[0167] O G3 Acting on the quantum bits of the first register and the second register, based on Performing algebraic calculations yields The following quantum state evolution is realized:
[0168]
[0169] Figure 5 Medium S For the third Oracle subunit, O S Acting on the qubits of the first, second and third registers, based on y j , G j , and formula By performing algebraic calculation, we can obtain the incremental set Δy of the meteorological variables to be predicted at discrete node j: j , and the following quantum state evolution is realized:
[0170]
[0171] O b The fourth Oracle subunit acts on the quantum bits of the first register and the second register, and the intermediate quantity of the non-target result stored in the first register and the second register is Perform decomposition operation to realize 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 convert the quantum state corresponding to the increment set of the meteorological variable to be predicted in the third register |j>|Δy j >Evolved into Get the non-zero increment set Δy m .
[0174] Using the method of the above embodiment, we can obtain the quantum state |j>|Δy j >After that, the quantum state needs to be extracted as classical data. Theoretically, for non-zero Δy j All should be extracted if Δy j ≠0, then at least O(J) observations are required to obtain all non-zero Δy j , the complexity of the entire computation process is O(J), but there are some incremental sets Δyj The value is 0. In order to maximize the quantum advantage and further reduce the computational complexity, for non-zero increment sets Δy m When the number M satisfies M<<J, in order to further filter out non-zero Δy m , can be based on the five Oracle subunits including O T Do the following:
[0175]
[0176] The quantum state |j>|Δy j >The information on the basis vector is converted into information on the amplitude, where L = Using L ∞ When the tomographic algorithm extracts amplitude information, the complexity is reduced to Magnitude. At this time, the number of non-zero values is not greater than The complexity of updating QRAM data after each iteration step is no greater than Finally, the computational complexity at each time step can be obtained as The computational complexity can be further reduced.
[0177] Based on the same inventive concept, the embodiment of the present invention also provides a weather forecasting device, such as Figure 6 As shown, the device comprises:
[0178] A 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 moment, wherein the first meteorological variable set includes the meteorological variables to be predicted of each discrete node, and the second meteorological variable set includes the meteorological variables to be predicted of the discrete nodes within a preset distance from each discrete node;
[0179] An input module 602 is used to input the first meteorological variable set and the second meteorological variable set of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run the circuit to obtain an 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 of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted of each discrete node.
[0181] Optionally, the quantum circuit includes an encoding unit and an estimation correction unit; the input module 602 is specifically used for:
[0182] encoding the first meteorological variable set and the second meteorological variable set onto quantum bits of a first register of the quantum circuit based on the encoding unit;
[0183] Based on the estimation and correction unit, quantum state evolution is performed on the quantum bits of the first register encoding the first meteorological variable set and the second meteorological variable set to obtain an estimated gradient set and a corrected gradient set of the first meteorological variable set and the second meteorological variable set for each discrete node;
[0184] An incremental set of meteorological variables to be predicted for each discrete node is calculated based on an estimated gradient set and a revised gradient set; the estimated revision unit includes a plurality of Oracle subunits constructed based on a revised formula, and the revised formula is obtained by solving a group of 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 estimation 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 quantum bits of the first register and the second register, 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 quantum bits of the first register and the second register so that the quantum state of the second register |G j >|G k(j) >Evolution to quantum state
[0188] The third Oracle subunit is used to perform quantum state evolution on the quantum bits of the first register, the second register and the third register, so that the quantum state of the third register evolves to a quantum state |j>|Δy j >
[0189] Among them, G j represents the estimated gradient set of the meteorological variable to be predicted at discrete node j, G k(j) represents the estimated gradient set of the meteorological variables to be predicted for discrete nodes within the preset distance of discrete node j, represents the set of estimated meteorological variables at discrete node j, represents the set of estimated meteorological variables of discrete nodes within the preset distance of discrete node j, represents the modified gradient set of the meteorological variable to be predicted at discrete node j, Δy j Represents the incremental set of meteorological variables to be predicted at discrete node j.
[0190] Optionally, the quantum circuit further includes a fourth Oracle subunit, and the fourth Oracle subunit is used to perform a decomposition operation 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] Among them, represents the meteorological variable set of the discrete node at time n, represents the interval between time n and the next time, represents the estimated gradient set of the meteorological variable set of the discrete node at time n, represents the estimated meteorological variable set at the next time, and represents the revised gradient set of the meteorological variables to be predicted for the discrete node at time n.
[0195] Optionally, the quantum circuit further includes a fifth Oracle subunit, the fifth Oracle subunit being 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 Get the non-zero increment set Δy m .
[0196] Optionally, the device further comprises:
[0197] The updating module is used to update the predicted meteorological variables of the area to be predicted at the current moment based on the predicted meteorological variables of the area to be predicted at the next moment, and returns to execute the steps of constructing the first meteorological variable set and the second meteorological variable set for each discrete node in the area to be predicted at the current moment to obtain the predicted meteorological variables of the area to be predicted at multiple moments.
[0198] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0199] Yet another embodiment of the present invention provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in the above-mentioned weather forecasting method embodiment when running.
[0200] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0201] Yet 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 execute the steps in the above-mentioned weather forecasting method embodiment.
[0202] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0203] Specifically, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0204] Step 1: Construct the first meteorological variable set and the second meteorological variable set for each discrete node in the area to be predicted at the current moment.
[0205] Step 2: Input the first meteorological variable set and the second meteorological variable set of each discrete node into the quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and run them to obtain the incremental set of meteorological variables to be predicted for each discrete node.
[0206] Step 3: Determine the predicted meteorological variables of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted at each discrete node.
[0207] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.
Claims
1. A weather forecasting method, characterized in that: The method comprises: Constructing a first meteorological variable set and a second meteorological variable set for each discrete node in the area to be predicted at the current moment, wherein the first meteorological variable set includes the meteorological variables to be predicted of each discrete node, and the second meteorological variable set includes the meteorological variables to be predicted of discrete nodes within a preset distance from each discrete node; Inputting the first meteorological variable set and the second meteorological variable set of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and running the circuit to obtain an incremental set of meteorological variables to be predicted for each discrete node; The predicted meteorological variables of the area to be predicted at the next moment are determined according to the incremental set of the meteorological variables to be predicted at each discrete node.
2. The method according to claim 1, characterized in that: The quantum circuit includes an encoding unit and an estimation correction unit; the first meteorological variable set and the second meteorological variable set 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, including: encoding the first meteorological variable set and the second meteorological variable set onto quantum bits of a first register of the quantum circuit based on the encoding unit; Based on the estimation and correction unit, quantum state evolution is performed on the quantum bits of the first register encoding the first meteorological variable set and the second meteorological variable set to obtain an estimated gradient set and a corrected 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 estimated gradient set and the revised gradient set; the estimated revision unit includes a plurality of Oracle subunits constructed based on a revised formula, and the revised formula 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 further includes a second quantum register and a third register, and the estimation 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 quantum bits of the first register and the second register, so that the quantum state of the second register evolves to the quantum state |G j >|G k(j) > The second Oracle subunit is used to perform quantum state evolution on the quantum bits of the first register and the second register so that the quantum state of the second register |G j >|G k(j) >Evolution to quantum state The third Oracle subunit is used to perform quantum state evolution on the quantum bits of the first register, the second register and the third register, so that the quantum state of the third register evolves to a quantum state |j>|Δy j > Among them, G j represents the estimated gradient set of the meteorological variable to be predicted at discrete node j, G k(j) represents the estimated gradient set of the meteorological variables to be predicted for discrete nodes within the preset distance of discrete node j, represents the set of estimated meteorological variables at discrete node j, represents the set of estimated meteorological variables of discrete nodes within a preset distance of discrete node j, represents the modified gradient set of the meteorological variable to be predicted at discrete node j, Δy j Represents the incremental set of meteorological variables to be predicted at discrete node j.
4. The method according to claim 3, characterized in that The quantum circuit also includes a fourth Oracle subunit, and the fourth Oracle subunit is used to perform a decomposition operation on the quantum states of the first register and the second register.
5. The method according to claim 2, characterized in that: The correction formula is: and + =and n +ΔtG n Among them, y n represents the meteorological variable set of discrete nodes at time n, Δt represents the interval between time n and the next time, G n Represents the estimated gradient set of the meteorological variable set of the discrete node at time n, y + represents the set of estimated meteorological variables at the next moment, G + Represents the set of corrected gradients of the meteorological variables to be predicted at the discrete nodes at time n.
6. The method according to claim 2, characterized in that The quantum circuit further includes a fifth Oracle subunit, which is used to convert the quantum state corresponding to the increment set of the meteorological variable to be predicted in the third register |j>|Δy j >Evolved into Get the non-zero increment set Δy m .
7. The method according to any one of claims 1 to 6, characterized in that: After determining the predicted meteorological variables of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted of each discrete node, the method further includes: Based on the predicted meteorological variables of the area to be predicted at the next moment, the predicted meteorological variables of the area to be predicted at the current moment are updated, and the steps of constructing the first meteorological variable set and the second meteorological variable set for each discrete node in the area to be predicted at the current moment are returned to obtain the predicted meteorological variables of the area to be predicted at multiple moments.
8. A weather forecasting device, characterized in that: The device comprises: A construction module, used to construct a first meteorological variable set and a second meteorological variable set for each discrete node in the to-be-predicted area at the current moment, wherein the first meteorological variable set includes the to-be-predicted meteorological variables of each discrete node, and the second meteorological variable set includes the to-be-predicted meteorological variables of discrete nodes within a preset distance from each discrete node; An input module, used for inputting the first meteorological variable set and the second meteorological variable set of each discrete node into a quantum circuit constructed based on the Runge-Kutta method and the atmospheric control equations and running the circuit to obtain an incremental set of meteorological variables to be predicted for each discrete node; The determination module is used to determine the predicted meteorological variables of the area to be predicted at the next moment according to the incremental set of the meteorological variables to be predicted of 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 according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Optimization cascade bi-stability based weak transient zero sequence current characteristics extracting method
CN105913042A
Virtual simulation method and system for simulating operation of 2-micron thulium-doped pulse laser
CN114021344A
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
Meteorological data prediction method and device, storage medium and electronic device
CN116011681A