Power data processing method based on load flow calculation

By using quantum linear solvers and quantum random access memory in trend calculations, the problems of slow flow calculation speed and limited accuracy of large-scale power systems are solved, and more efficient trend calculations are achieved.

CN118964857APending Publication Date: 2024-11-15STATE GRID ANHUI ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST

Patent Information

Application Number
CN202411227902.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing trend-based computing methods are slow in processing large-scale power systems and have limited accuracy. It is difficult to meet high-precision requirements under the limitation of traditional computer storage capacity. Quantum computing methods have not been fully verified in practice, and there are error accumulation and error solutions. The problem.

Method used

A power data processing method based on current calculation is proposed. By constructing the linear equation Ax=b, using a quantum linear solver to solve the corrected linear equation, and combining with a quantum random access memory to perform quantum state coding, reducing the overall algorithm complexity and Accelerate the calculation of trend problems.

Benefits of technology

By preprocessing and correcting the linear equations of the current calculation of the power system and solving them using a quantum linear solver, the matrix condition number is significantly reduced, the convergence and calculation efficiency are improved, and the calculation of the accelerated flow problem is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964857A_ABST
    Figure CN118964857A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power data processing method based on load flow calculation, which comprises the following steps: constructing a linear equation Ax = b for the load flow calculation process of an electric power system based on power grid parameters, A being a Jacobian matrix, b being an unbalance amount, and x being a to-be-solved amount; the linear equation is corrected to obtain a corrected linear equation Aprex = bpre, Aprex = MA, bpre = Mb, and a matrix M = A-1; the corrected linear equation is solved through a quantum linear solver, a solution of the linear equation set is obtained, and the quantum linear solver carries out quantum state coding through a quantum random access memory; and updating unbalanced point parameters according to the solution of the linear equation set, and outputting node voltage and power distribution when a convergence condition is reached.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power systems, and in particular to a power data processing method based on power flow calculation. Background Art

[0002] Power flow calculation is the core foundation of various power system calculations. As the scale of power systems continues to expand and the complexity increases, the amount of data that needs to be processed by power flow calculations is also increasing. The processing speed of traditional computers is limited, so it takes longer to complete the calculation task; at the same time, the accuracy of traditional power flow calculation methods is limited by factors such as hardware architecture and algorithms, and it is difficult to meet the needs of high-precision power flow calculations; in addition, when the scale of the power system is large, due to the limitation of computer storage capacity, power flow calculations often use approximate algorithms for solution. Although this speeds up the calculation to a certain extent, this will cause the errors in the calculation results to gradually accumulate.

[0003] The current technical solution includes constructing a linear system of equations for fast decoupled power flow and a linear system of equations for DC power flow, and then using quantum linear algorithms to solve the constructed linear system of equations. Among them, quantum linear algorithms include the HHL algorithm and the VQLS algorithm. When the HHL algorithm is applied to DC power flow calculations, traditional computers are combined with quantum computers, and different quantum computers are used for calculations. However, the scale of the calculation examples is also very small, and the exponential acceleration effect of quantum computing has not yet been proven in practice. In addition, the solution of some points in the analysis is quite different from the classical solution.

[0004] The technologies currently required for quantum current computing include quantum random access memory (QRAM), quantum linear algorithm, shadow tomography, etc. For QPE-HHL, only the evaluation of the resources required for the calculation process (quantum gate count) was done. For QPE-VQLS, noisy and noise-free simulations were performed on classical computers. The results show that the noisy loss function fluctuates widely with the number of iterations, and even negative numbers appear. The error mitigation method is not implemented in the paper. Among them, the quantum phase estimation algorithm (QPE) is a subroutine in the HHL algorithm or VQLS algorithm. In addition, the comparison between classical solutions and quantum solutions and data analysis such as errors are not given in the study. In order to ensure convergence under large quantum computing errors, the convergence conditions of the Newton-Raphson method need to be set slightly larger, and the probability of incorrect solutions to linear equations calculated on current medium-sized quantum computers will increase with the increase of computing scale.

[0005] The newly developed dissipative quantum neural network trains and learns the relevant parameters for power flow calculation, but quantum neural networks have not been proven to have obvious advantages over classical neural networks so far. The real-coded quantum optimization algorithm was used to simulate the IEEE 6-node power system and 8-node thermal system. It may have advantages only when solving specific types of problems, especially those involving a large number of real number calculations and optimization problems. Moreover, the quantum power flow calculation process was only theoretically analyzed based on the HHL algorithm, which shows that compared with the existing classical methods, the quantum algorithm can reduce the complexity of power system power flow calculation by exponential level, but the correctness and effectiveness of its results have not been verified. Although the results of the quantum simulator are basically consistent with the classical results, there is still a certain gap between the results of the real chip and the results of the quantum simulator, and the power system power flow equation cannot be correctly solved. By using multiple phase estimation modules, the demand for the number of precision qubits is reduced in HMPEA, but the success rate of phase estimation in HMPEA is lower than that of the HHL algorithm, and too high precision and too few qubits will lead to an increase in relative error. Since HMPEA is based on the phase estimation module, it also has corresponding limitations, and more effective initial quantum state preparation schemes and Hamiltonian simulation schemes remain to be explored. In addition, since HMPEA relies on the statistics of measurement results, a more efficient solution to read out the quantum register state can greatly improve the performance of HMPEA.

