Parameter training method of variable component sub-linear solver and related device

By using the Hessian approximation matrix to update parameters in a variational quantum linear solver, the problem of high computer hardware resource consumption is solved, and a more efficient training process is achieved, which is suitable for parameter training on quantum computers.

CN121638490APending Publication Date: 2026-03-10ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing variational quantum linear solvers (VQLS) suffer from high computer hardware resource consumption and low training efficiency during training, especially in the standard Newton method, where the inversion of the Hessian matrix requires a large amount of memory resources.

Method used

When the gradient norm at the current moment is greater than or equal to the preset shut-off precision standard, the variable parameters are updated through the Hessian approximation matrix, reducing RAM storage requirements. Iterative calculations are performed by combining the gradient and the Hessian approximation matrix, avoiding a large number of memory operations.

Benefits of technology

While saving computer hardware resources, it improves the training efficiency of VQLS, achieving faster convergence speed and higher training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121638490A_ABST
    Figure CN121638490A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a parameter training method of a variable component sub-linear solver and a related device. The method comprises the following steps: calculating the gradient of a quantum circuit in the variable component sub-linear solver under a variable parameter at the current moment; if the norm of the gradient at the current moment is greater than or equal to a preset closing precision standard, determining a Hessian approximation matrix at the current moment according to the variable parameter increment and the gradient increment of the current moment relative to the previous moment; determining a variable parameter of the next moment according to the variable parameter of the current moment, the gradient and the Hessian approximation matrix; and taking the variable parameter of the next moment as the variable parameter of the current moment, and executing the step of calculating the gradient of the quantum circuit under the variable parameter of the current moment. By adopting the embodiment of the invention, the parameter training efficiency of the variable component sub-linear solver can be improved while computer hardware resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quantum computing technology, and in particular to a parameter training method and related apparatus for a variable quantum linear solver. Background Technology

[0002] The Variational Quantum Linear Solver (VQLS) is a variational quantum algorithm for solving systems of linear equations. It employs a classical-quantum hybrid approach—using a classical optimizer to train a parametric quantum circuit, allowing it to run on noisy, medium-scale quantum computers. The overall algorithm is similar to machine learning and is widely applicable to all applications involving solving linear systems and optimization problems, such as computational fluid dynamics (CFD), weather forecasting, and path planning.

[0003] Currently, there are two main methods for training quantum circuits in VQLS: Basic VQLS first uses the quantum circuit to obtain the gradient of the loss function, and then uses gradient descent for parameter updates. This training method has slow convergence speed and low training efficiency. In the standard Newton method, the inverse of the Hessian matrix of the loss function is used to replace the step size in gradient descent. In principle, it has a fast convergence speed and high training efficiency. However, in practical applications, it can be found that the parameter update process of the standard Newton method involves the inversion of the Hessian matrix. In classical computers, a large amount of Random Access Memory (RAM) is required to store the intermediate and final results of the inversion operation, thus consuming significant computational hardware resources. Therefore, there is an urgent need for a VQLS parameter training method that can save computer hardware resources while improving training efficiency. Summary of the Invention

[0004] This application provides a parameter training method and related apparatus for a variable quantum linear solver, which can save computer hardware resources and improve the parameter training efficiency of the variable quantum linear solver.

[0005] The first aspect of this application provides a parameter training method for a variational quantum linear solver, the method comprising:

[0006] Calculate the gradient of the quantum circuit in the variable quantum linear solver under the variable parameters at the current time.

[0007] If the norm of the gradient at the current time is greater than or equal to the preset closing precision standard, then the Hessian approximation matrix at the current time is determined based on the variable parameter increment and gradient increment at the current time relative to the previous time.

[0008] The variable parameters for the next time step are determined based on the variable parameters, gradient, and Hessian approximation matrix at the current time step.

[0009] The variable parameters at the next time step are used as the variable parameters at the current time step, and the gradient of the quantum circuit is calculated under the variable parameters at the current time step as described in the execution step.

[0010] Based on the above scheme, if the norm of the gradient at the current time step is greater than or equal to the preset closing precision standard, the Hessian approximation matrix at the current time step is determined based on the variable parameter increment and gradient increment relative to the previous time step. Then, the variable parameters at the next time step are determined based on the variable parameters, gradient, and Hessian approximation matrix, and iterative calculations are performed. The preset closing precision standard represents the distance from the extreme point; that is, when moving away from the extreme point, the variable parameters are updated using the variable parameters, gradient, and Hessian approximation matrix. Since the Hessian approximation matrix can be easily inverted, it does not require excessive RAM storage for intermediate and final results during the inversion operation, effectively solving the technical problem of memory overflow preventing computation. Therefore, the above scheme can improve the training efficiency of VQSL while saving computer hardware resources.

[0011] In conjunction with the first aspect, in some descriptions of the first aspect, the method further includes:

