Quantum weather forecasting method and device
Through variable component quantum linear solver and density matrix observation technology, the hardware resource consumption problem caused by Hamiltonian decomposition in quantum weather forecast is solved, and efficient weather forecast on NISQ equipment is achieved, reducing calculation costs and improving accuracy .
Patent Information
- Application Number
- CN202410981071.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-12
AI Technical Summary
The existing quantum weather forecasting technology requires decomposition of Hamiltonian quantum devices in noise medium-scale quantum devices, resulting in excessive hardware resource consumption and high computing costs.
The Hamiltonian decomposition is used to use a variable component quantum linear solver, and the loss function is estimated through random perturbation and density matrix observations, and the parameters are adjusted to reduce the calculation cost and avoid directly measuring the Hamiltonian.
Efficiently implement linear equation solutions for quantum weather forecasts on NISQ equipment, reducing hardware resource dependence and calculation costs, and improving prediction accuracy and efficiency.
Smart Images

Figure CN118939932A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing technology, and in particular to a quantum weather forecasting method and device. Background Art
[0002] Weather forecasting is a scientific method used to predict the meteorological conditions of a certain area within a certain period of time in the future, including the prediction of temperature, precipitation, humidity, wind speed and other meteorological elements. The importance of weather forecasting lies in that it helps people make decisions in their daily lives and work, reduce the impact of natural disasters, improve agricultural production efficiency, ensure traffic safety, and support emergency management. Accurate weather forecasts can warn people in advance to prepare, thereby avoiding or reducing losses caused by extreme weather events.
[0003] Current weather forecasting technology relies on large-scale meteorological observation networks and data obtained by advanced meteorological satellites. The meteorological observation network includes meteorological stations, meteorological centers and communication systems. Meteorological stations around the world continuously collect atmospheric parameters such as temperature, air pressure, and humidity, and transmit the data to meteorological centers in various places through ground and satellite communication systems. Meteorological satellites provide wide-coverage and continuous observation data, especially in remote areas and over the ocean. After acquiring the data, quantum optimization algorithms, quantum linear algebra algorithms, and quantum machine learning are combined to accelerate and optimize the solution of weather forecast models, thereby processing large-scale data and complex differential equations to achieve more efficient and accurate weather forecasts.
[0004] To implement these calculations on noisy intermediate-scale quantum devices (NISQ devices), the Hamiltonian needs to be decomposed, usually into linear combinations of Pauli terms, and this decomposition leads to an exponentially growing number of subterms as the number of bits increases, each of which requires an independent quantum circuit to measure, which leads to an exponential growth in the number of observation lines required, greatly consuming hardware resources. Summary of the invention
[0005] The present invention provides a quantum weather forecasting method and device, which can help reduce the hardware resource dependence required for quantum weather forecasting and reduce the computational cost of weather forecasting.
[0006] In order to solve the above technical problems, the first aspect of the present invention discloses a quantum weather forecasting method, which comprises:
[0007] Obtaining a variational quantum linear solver, wherein a linear equation group in the variational quantum linear solver is used to describe the relationship between the data of meteorological influencing factors and time changes;
[0008] Decomposing the Hamiltonian corresponding to the linear equations to obtain a plurality of sub-Hamiltonians;
[0009] Randomly perturbing the quantum state prepared by the variational quantum linear solver, and observing the perturbed quantum state to obtain a density matrix;
[0010] determining a loss function of the variational quantum linear solver according to the sum of each of the sub-Hamiltonians and the trace of the density matrix, and adjusting parameters of the variational quantum linear solver according to the loss function;
[0011] The meteorological influencing factors at the target time are input into the adjusted variational quantum linear solver, and the weather at the target time is determined according to the output result of the adjusted variational quantum linear solver.
[0012] As an optional implementation, in the first aspect of the present invention, the density matrix is obtained by:
[0013] Running N*K of the variational quantum linear solvers, using the output of each variational quantum linear solver as the input of a random quantum circuit, and all the variational quantum linear solvers have the same parameters;
[0014] The output of the random quantum circuit is measured on the computing base to obtain N*K measurement results. According to the formula Calculate and obtain N*H snapshots of the density matrix, where U represents the unitary matrix corresponding to the random quantum circuit;
[0015] Calculate the approximate density matrix corresponding to all the variational quantum linear solvers according to the snapshot Wherein, Q represents the quantum channel from the density matrix to the snapshot;
[0016] According to N*K approximate density matrices Compute the density matrix.
[0017] As an optional embodiment, in the first aspect of the present invention, the random quantum circuit includes a Clifford gate;
[0018] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0019]
[0020] Wherein, n represents the number of quantum bits, R represents the input parameter of the inverse quantum channel, and I represents the unit matrix.
[0021] As an optional implementation, in the first aspect of the present invention, the random quantum circuit includes a Hadamard gate and an S-phase gate;
[0022] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0023]
[0024] Where i represents the index of the quantum bit;
[0025] And, each of the sub-Hamiltonians H m All satisfy locality.
[0026] As an optional implementation, in the first aspect of the present invention, determining the loss function of the variational quantum linear solver according to the sum of the traces of each of the sub-Hamiltonians and the density matrix comprises:
[0027] Divide the approximate density matrices corresponding to all the variational quantum linear solvers into K parts, calculate the algebraic mean of each part, and obtain K algebraic means
[0028] The loss function of the variational quantum linear solver is determined according to the loss function calculation formula, and the loss function calculation formula is: Wherein, median{} represents a median operation, and θ represents a parameter of the variational quantum linear solver.
[0029] As an optional embodiment, in the first aspect of the present invention, the linear equation group is A·x=b, wherein A is a meteorological evolution factor matrix and is used to represent the interaction between the meteorological influencing factors from the current moment to the target moment, x is the value of the meteorological influencing factor to be solved at the target moment, and b is a known meteorological influencing factor vector and is used to represent the known values of the meteorological influencing factors at past moments.
[0030] As an optional implementation, in the first aspect of the present invention, the Hamiltonian H corresponding to the linear equations is
[0031] And, the Hamiltonian corresponding to the linear equations is decomposed to obtain a plurality of sub-Hamiltonians, including:
[0032] The Hamiltonian is decomposed on the Pauli basis as follows:
[0033]
[0034] σ n ∈[I,X,Y,Z];
[0035] Among them, M represents the total number of terms after decomposition, αm represents the weight of the mth decomposition term in the Hamiltonian H, and X, Y, and Z all represent Pauli matrices;
[0036] The H m as a sub-Hamiltonian.
[0037] The second aspect of the present invention discloses a quantum weather forecasting device, the device comprising:
[0038] A construction module is used to obtain a variational quantum linear solver, wherein a linear equation group in the variational quantum linear solver is used to describe the relationship between the data of meteorological influencing factors and time changes;
[0039] A decomposition module, used for decomposing the Hamiltonian corresponding to the linear equations to obtain multiple sub-Hamiltonians;
[0040] A perturbation module, used for randomly perturbing the quantum state prepared by the variational quantum linear solver, and observing the perturbed quantum state to obtain a density matrix;
[0041] An adjustment module, configured to determine a loss function of the variational quantum linear solver according to the sum of each of the sub-Hamiltonians and the trace of the density matrix, and to adjust parameters of the variational quantum linear solver according to the loss function;
[0042] The prediction module inputs the meteorological influencing factors at the target time into the adjusted variational quantum linear solver, and determines the weather at the target time according to the output result of the adjusted variational quantum linear solver.
[0043] As an optional implementation, in the second aspect of the present invention, the density matrix in the adjustment module is obtained in the following manner:
[0044] Running N*K of the variational quantum linear solvers, using the output of each variational quantum linear solver as the input of a random quantum circuit, and all the variational quantum linear solvers have the same parameters;
[0045] The output of the random quantum circuit is measured on the computing base to obtain N*K measurement results. According to the formula Calculate and obtain N*H snapshots of the density matrix, where U represents the unitary matrix corresponding to the random quantum circuit;
[0046] Calculate the approximate density matrix corresponding to all the variational quantum linear solvers according to the snapshot Wherein, Q represents the quantum channel from the density matrix to the snapshot;
[0047] According to N*K approximate density matrices Compute the density matrix.
[0048] As an optional implementation, in the second aspect of the present invention, the random quantum circuit in the adjustment module includes a Clifford gate;
[0049] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0050]
[0051] Wherein, n represents the number of quantum bits, R represents the input parameter of the inverse quantum channel, and I represents the unit matrix.
[0052] As an optional implementation, in the second aspect of the present invention, the random quantum circuit in the adjustment module includes a Hadamard gate and an S phase gate;
[0053] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0054]
[0055] Where i represents the index of the quantum bit;
[0056] And, each of the sub-Hamiltonians H m All satisfy locality.
[0057] As an optional implementation, in the second aspect of the present invention, the step of determining the loss function of the variational quantum linear solver according to the sum of the traces of each of the sub-Hamiltonians and the density matrix in the adjustment module includes:
[0058] Divide the approximate density matrices corresponding to all the variational quantum linear solvers into K parts, calculate the algebraic mean of each part, and obtain K algebraic means
[0059] The loss function of the variational quantum linear solver is determined according to the loss function calculation formula, and the loss function calculation formula is: Wherein, median{} represents a median operation, and θ represents a parameter of the variational quantum linear solver.
[0060] As an optional embodiment, in the second aspect of the present invention, the group of linear equations in the building module is A·x=b, wherein A is a meteorological evolution factor matrix and is used to represent the interaction between the meteorological influencing factors from the current moment to the target moment, x is the value of the meteorological influencing factor to be solved at the target moment, and b is a known meteorological influencing factor vector and is used to represent the known values of the meteorological influencing factors at past moments.
[0061] As an optional implementation, in the second aspect of the present invention, the Hamiltonian H corresponding to the linear equations in the decomposition module is
[0062] And, the Hamiltonian corresponding to the linear equations is decomposed to obtain a plurality of sub-Hamiltonians, including:
[0063] The Hamiltonian is decomposed on the Pauli basis as follows:
[0064]
[0065] σ n ∈[I,X,Y,Z];
[0066] Among them, M represents the total number of terms after decomposition, α m represents the weight of the mth decomposition term in the Hamiltonian H, X, Y, Z all represent Pauli matrices, and I represents the identity matrix;
[0067] The H m as a sub-Hamiltonian.
[0068] The third aspect of the present invention discloses another quantum weather forecasting device, the device comprising:
[0069] A memory storing executable program code;
[0070] a processor coupled to the memory;
[0071] The processor calls the executable program code stored in the memory to execute the quantum weather forecasting method disclosed in the first aspect of the present invention.
[0072] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the quantum weather forecasting method disclosed in the first aspect of the present invention.
[0073] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0074] The present invention estimates the observed expected value of the Hamiltonian through shadow tomography, avoiding direct measurement of the Hamiltonian, thereby making it possible to efficiently solve the linear equations for quantum weather forecasting on NISQ equipment, reducing the hardware resource dependence required for quantum weather forecasting and reducing the computational cost of weather forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0076] Figure 1 It is a flow chart of a quantum weather forecasting method disclosed in an embodiment of the present invention;
[0077] Figure 2 It is a schematic diagram of the structure of a quantum weather forecasting device disclosed in an embodiment of the present invention;
[0078] Figure 3 is a schematic structural diagram of another quantum weather forecasting device disclosed in an embodiment of the present invention;
[0079] Figure 4 is the information of the variational quantum linear solver used for the experiment provided by the present invention;
[0080] Figure 5 It is a relationship diagram between the result error of the method provided by the present invention and the quantity of the variational quantum linear solver. DETAILED DESCRIPTION
[0081] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0082] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.
[0083] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0084] The present invention discloses a quantum weather forecasting method and device, which can avoid direct measurement of the Hamiltonian, so that the linear equations for quantum weather forecasting can be efficiently solved on the NISQ device, reducing the hardware resource dependence required for quantum weather forecasting and reducing the computational cost of weather forecasting. The following are detailed descriptions.
[0085] Embodiment 1
[0086] See also Figure 1 , Figure 1 : is a flow chart of a quantum weather forecasting method disclosed in an embodiment of the present invention. Figure 1 The quantum weather forecasting method described can be applied to ocean weather forecasting, mountain weather forecasting, urban weather forecasting, etc., and the embodiments of the present invention do not limit this. Figure 1 As shown, the quantum weather forecasting method may include the following operations:
[0087] 101. Obtain a variational quantum linear solver, wherein a linear equation group in the variational quantum linear solver is used to describe the relationship between the data of meteorological influencing factors and time changes;
[0088] The linear equations in this embodiment are obtained by time discretization of the weather data evolution equation. The weather data evolution equation is a mathematical model used to describe the change of meteorological influencing factors over time. These equations are based on fluid mechanics, thermodynamics and other related physical laws, and can simulate the dynamic behavior of the atmosphere to predict future weather conditions. For example, the Navier-Stokes equations, atmospheric dynamics equations, etc.
[0089] The meteorological influencing factors in this embodiment refer to various physical quantities that affect the state of the atmosphere and weather changes. These physical quantities include temperature, air pressure, humidity, wind speed, wind direction, etc., which together determine the dynamic changes and forecasts of the weather. These factors affect the formation, evolution and movement of the weather system through complex interactions and feedback mechanisms.
[0090] 102. Decompose the Hamiltonian corresponding to the linear equations to obtain multiple sub-Hamiltonians;
[0091] 103. Randomly perturb the quantum state prepared by the variational quantum linear solver, and obtain a density matrix by observing the perturbed quantum state;
[0092] 104. Determine a loss function of a variational quantum linear solver according to the sum of the traces of each sub-Hamiltonian and the density matrix, and adjust parameters of the variational quantum linear solver according to the loss function;
[0093] In this embodiment, adjusting the parameters of the variational quantum linear solver according to the loss function refers to adjusting the parameters of the variational quantum linear solver until the value of the loss function is less than a preset loss threshold.
[0094] In this embodiment, the loss L of the variational quantum linear solver is:
[0095]
[0096] Where ψ is the quantum state prepared by the variational quantum linear solver, L m is the loss corresponding to each sub-Hamiltonian.
[0097] In this embodiment, the parameters of the variational quantum linear solver are adjusted according to the loss function, and a gradient descent method, a stochastic gradient descent method, etc. may be used, which is not limited in the embodiment of the present invention.
[0098] 105. Input the meteorological factors at the target time into the adjusted variational quantum linear solver, and determine the weather at the target time according to the output result of the adjusted variational quantum linear solver.
[0099] It can be seen that the implementation of this embodiment can avoid direct measurement of the Hamiltonian, so that the linear equations for quantum weather forecasting can be efficiently solved on the NISQ device, reducing the hardware resource dependence required for quantum weather forecasting and reducing the computational cost of weather forecasting.
[0100] In an optional embodiment, the density matrix is obtained in the following manner:
[0101] Run N*K variational quantum linear solvers, and use the output of each variational quantum linear solver as the input of the random quantum circuit. The parameters of all variational quantum linear solvers are the same.
[0102] Measure the output of random quantum circuits on the computational basis and obtain N*K measurement results According to the formula Calculate and obtain N*K snapshots of density matrices, where U represents the unitary matrix corresponding to the random quantum circuit. represents conjugate transpose, |> represents right arrow, <| represents left arrow;
[0103] Calculate the approximate density matrix corresponding to all variational quantum linear solvers based on the snapshot Where Q represents the quantum channel from density matrix to snapshot;
[0104] According to N*K approximate density matrices Compute the density matrix.
[0105] It can be seen that this embodiment runs multiple variational quantum linear solvers and uses the measurement results of random quantum circuits to calculate the approximate density matrix, and then calculates the density matrix based on these approximate density matrices. This can effectively reduce the noise and error of a single measurement and improve the estimation accuracy of the density matrix, thereby improving the overall performance and prediction accuracy of the variational quantum linear solver, and further improving the prediction accuracy and efficiency of weather forecasts.
[0106] In another alternative embodiment, the random quantum circuit comprises a Clifford gate;
[0107] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0108]
[0109] Among them, n represents the number of quantum bits, R represents the input parameter of the inverse quantum channel, and I represents the unit matrix.
[0110] In this embodiment, the complexity of estimating the expected value of the density matrix of the quantum state after the action of the random quantum circuit is independent of the number of quantum bits. Only a finite number of times is required to estimate the expected value of the density matrix of the quantum state after the action of the random quantum circuit. For details, please refer to the paper "Predicting many properties of a quantum system from very few measurements", published in Nature Physics (IF 17.6), publication date: 2020-06-22, DOI number: 10.1038 / s41567-020-0932-7.
[0111] It can be seen that this embodiment uses the Clifford gate in the random quantum circuit and uses the inverse quantum channel to calculate the snapshot of the density matrix, thereby ensuring that the calculation of the inverse quantum channel is simple and efficient, and improving the approximate accuracy of the density matrix, thereby improving the overall performance of the variational quantum linear solver and enhancing the accuracy and reliability of quantum weather forecasting.
[0112] In yet another optional embodiment, the random quantum circuit includes a Hadamard gate and an S-phase gate;
[0113] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0114]
[0115] Where i represents the index of the quantum bit;
[0116] And, each sub-Hamiltonian H m All satisfy the locality property, that is, There are only w σ mi ≠I, and w<<n; wherein m represents the index of the sub-Hamiltonian, and X, Y, and Z all represent Pauli matrices.
[0117] In this embodiment, the complexity upper bound of the estimation of the expected value of the density matrix of the quantum state after the random quantum circuit is applied is related to the local properties of the Hamiltonian, and has nothing to do with the exponential level of the number of quantum bits. Since the Hamiltonian has local properties, only a small number of non-unit Pauli matrices are involved in the calculation, and the upper bound of the complexity is only proportional to the exponential level of the number of non-unit Pauli matrices in the local operation.
[0118] It can be seen that this embodiment uses the Hadamard gate and the S-phase gate in the random quantum circuit and adopts a specific inverse quantum channel form so that each sub-Hamiltonian satisfies specific conditions. This optimizes the structure of the random quantum circuit, improves the stability and computational efficiency of the quantum circuit, and further improves the accuracy and reliability of quantum weather forecasting.
[0119] In yet another optional embodiment, determining the loss function of the variational quantum linear solver according to the sum of the traces of each sub-Hamiltonian and the density matrix includes:
[0120] Divide the approximate density matrices corresponding to all variational quantum linear solvers into K parts, calculate the algebraic mean of each part, and obtain K algebraic means
[0121] The loss function of the variational quantum linear solver is determined according to the loss function calculation formula. The loss function calculation formula is: Among them, median{} represents the median operation, and θ represents the parameters of the variational quantum linear solver.
[0122] It can be seen that this optional embodiment can effectively reduce the statistical error and noise in a single measurement by dividing the approximate density matrix corresponding to all variational quantum linear solvers into multiple parts and calculating the algebraic mean of each part, and then taking the median of these averages to calculate the loss function, thereby improving the accuracy and reliability of quantum weather forecasting.
[0123] In another optional embodiment, the linear equation group is A·x=b, wherein A is the meteorological evolution factor matrix and is used to represent the interaction between meteorological influencing factors from the current moment to the target moment, x is the value of the meteorological influencing factor to be solved at the target moment, and b is a vector of known meteorological influencing factors and is used to represent the known values of the meteorological influencing factors at past moments.
[0124] It can be seen that this optional embodiment uses a set of linear equations to describe the evolution relationship of meteorological influencing factors over time, which can systematically model the dynamic changes of meteorological factors, making the results solved by the variational quantum linear solver more accurate and reliable, thereby improving the accuracy of weather forecasts.
[0125] In another optional embodiment, the Hamiltonian H corresponding to the linear equation system is
[0126] And, the Hamiltonian corresponding to the linear equations is decomposed to obtain multiple sub-Hamiltonians, including:
[0127] The Hamiltonian is decomposed as follows on the Pauli basis:
[0128]
[0129] σ n ∈[I,X,Y,Z];
[0130] Among them, M represents the total number of terms after decomposition, α m represents the weight of the mth decomposition term in the Hamiltonian H, X, Y, Z all represent Pauli matrices, and I represents the identity matrix;
[0131] The H m as a sub-Hamiltonian.
[0132] It can be seen that this optional embodiment utilizes the sparsity and orthogonality of the Pauli matrix to decompose the complex Hamiltonian into more manageable sub-terms, thereby simplifying the calculation process, improving the efficiency and accuracy of the variational quantum linear solver, and further improving the accuracy and efficiency of quantum weather forecasting.
[0133] Embodiment 2
[0134] See also Figure 2 , Figure 2 : is a schematic diagram of the structure of a quantum weather forecasting device disclosed in an embodiment of the present invention. Figure 2 The quantum weather forecasting device described can be applied to ocean weather forecasting, mountain weather forecasting, urban weather forecasting, etc., and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the quantum weather forecasting device includes:
[0135] A construction module 201 is used to obtain a variational quantum linear solver, wherein a linear equation group in the variational quantum linear solver is used to describe the relationship between the data of meteorological influencing factors and time changes;
[0136] A decomposition module 202 is used to decompose the Hamiltonian corresponding to the linear equation system to obtain multiple sub-Hamiltonians;
[0137] The perturbation module 203 is used to randomly perturb the quantum state prepared by the variational quantum linear solver, and obtain a density matrix by observing the perturbed quantum state;
[0138] An adjustment module 204, configured to determine a loss function of a variational quantum linear solver according to the sum of traces of each sub-Hamiltonian and a density matrix, and to adjust parameters of the variational quantum linear solver according to the loss function;
[0139] The prediction module 205 inputs the meteorological influencing factors at the target time into the adjusted variational quantum linear solver, and determines the weather at the target time according to the output result of the adjusted variational quantum linear solver.
[0140] It can be seen that the implementation of this embodiment can avoid direct measurement of the Hamiltonian, so that the linear equations for quantum weather forecasting can be efficiently solved on the NISQ device, reducing the hardware resource dependence required for quantum weather forecasting and reducing the computational cost of weather forecasting.
[0141] In an optional embodiment, the density matrix in the adjustment module 204 is obtained in the following manner:
[0142] Run N*K variational quantum linear solvers, and use the output of each variational quantum linear solver as the input of the random quantum circuit. The parameters of all variational quantum linear solvers are the same.
[0143] Measure the output of random quantum circuits on the computational basis and obtain N*K measurement results According to the formula Calculate and obtain N*K snapshots of density matrices, where U represents the unitary matrix corresponding to the random quantum circuit;
[0144] Calculate the approximate density matrix corresponding to all variational quantum linear solvers based on the snapshot Where Q represents the quantum channel from density matrix to snapshot;
[0145] According to N*K approximate density matrices Compute the density matrix.
[0146] This embodiment runs multiple variational quantum linear solvers and uses the measurement results of random quantum circuits to calculate approximate density matrices, and then calculates the density matrix based on these approximate density matrices. This can effectively reduce the noise and error of a single measurement and improve the estimation accuracy of the density matrix, thereby improving the overall performance and prediction accuracy of the variational quantum linear solver, and further improving the prediction accuracy and efficiency of weather forecasts.
[0147] In another optional embodiment, the random quantum circuit in the adjustment module 204 includes a Clifford gate;
[0148] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0149]
[0150] Among them, n represents the number of quantum bits, R represents the input parameter of the inverse quantum channel, and I represents the unit matrix.
[0151] It can be seen that this embodiment uses the Clifford gate in the random quantum circuit and uses the inverse quantum channel to calculate the snapshot of the density matrix, thereby ensuring that the calculation of the inverse quantum channel is simple and efficient, and improving the approximate accuracy of the density matrix, thereby improving the overall performance of the variational quantum linear solver and enhancing the accuracy and reliability of quantum weather forecasting.
[0152] In yet another optional embodiment, the random quantum circuit in the adjustment module 204 includes a Hadamard gate and an S-phase gate;
[0153] And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for:
[0154]
[0155] Where i represents the index of the quantum bit;
[0156] And, each sub-Hamiltonian H m All satisfy locality.
[0157] It can be seen that this embodiment uses the Hadamard gate and the S-phase gate in the random quantum circuit and adopts a specific inverse quantum channel form so that each sub-Hamiltonian satisfies specific conditions. This optimizes the structure of the random quantum circuit, improves the stability and computational efficiency of the quantum circuit, and further improves the accuracy and reliability of quantum weather forecasting.
[0158] In yet another optional embodiment, the adjustment module 204 determines the loss function of the variational quantum linear solver according to the sum of the traces of each sub-Hamiltonian and the density matrix, including:
[0159] Divide the approximate density matrices corresponding to all variational quantum linear solvers into K parts, calculate the algebraic mean of each part, and obtain K algebraic means
[0160] The loss function of the variational quantum linear solver is determined according to the loss function calculation formula. The loss function calculation formula is: Among them, median{} represents the median operation, and θ represents the parameters of the variational quantum linear solver.
[0161] It can be seen that this optional embodiment can effectively reduce the statistical error and noise in a single measurement by dividing the approximate density matrix corresponding to all variational quantum linear solvers into multiple parts and calculating the algebraic mean of each part, and then taking the median of these averages to calculate the loss function, thereby improving the accuracy and reliability of quantum weather forecasting.
[0162] In another optional embodiment, the linear equation group in the construction module 201 is A·x=b, wherein A is a meteorological evolution factor matrix and is used to represent the interaction between meteorological influencing factors from the current moment to the target moment, x is the value of the meteorological influencing factor to be solved at the target moment, and b is a known meteorological influencing factor vector and is used to represent the known values of the meteorological influencing factors at past moments.
[0163] It can be seen that this optional embodiment uses a set of linear equations to describe the evolution relationship of meteorological influencing factors over time, which can systematically model the dynamic changes of meteorological factors, making the results solved by the variational quantum linear solver more accurate and reliable, thereby improving the accuracy of weather forecasts.
[0164] In another optional embodiment, the Hamiltonian H corresponding to the linear equation system is
[0165] And, the Hamiltonian corresponding to the linear equations is decomposed to obtain multiple sub-Hamiltonians, including:
[0166] The Hamiltonian is decomposed as follows on the Pauli basis:
[0167]
[0168] σ n ∈[I,X,Y,Z];
[0169] Among them, M represents the total number of terms after decomposition, α m represents the weight of the mth decomposition term in the Hamiltonian H, X, Y, Z all represent Pauli matrices, and I represents the identity matrix;
[0170] The H m as a sub-Hamiltonian.
[0171] It can be seen that this optional embodiment utilizes the sparsity and orthogonality of the Pauli matrix to decompose the complex Hamiltonian into more manageable sub-terms, thereby simplifying the calculation process, improving the efficiency and accuracy of the variational quantum linear solver, and further improving the accuracy and efficiency of quantum weather forecasting.
[0172] Embodiment 3
[0173] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the structure of another quantum weather forecasting device disclosed in an embodiment of the present invention. Figure 3 As shown, the quantum weather prediction device may include:
[0174] A memory 301 storing executable program codes;
[0175] a processor 302 coupled to the memory 301;
[0176] The processor 302 calls the executable program code stored in the memory 301 to execute the steps in the quantum weather forecasting method described in the first embodiment of the present invention or the second embodiment of the present invention.
[0177] Embodiment 4
[0178] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the quantum weather forecasting method described in Embodiment 1 or Embodiment 2 of the present invention.
[0179] Embodiment 5
[0180] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the quantum weather forecasting method described in Embodiment 1 or Embodiment 2.
[0181] Experimental comparison
[0182] Figure 4 Information about the variational quantum linear solver used for the experiments is presented. Figure 4 RX in the figure indicates the X-axis revolving door, RY indicates the Y-axis revolving door, and RZ indicates the Z-axis revolving door. The brackets after RX, RY, and RZ are the parameter settings for each revolving door.
[0183] In this experiment, 10 quantum bits are selected, 100 random Hamiltonians are constructed, and the loss function of the variational quantum linear solver is calculated.
[0184] If basic chromatography methods are used, the precision is 10 -1 , need 100×3 10 A copy of the quantum state.
[0185] Using the method provided by the present invention, when running N*K variational quantum linear solvers, N takes the values of 102, 204, 408, 816, 1615, 3213, 6409, 12801 respectively, and the value of K is set to 10. Figure 5 The experimental results are shown. Figure 5 The horizontal axis in the middle represents the value of N, the red dot in the figure represents the expected value of the operator O in the quantum state ρ obtained according to the method provided by the present invention, and its vertical axis refers to the vertical axis on the left. The green triangle in the figure represents the relative error percentage between the expected value of the operator O in the quantum state ρ obtained according to the method provided by the present invention and the true value, and its vertical axis refers to the vertical axis on the right.
[0186] Depend on Figure 5 It can be seen that as the value of N increases, the relative error percentage gradually decreases, and when the value of N exceeds 10000, the relative error percentage is within 10%. When the number of quantum bits is larger, the method provided by the present invention has a greater efficiency advantage than the basic tomography method.
[0187] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0188] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0189] Finally, it should be noted that the quantum weather forecasting method and device disclosed in the embodiments of the present invention only disclose the preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A quantum weather forecasting method, characterized in that: The method comprises: Obtaining a variational quantum linear solver, wherein a linear equation group in the variational quantum linear solver is used to describe the relationship between the data of meteorological influencing factors and time changes; Decomposing the Hamiltonian corresponding to the linear equations to obtain a plurality of sub-Hamiltonians; Randomly perturbing the quantum state prepared by the variational quantum linear solver, and observing the perturbed quantum state to obtain a density matrix; determining a loss function of the variational quantum linear solver according to the sum of each of the sub-Hamiltonians and the trace of the density matrix, and adjusting parameters of the variational quantum linear solver according to the loss function; The meteorological influencing factors at the target time are input into the adjusted variational quantum linear solver, and the weather at the target time is determined according to the output result of the adjusted variational quantum linear solver.
2. The quantum weather forecasting method according to claim 1, characterized in that: The density matrix is obtained in the following way: Running N*K of the variational quantum linear solvers, using the output of each variational quantum linear solver as the input of a random quantum circuit, and all the variational quantum linear solvers have the same parameters; The output of the random quantum circuit is measured on the computing base to obtain N*K measurement results. According to the formula Calculate and obtain N*K snapshots of the density matrix, where U represents the unitary matrix corresponding to the random quantum circuit; Calculate the approximate density matrix corresponding to all the variational quantum linear solvers according to the snapshot Wherein, Q represents the quantum channel from the density matrix to the snapshot; According to N*K approximate density matrices Compute the density matrix.
3. The quantum weather forecasting method according to claim 2, characterized in that: The random quantum circuit includes a Clifford gate; And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for: Wherein, n represents the number of quantum bits, R represents the input parameter of the inverse quantum channel, and I represents the unit matrix.
4. The quantum weather forecasting method according to claim 2, characterized in that: The random quantum circuit includes a Hadamard gate and an S phase gate; And, the inverse quantum channel Q of the quantum channel from the density matrix to the snapshot -1 for: Where i represents the index of the quantum bit; And, each of the sub-Hamiltonians H m All satisfy locality.
5. The quantum weather forecasting method according to any one of claims 2 to 4, characterized in that: Determining the loss function of the variational quantum linear solver according to the sum of each of the sub-Hamiltonians and the trace of the density matrix comprises: Divide the approximate density matrices corresponding to all the variational quantum linear solvers into K parts, calculate the algebraic mean of each part, and obtain K algebraic means The loss function of the variational quantum linear solver is determined according to the loss function calculation formula, and the loss function calculation formula is: Wherein, median{} represents a median operation, and θ represents a parameter of the variational quantum linear solver.
6. The quantum weather forecasting method according to any one of claims 1 to 4, characterized in that: The linear equation group is A·x=b, wherein A is the meteorological evolution factor matrix and is used to represent the interaction between the meteorological influencing factors from the current moment to the target moment, x is the value of the meteorological influencing factor to be solved at the target moment, and b is a known meteorological influencing factor vector and is used to represent the known values of the meteorological influencing factors at past moments.
7. The quantum weather forecasting method according to any one of claims 1 to 4, characterized in that: The Hamiltonian H corresponding to the linear equations is: And, the Hamiltonian corresponding to the linear equations is decomposed to obtain a plurality of sub-Hamiltonians, including: The Hamiltonian is decomposed on the Pauli basis as follows: σ n ∈[I,X,Y,Z]; Among them, M represents the total number of terms after decomposition, α m represents the weight of the mth decomposition term in the Hamiltonian H, and X, Y, and Z all represent Pauli matrices; The H m as a sub-Hamiltonian.
8. A quantum weather forecasting device, characterized in that: The device comprises: A construction module is used to obtain a variational quantum linear solver, wherein a linear equation group in the variational quantum linear solver is used to describe the relationship between the data of meteorological influencing factors and time changes; A decomposition module, used for decomposing the Hamiltonian corresponding to the linear equations to obtain multiple sub-Hamiltonians; A perturbation module, used for randomly perturbing the quantum state prepared by the variational quantum linear solver, and observing the perturbed quantum state to obtain a density matrix; An adjustment module, configured to determine a loss function of the variational quantum linear solver according to the sum of each of the sub-Hamiltonians and the trace of the density matrix, and to adjust parameters of the variational quantum linear solver according to the loss function; The prediction module inputs the meteorological influencing factors at the target time into the adjusted variational quantum linear solver, and determines the weather at the target time according to the output result of the adjusted variational quantum linear solver.
9. A quantum weather forecasting device, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the quantum weather forecasting method as described in any one of claims 1-7.
10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, which, when called, are used to execute the quantum weather forecasting method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-target photovoltaic single-phase grid-connected capacity planning method considering three-phase imbalance
CN114123294A
Controllable Hamiltonian evolution-based eigenvalue solving method and equipment
CN117497070A
Methods, kits and arrays for screening for, predicting and identifying donors for hematopoietic cell transplantation, and predicting risk of hematopoietic cell transplant (HCT) to induce graft VS. host disease (GVHD)
US20120277999A1
Cited By
Power grid weather and weather early warning system based on multi-data cloud platform
CN119358773A
A power grid weather warning system based on multi-data cloud platform
CN119358773B
Parameter optimization method and system based on variable component enhanced Bayesian network
CN121765530A
Parameter optimization method and system based on variational quantum augmented bayesian network
CN121765530B