[0006] At present, the application of quantum computing to solve power flow problems at home and abroad mainly includes the exploration of variational quantum algorithms and HHL algorithms, which lays the foundation for quantum analysis of power systems, but there are still many problems that need to be optimized and solved. The details are as follows:

[0007] (1) For data processing of quantum power flow computing problems, the current quantum programming framework lacks systematic quantum data structure functions. It is necessary to construct specific quantum operators and design data structures for classical-quantum data conversion specifically for quantum power flow computing, and use specific technologies to accelerate the process of classical-quantum data conversion.

[0008] (1) The core of quantum power flow calculation is realized through quantum programs of quantum linear accelerators that solve nonlinear problems. In view of the large amount of power flow calculation in modern complex power system analysis, there is currently no complete quantum preprocessing method. It is necessary to develop a quantum preprocessing linear algorithm that can significantly reduce the condition number of sparse matrices and combine it with a quantum linear solver to reduce the overall algorithm complexity, form a power flow calculation with quantum preprocessing, and realize the acceleration of power flow problem calculation;

[0009] (3) Current research has not yet focused on the development of a quantum tidal computing software prototype. The development of a quantum tidal computing software prototype can provide preliminary basic support for the research and development of large-scale quantum tidal computing software. Summary of the invention

[0010] The technical problem to be solved by the present invention is how to form a power flow calculation with quantum preprocessing, reduce the overall algorithm complexity, and realize accelerated power flow problem calculation.

[0011] The present invention solves the above technical problems by the following technical means:

[0012] The present invention proposes a power data processing method based on power flow calculation, the method comprising:

[0013] Based on the grid parameters, the power flow calculation process of the power system is constructed into a linear equation Ax=b, where A is the Jacobian matrix, b is the unbalanced quantity, and x is the quantity to be solved;

[0014] The linear equation is corrected to obtain the corrected linear equation A pre x=b pre , where A pre =MA,b pre =Mb, matrix M = A -1 ;

[0015] Solving the modified linear equation using a quantum linear solver to obtain a solution to a system of linear equations, wherein the quantum linear solver uses a quantum random access memory to encode a quantum state;

[0016] The non-equilibrium point parameters are updated according to the solutions of the linear equations, and the node voltage and power distribution are output when the convergence conditions are met.

[0017] Furthermore, the power flow calculation process of the power system is constructed into a linear equation Ax=b based on the power grid parameters, including:

[0018] Constructing a node admittance matrix based on power grid parameters, wherein the power grid parameters include network structure, node parameters and branch parameters;

[0019] The initial value and the node admittance matrix are substituted into the nonlinear equation of Newton-Raphson power flow calculation to solve the nonlinear equation, so as to convert the nonlinear equation into the linear equation.

[0020] Further, the step of substituting the initial value and the node admittance matrix into the nonlinear equation of Newton-Raphson power flow calculation for solving the nonlinear equation to convert the nonlinear equation into the linear equation includes:

[0021] In a rectangular coordinate system, the initial value and the node admittance matrix are substituted into the nonlinear equation of Newton-Raphson power flow calculation for solution, the partial derivative is obtained by the nonlinear equation, the Jacobian matrix A is constructed, and the unbalanced amount b is obtained to convert the nonlinear equation into the linear equation, wherein the unbalanced amount b includes the unbalanced amount of injected active power and the unbalanced amount of injected reactive power;

[0022] The representation of each element in the Jacobian matrix A is:

[0023]

[0024]

[0025] In the formula, e i and f i is the real and imaginary part of the voltage at the ith node, G ij and B ij are the node admittance matrix elements Y ij The real and imaginary parts of G ii and B ii are the node admittance matrix elements Y ii The real and imaginary parts, H ij 、N ij 、M ij , L ij , R ij and S ij are the elements of the Jacobian matrix, P i is the active power at node i, U i is the voltage at node i, Q i is the reactive power at node i.

[0026] Further, the step of substituting the initial value and the node admittance matrix into the nonlinear equation of Newton-Raphson power flow calculation for solving the nonlinear equation to convert the nonlinear equation into the linear equation includes:

[0027] In the polar coordinate system, the initial value and the node admittance matrix are substituted into the nonlinear equation of Newton-Raphson power flow calculation for solution. The partial derivative of the nonlinear equation is obtained to construct the Jacobian matrix A and obtain the unbalanced value b, so as to convert the nonlinear equation into the linear equation. According to The active power unbalance of the PQ node is calculated by using the voltage given by the PV node and the balancing node. and reactive power unbalance according to and the elements in the node admittance matrix to calculate the elements of the Jacobian matrix, is the voltage value of the kth iteration, is the voltage phase angle value of the kth iteration.

[0028] Furthermore, the linear equation is corrected to obtain a corrected linear equation A pre x=b pre , specifically:

[0029] The linear equation is subjected to diagonal preprocessing, wherein the diagonal elements of the diagonal matrix used in the diagonal preprocessing are the reciprocals of the diagonal elements of the matrix A.

[0030] Furthermore, the quantum linear solver includes a quantum processing unit and a quantum random access memory, and the quantum random access register includes an address quantum register |i> A , data quantum register |d> D , the quantum processing unit and the quantum random access memory are connected via an address bus and a data bus, corresponding to quantum registers |i> A 、|d> D ;