[0012] If the norm of the gradient at the current moment is greater than the preset program convergence accuracy standard and less than the preset shutdown accuracy standard, then the variable parameters at the next moment are determined based on the variable parameters and gradient at the current moment, and the step is performed to use the variable parameters at the next moment as the variable parameters at the current moment. The preset program convergence accuracy standard is less than the preset shutdown accuracy standard.

[0013] In conjunction with the first aspect, in some descriptions of the first aspect, the method further includes:

[0014] If the norm of the gradient at the current time step is less than or equal to the preset program convergence accuracy standard, then the variable parameter at the current time step is used as the final variable parameter.

[0015] In conjunction with the first aspect, in some descriptions of the first aspect, prior to calculating the gradient of the quantum circuit in the variable quantum linear solver under the variable parameters at the current time, the method further includes:

[0016] Obtain the initial variable parameters of the quantum circuit in the variable quantum linear solver and calculate the initial gradient of the quantum circuit under the values ​​of the initial variable parameters;

[0017] The variable parameters at the current time are calculated based on the initial variable parameters, the initial gradient, and the pre-given initial Hessian approximation matrix.

[0018] In conjunction with the first aspect, in certain descriptions of the first aspect, the calculation of the variable parameters at the current time based on the initial variable parameters, the initial gradient, and a pre-given initial Hessian approximation matrix includes:

[0019] The initial variable parameters, the initial gradient, and the pre-given initial Hessian approximation matrix are respectively used as the variable parameters, gradient, and Hessian approximation matrix at the current time step, and the variable parameters at the next time step are determined based on the variable parameters, gradient, and Hessian approximation matrix at the current time step.

[0020] In conjunction with the first aspect, in certain descriptions of the first aspect, determining the Hessian approximation matrix at the current time based on the variable parameter increment and gradient increment relative to the previous time includes:

[0021] The multiplier terms of the Hessian approximation matrix are determined based on the variable parameter increment and gradient increment of the current time relative to the previous time, as well as the identity matrix; and the linear terms of the Hessian approximation matrix are determined based on the variable parameter increment and gradient increment of the current time relative to the previous time.

[0022] The Hessian approximation matrix at the current time is determined based on the multiplier term and the linear term.

[0023] A second aspect of this application provides a weather forecasting method, the method comprising:

[0024] Obtain a system of linear equations that characterize the relationship between meteorological influencing factor data and time. The constant vector of the system of linear equations is used to characterize the meteorological influencing factor data, and the coefficient matrix of the system of linear equations is used to characterize the interaction between meteorological influencing factors.

[0025] A variable quantum linear solver is constructed based on a first unitary operator for preparing the constant vector, a linear combination of a second unitary operator for preparing the coefficient matrix, and a variable quantum circuit. The parameters of the variable quantum linear solver are trained according to the method described in any embodiment of the first aspect.

[0026] The weather at the target time is predicted based on the variable quantum linear solver.

[0027] Based on the above scheme, a system of linear equations characterizing the relationship between meteorological influencing factor data and time is obtained. The constant vector of this system of linear equations is used to characterize the meteorological influencing factor data, and the coefficient matrix of this system of linear equations is used to characterize the interaction between meteorological influencing factors. A variable quantum linear solver is constructed based on a linear combination of a first unitary operator for preparing the constant vector, a second unitary operator for preparing the coefficient matrix, and a variable quantum circuit. The parameters of the variable quantum linear solver are trained according to the method described in any embodiment of the first aspect. The weather at the target time is predicted based on the variable quantum linear solver. Compared with existing weather forecasting schemes, this scheme adopts the parameter training method in the first aspect, thus achieving faster convergence speed and solving the problem of potential RAM overflow in computer hardware resources. Therefore, this method is more practical. It partially adopts quantum computing, i.e., VQLS, which allows for faster processing speed for large amounts of meteorological data and meets the real-time requirements of weather forecasting.

[0028] A third aspect of this application provides a parameter training apparatus for a variational quantum linear solver, the apparatus comprising:

[0029] The gradient calculation unit is used to calculate the gradient of the quantum circuit in the variable quantum linear solver under the variable parameters at the current time.

[0030] The Hessian approximation matrix determination unit is used to determine the Hessian approximation matrix at the current time based on the variable parameter increment and gradient increment at the current time relative to the previous time if the norm of the gradient at the current time is greater than or equal to a preset closing precision standard.

[0031] The variable parameter unit is used to determine the variable parameters at the next time step based on the variable parameters, gradient, and Hessian approximation matrix at the current time step.

[0032] The iterative loop unit is used to take the variable parameters of the next time step as the variable parameters of the current time step and to perform the step of calculating the gradient of the quantum circuit under the variable parameters of the current time step.

[0033] A fourth aspect of this application provides a weather forecasting device, the device comprising:

[0034] The acquisition unit is used to acquire a set of linear equations that characterize the relationship between meteorological influencing factor data and time. The constant vector of the linear equations is used to characterize the meteorological influencing factor data, and the coefficient matrix of the linear equations is used to characterize the interaction between meteorological influencing factors.

[0035] A construction unit is used to construct a variable quantum linear solver based on a first unitary operator for preparing the constant vector, a linear combination of a second unitary operator for preparing the coefficient matrix, and a variable quantum circuit. The parameters of the variable quantum linear solver are trained according to the method described in any embodiment of the first aspect.

[0036] A prediction unit is used to predict the weather at a target time based on the variable quantum linear solver.

[0037] A fifth aspect of this application provides an electronic device, including: a processor and a memory;

[0038] The processor is connected to a memory, wherein the memory is used to store computer programs and the processor is used to invoke the computer programs to execute the methods as described in the first aspect of the embodiments of this application.

[0039] A sixth aspect of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the method as described in the first aspect of this application. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 An example system block diagram of parameter training for a variational quantum linear solver provided in one embodiment of this application is shown;

[0042] Figure 2 This paper illustrates the overall architecture of a VQLS algorithm provided in one embodiment of this application.

[0043] Figure 3 A flowchart illustrating the parameter training method for a variational quantum linear solver provided in one embodiment of this application is shown.

[0044] Figure 4 A flowchart illustrating a weather forecasting method provided in one embodiment of this application is shown;

[0045] Figure 5 This paper shows a schematic diagram of the structure of a parameter training device for a variational quantum linear solver provided in one embodiment of the present application;

[0046] Figure 6A schematic diagram of the structure of a weather forecasting device provided in one embodiment of this application is shown;

[0047] Figure 7 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown. Detailed Implementation

[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0049] Classical computers use transistors to encode information in binary data, such as bits, where each bit can represent a value of 1 or 0. These 1s and 0s act as switches to drive the functions of a classical computer. If there are n bits of data, there are 2^n possible classical states, and one state is represented at a time.

[0050] Quantum computers use quantum processors that operate on data represented by qubits, also known as quantum bits. A single qubit can represent the classical binary states "0" or "1", or a superposition of "0" and "1". Because it can represent a superposition of "0" and "1", a qubit can represent both "0" and "1" states simultaneously. For example, if there are n bits of data, then 2^n qubits can represent n bits of data. n A quantum state can be represented simultaneously. Furthermore, qubits in a superposition can be correlated with each other, a phenomenon known as entanglement, where the state of one qubit (whether 1, 0, or both) depends on the state of another qubit, and more information can be encoded within two entangled qubits. Based on the principles of superposition and entanglement, qubits enable quantum computers to perform functions that might be relatively complex and time-consuming for classical computers.

[0051] Please refer to Figure 1 This illustrates an example system block diagram for parameter training of a variational quantum linear solver provided in one embodiment of this application. System 100 may be a hybrid computing system comprising a combination of one or more quantum computers, quantum systems, and / or classical computers. Figure 1In the example shown, system 100 may include a quantum system 110 and a classical computer 120. In one implementation, the quantum system 110 and the classical computer 120 may be configured to communicate via one or more wired and / or wireless connections (e.g., wireless networks). The quantum system 110 may include a quantum chipset consisting of one or more quantum chips, comprising various hardware components for processing data encoded in qubits. The quantum chipset may be a quantum computing core surrounded by infrastructure to protect the quantum chips from electromagnetic noise sources, mechanical vibration sources, heat sources, and other noise sources that can degrade the performance of the quantum chips. The classical computer 120 may be electronically integrated with the quantum system 110 via any suitable wired and / or wireless electronic connection.

[0052] exist Figure 1 In the example shown, quantum system 110 can be any suitable set of components capable of performing quantum operations on a physical system. Quantum operations, such as quantum gate operations, manipulate the quantum states of qubits to evolve and / or become entangled. Figure 1 In the illustrated example embodiment, the quantum system 110 may include a measurement and control unit 111, an interface 112, and a quantum chip 113. In some embodiments, all or part of each of the measurement and control unit 111, interface 112, and quantum chip 113 may be located in a cryogenic environment to facilitate the performance of quantum operations. The quantum chip 113 may be any hardware capable of processing information using quantum states. This hardware may include multiple qubits and means for coupling or entanglement of the qubits to process information using quantum states. Qubits may include, but are not limited to, charge qubits, flux qubits, phase qubits, spin qubits, and ion qubits. The quantum chip may include a set of quantum logic gates configured to perform quantum logic operations on the qubits stored in a quantum register. The quantum gates may include one or more single-qubit gates, two-qubit gates, and / or other multi-qubit gates.

[0053] The measurement and control unit 111 can be any combination of digital computing devices capable of performing quantum computing (e.g., executing quantum circuits) in conjunction with interface 112. This digital computing device may include a digital processor and memory for storing and executing quantum instructions using interface 112. The digital computing device may also include a communication protocol device for receiving instructions and sending the results of the performed quantum computing to a classical computer. Additionally, the digital computing device may include a communication interface having interface 112. In one embodiment, the measurement and control unit 111 may be configured to receive classical instructions (e.g., from classical computer 120) and convert these classical instructions into measurement and control instructions for interface 112. The measurement and control instructions provided by the measurement and control unit 111 to interface 112 may be, for example, digital signals indicating which quantum gates in a quantum gate array need to be applied to the qubits to perform a specific function. Interface 112 may be configured to convert these digital signals into analog signals (e.g., analog pulses of microwave pulses), which can be used to apply quantum gates to the qubits to manipulate the interactions between the qubits.