[0031] The quantum random access memory adopts a binary tree structure, and the tree nodes are composed of qudits. Each node in the binary tree contains an address qubit A and a data qubit D, wherein the address qubit A is used to mark the address route, and the data qubit D transmits bits along the route.

[0032] Furthermore, the nodes of the binary tree structure are labeled with integers (l, q), where l represents the layer number, q represents the position in the layer, and 0≤q≤2 l -1.

[0033] Further, when the tree node level is qutrit, the address qubit A is qutrit, and the data qubit D is qubit; when the tree node level is qubit, the address qubit A and the data qubit D are both qubits.

[0034] Furthermore, the query process of the quantum random access memory includes: address setting, data acquisition and decomposition; in the address setting stage, a path from the root of the tree to the bottom of the tree is established according to the address of the data item to be queried; in the data acquisition stage, the data is first transferred from the data bus register to the root of the tree, then to the memory node for data bit retrieval, and finally returned to the bus; in the decomposition stage, the address setting stage is reversed to return the system to the initial state.

[0035] Furthermore, the method of solving the modified linear equations using a quantum linear solver to obtain a solution to the linear equation system includes:

[0036] The matrix A of the modified linear equation is decomposed into a number of unitary matrix linear sum forms, and the imbalance b is encoded into the quantum circuit to construct the Hamiltonian containing the information of the linear equation system. The ground state of the Hamiltonian is the solution of a system of linear equations;

[0037] The gradient of the loss function of the Hamiltonian is obtained using the variational idea, and the ground state of the Hamiltonian is obtained using the gradient descent method.

[0038] The advantages of the present invention are:

[0039] (1) The present invention pre-processes and corrects the linear equation for power system flow calculation. The corrected linear equation A pre x=b pre , where A pre =MA,b pre =Mb, matrix M = A -1 , which makes the condition number of MA much lower than the original matrix A, and the convergence is improved. Then, the quantum linear solver is used to solve the modified linear equation. By combining it with the quantum linear solver, the overall algorithm complexity is reduced, and the calculation of the power flow problem is accelerated.

[0040] (2) The quantum linear solver in the present invention introduces quantum random access memory, which can effectively load classical data into the quantum computer and allow querying in quantum superposition. The quantum random access memory achieves its efficiency by exploiting circuit-level parallelism, using O(N) auxiliary qubits to load O(N) data items, with a time complexity of O(log N).

[0041] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flowchart of a method for processing power data based on power flow calculation proposed in one embodiment of the present invention;

[0043] Figure 2 It is a schematic diagram of the completion process of the power data processing method based on power flow calculation in one embodiment of the present invention;

[0044] Figure 3 is a schematic diagram of the structure of a quantum computer of QRAM in one embodiment of the present invention;

[0045] Figure 4 It is a schematic diagram of the data structure in the quantum Newton method in one embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are 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.

[0047] like Figure 1 to Figure 2 As shown, an embodiment of the present invention proposes a power data processing method based on power flow calculation, and the method includes the following steps:

[0048] S10, based on the grid parameters, construct the linear equation Ax=b for the power flow calculation process of the power system, where A is the Jacobian matrix, b is the unbalanced quantity, and x is the quantity to be solved;

[0049] S20, correcting the linear equation to obtain a corrected linear equation A pre x=b pre ,in,

[0050] A pre =MA,b pre =Mb, matrix M = A -1 ;

[0051] S30, using a quantum linear solver to solve the modified linear equation to obtain a solution to the linear equation system, wherein the quantum linear solver uses a quantum random access memory to perform quantum state encoding;

[0052] S40, update the non-equilibrium point parameters according to the solution of the linear equations, and output the node voltage and power distribution when the convergence condition is reached

[0053] It should be understood that if the convergence condition is not met, the linear equation is reconstructed, and the convergence condition includes the convergence accuracy and the maximum number of calculation steps.

[0054] In this embodiment, the linear equation of power system flow calculation is preprocessed and corrected. The corrected linear equation A pre x=b pre , where A pre =MA,b pre =Mb, matrix M = A -1 , which makes the condition number of MA much lower than the original matrix A, and the convergence is improved. Then, the quantum linear solver is used to solve the modified linear equation. By combining it with the quantum linear solver, the overall algorithm complexity is reduced, and the calculation of the power flow problem is accelerated.

[0055] As a further preferred technical solution, the step S10: constructing a linear equation Ax=b from the power flow calculation process of the power system based on the power grid parameters, comprises the following steps:

[0056] S11, constructing a node admittance matrix based on power grid parameters, wherein the power grid parameters include network structure, node parameters and branch parameters;

[0057] It should be noted that this embodiment imports power grid parameters, including: network structure, node parameters and branch parameters, which are all known parameters, manually input or obtained by the system, and uses these known parameters for calculation; and sorts the node data to construct a node admittance matrix.

[0058] S12, substituting the initial value and the node admittance matrix into the nonlinear equation of Newton-Raphson power flow calculation to solve it, so as to convert the nonlinear equation into the linear equation.

[0059] Specifically, this embodiment substitutes the imported parameters and the admittance matrix into the nonlinear equation, obtains the partial derivative through the equation, constructs the Jacobian matrix A, and obtains the unbalanced amount b, which is specifically divided into the following two methods:

[0060] (1) In rectangular coordinate system:

[0061] When rectangular coordinates are used, the quantities to be solved in the power flow problem are the real and imaginary components of the node voltages e1, f1, e2, f2...e n ,f n , since the voltage vector of the equilibrium node is given, there are 2(n-1) quantities to be determined, and 2(n-1) equations are required. In fact, except for the power equation of the equilibrium node, which has no constraints in the iteration process, two equations can be listed for each of the remaining nodes.

[0062] For PQ nodes, P is and Q is is given, so we can write:

[0063]

[0064] For PV nodes, the given quantity is P is and V is , so we can list:

[0065]

[0066] Where ΔP i is the active power imbalance at node i, ΔQ i is the reactive power unbalance at node i, P is is the injected active power given by node i, Gij and B ij are the node admittance matrix elements Y ij The real and imaginary parts, Q is is the injected reactive power given by node i, ΔV i is the voltage deviation of the PV node, V is is the voltage amplitude given at node i.

[0067] Therefore, the solution process of the Jacobian matrix and the imbalance is:

[0068] (1) Forming a node admittance matrix Y;

[0069] (2) Set the initial value U of each node voltage;

[0070] (3) Substitute the initial values ​​of the nodes into the above two equations to find the constant term vector of the modified equation;

[0071] (4) Substitute the initial value of the node voltage into the formula to find the Jacobian matrix elements;

[0072] (5) Solve the correction equation and find the correction vector;

[0073] (6) Obtain a new value of the node voltage;

[0074] (7) Check whether it converges. If not, use the new values ​​of the node voltages as the initial values ​​and restart from step (3) to perform the narrow iteration again. Otherwise, proceed to the next step.

[0075] (8) Calculate branch power distribution, PV node reactive power and balancing node injection power.

[0076] There are two different coordinate systems. If it is a rectangular coordinate system, the iterative calculation formula is:

[0077] When using rectangular coordinates, the node voltage phasor and complex admittance can be expressed as:

[0078]

[0079] Y ij =G ij +jB ij

[0080] Expand and separate the real and imaginary parts. Assume that the 1st, 2nd, ..., mth nodes in the system are PQ nodes, and the m+1st, m+2nd, ..., n-1th nodes are PV nodes. According to the different properties of the nodes, the following iterative calculation formula is obtained:

[0081] For PQ nodes:

[0082]

[0083] Among them, i=1,2,…,m.

[0084] For PV nodes:

[0085]

[0086] Among them, i=m+1,m+2,…,n-1.

[0087] For the equilibrium node, there is only one equilibrium node, the voltage is known, and it does not participate in the iteration. Its voltage is:

[0088] V n =e n +jf n

[0089] The iterative formula of the correction equation includes 2 (n-1) equations. The initial voltage value and the variable correction value symbol are selected, substituted into the PQ node equation and the PV node equation and expanded according to the Taylor series, ignoring Δe i ,Δf i The quadratic equation and subsequent terms give a set of linear equations or a linearized system of equations, often called a modified system of equations:

[0090] ΔW=-JΔU

[0091]

[0092] Where ΔW is the correction of the state variable, ΔU is the correction of the node voltage amplitude, J is the Jacobian matrix, ΔP m is the active power imbalance at PQ node m, ΔQ m is the reactive power unbalance at node m, ΔU m+1 is the voltage amplitude correction value of PV node m+1, ΔU n-1 is the voltage amplitude correction value of PV node n-1, Δe m is the real part of the voltage vector at node m, Δf m is the imaginary part of the voltage vector at node m.

[0093] In the above formula, each element in the Jacobian matrix can be obtained by partial derivative of the PQ node calculation formula and the PV node calculation formula. When j≠i, the non-diagonal elements in the Jacobian matrix are:

[0094]

[0095] When j=i, the diagonal elements in the Jacobian matrix are:

[0096]

[0097] From the calculation formula of the diagonal elements in the Jacobian matrix above, it can be seen that the characteristics of the Jacobian matrix are:

[0098] 1) Each element in the matrix is ​​a function of the node voltage, and these elements change as the node voltage changes during the iteration process;

[0099] 2) When some off-diagonal elements in the admittance matrix are zero, the corresponding elements in the Jacobian matrix are also zero. If Y ij =0, then there must be J ij =0, Y ij is the element of the admittance matrix, J ij is the element in the Jacobian matrix;

[0100] 3) The Jacobian matrix is ​​not a symmetric matrix (i = q1,2,…,n; i≠s),

[0101] The elements in the Jacobian matrix are expressed as follows:

[0102]

[0103]

[0104] In the formula, e i and f i is the real and imaginary part of the voltage at the ith node, G ij and B ij is the node admittance matrix element Y ij The real and imaginary parts, H ij 、N ij 、M ij , L ij , R ij and S ij are the elements of the Jacobian matrix, P i is the active power at node i, U i is the voltage at node i, Q i is the reactive power at node i.

[0105] (2) Polar coordinate system:

[0106] The model for power flow calculation in this embodiment adopts the Newton-Raphson method in polar coordinate form, and the specific principle is as follows:

[0107] 1) Input and read the model system parameters: active and reactive power of the generator at each node, active and reactive power of the load (for PV nodes, the generator active power and node voltage amplitude need to be given, and for balanced nodes, the voltage amplitude and phase angle need to be given); the resistance reactance value of each branch and the transformer ratio.

[0108] 2) Linearization and iterative calculation of steady-state power flow equation: node type sorting, admittance matrix Y B Construct and initialize the voltage of each node and Set the maximum number of iterations K according to The active power unbalance of the PQ node is calculated by using the voltage given by the PV node and the balancing node. and reactive power unbalance And the active power imbalance of the PV node In polar coordinates, voltage can be expressed as: The calculation formula for active and reactive power is:

[0109]

[0110] The calculation formula of node imbalance is:

[0111]

[0112]

[0113] Where V i is the voltage at node i, V j is the voltage at node j, G ij and are the node admittance matrix elements Y ij The real and imaginary parts, θ ij is the voltage phase angle difference between node i and node j, is the voltage value of the kth iteration, is the voltage phase angle value of the kth iteration.

[0114] application The elements of the Jacobian matrix are calculated by summing the elements of the node admittance matrix Solve the following set of equations to find the voltage change at each node, i.e. the correction value and

[0115]

[0116] Among them, H, N, J, and L are the four block sub-matrices of the Jacobian matrix; ΔP is the column vector of the node active power unbalance; ΔQ is the column vector of the node reactive power unbalance; Δθ is the column vector of the node voltage phase angle correction, and ΔV is the column vector of the node voltage amplitude correction.

[0117] Among them, the non-diagonal elements in the Jacobian matrix (i≠j):

[0118]

[0119] Diagonal elements in the Jacobian matrix (i=j):

[0120]

[0121] Determine whether the convergence condition is met. If not, calculate the new voltage value of each node according to the following formula, that is, the corrected voltage value of each node, set k=k+1, and perform the next round of iteration:

[0122]

[0123] If converged, the reactive injection power of each PV node is calculated to balance the node power and line power.

[0124] 3) Calculation result output: supports the output of node calculation results and branch calculation results in csv format.