[0054] Interface 112 may be a classical-quantum interface, comprising a combination of devices capable of receiving instructions from the integrated measurement and control unit 111 and converting those instructions into a means for implementing quantum operations. In one embodiment, interface 112 may convert instructions from the integrated measurement and control unit 111 into drive signals capable of driving or manipulating qubits, and / or applying quantum gates to qubits. Additionally, interface 112 may be configured to convert signals received from the quantum chip 113 into digital signals capable of being processed and transmitted by the integrated measurement and control unit 111. Devices included in interface 112 may include, but are not limited to, digital-to-analog converters, analog-to-digital converters, waveform generators, attenuators, amplifiers, optical fibers, lasers, and filters. Interface 112 may further include circuitry configured to measure multiple qubits after the application of quantum gates, wherein the measurements may produce results represented in classical bits. Each measurement performed by interface 112 may be read out to a device connected to the quantum system 110, such as a classical computer 120. The multiple measurement results provided by interface 112 may represent probabilistic results.

[0055] The classical computer 120 can include hardware components such as a processor and storage devices (e.g., including memory devices and classical registers) for processing data encoded in classical bits. In one embodiment, the classical computer 120 can be configured to provide the quantum system 110 with various control signals, instructions, and data encoded in classical bits. Further, quantum states measured by the quantum system 110 can be read out by the classical computer 120, and the classical computer 120 can store the measured quantum states as classical bits in classical registers. In one embodiment, the classical computer 120 can be any suitable combination of computer-executable hardware and / or computer-executable software capable of executing the preparation module 121 to perform quantum computation using data stored in the data storage module 122 as part of the construction and computation. The data storage module 122 can be a repository for data to be analyzed using quantum computing algorithms and the results of that analysis. The preparation module 121 can be a program or module capable of preparing classical data from the data storage module 122 as part of a quantum circuit implementation. Preparation module 121 can be instantiated as part of a larger algorithm, such as an application programming interface (API) function call, or by resolving hybrid classical-quantum computing into aspects of quantum and classical computing. For example, preparation module 121 can generate instructions for creating quantum circuits using quantum gates. In an embodiment, such instructions can be stored by the measurement and control unit 111 and can be instantiated by components of interface 112 to execute, enabling quantum operations of quantum gates to be performed on quantum chip 113.

[0056] The classic computer 120 may be a laptop computer, desktop computer, vehicle-integrated computer, smart mobile device, tablet device, and / or any other suitable classic computing device. Additionally or alternatively, the classic computer 120 may also operate as part of a cloud computing service model, such as Software as a Service (SaaS), Platform as a Service (PaaS), or Infrastructure as a Service (IaaS). The classic computer 120 may also reside in a cloud computing deployment model, such as a private cloud, community cloud, public cloud, or hybrid cloud.

[0057] Please refer to Figure 2 This diagram illustrates the overall architecture of the VQLS algorithm provided in one embodiment of this application. For a detailed explanation of the VQLS algorithm's working principle, please refer to [link / reference]. Figure 2 The linear system of equations A·x=b, where A is the coefficient matrix, b is the constant vector, and x is the unknown quantity to be solved. Using the VQLS algorithm, a quantum state proportional to x can be obtained, i.e., a normalized vector.

[0058] Solving linear equations in a quantum scenario differs slightly from the usual approach because quantum computing requires applying unitary operators to quantum states. For an input coefficient matrix A, it needs to be decomposed into a linear combination of unitary operators, A = ∑ n C n A n , where each A n Both are unitary operators and can run on quantum circuits. For the input constant vector b, it needs to be assumed that it is a quantum state that can be prepared by some unitary operator U, i.e., U|0>=|b>.

[0059] As can be seen, the VQLS algorithm is a hybrid optimization algorithm, which can be divided into classical and quantum parts. It requires preparing a parameterized quantum circuit V(α) on a quantum computer and calculating the loss function C(α). Then, it optimizes the parameter α on a classical computer to minimize the loss function until the loss is below a certain threshold, finally outputting the target quantum state |x>. The parameterized circuit V(α) generates a quantum state |ψ(α)>, and the circuit F(A) calculates the approximation between A|ψ(α)> and |b>, i.e., the loss function C(α). When the quantum state A|ψ(α)> is close enough to |b>, it means that the quantum state |ψ(α)> is close enough to the target quantum state |x>, and the quantum state |ψ(α)> can be output as an approximation of the target quantum state |x>.