[0125] It should be noted that the present embodiment uses the Newton-Raphson method (Newton's method for short) to construct nonlinear equations, which is an effective method for solving nonlinear algebraic equations in mathematics. The key point is to transform the process of solving nonlinear equations into a process of repeatedly solving corresponding linear equations, which is usually called a successive linearization process.

[0126] For a nonlinear system of algebraic equations:

[0127] f(x)=0

[0128] Right now

[0129] f i (x1,x2,…x n )=0(i=1,2,…n)

[0130] In the substitution of a certain initial estimate x of the quantity x (0) Nearby, expand the above formula into a Taylor series and ignore the second-order and higher-order terms to obtain the following linearized system of equations:

[0131] f(x (0) )+f′(x (0) )Δx (0) =0

[0132] The above formula is called the correction equation of Newton's method. From this, the correction value of the first iteration can be obtained:

[0133] Δx (0) = -[f′(x (0) )] -1 f(x (0) )

[0134] Δx (0) and x (0) Add together to get the first improved value x of the variable (1) Then from x (1) Starting from a certain initial value x(0) Starting from, the iterative format of Newton's method is:

[0135] f′(x (k) )Δx (k) =-f(x (k) )

[0136] x (k+1) =x (k) +Δx (k)

[0137] In the above two equations, f′(x) is the first-order partial derivative matrix of function f(x) with respect to variable x, i.e., Jacobian matrix J; k is the number of iterations. As can be seen from the above equations, the core of Newton’s method is to iterate and solve the modified equation. (0) When the exact solution to the equation is close enough, the convergence speed is very fast and has a quadratic convergence characteristic.

[0138] The outstanding advantage of the Newton power flow algorithm is its fast convergence speed. If a good initial value is selected, the algorithm will have a quadratic convergence characteristic. Generally, it can converge to a very accurate solution after 4 to 5 iterations. Moreover, the number of iterations has little to do with the size of the network being calculated. The Newton method also has good convergence reliability. For systems that are ill-conditioned based on the Gaussian method of the node admittance matrix, the Newton method can also converge reliably. The amount of memory required by the Newton method and the time required for each iteration are much greater than those of the Gaussian method.

[0139] The reliable convergence of Newton's method depends on having a good initial value. If the initial value is not chosen properly, the algorithm may not converge at all or converge to a node that cannot run. For a normally operating system, the voltage of each node is generally close to the rated value, the deviation is not too large, and the phase angle difference between the nodes is not large, so a unified voltage initial value (also called flat voltage) can be used for each node, such as assuming:

[0140] U i (0) =1θ i (0) =0 or e i (0) =1f i (0) =0(i=q1,2,…,n; i≠s)

[0141] This generally gives satisfactory results. However, if the voltage quality is very poor due to reactive power tension or other reasons, or there are overloaded lines and the angle difference between nodes is large, problems may occur if the above initial voltage is still used. The solution to this problem is to use the Gaussian method to iterate 1 to 2 times, and use the iterative result as the initial value of the Newton method. You can also use the DC method to solve the current flow once to obtain a better initial angle value, and then switch to the Newton method iteration.

[0142] As a further preferred technical solution, the step S20: correcting the linear equation to obtain a corrected linear equation A pre x=b pre , where A pre =MA,b pre =Mb, matrix M = A -1 , specifically:

[0143] The linear equation is subjected to diagonal preprocessing, wherein the diagonal elements of the diagonal matrix used in the diagonal preprocessing are the reciprocals of the diagonal elements of the matrix A.

[0144] It should be noted that after the preconditioning, the equation to be solved is no longer Ax=b, but the corrected equation A pre x=b pre , where A pre =MA,b pre =Mb. If we can find a matrix M such that the condition number of MA is much lower than the original matrix A, the convergence will be improved. The best preconditioner is obviously M = A -1 However, finding A -1 is equivalent to solving a linear system, so using it as a precondition will not provide any speedup. One solution is to find an efficient computable approximate inverse M that is approximately equal to A. -1 However, there are two limitations of general quantum linear algorithms that make many classical preconditions unusable: (1) only local knowledge of A can be obtained, and (2) for Hamiltonian simulation, the preconditioning matrix MA itself must be sparse. For this reason, this embodiment anticipates selecting diagonal preprocessing as the preconditioner, that is, D is a diagonal matrix whose diagonal elements are the inverses of the diagonal elements of A.

[0145] As a further preferred technical solution, the quantum linear solver used in this embodiment introduces quantum random access memory (Quantum Random Access Memory, QRAM), which is a quantum simulation of a classical random access memory that can effectively load classical data into a quantum computer and allow queries in quantum superposition. QRAM achieves its efficiency by exploiting circuit-level parallelism, using O(N) auxiliary qubits to load O(N) data items with a time complexity of O(log N). The exponential number of qubits required to achieve scalable QRAM has always been one of the most challenging aspects, because even a small error rate in a qubit can lead to large errors in the entire system. To overcome this problem, this embodiment proposes a QRAM architecture called a bucket-brigade architecture, which has been proven to be fault-tolerant.

[0146] The structure of a quantum computer with QRAM is as follows: Figure 3 As shown: Part (a) describes a possible quantum computer design, including a quantum processing unit (QPU) and a bucket-brigade QRAM. The QPU and QRAM are linked by an address bus and a data bus, corresponding to the input registers A and D of the QRAM respectively. The bucket-brigade QRAM adopts a binary tree structure, and the tree nodes are composed of qudits (including qubit, qutrit or more levels). Part (b) usually uses a pair of integers (l, p) to mark each node, where l represents the layer number and p represents the position in the layer (0≤p≤2 l -1), for example, the root node is (0,0), and its left and right child nodes are represented as (1,0) and (1,1) respectively. Each node in the binary tree contains two qubits: the address qubit A and the data qubit D. In general, the address qudit marks the address route, while the data qudit transmits bits along the route. The architecture is usually divided into two schemes based on the type of qubits used in the address register: qutrit-based and quantum qubit-based. (c) In some qutrit-based schemes, the address bit A is a qutrit and the data bit D is a qubit, while in qubit-based schemes, both the address bit A and the data bit D are qubits. This classification is proposed because the two schemes have different error scales. The number of layers of data qudit determines the number of bits of data converted at a time, that is, the bandwidth of QRAM.

[0147] Further, the QRAM query process consists of three phases: address setup, data acquisition, and decomputation. In the address setup phase, a path from the root of the tree to the bottom of the tree is established according to the address of the data item to be queried. In the data acquisition phase, data is first transferred from the data bus register to the root of the tree, then to the memory node for data bit retrieval, and finally returned to the bus. In the decomputation phase, the address setup phase is reversed, returning the system to the initial state.

[0148] It is important to note that QRAM must be reversible during simulation. This requirement allows QRAM to not only map |i>|0> to |i>|m i >, but also performs a reversal. It is therefore important that all side effects that occur during the query are completely ignored to ensure that the state of the QRAM is fully restored and only the state of the bus is changed.

[0149] Furthermore, regarding the quantum data structure, this embodiment designs the quantum state in the quantum Newton method and uses QRAM for encoding. Figure 4 The figure shows a schematic diagram of the data structure when the Jacobian matrix dimension N=4 for power flow calculation, which is a data structure similar to a binary tree.

[0150] like Figure 4 As shown, the specific data stored in the (N=4) root node and leaf node are:

[0151]

[0152] Where i,j represents the jth root node of the i-th layer, n represents the total number of root nodes; d ijx is the norm of all dimensional data below the root node of this layer, x k is a dimension data of the state to be optimized, d ijy is the norm of all gradient values ​​below the root node of this layer, f k (x) is the gradient value of the objective function corresponding to the dimensional data.

[0153] It can be proved that under this data structure, the time complexity can be O(logN) by O M1 ,O M2 ,O M3 ,O M4 The four Oracles implement the following process:

[0154] O M1 |k>|0>=|k>|x k >

[0155] O M2 |k>|0>=|k>|f k (x)>

[0156] OM3 |i>|j>|0>=|i>|j>|d ijx >

[0157] O M4 |i>|j>|0>=|i>|j>|d ijy >

[0158] Among them, integers k∈[0,N-1],i∈[0,n],j∈[0,2 i -1];

[0159] For linear system quantum state encoding: In Newton's method, the linear system AΔx=-b needs to be solved. When using quantum Newton's method, the coefficient matrix A and the right-hand vector b need to be encoded into the following quantum state |j,k>|A jk >:

[0160]

[0161] Here j, k, i ∈ [0, N-1], f i (x) is the gradient value of the objective function corresponding to each dimensional data, ‖F(x)‖2 is the norm of the gradient F(x) of the objective function in the above QRAM data structure, which can be used to normalize the coefficients to facilitate the execution of subsequent quantum linear algorithm and quantum state tomography algorithm.

[0162] By querying O(logN) times M4 Can build O b Implement the following encoding process:

[0163] O b |0>=|b>

[0164] The encoding of |A> is done by O A1 ,O A2 Two Oracle implementations can complete the following processes respectively:

[0165] O A1 |j,l>=|j,h(j,l)>

[0166]

[0167] Where j, k represent the row and column labels of matrix A respectively, l is the sparsity of matrix A, and h(j,l) is the column label of the lth non-zero element in the jth row.

[0168] O A1 The structure of is related to the distribution of non-zero elements in A. A2 The key to the construction is to use quantum circuits to achieve The finite difference method can be used to calculate as follows

[0169]

[0170] At this time, through O A1 and O M2 It is possible to construct O A2 .

[0171] Here we give O b , O A2 The time complexity is:

[0172]

[0173] Here,N,∈,l,are the data dimension, precision and coefficient matrix sparsity, respectively.

[0174] Implementing the encoding and O of |b> A1 ,O A2 After the construction, the quantum linear algorithm can be used to obtain |Δx>. The quantum linear algorithm now generally uses the CKS algorithm, and its algorithm complexity can be expressed as:

[0175]

[0176] where κ represents the condition number of the coefficient matrix.

[0177] Finally, the overall time complexity of the QLSS process can be obtained as

[0178] As a further preferred technical solution, in step S30, the modified linear equation is solved by using a quantum linear solver to obtain a solution to the linear equation system, specifically including:

[0179] The linear equations The coefficient matrix A is decomposed into several unitary matrix linear summation forms, and the vector Encoding into quantum circuits, constructing Hamiltonians containing information about linear equations The ground state of this Hamiltonian is the solution to the linear system of equations;

[0180] The gradient of the loss function of the Hamiltonian is obtained using the variational idea, and the ground state of the Hamiltonian is finally obtained using the gradient descent method.

[0181] It should be noted that when the loss function approaches 0, is the solution of the linear equations, which can be transformed into a classical vector representation It is worth noting that the quantum state output by the quantum circuit is the normalized result, because the vector encoded into the quantum circuit is the normalized quantum state |b>. Assume that the solution of the equations obtained by the quantum circuit is and solutions to real linear systems Satisfy the proportional relationship:

[0182]

[0183] Substituting it into the initial linear equations, we get:

[0184]

[0185] Multiply the above formulas by their respective transposes on the left to obtain:

[0186]

[0187] The left side of the above formula Equal to the measured loss function Therefore, the coefficient η can be calculated and finally the solution of the linear equation system can be obtained.

[0188] The quantum linear solver combines methods for nonlinear equations using:

[0189]

[0190] In the formula, x s ,x s+1 They represent the calculation results of the sth and s+1th iteration steps respectively, F represents the nonlinear equation, and F′ represents the Jacobian matrix of the function F. The specific form is:

[0191]

[0192] The specific process of the quantum Newton algorithm is as follows:

[0193] 1) Any given initial solution x at step s = 0 s and the preset calculation accuracy∈;