[0060] Please refer to Figure 3 This document illustrates a flowchart of a parameter training method for a variational quantum linear solver according to an embodiment of this application. This method can be applied to computer devices, which refer to electronic devices capable of data computation and processing. The method may include the following steps:

[0061] Step 301: Calculate the gradient of the quantum circuit in the variable quantum linear solver under the variable parameters at the current time.

[0062] Here, variable parameters refer to the parameters in the quantum circuit that need to be determined, specifically they can be... Figure 2 In this context, α can be represented by parameters in a parametric quantum logic gate, such as rotation gates RX, RY, and RZ, or U(α) rotating around an arbitrary axis. The gradient of a quantum circuit can be calculated using the parameter-shift rule. The advantage of the parameter-shift rule is that it uses two circuits with the same structure and parameters as the original circuit to calculate its derivative, without requiring any auxiliary qubits.

[0063] Step 302: If the norm of the gradient at the current time is greater than or equal to the preset closing precision standard, then determine the Hessian approximation matrix at the current time based on the variable parameter increment and gradient increment at the current time relative to the previous time.

[0064] A norm is a standard for measuring the size of a vector or matrix, widely used in mathematics, engineering, and computer science. It's a method of mapping vectors or matrices to non-negative real numbers, used to measure their "length" or "size," and can include the Manhattan norm, Euclidean norm, maximal norm, spectral norm, Frobenius norm, etc. For example... Figure 2 In the embodiment, ||x||2 is the Euclidean norm, which represents the square root of the sum of the squares of the vector components. It is only one embodiment, and the norm in this application can also be other norms, which are not limited here.

[0065] Among them, the variable parameter increment is the difference between the variable parameter at the current time and the variable parameter at the previous time, and the gradient increment is the difference between the gradient at the current time and the gradient at the previous time.

[0066] Step 303: Determine the variable parameters for the next time step based on the variable parameters, gradient, and Hessian approximation matrix at the current time step.

[0067] Specifically, the variable parameters for the next time step are determined based on the variable parameters, gradient, and Hessian approximation matrix at the current time step. That is, the variable parameters for the next time step are determined according to the following formula:

[0068]

[0069] Where the current time is k-1, the next time is k, and the variable parameter for the current time is θ. k-1 The gradient at the current time is g. k-1 The Hessian approximation matrix at the current moment is B. k-1 The variable parameter at the next moment is θ k .

[0070] Step 304: Use the variable parameters of the next time step as the variable parameters of the current time step, and perform the step described above to calculate the gradient of the quantum circuit under the variable parameters of the current time step.

[0071] Among them, the closing accuracy standard represents the distance from the extreme point of the loss function.

[0072] Based on the above scheme, if the norm of the gradient at the current time step is greater than or equal to the preset closing precision standard, the Hessian approximation matrix at the current time step is determined based on the variable parameter increment and gradient increment relative to the previous time step. Then, the variable parameters at the next time step are determined based on the variable parameters, gradient, and Hessian approximation matrix, and iterative calculations are performed. The preset closing precision standard represents the distance from the extreme point; that is, when moving away from the extreme point, the variable parameters are updated using the variable parameters, gradient, and Hessian approximation matrix. Since the Hessian approximation matrix can be easily inverted, it does not require excessive RAM storage for intermediate and final results during the inversion operation, effectively solving the technical problem of memory overflow preventing computation. Furthermore, compared to the first convergence of basic VQLS, the technical solution of this application achieves quadratic convergence, resulting in faster convergence and higher training efficiency. In summary, the above scheme can improve the training efficiency of VQSL while saving computer hardware resources.

[0073] In conjunction with the first aspect, in some descriptions of the first aspect, the method further includes:

[0074] If the norm of the gradient at the current moment is greater than the preset program convergence accuracy standard and less than the preset shutdown accuracy standard, then the variable parameters at the next moment are determined based on the variable parameters and gradient at the current moment, and the step is performed to use the variable parameters at the next moment as the variable parameters at the current moment. The preset program convergence accuracy standard is less than the preset shutdown accuracy standard.

[0075] Among them, the program convergence accuracy standard is an indicator used to judge whether the solution is close to the true solution or whether it has reached a sufficient degree of accuracy.

[0076] Specifically, the variable parameters for the next time step are determined based on the variable parameters and gradient at the current time step, i.e., according to the following formula:

[0077] θ k =θ k-1 -g k-1 ,

[0078] Where the current time is k-1, the next time is k, and the variable parameter for the current time is θ. k-1 The gradient at the current time is g. k-1 The variable parameter at the next moment is θ k .

[0079] Based on the above scheme, if the norm of the gradient at the current moment is greater than the preset program convergence accuracy standard and less than the preset shutdown accuracy standard, then the variable parameters at the next moment are determined according to the variable parameters and gradient at the current moment. That is, when approaching the extreme point of the loss function, the basic VSQL method is adopted. Since the scheme in the first aspect is still adopted, it is difficult to guarantee the accuracy of the Hessian approximation matrix. At this time, it is already close to the extreme point, so a large number of iterations will not be performed. The convergence speed of this scheme is already very fast and the training efficiency is high.