[0194] 2) By x s Calculate the matrix A s =F′(x s ) and vector b s =-F(x s );

[0195] 3) Solve linear equations

[0196] 4) Calculate x s+1 =x s +Δx s and F(x s+1 );

[0197] 5) Determine if ‖F(x s+1 )‖≤∈, then the final solution is xs+1 ; If not, return to step 2) until a solution that satisfies the accuracy is found.

[0198] The present invention is aimed at data processing of power flow calculation problems, and can construct a special quantum data structure that can meet the needs of power flow calculation, and develop a classical-quantum data conversion technology dedicated to quantum power flow problems. For solving nonlinear problems, firstly, it is converted into a linear problem by a linearization method, a quantum preprocessing method is designed, and it is combined with a quantum linear solver, thereby effectively reducing the overall algorithm complexity. The current calculation scale is relatively small, and the linear system to be solved can be mapped to a small dimensional space by a subspace method for solution, so as to achieve the effect of expanding the calculation scale. The goal of the power flow calculation of the present invention is to obtain the calculation of the power system in a given operating state. That is, the node voltage and power distribution are used to check whether the components of the system are overloaded. Whether the voltage at each point meets the requirements, whether the distribution and allocation of power are reasonable, and power loss, etc. The operation and expansion of the existing power system, the planning and design of the new power system, and the static and transient stability analysis of the power system are all based on power flow calculation. The results of power flow calculation can be used, such as power system steady-state research, safety estimation or optimal power flow, which have a direct impact on the model and method of power flow calculation.

[0199] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0200] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0201] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A power data processing method based on power flow calculation, It is characterized in that The method comprises: Based on the grid parameters, the power flow calculation process of the power system is constructed into a linear equation Ax=b, where A is the Jacobian matrix, b is the unbalanced quantity, and x is the quantity to be solved; The linear equation is corrected to obtain the corrected linear equation A pre x=b pre , where A pre =MA,b pre =Mb, matrix M = A -1 ; Solving the modified linear equation using a quantum linear solver to obtain a solution to a system of linear equations, wherein the quantum linear solver uses a quantum random access memory to encode a quantum state; The non-equilibrium point parameters are updated according to the solutions of the linear equations, and the node voltage and power distribution are output when the convergence conditions are met.