[0080] In conjunction with the first aspect, in some descriptions of the first aspect, the method further includes:

[0081] If the norm of the gradient at the current time step is less than or equal to the preset program convergence accuracy standard, then the variable parameter at the current time step is used as the final variable parameter.

[0082] Based on the above scheme, when the norm of the gradient at the current moment is less than or equal to the preset program convergence accuracy standard, it can be determined that the convergence requirement has been met. Therefore, the variable parameter at the current moment can be used as the final variable parameter. It can be seen that the embodiments of this application further determine the iteration termination condition through the preset program convergence accuracy standard, preventing the situation of getting stuck in infinite iteration calculations and being unable to obtain the final variable parameter.

[0083] In conjunction with the first aspect, in some descriptions of the first aspect, prior to calculating the gradient of the quantum circuit in the variable quantum linear solver under the variable parameters at the current time, the method further includes:

[0084] Obtain the initial variable parameters of the quantum circuit in the variable quantum linear solver and calculate the initial gradient of the quantum circuit under the values ​​of the initial variable parameters;

[0085] The variable parameters at the current time are calculated based on the initial variable parameters, the initial gradient, and the pre-given initial Hessian approximation matrix.

[0086] Specifically, the step of calculating the variable parameters at the current time based on the initial variable parameters, the initial gradient, and the pre-given initial Hessian approximation matrix includes:

[0087] The initial variable parameters, the initial gradient, and the pre-given initial Hessian approximation matrix are respectively used as the variable parameters, gradient, and Hessian approximation matrix at the current time step, and the variable parameters at the next time step are determined based on the variable parameters, gradient, and Hessian approximation matrix at the current time step.

[0088] Specifically, for example, the initial Hessian approximation matrix can be an identity matrix.

[0089] In the initial step of the iterative calculation, since there is no previous time step, the formula can be used as follows: Or formula θ k =θ k-1 -g k-1 The initial calculations are then performed. Specifically, it is necessary to determine the norm of the gradient at the initial moment. If the norm of the gradient at the initial moment is greater than or equal to the preset closing precision standard, then the formula is used. The initial variable parameters, initial gradient, and pre-given initial Hessian approximation matrix are used as the variable parameters, gradient, and Hessian approximation matrix at the current time step, respectively, for calculation. If the norm of the gradient at the initial time step is greater than the preset program convergence accuracy standard but less than the preset shutdown accuracy standard, then formula θ is used. k =θ k-1 -g k-1 And the initial variable parameters and initial gradient are used as the variable parameters and gradient at the current time step, respectively, for calculation.

[0090] In conjunction with the first aspect, in certain descriptions of the first aspect, determining the Hessian approximation matrix at the current time based on the variable parameter increment and gradient increment relative to the previous time includes:

[0091] The multiplier terms of the Hessian approximation matrix are determined based on the variable parameter increment and gradient increment of the current time relative to the previous time, and the linear terms of the Hessian approximation matrix are determined based on the variable parameter increment, gradient increment and identity matrix of the current time relative to the previous time.

[0092] The Hessian approximation matrix at the current time is determined based on the multiplier term and the linear term.

[0093] The variable parameters and gradient at the previous time step are θ. k-1 g k-1 The variable parameters and gradient at the current time are θ. k g k Then the increment of the variable parameters and the increment of the gradient at the current time relative to the previous time can be expressed as s, respectively. k-1 =θ k -θ k-1 y k-1 =g k -g k-1 The multiplier P can be calculated. k-1 and linear term Q k :

[0094]

[0095] Furthermore, it can be calculated based on the multipliers. Hessian approximation matrix at the current time

[0096] Current weather forecasting technology relies on large-scale meteorological observation networks and data acquired by advanced meteorological satellites. These networks consist of meteorological stations, meteorological centers, and communication systems. Globally distributed meteorological stations continuously collect atmospheric parameters such as temperature, air pressure, and humidity, transmitting the data to meteorological centers worldwide via terrestrial and satellite communication systems. Meteorological satellites provide extensive and continuous observational data, particularly for remote areas and over oceans. The amount of meteorological data currently acquired is massive, and current classical computational methods are inefficient at processing this vast amount of data, failing to meet the real-time requirements of weather forecasting. To address this technical problem, this application provides a weather forecasting method.

[0097] Please refer to Figure 4 This illustration shows a flowchart of a weather forecasting method provided in one embodiment of this application. The method can be applied to computer equipment, which refers to electronic devices capable of data calculation and processing. The method may include the following steps:

[0098] Step 401: Obtain a set of linear equations characterizing the relationship between meteorological influencing factor data and time. The constant vector of the linear equations is used to characterize the meteorological influencing factor data, and the coefficient matrix of the linear equations is used to characterize the interaction between meteorological influencing factors.

[0099] Step 402: Construct a variable quantum linear solver based on the first unitary operator for preparing the constant vector, the second unitary operator for preparing the coefficient matrix, and the variable quantum circuit. The parameters of the variable quantum linear solver are trained according to the method described in any embodiment of the first aspect.

[0100] Step 403: Predict the weather at the target time based on the variable quantum linear solver.

[0101] The linear equations in this embodiment are obtained by time discretization of weather data evolution equations. Weather data evolution equations are mathematical models used to describe the changes of meteorological influencing factors over time. These equations are based on fluid dynamics, thermodynamics, and other related physical laws, and can simulate the dynamic behavior of the atmosphere, thereby predicting future weather conditions. Examples include the Navier-Stokes equations and atmospheric dynamics equations.

[0102] In this embodiment, meteorological influencing factors refer to various physical quantities that affect atmospheric conditions and weather changes. These physical quantities include temperature, air pressure, humidity, wind speed, and wind direction, which together determine the dynamic changes and forecasts of weather. These factors influence the formation, evolution, and movement of weather systems through complex interactions and feedback mechanisms.

[0103] Wherein, the Hamiltonian corresponding to the linear equation system

[0104] Specifically, the Hamiltonian corresponding to the linear equation system can be decomposed, for example, by decomposing the Hamiltonian on a Paulizio scale to obtain... σ i ∈[I,X,Y,Z]; where m represents the index of the sub-Hamiltonian, and X,Y,Z all represent Pauli matrices, then the linear combination of the first unitary operator U and the second unitary operator A = ∑ n C n A n Each A in n All of these can be represented using Pauli matrices, thus enabling the construction of a variational quantum linear solver.

[0105] Based on the above scheme, a system of linear equations characterizing the relationship between meteorological influencing factor data and time is obtained. The constant vector of this system of linear equations is used to characterize the meteorological influencing factor data, and the coefficient matrix of this system of linear equations is used to characterize the interaction between meteorological influencing factors. A variable quantum linear solver is constructed based on a linear combination of a first unitary operator for preparing the constant vector, a second unitary operator for preparing the coefficient matrix, and a variable quantum circuit. The parameters of the variable quantum linear solver are trained according to the method described in any embodiment of the first aspect. The weather at the target time is predicted based on the variable quantum linear solver. Compared with existing weather forecasting schemes, this scheme adopts the parameter training method in the first aspect, thus achieving faster convergence speed and solving the problem of potential RAM overflow in computer hardware resources. Therefore, this method is more practical. It partially adopts quantum computing, i.e., VQLS, which allows for faster processing speed for large amounts of meteorological data and meets the real-time requirements of weather forecasting.

[0106] Figure 5 A schematic diagram of the parameter training apparatus for a variational quantum linear solver according to an embodiment of this application is shown. The apparatus includes:

[0107] The gradient calculation unit 501 is used to calculate the gradient of the quantum circuit in the variable quantum linear solver under the variable parameters at the current time.

[0108] Hessian approximation matrix determination unit 502 is used to determine the Hessian approximation matrix at the current time based on the variable parameter increment and gradient increment at the current time relative to the previous time if the norm of the gradient at the current time is greater than or equal to a preset closing precision standard.

[0109] The variable parameter unit 503 is used to determine the variable parameters at the next time step based on the variable parameters, gradient, and Hessian approximation matrix at the current time step.

[0110] The iterative loop unit 504 is used to take the variable parameter of the next time step as the variable parameter of the current time step and to perform the step of calculating the gradient of the quantum circuit under the variable parameter of the current time step.

[0111] Figure 6 This application provides a schematic diagram of the structure of a weather forecasting device according to an embodiment of the present application. The device includes:

[0112] The acquisition unit 601 is used to acquire a set of linear equations that characterize the relationship between meteorological influencing factor data and time. The constant vector of the linear equations is used to characterize the meteorological influencing factor data, and the coefficient matrix of the linear equations is used to characterize the interaction between meteorological influencing factors.

[0113] Construction unit 602 is used to construct a variable quantum linear solver based on a first unitary operator for preparing the constant vector, a linear combination of a second unitary operator for preparing the coefficient matrix, and a variable quantum circuit. The parameters of the variable quantum linear solver are trained according to the method described in any embodiment of the first aspect.

[0114] The prediction unit 603 is used to predict the weather at a target time based on the variable quantum linear solver.

[0115] Figure 7 The diagram illustrates the structure of a computer device provided in one embodiment of this application, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the functions of a computer system for parameter training of a variable quantum linear solver or a weather forecasting method in any of the above embodiments.

[0116] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform the functions of a computer system for parameter training of a variable quantum linear solver or weather forecasting method in any of the above embodiments.

[0117] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the functions of a computer system for parameter training of a variable quantum linear solver or weather forecasting method in any of the above embodiments.

[0118] It is understood that the specific examples in this application are only intended to help those skilled in the art better understand the implementation methods of this application, and are not intended to limit the scope of the invention.

[0119] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this application in any way.

[0120] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.