2. The power data processing method based on power flow calculation according to claim 1, It is characterized in that The power flow calculation process of the power system is constructed into a linear equation Ax=b based on the power grid parameters, including: Constructing a node admittance matrix based on power grid parameters, wherein the power grid parameters include network structure, node parameters and branch parameters; The initial value and the node admittance matrix are substituted into the nonlinear equation of Newton-Raphson power flow calculation to solve the nonlinear equation, so as to convert the nonlinear equation into the linear equation.

3. The power data processing method based on power flow calculation according to claim 2, It is characterized in that Substituting the initial value and the node admittance matrix into the nonlinear equation of Newton-Raphson power flow calculation for solving, so as to convert the nonlinear equation into the linear equation, comprises: In a rectangular coordinate system, the initial value and the node admittance matrix are substituted into the nonlinear equation of Newton-Raphson power flow calculation for solution, the partial derivative is obtained by the nonlinear equation, the Jacobian matrix A is constructed, and the unbalanced amount b is obtained to convert the nonlinear equation into the linear equation, wherein the unbalanced amount b includes the unbalanced amount of injected active power and the unbalanced amount of injected reactive power; The representation of each element in the Jacobian matrix A is: In the formula, e i and f i is the real and imaginary part of the voltage at the ith node, G ij and B ij are the node admittance matrix elements Y ij The real and imaginary parts of G ii and b ii are the node admittance matrix elements Y ii The real and imaginary parts, H ij 、N ij 、M ij , L ij , R ij and S ij are the elements of the Jacobian matrix, P i is the active power at node i, U i is the voltage at node i, Q i is the reactive power at node i.

4. The power data processing method based on power flow calculation according to claim 2, It is characterized in that Substituting the initial value and the node admittance matrix into the nonlinear equation of Newton-Raphson power flow calculation for solving, so as to convert the nonlinear equation into the linear equation, comprises: In the polar coordinate system, the initial value and the node admittance matrix are substituted into the nonlinear equation of Newton-Raphson power flow calculation for solution. The partial derivative of the nonlinear equation is obtained to construct the Jacobian matrix A and obtain the unbalanced value b, so as to convert the nonlinear equation into the linear equation. According to The active power unbalance of the PQ node is calculated by using the voltage given by the PV node and the balancing node. and reactive power unbalance according to and the elements in the node admittance matrix to calculate the elements of the Jacobian matrix, is the voltage value of the kth iteration, is the voltage phase angle value of the kth iteration.

5. The power data processing method based on power flow calculation according to claim 1, It is characterized in that The linear equation is corrected to obtain a corrected linear equation A pre x=b pre , specifically: The linear equation is subjected to diagonal preprocessing, wherein the diagonal elements of the diagonal matrix used in the diagonal preprocessing are the reciprocals of the diagonal elements of the matrix A.

6. The power data processing method based on power flow calculation according to claim 1, It is characterized in that The quantum linear solver includes a quantum processing unit and a quantum random access memory, wherein the quantum random access register includes an address quantum register |i> A , data quantum register |d> D , the quantum processing unit and the quantum random access memory are connected via an address bus and a data bus, corresponding to quantum registers |i> A 、|d> D ; The quantum random access memory adopts a binary tree structure, and the tree nodes are composed of qudits. Each node in the binary tree contains an address qubit A and a data qubit D, wherein the address qubit A is used to mark the address route, and the data qubit D transmits bits along the route.

7. The power data processing method based on power flow calculation according to claim 6, It is characterized in that The nodes of the binary tree structure are labeled with integers (l, q), where l represents the layer number and q represents the position in the layer, 0≤q≤2 l -1.

8. The power data processing method based on power flow calculation according to claim 6, It is characterized in that When the tree node level is qutrit, the address qubit A is a qutrit and the data qubit D is a qubit; when the tree node level is qubit, both the address qubit A and the data qubit D are qubits.

9. The power data processing method based on power flow calculation according to claim 6, It is characterized in that The query process of the quantum random access memory includes: address setting, data acquisition and decomposition; in the address setting stage, a path from the root of the tree to the bottom of the tree is established according to the address of the data item to be queried; in the data acquisition stage, the data is first transferred from the data bus register to the root of the tree, then to the memory node for data bit retrieval, and finally returned to the bus; In the decomputation phase, the address setting phase is reversed, returning the system to the initial state.

10. The power data processing method based on power flow calculation according to claim 1, It is characterized in that The method of solving the modified linear equations using a quantum linear solver to obtain a solution to the linear equation system includes: The matrix A of the modified linear equation is decomposed into a number of unitary matrix linear sum forms, and the imbalance b is encoded into the quantum circuit to construct the Hamiltonian containing the information of the linear equation system. The ground state of the Hamiltonian is the solution of a system of linear equations; The gradient of the loss function of the Hamiltonian is obtained using the variational idea, and the ground state of the Hamiltonian is obtained using the gradient descent method.

Citation Information

Patent Citations

  • Quantum Newton-Raphson method load flow calculation method and system based on HHL algorithm

    CN116706921A

Cited By

  • Post-disaster island division method and system for power system

    CN119362586A

  • Power system transient stability time domain numerical value recursive calculation method based on HHL algorithm

    CN121072196A