[0121] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0122] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0123] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0124] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0126] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0128] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0129] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] The above are merely specific embodiments of this application, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A parameter training method for a variational quantum linear solver, characterized in that, The method comprises: calculating the gradient of the quantum circuit in the variational quantum linear solver under the variable parameters at the current time; if the norm of the gradient at the current time is greater than or equal to the preset closing precision standard, determining the Hessian approximation matrix at the current time according to the variable parameter increment and the gradient increment of the current time relative to the last time; determining the variable parameters at the next time according to the variable parameters, the gradient and the Hessian approximation matrix at the current time; taking the variable parameters at the next time as the variable parameters at the current time and performing the step of calculating the gradient of the quantum circuit under the variable parameters at the current time.

2. The method of claim 1, wherein, The method further comprises: if the norm of the gradient at the current time is greater than the preset program convergence precision standard and less than the preset closing precision standard, determining the variable parameters at the next time according to the variable parameters and the gradient at the current time, and performing the step of taking the variable parameters at the next time as the variable parameters at the current time, wherein the preset program convergence precision standard is less than the preset closing precision standard.

3. The method of claim 1, wherein, The method further comprises: if the norm of the gradient at the current time is less than or equal to the preset program convergence precision standard, taking the variable parameters at the current time as the final variable parameters.

4. The method of claim 1, wherein, Before the step of calculating the gradient of the quantum circuit in the variational quantum linear solver under the variable parameters at the current time, the method further comprises: obtaining the initial variable parameters of the quantum circuit in the variational quantum linear solver and the initial gradient of the quantum circuit calculated under the initial variable parameter value; calculating the variable parameters at the current time according to the initial variable parameters, the initial gradient and the initially given initial Hessian approximation matrix.

5. The method of claim 4, wherein, The step of calculating the variable parameters at the current time according to the initial variable parameters, the initial gradient and the initially given initial Hessian approximation matrix comprises: taking the initial variable parameters, the initial gradient and the initially given initial Hessian approximation matrix as the variable parameters, the gradient and the Hessian approximation matrix at the current time respectively, and performing the step of determining the variable parameters at the next time according to the variable parameters, the gradient and the Hessian approximation matrix at the current time.

6. The method according to any one of claims 1 to 5, characterized in that, The step of determining the Hessian approximation matrix at the current time according to the variable parameter increment and the gradient increment of the current time relative to the last time comprises: determining the multiplicative term of the Hessian approximation matrix according to the variable parameter increment and the gradient increment of the current time relative to the last time and the unit matrix, and determining the linear term of the Hessian approximation matrix according to the variable parameter increment and the gradient increment of the current time relative to the last time; determining the Hessian approximation matrix at the current time according to the multiplicative term and the linear term.

7. A weather prediction method characterized by, The method comprises: obtaining a system of linear equations representing the time-varying relationship of meteorological influence factor data, a constant vector of the system of linear equations being used to represent meteorological influence factor data, and a coefficient matrix of the system of linear equations being used to represent the interaction between meteorological influence factors; linearly combining a first unitary operator for preparing the constant vector, a second unitary operator for preparing the coefficient matrix, and a variational quantum circuit to construct a variational quantum linear solver, and training parameters of the variational quantum linear solver according to the method of any one of claims 1-6. The variational quantum linear solver is used to predict the weather at the target time.

8. A parameter training device for a variational quantum linear solver, characterized in that, The device comprises: a gradient calculation unit configured to calculate the gradient of the quantum circuit in the variational quantum linear solver under the variable parameter at the current time; a Hessian approximation matrix determination unit configured to determine the Hessian approximation matrix at the current time according to the variable parameter increment and the gradient increment of the current time relative to the previous time if the norm of the gradient at the current time is greater than or equal to a preset closing precision standard; a variable parameter unit configured to determine the variable parameter at the next time according to the variable parameter, the gradient and the Hessian approximation matrix at the current time; a loop iteration unit configured to take the variable parameter at the next time as the variable parameter at the current time and perform the step of calculating the gradient of the quantum circuit under the variable parameter at the current time.

9. A weather prediction apparatus characterized by comprising: The device comprises: an acquisition unit configured to acquire a linear equation set representing the time-varying relationship of meteorological influence factor data, a constant vector of the linear equation set representing meteorological influence factor data, and a coefficient matrix of the linear equation set representing the interaction between meteorological influence factors; a construction unit configured to construct a variational quantum linear solver by linear combination of a first unitary operator for preparing the constant vector, a second unitary operator for preparing the coefficient matrix, and a variational quantum circuit, wherein the parameters of the variational quantum linear solver are trained according to the method of any one of claims 1-6; a prediction unit configured to predict the weather at the target time according to the variational quantum linear solver.

10. An electronic device, comprising: It comprises: a processor and a memory; The processor and the memory are connected, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the method of any one of claims 1-6 or claim 7.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program comprises program instructions, which, when executed by a processor, execute the method of any one of claims 1-6 or claim 7.