Quantum calculation method and device for optimizing generator set, equipment and medium

Through quantum computing methods, variable component quantum circuits are constructed and training parameters are optimized, which solves the computational complexity of large-scale UC problems and realizes the optimal combination optimization and real-time response capabilities of generator sets.

CN119990699AInactive Publication Date: 2025-05-13GUOKAIKE QUANTUM TECH (ANHUI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510457845.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-05-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In power systems, the computational complexity of unit combination optimization problems increases with the expansion of the power system scale. The existing MIP solvers have too long calculation time when dealing with large-scale UC problems, which makes it difficult to meet the real-time change requirements.

Method used

Using quantum computing method, unconstrained objective function and variable component quantum circuits containing training parameters are constructed by obtaining generator set data, and the power generation power of each generator is encoded using the amplitude in the quantum state, and the training parameters are optimized to determine the optimal stop or working state of each generator.

Benefits of technology

It effectively solves the computational complexity of large-scale UC problems, improves optimization efficiency, can cope with real-time changes in complex units in a short time, and achieves optimal combination optimization of generator sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119990699A_ABST
    Figure CN119990699A_ABST
Patent Text Reader

Abstract

The invention discloses a quantum computing method and device for optimizing a generator set, equipment and a medium. The method comprises the following steps: constructing an unconstrained objective function and a variable component sub-line containing training parameters according to data of the generator set; substituting a preset parameter value as a training parameter into the variable component sub-line so as to output a training quantum state evolved by the variable component sub-line; determining a first output ratio of each generator according to the amplitude in the training quantum state; calculating an unconstrained objective function value based on the first output ratio of each generator; training the training parameters of the variable component sub-lines through an optimizer; determining the training quantum state evolved by the variable component sub-line as a target quantum state in response to a training parameter or an unconstrained target function value converging to a target value; determining a second output ratio of each generator according to the amplitude in the target quantum state; and determining the optimal stop state or working state of each generator according to the second output ratio of each generator and the total load power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of quantum computing, and in particular to a quantum computing method, device, equipment and medium for optimizing a generator set. Background Art

[0002] Mixed Integer Programming (MIP) is an optimization problem that combines the characteristics of linear programming and integer programming. In the MIP problem, some decision variables are continuous (can take any real value), while the other decision variables are discrete (can only take integer values). For example, classic algorithms such as the cutting plane method or branch and bound method take up a lot of classical memory when processing integer variables. Therefore, the time taken to optimize integer variables in a MIP problem is much longer than the time to optimize continuous variables. The unit commitment optimization (UC) problem is one of the important problems in power system planning and operation. The UC problem is a specific mixed integer programming problem. The objective function and constraints include power continuous variables and start and stop binary variables. Therefore, the UC problem belongs to the mixed binary programming problem in the MIP problem.

[0003] At present, with the continuous expansion of the scale of power systems, the computational complexity of unit combination optimization problems has also increased. Algorithms that rely on MIP solvers still face the problem of long calculation time when dealing with large-scale UC problems, and are unable to meet the real-time changes of power systems. Summary of the invention

[0004] The object of the present invention is to provide a quantum computing method, device, equipment and medium for optimizing a generator set.

[0005] An embodiment of the present invention provides a quantum computing method for optimizing a generator set, comprising: Acquire generator set data, wherein the generator set data includes total load power; Construct an unconstrained objective function and a variational quantum circuit containing training parameters based on the generator set data; Substituting preset parameter values ​​as training parameters into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; Determine the first output proportion of each generator according to the amplitude in the training quantum state; Calculate the unconstrained objective function value based on the first output proportion of each generator; Training the training parameters of the variational quantum circuit by an optimizer; In response to the training parameter or the unconstrained objective function value converging to the target value, determining the training quantum state after the evolution of the variational quantum circuit as the target quantum state; Determine the second output proportion of each generator according to the amplitude in the target quantum state; The optimal stopping state or working state of each generator is determined according to the second output proportion of each generator and the total load power; wherein, The unconstrained objective function used in training includes the cost function and penalty function of the UC problem, where the cost function is used to calculate the sum of the operating costs of all generators in the generator set, and the penalty function is used to constrain the power distribution so that the power generation of each generator depends on the product of the first output proportion of each generator and the total load power.

[0006] Further, the unconstrained objective function is constructed according to the generator set data, including: Determine the cost function, power balance constraint and power upper and lower limit constraint of the UC problem based on the generator set data, wherein the power balance constraint includes that the total power generated by each generator is equal to the total load power, and the power upper and lower limit constraint includes that the power generated by each generator in the generator set is within the range from the minimum power generated by the generator to the maximum power generated by the generator; The power balance constraint and the power upper and lower limit constraint are converted into a penalty function with a penalty value of 0, and when the penalty value is equal to 0, the sum of the operating costs of all generators in the generator set calculated by the cost function is the smallest.

[0007] Furthermore, the constructing of an unconstrained objective function according to the generator set data further includes: A penalty function is constructed according to the power balance constraint and the power upper and lower limit constraints, and the penalty function includes a first segment penalty function, a second segment penalty function, a third segment penalty function and a fourth segment penalty function, wherein: When the current generator power is zero, the penalty value of the penalty function is zero; When the power generation of the current generator gradually increases from zero to half of the minimum power generation, the corresponding first segmented penalty function is a monotonically increasing linear function, and the penalty value of the first segmented penalty function is greater than zero; When the power generation of the current generator gradually increases from half of the minimum power generation to the minimum power generation, the corresponding second piecewise penalty function is a monotonically decreasing linear function, and the penalty value of the second piecewise penalty function is greater than zero; When the power generation of the current generator is in the range of minimum power generation to maximum power generation, the penalty value of the corresponding third segmented penalty function is zero; When the current power generation of the generator is greater than the maximum power generation, the corresponding fourth segment penalty function is a monotonically increasing linear function, and the penalty value of the fourth segment penalty function is greater than zero.

[0008] Furthermore, the penalty function with a penalty value of 0 is a third segmented penalty function.

[0009] Further, the training parameters of the variational quantum circuit are trained by an optimizer, including: Using an optimizer to train and optimize the training parameters of the variational quantum circuit, and using a gradient descent algorithm to repeatedly iterate the optimization so that the calculated unconstrained objective function value converges to the target value; After multiple iterations of optimization, the variational quantum circuit after iterative optimization is obtained; The variational quantum circuit is measured after iterative optimization to obtain the amplitude in the target quantum state.

[0010] Further, determining the first output ratio of each generator according to the amplitude in the training quantum state includes: Each basis vector in the training quantum state corresponds to a generator, so as to realize encoding the power generation of each generator by the amplitude in the training quantum state; The square of each amplitude in the training quantum state is determined as the first output ratio of the corresponding generator, so that the total power generation of each generator in the generator set is equal to the total load power.

[0011] Furthermore, constructing a variational quantum circuit including training parameters according to the generator set data includes: Initialize a quantum circuit, wherein the initialized quantum circuit contains m quantum bits arranged in order from low to high; The generator set data obtained also includes the number of generators, and the number of quantum bits in the variational quantum circuit is determined according to the number of generators; A plurality of repeatably operable hypothetical layers are arranged on the initialized quantum circuit to realize the construction of the variational quantum circuit, wherein each hypothetical layer includes a single-qubit gate and / or a double-qubit gate capable of generating quantum entanglement, and each single-qubit gate carries a training parameter.

[0012] An embodiment of the present invention provides a quantum computing device for optimizing a generator set, comprising: An acquisition module, which is used to acquire generator set data, wherein the generator set data includes total load power; A construction module, which is used to construct an unconstrained objective function and a variational quantum circuit including training parameters according to the generator set data; A substitution module, which is used to substitute a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; A first determination module, which is used to determine a first output ratio of each generator according to the amplitude in the training quantum state; A calculation module, which is used to calculate the unconstrained objective function value based on the first output ratio of each generator; A training module, which is used to train the training parameters of the variational quantum circuit through an optimizer; A response module, which is used to determine the training quantum state after the evolution of the variational quantum circuit as the target quantum state in response to the training parameter or the unconstrained objective function value converging to the target value; A second determination module, which is used to determine the second output ratio of each generator according to the amplitude in the target quantum state; The third determination module is used to determine the optimal stop state or optimal working state of each generator according to the second output ratio of each generator and the total load power; wherein, The unconstrained objective function includes the cost function and penalty function of the UC problem, wherein the cost function is used to calculate the sum of the operating costs of all generators in the generator set, and the penalty function is used to constrain the power distribution so that the power generation of each generator depends on the product of the first output proportion of each generator and the total load power.

[0013] An embodiment of the present invention provides an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the method described above are implemented.

[0014] An embodiment of the present invention provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the method described above are implemented.

[0015] The above technical solution of the present invention has the following beneficial technical effects: 1. The technical solution of the present invention combines classical optimization technology and variational quantum circuits. The amplitude in the quantum state can be used to encode the power generation of each generator to obtain the optimal stop state or optimal power generation of each generator. At this time, the total cost of the generator set calculated is the smallest. In this way, the computational complexity of the unit combination optimization problem can be solved by using quantum classical algorithms. The technical solution of the present invention has a short training time for variational quantum circuits, which can improve the work efficiency of optimizing the unit combination problem, and thus can cope with real-time changes in complex units.

[0016] 2. The technical solution of the present invention utilizes quantum classical algorithm to realize the joint optimization of binary start-stop variables and power continuous variables in UC problem.

[0017] 3. In the embodiment of the present invention, when dealing with the problem of optimizing the combination of generator sets with n generators, the number of quantum bits required can be calculated based on log 2n is determined, so as the number of quantum bits increases, the number of generators that can be optimized will increase exponentially, and the number of generator sets can be easily expanded.

[0018] 4. In the embodiment of the present invention, the power balance constraint is guaranteed by the normalization condition of quantum mechanics and is strictly followed in the optimization process of the UC problem, thereby improving the overall optimization efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings in the embodiment of the present invention are briefly introduced below.

[0020] Figure 1 It is a flowchart of a quantum computing method for optimizing a generator set according to an embodiment of the present invention.

[0021] Figure 2 It is a schematic diagram of a processing process of a quantum computing method for optimizing a generator set according to an embodiment of the present invention.

[0022] Figure 3 It is a schematic diagram of a piecewise penalty function according to an embodiment of the present invention.

[0023] Figure 4 It is a schematic structural diagram of a single proposed layer of a variational quantum circuit according to an embodiment of the present invention.

[0024] Figure 5 It is a structural block diagram of a quantum computing device for optimizing a generator set according to an embodiment of the present invention.

[0025] Figure 6 It is a schematic diagram of an electronic device used to implement a quantum computing method for optimizing a generator set according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present invention clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present invention. The exemplary embodiments provided herein are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a quantum computing method, device, electronic device, and computer-readable storage medium for optimizing a generator set. Therefore, the present disclosure may be implemented in at least one of the following forms: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0028] In this document, terms such as first, second, etc. are only used to distinguish one entity (or operation) from another entity (or operation), and do not require or imply any order or association between these entities (or operations). In this document, the elements (such as parts, components, processes, steps) defined by the sentence "including..." do not exclude the existence of other elements in addition to the listed elements, that is, other elements that are not explicitly listed may also be included. In this document, any elements and their quantities in the drawings are used for illustration rather than limitation, and any names in the drawings are only used for distinction and do not have any limiting meaning.

[0029] The principle and spirit of the present invention are explained in detail below with reference to several exemplary or representative embodiments of the present invention.

[0030] Figure 1 A schematic flow chart of a quantum computing method for optimizing a generator set according to an embodiment of the present invention is shown, and the method comprises the following steps: S101: Acquire generator set data, wherein the generator set data includes total load power; S102: constructing an unconstrained objective function and a variational quantum circuit including training parameters according to the generator set data; S103: Substituting a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; S104: Determine the first output ratio of each generator according to the amplitude in the training quantum state; S106: Calculating an unconstrained objective function value based on the first output ratio of each generator; S107: training the training parameters of the variational quantum circuit by an optimizer; S108: In response to the training parameter or the unconstrained objective function value converging to the target value, determining the training quantum state after the evolution of the variational quantum circuit as the target quantum state; S109: Determine the second output ratio of each generator according to the amplitude in the target quantum state; S110: Determine the optimal stop state or optimal working state of each generator according to the second output ratio of each generator and the total load power; wherein, The unconstrained objective function includes the cost function and penalty function of the UC problem. The cost function is used to calculate the sum of the operating costs of all generators in the generator set, and the penalty function is used to constrain the power distribution so that the power generation of each generator depends on the product of the first output proportion of each generator and the total load power.

[0031] Specifically, a generator set is a collection of multiple generators. In the generator set combination optimization problem, the cost of each generator can be calculated by the following cost function formula:

[0032] Where, the subscript i represents the generator number, i=1,2,…,n; and are the quadratic coefficient and the linear coefficient of the cost item, respectively. is the power generated by each generator, is the unit power decision variable, and is a continuous variable. The total cost F of the generator set can be calculated by the following formula:

[0033] Where n is the number of generators in the generator set, is a binary decision variable representing the start and stop of the generator set, The values ​​0 and 1 correspond to the shutdown and startup of the generator respectively.

[0034] It is not difficult to see from the above cost function formula and the total cost F formula that the cost function of the UC problem is a specific mixed integer programming problem, which contains power continuous variables and start-stop binary variables.

[0035] In the embodiment of the present invention, the acquired generator set data may include, for example, the number of generators, serial number, total load power, and the quadratic coefficient of the cost item. and the first-order coefficient etc.; by adding a penalty function to the cost function to realize the unconstrained objective function, the unconstrained objective function only contains continuous variables, and the continuous variable is the power generation of each generator; when the total load power is constant, the power generation of each generator can be calculated according to the output proportion of each generator; when the variational quantum circuit is constructed according to the generator set data, the superposition state of the quantum state can be obtained after the variational quantum circuit evolves, and the quantum state can include basis vectors and their amplitudes. The basis vectors are set to correspond to the serial number of each generator. The output proportion of each generator can be determined according to the amplitude in the quantum state, and the output proportion of each generator is substituted into the unconstrained objective function to calculate the function value; among them, in the deep learning of the machine, the gradient descent algorithm is used to minimize the loss function, that is, the loss value calculated by the loss function is minimized, and the optimal training parameters can be obtained. In the embodiment of the present invention, the unconstrained objective function can be used as the loss function, and the gradient descent algorithm can be used to minimize the loss value during the training process. The training parameters are optimized iteratively for multiple times to obtain the target variational quantum circuit with optimized and fixed training parameters, and then the target quantum state after the evolution of the target variational quantum circuit can be output, and the optimal output ratio of each generator is determined according to the amplitude in the target quantum state, and the optimal stop state or the optimal power generation of each generator is determined according to the optimal output ratio of each generator and the total load power; wherein, when the output ratio is zero, it means that the generator is in the off state. Therefore, the technical solution of the present invention combines the classical optimization technology and the variational quantum circuit, and the power generation of each generator can be encoded by the amplitude in the quantum state to obtain the optimal stop state or the optimal power generation of each generator. At this time, the total cost of the generator set calculated is the smallest, so that the computational complexity of the unit combination optimization problem can be solved by using the quantum classical algorithm, and the technical solution of the present invention has a short training time for the variational quantum circuit, which can improve the work efficiency of optimizing the unit combination problem, and then can achieve the real-time change of the complex unit.

[0036] In some embodiments, constructing an unconstrained objective function based on the generator set data comprises the following steps: S1051: Determine the cost function, power balance constraint and power upper and lower limit constraints of the UC problem based on the generator set data, wherein the power balance constraint includes that the total power generated by each generator is equal to the total load power, and the power upper and lower limit constraints include that the power generated by each generator in the generator set is within the range from the minimum power generated by the generator to the maximum power generated by the generator; S1052: Convert the power balance constraint condition into a penalty function with a penalty value of 0, and when the penalty value is equal to 0, the sum of the operating costs of all generators in the generator set calculated by the cost function is the smallest.

[0037] Specifically, for example, the power balance constraint is set as an equality constraint, that is, the total power generated by each generator is equal to the total load power. The power balance constraint can be expressed by the following formula:

[0038] Wherein, L is the total load power of the generator set.

[0039] The upper and lower power limits are set as inequality constraints, that is, the power generation power of each generator in the generator set is within the range of the minimum power generation power to the maximum power generation power of the generator. The upper and lower power limits can be expressed by the following formula:

[0040] in, is the minimum power of the i-th generator, is the maximum power of the i-th generator.

[0041] By adding a penalty function with a penalty value of 0 to the cost function, the mixed binary programming problem can be converted into an optimization problem containing only continuous variables. When the constraints are not met, the penalty function can generate a penalty value greater than 0 in the objective function; when the constraints are met, the penalty value of the penalty function in the objective function is 0.

[0042] In some embodiments, the step of constructing an unconstrained objective function based on the generator set data may further include the following steps: S1053: constructing a penalty function according to the power balance constraint and the power upper and lower limit constraints, the penalty function including a first segment penalty function, a second segment penalty function, a third segment penalty function and a fourth segment penalty function, wherein: When the current generator power is zero, the penalty value of the penalty function is zero; When the power generation of the current generator gradually increases from zero to half of the minimum power generation, the corresponding first segmented penalty function is a monotonically increasing linear function, and the penalty value of the first segmented penalty function is greater than zero; When the power generation of the current generator gradually increases from half of the minimum power generation to the minimum power generation, the corresponding second piecewise penalty function is a monotonically decreasing linear function, and the penalty value of the second piecewise penalty function is greater than zero; When the power generation of the current generator is in the range of minimum power generation to maximum power generation, the penalty value of the corresponding third segmented penalty function is equal to zero; When the current power generation of the generator is greater than the maximum power generation, the corresponding fourth segment penalty function is a monotonically increasing linear function, and the penalty value of the fourth segment penalty function is greater than zero.

[0043] Specifically, a penalty function is constructed based on the power balance constraint and the power upper and lower limit constraints. The penalty function can be divided into multiple piecewise penalty functions, which can be referred to Figure 3 , when the generator power When treated as a continuous variable, its domain is , then the penalty value of the penalty function is equal to 0, which can make the binary variable No longer appears; therefore, the piecewise penalty function method can be used to convert the mixed binary programming problem into an optimization problem containing only continuous variables. When it is in the non-defined domain, the penalty value is greater than 0, which means that the constraint condition is not met.

[0044] In some embodiments, the penalty function with a penalty value of 0 is a third segmented penalty function. Specifically, if the current generator is turned on, when the penalty value is equal to 0, it means that the power balance constraint and the power upper and lower limit constraints are met, and the sum of the operating costs of all generators in the generator set calculated by the cost function is the smallest; if the current generator is turned off, the power generation of the current generator is 0, and the corresponding penalty value is also equal to 0, that is, in order to minimize the sum of the operating costs of the generator set, some generators are turned on and some generators are turned off.

[0045] In some embodiments, constructing a variational quantum circuit including training parameters according to the generator set data comprises the following steps: S1021: Initialize a quantum circuit, wherein the initialized quantum circuit includes m quantum bits arranged in order from low to high; S1022: The generator set data obtained also includes the number of generators, and the number of quantum bits in the variational quantum circuit is determined according to the number of generators. If the number of generators satisfies 2 m The number of quantum bits in the variational quantum circuit is determined to be m. If the number of generators does not satisfy the positive integer power of 2, the logarithm of the number of generators is calculated with 2 as the base, and the integer part of the logarithm is added with 1 to determine the number of quantum bits in the variational quantum circuit. S1023: Setting a plurality of repeatable hypothetical layers on the initialized quantum circuit to realize the construction of the variational quantum circuit, wherein each hypothetical layer includes a single-qubit gate and / or a double-qubit gate capable of generating quantum entanglement, and each single-qubit gate carries a training parameter.

[0046] Furthermore, in each hypothetical layer, each single-qubit gate is set on m qubits; the target bit of each double-qubit gate is set on the second to m-th qubits located at the second lowest position, and the control bit of the double-qubit gate is the previous low-position qubit adjacent to the target qubit of the double-qubit gate.

[0047] In an exemplary embodiment, the single-qubit gate includes: an RX gate, an RY gate, or an RZ gate; and the two-qubit gate includes a CNOT gate, a CZ gate, or a CY gate.

[0048] Specifically, a variational quantum circuit can be constructed based on the hardware efficient analogy (HEA). If the number of generators satisfies n=2 m , the constructed variational quantum circuit can contain m quantum bits; multiple repeatable simulated layers can be arranged in sequence from front to back and perform quantum operations. The "front" and "back" mentioned here refer to the "front" and "back" in the sense of time, corresponding to Figure 4 , that is, the left is the front and the right is the back, in the order from front to back, that is, in the order from left to right. In this embodiment, the variational quantum circuit may include: m quantum bits arranged in sequence from low to high, the m quantum bits may be initialized so that each quantum bit is in the |0> state, and the m quantum bits may be used to control the number of generators in the generator set n=2 m The power generated is encoded; if the number of generators does not satisfy the positive integer power of 2, then log 2 The integer part of n + 1 is used as the number of quantum bits m; therefore, the number of quantum bits m is the minimum number of quantum bits used, and no auxiliary quantum bits need to be added; as the number of quantum bits increases, the number of generators in the optimizable generator set will increase exponentially.

[0049] The initialized variational quantum circuit may include m quantum bits arranged in order from low to high, which can be denoted as q 0 ,q 1 ,q 2 …q m-1 The number of proposed layers can be set as needed. The more the number of proposed layers is set, the more accurate the calculation result will be. However, when the number is set too much, the calculation result will not necessarily be more accurate. Figure 2The number of the fictitious layers within the dotted line shown in can be set to P, or defined as P layers, for example, P=5, and multiple fictitious layers can be arranged in sequence from left to right, that is, the fictitious layers can be repeatedly operated P times; wherein each fictitious layer includes m single-qubit gates and m-1 double-qubit gates that can generate quantum entanglement, and the single-qubit gates in each fictitious layer can be set to RY gates, for example, and the training parameters carried by each single-qubit gate are, for example, rotation angles; the m single-qubit gates can be set on m qubits in sequence, and the training parameters they carry can be expressed as θ 1-1 ,θ 1-2 ,…θ 1-m ; When the training parameters carried by the RY gate in the second proposed layer can be expressed as θ 2-1 ,θ 2-2 ,…θ 2-m ; and so on; the training parameters carried by each single-qubit gate are set to be different; the two-qubit gate can be set to be a CNOT gate, for example, and the target bits of the m-1 CNOT gates are qubits q 1 ,q 2 …q m-1 , the control bits are qubit q 0 ,q 1 ,q 2 …q m-2 The operation columns of the single-qubit gate and the double-qubit gate in the hypothetical layer can be repeatedly arranged from left to right in P layers, and the two ends of the multiple hypothetical layers are respectively connected to the input and output ends of the variational quantum circuit. It is worth noting that Figure 2 The dashed lines shown in do not belong to the structure of the variational quantum circuit.

[0050] It can be seen that the variational quantum circuit ansatz to be trained can be constructed based on HEA, in which only single-qubit gate and double-qubit gate operations need to be performed. Since only two types of quantum gates, single-qubit gate and double-qubit gate, are set in the variational quantum circuit provided by the embodiment of the present invention, it is easy to implement in a specific physical experiment, avoiding the use of multi-qubit gates, simplifying the structure of the variational quantum circuit, reducing the depth of the quantum circuit, and further improving the execution efficiency of amplitude coding, and reducing the use of quantum gates.

[0051] In some embodiments, step S104: determining the first output ratio of each generator according to the amplitude in the training quantum state comprises the following steps: S1041: Corresponding each basis vector in the training quantum state to a generator, so as to realize encoding the power generation of each generator by the amplitude in the training quantum state; S1042: Determine the square of each amplitude in the training quantum state as the first output ratio of the corresponding generator, so that the total power generation of each generator in the generator set is equal to the total load power.

[0052] Specifically, the quantum state includes a basis vector and its amplitude. Each basis vector in the quantum state is set to correspond to the serial number of each generator. The quantum state after the variational quantum circuit evolution As shown in the following conditional expression:

[0053] in, is a basis vector in Hilbert space, is the amplitude. The normalization of quantum mechanics satisfies the following conditional formula:

[0054] Therefore, the quantum state Each basis vector in corresponds to a generator, which can realize the use of quantum states The amplitude coded power in Can be calibrated as the output proportion of each generator It can be seen that the normalization condition of quantum mechanics requires that the total power generated by n generators is equal to the total load power L. Therefore, the constructed variational quantum circuit can strictly generate a quantum state that satisfies the power balance constraint.

[0055] In some embodiments, step S107: training the training parameters of the variational quantum circuit by the optimizer comprises the following steps: S1071: using an optimizer to train and optimize the training parameters of the variational quantum circuit, and using a gradient descent algorithm to repeatedly iterate the optimization so that the calculated unconstrained objective function value converges to the target value; S1072: After multiple iterations of optimization, the variational quantum circuit after iteration optimization is obtained; S1073: Measure the variational quantum circuit after iterative optimization to obtain the amplitude in the target quantum state.

[0056] Specifically, a quantum-classical hybrid neural network can be constructed first. The quantum-classical hybrid neural network can include a constructed variational quantum circuit. The optimizer can adopt a classical optimizer, such as Adam or BFGS, etc. The training parameters of the variational quantum circuit in the quantum-classical hybrid neural network are trained and optimized by the classical optimizer; each iterative optimization will return a new set of parameter values ​​for optimizing the performance of the quantum-classical hybrid neural network.

[0057] refer to Figure 2In the embodiment of the present invention, the quantum computing system may include two parts: one part is a classical processor, which is used to perform classical computing and control; the other part is a quantum processor, which is used to run quantum programs to achieve quantum computing. The classical optimizer is used to set the parameter values ​​in the quantum circuit, and the parameter values ​​are sent to the quantum computing device, wherein the classical optimizer is implemented by the classical processor, and the quantum computing device is implemented by the quantum processor. Figure 2 The quantum processor in can be the processor of a real quantum machine or a classical processor that implements a quantum simulator.

[0058] In the deep learning of the machine, the gradient descent algorithm is used to minimize the loss function, that is, the loss value calculated by the loss function is minimized to obtain the optimal training parameters. In the embodiment of the present invention, the unconstrained objective function can be used as the loss function, and the output ratio of each generator can be determined according to the amplitude of the training quantum state. The output ratio of each generator is substituted into the loss function to calculate the loss value. For example, the gradient descent method is used to adjust the rotation angle of each single quantum bit gate (for example, the RY gate) in the variational quantum circuit, so as to optimize the training quantum state so that the loss function tends to be minimized. In the iterative optimization process, the new training parameters returned each time can be substituted into the variational quantum circuit to output the training quantum state after the variational quantum circuit has evolved again, measure the variational quantum circuit to obtain the amplitude of the training quantum state, and calculate the loss value, and use the calculated loss value result for further training, and reversely adjust the training parameters in the variational quantum circuit; when the loss value is the smallest, stop training, and the optimal training parameters can be obtained; at this time, fix the training parameters to obtain the target variational quantum circuit. The target variational quantum circuit is measured to obtain the amplitude in the target quantum state; the optimal output ratio of each generator is determined according to the amplitude in the target quantum state, and the optimal stop state or optimal power generation power of each generator is determined according to the optimal output ratio of each generator and the total load power; wherein, when the output ratio is zero, it indicates that the generator is in the off state.

[0059] The implementation methods and advantages of the embodiments of the present invention are described above through multiple embodiments. The specific processing process of the embodiments of the present invention is described in detail below with reference to specific examples.

[0060] Another quantum computing method for optimizing a generator set according to an embodiment of the present invention may include the following specific steps: Step S1: Determine the cost function of the UC problem.

[0061] A generator set is a collection of multiple generators. In the generator set combination optimization problem, the cost of each generator can be calculated by the following formula (1): (1) Where, the subscript i represents the generator number, i=1,2,…,n; and are the quadratic coefficient and the linear coefficient of the cost item, respectively. is the power generation of each generator, is the unit power decision variable, and is a continuous variable. The total cost F of the unit can be calculated by the following formula (2): (2) Where n is the number of generators in the generator set, is a binary decision variable representing the start and stop of the generator set, The values ​​0 and 1 correspond to the shutdown and startup of the generator respectively.

[0062] Step S2: Construct the constraints of the UC problem, including equality constraints and inequality constraints.

[0063] The power balance constraint is set as an equality constraint, and the power balance constraint can be expressed by the following formula (3): (3) Wherein, L is the total load power of the generator set.

[0064] The upper and lower power limits are set as inequality constraints. The upper and lower power limits can be expressed by the following formula (4): (4) in, is the minimum power of the i-th generator, is the maximum power of the i-th generator.

[0065] Step S3: The mixed binary programming problem can be converted into an optimization problem containing only continuous variables by using the following formulas (5)-(7).

[0066] (5) (6) (7) The mathematical symbol st (subject to) indicates a constraint condition. When treated as a continuous variable, its domain is , which makes the binary variable No longer appears.

[0067] Step S4: construct a penalty function according to the power balance constraint and the power upper and lower limit constraints, and divide the penalty function into multiple piecewise penalty functions. The piecewise penalty function can be expressed by the following formula (8): (8) Among them, λ 1 , 2 and λ 3 Both are penalty coefficients. The penalty coefficients can be adjusted according to the importance of the constraints. The larger the penalty coefficient, the stricter the constraints are observed during the optimization process. It represents the output proportion of the i-th generator's power in the total load power L.

[0068] therefore It can be expressed by the following formula (9): (9) and The following constraints are met: (10) This constraint ensures that the total power generated by all switched-on generators reaches the total load power L. Figure 3 Shows the piecewise penalty function, where the red area is the domain The slope of the linear part of the piecewise penalty function is determined by the penalty coefficient, and the slope increases linearly with the increase of the penalty coefficient.

[0069] Step S5: Add the piecewise penalty function term of the penalty function to formula (1) to obtain an unconstrained objective function, and determine the unconstrained objective function as a loss function. The loss function can be expressed by the following formula (11): (11) Step S6: constructing a variable quantum circuit according to the generator set data.

[0070] The variational quantum circuit includes a parameterized single-qubit gate Ry(θ) and a CNOT entanglement gate of order, which is divided into multiple pseudo-layers that can be repeatedly operated. The training parameter θ is a vector that can rotate the single-bit quantum state on the Bloch sphere. For example, when the number of generators n in the generator set satisfies 2 m When the number of generators n in the generator set does not satisfy 2 m When , find the logarithm of the number of generators n with base 2, that is, m is log 2 The integer part of n + 1.

[0071] A variational quantum circuit with m qubits can generate quantum states , quantum state In one 2 m dimensional Hilbert space can be expanded into a vector, the quantum state As shown in the following conditional expression:

[0072] in, is a basis vector in Hilbert space, is the amplitude. The normalization condition of quantum mechanics is shown in the following conditional formula:

[0073] The quantum state Each basis vector in corresponds to a generator, and uses the quantum state The amplitude coded power in Can be calibrated as the output proportion of each generator It can be seen that the normalization condition of quantum mechanics requires that the total power generated by n generators is equal to the total load power L. Therefore, the constructed variational quantum circuit can strictly generate a quantum state that satisfies the power balance constraint.

[0074] For example, the acquired generator set data is shown in Table 1: Table 1 Generator set data of 16 generators

[0075] In Table 1, the parameters and are the nonlinear cost coefficient (quadratic coefficient of the cost item) and the linear cost coefficient (primary coefficient) of the ith generator respectively; is the minimum power of the i-th generator, is the maximum power of the i-th generator, in MW. According to the generator set data in Table 1, a variational quantum circuit can be constructed. The variational quantum circuit can include 4 quantum bits, which are arranged from low to high and can be recorded as q 0 ,q 1 ,q 2 ,q 3 , set the initial state to all zeros. The structure of the single simulated layer used is as follows Figure 4 As shown, the variational quantum circuit may include 10 repeated pseudo layers, each of which includes 4 RY gates and 3 CNOT gates. The RY gate is a single quantum bit Y-direction rotation gate. The RY gates correspond to the quantum bits q 0 ,q 1 ,q 2 ,q 3 Each RY gate can carry training parameters, such as rotation angles, which are denoted by θ 1 ,θ 2 ,θ 3 ,θ 4; The three CNOT gates are arranged in order, and the target bits of the three CNOT gates are quantum bits q 1 ,q 2 ,q 3 , the control bits are qubit q 0 ,q 1 ,q 2 .

[0076] The corresponding binary values ​​of the serial numbers in Table 1 can be set, for example, the corresponding binary value of serial number 1 is set to 0000, the corresponding binary value of serial number 1 is set to 0001, the corresponding binary value of serial number 2 is set to 0010, ..., the corresponding binary value of serial number 14 is set to 1110, and the corresponding binary value of serial number 15 is set to 1111, so as to realize the quantum state Each basis vector in corresponds to a generator, and uses the quantum state The amplitude coded power in .

[0077] Step S7: Initialize m qubits, execute all parameter-containing quantum gates on the m qubits, measure the variational quantum circuit, and obtain the quantum final state , measure the quantum final state The amplitude on the basis vector is obtained. According to the amplitude on each basis vector, the corresponding output ratio of each generator can be calculated. , i=1,2,…,n.

[0078] Step S8: The output ratio of each generator Substitute them into the unconstrained objective function (11), and adjust the training parameters θ (including the training parameters in each proposed layer) through the gradient descent algorithm. Use the classic optimizer to iteratively solve the minimum value F of the unconstrained objective function min When the unconstrained objective function reaches the minimum value, the output ratio obtained at this time is determined as the optimal output ratio x j , calculate the optimal power generation power p j =x j ×L, and then get the optimal start and stop state and optimal output power p of each generator j .

[0079] For example, by executing steps S7 and S8, the optimal start-stop state and output power of the generator set in Table 1 can be obtained. Table 2 lists the output power of each generator when the total load power is L = 1, 2, 3, 4 (the unit of power is MW), among which the generators without listed serial numbers are turned off.

[0080] Table 2 Optimal output power of generators in generator sets

[0081] According to Table 1, the power of each generator in Table 2 basically meets the constraints of maximum power and minimum power. Even if it slightly exceeds the specified range, it is within the allowable error range; for example, the allowable error range is set to 0-8.5%. Then, according to formula (1), the minimum cost of each generator that meets the constraints can be calculated. The minimum total cost of the generator set can be obtained by summing the calculated minimum costs of each generator, and compared with the total cost of the generator set calculated by the classic solver. The comparison results are shown in Table 3.

[0082] Table 3 Minimum total cost of generator sets

[0083] It is not difficult to see from the data in Table 3 that the total cost of the generator set calculated by the quantum computing method provided in the embodiment of the present invention is compared with the calculation result of the classical solver, and the error range is within 1%. It can be seen that the total cost of the generator set calculated by the quantum computing method provided in the embodiment of the present invention has a small error and a high accuracy of the calculation result.

[0084] Corresponding to the method embodiment of the present invention, the present invention also provides a quantum computing device for optimizing a generator set, such as Figure 5 As shown, specifically, it may include: An acquisition module 510, which is used to acquire generator set data, wherein the generator set data includes total load power; A construction module 520, which is used to construct an unconstrained objective function and a variational quantum circuit including training parameters according to the generator set data; A substitution module 530, which is used to substitute a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; A first determination module 540, which is used to determine a first output ratio of each generator according to the amplitude in the training quantum state; A calculation module 550, which is used to calculate an unconstrained objective function value based on a first output ratio of each generator; A training module 560, which is used to train the training parameters of the variational quantum circuit through an optimizer; A response module 570, which is used to determine the training quantum state after the evolution of the variational quantum circuit as the target quantum state in response to the training parameter or the unconstrained objective function value converging to the target value; A second determination module 580, which is used to determine a second output ratio of each generator according to the amplitude in the target quantum state; The third determination module 590 is used to determine the optimal stop state or optimal working state of each generator according to the second output ratio of each generator and the total load power; wherein, The unconstrained objective function includes the cost function and penalty function of the UC problem. The cost function is used to calculate the sum of the operating costs of all generators in the generator set, and the penalty function is used to constrain the power distribution so that the power generation of each generator depends on the product of the first output proportion of each generator and the total load power.

[0085] In another aspect, the present invention further provides an electronic device, see Figure 6 , Figure 6 1 is a block diagram of the structure principle of an electronic device according to an embodiment of the present invention. Figure 6 As shown, the electronic device includes a processor 601 and a memory 602 storing computer program instructions; when the processor 601 executes the computer program instructions, the quantum computing method for optimizing the generator set in the above-mentioned embodiment is implemented.

[0086] Specifically, the processor 601 may include a central processing unit (CPU) or a graphics processing unit (GPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of an embodiment of the present invention. The memory 602 may include a memory for data or instructions. For example, the memory 602 may be at least one of the following: a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, a universal serial bus (USB) drive, or other physical / tangible memory storage device. For another example, the memory 602 includes a removable or non-removable (or fixed) medium. For another example, the memory 602 may be inside or outside the integrated gateway disaster recovery device. The memory 602 may be a non-volatile solid-state memory. In other words, typically the memory 602 includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with executable instructions, wherein when the stored executable instructions are executed by the processor 601 (such as executed by one or more processors), the quantum computing method for optimizing the generator set in the embodiment of the present invention can be implemented.

[0087] In one example, Figure 6The electronic device shown may also include a communication interface 603 and a bus 610. The processor 601, the memory 602, and the communication interface 603 are connected and communicate with each other via the bus 610. The communication interface 603 is mainly used to implement communication between modules, devices, units, and / or devices in the electronic device.

[0088] The bus 610 includes hardware, software or both, and can couple the components of the online data traffic billing device to each other. For example, the bus may include at least one of the following: an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus. The bus 610 may include one or more buses. Although the embodiments of the present invention describe or show a specific bus, the embodiments of the present invention may consider any suitable bus or interconnection method.

[0089] On the other hand, an embodiment of the present invention further provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the aforementioned quantum computing method for optimizing a generator set is implemented.

[0090] The flowchart and / or block diagram of the method and system of the embodiment of the present invention are described above by way of example, and various aspects of the related aspects are described. It should be understood that each box or combination thereof in the flowchart and / or block diagram can be implemented by computer program instructions, or by dedicated hardware that performs specified functions or actions, or by a combination of dedicated hardware and computer instructions. For example, these computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to form a machine that enables these instructions executed by such a processor to enable the implementation of the functions / actions specified in each box or combination thereof in the flowchart and / or block diagram. Such a processor can be a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit.

[0091] The functional blocks shown in the structural block diagram of the embodiment of the present invention can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required task. The program or code segment can be stored in a memory, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0092] It should be noted that the present invention is not limited to the specific configurations and processes described above or shown in the figures. The above is only a specific implementation mode of the present invention. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the described system, device, module or unit can refer to the corresponding process in the method embodiment without further description. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be covered within the protection scope of the present invention.

Claims

1. A quantum computing method for optimizing a generator set, characterized in that: include: Acquire generator set data, wherein the generator set data includes total load power; Construct an unconstrained objective function and a variational quantum circuit containing training parameters based on the generator set data; Substituting preset parameter values ​​as training parameters into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; Determine the first output proportion of each generator according to the amplitude in the training quantum state; Calculate the unconstrained objective function value based on the first output proportion of each generator; Training the training parameters of the variational quantum circuit by an optimizer; In response to the training parameter or the unconstrained objective function value converging to the target value, determining the training quantum state after the evolution of the variational quantum circuit as the target quantum state; Determine the second output proportion of each generator according to the amplitude in the target quantum state; Determining the optimal stop state or optimal working state of each generator according to the second output proportion of each generator and the total load power; Among them, the unconstrained objective function includes the cost function and penalty function of the UC problem. The cost function is used to calculate the sum of the operating costs of all generators in the generator set, and the penalty function is used to constrain the power distribution so that the power generation of each generator depends on the product of the first output proportion of each generator and the total load power.

2. The method according to claim 1, characterized in that The unconstrained objective function is constructed according to the generator set data, including: Determine the cost function, power balance constraint and power upper and lower limit constraint of the UC problem based on the generator set data, wherein the power balance constraint includes that the total power generated by each generator is equal to the total load power, and the power upper and lower limit constraint includes that the power generated by each generator in the generator set is within the range from the minimum power generated by the generator to the maximum power generated by the generator; The power balance constraint and the power upper and lower limit constraint are converted into a penalty function with a penalty value of 0, and when the penalty value is equal to 0, the sum of the operating costs of all generators in the generator set calculated by the cost function is the smallest.

3. The method according to claim 2, characterized in that The constructing of the unconstrained objective function according to the generator set data also includes: A penalty function is constructed according to the power balance constraint and the power upper and lower limit constraints, and the penalty function includes a first segment penalty function, a second segment penalty function, a third segment penalty function and a fourth segment penalty function, wherein: When the current generator power is zero, the penalty value of the penalty function is zero; When the power generation of the current generator gradually increases from zero to half of the minimum power generation, the corresponding first segmented penalty function is a monotonically increasing linear function, and the penalty value of the first segmented penalty function is greater than zero; When the power generation of the current generator gradually increases from half of the minimum power generation to the minimum power generation, the corresponding second piecewise penalty function is a monotonically decreasing linear function, and the penalty value of the second piecewise penalty function is greater than zero; When the power generation of the current generator is between the minimum power generation and the maximum power generation, the penalty value of the corresponding third segment penalty function is zero; When the current power generation of the generator is greater than the maximum power generation, the corresponding fourth segment penalty function is a monotonically increasing linear function, and the penalty value of the fourth segment penalty function is greater than zero.

4. The method according to claim 3, characterized in that The penalty function with a penalty value of 0 is the third segmented penalty function.

5. The method according to claim 1, characterized in that The step of training the training parameters of the variational quantum circuit by an optimizer comprises: Using an optimizer to train and optimize the training parameters of the variational quantum circuit, and using a gradient descent algorithm to repeatedly iterate the optimization so that the calculated unconstrained objective function value converges to the target value; After multiple iterations of optimization, the variational quantum circuit after iterative optimization is obtained; The variational quantum circuit is measured after iterative optimization to obtain the amplitude in the target quantum state.

6. The method according to claim 1, characterized in that The determining the first output ratio of each generator according to the amplitude in the training quantum state includes: Each basis vector in the training quantum state corresponds to a generator, so as to realize encoding the power generation of each generator by the amplitude in the training quantum state; The square of each amplitude in the training quantum state is determined as the first output ratio of the corresponding generator, so that the total power generation of each generator in the generator set is equal to the total load power.

7. The method according to any one of claims 1 to 6, characterized in that: The step of constructing a variational quantum circuit including training parameters according to the generator set data includes: Initializing a quantum circuit, wherein the quantum circuit comprises m quantum bits arranged in order from low to high; The generator set data obtained also includes the number of generators, and the number of quantum bits in the variational quantum circuit is determined according to the number of generators; A plurality of repeatably operable hypothetical layers are arranged on the quantum circuit to construct the variational quantum circuit, wherein each hypothetical layer includes a single-qubit gate and / or a double-qubit gate capable of generating quantum entanglement, and each single-qubit gate carries a training parameter.

8. A quantum computing device for optimizing a generator set, characterized in that: include: An acquisition module, which is used to acquire generator set data, wherein the generator set data includes total load power; A construction module, which is used to construct an unconstrained objective function and a variational quantum circuit including training parameters according to the generator set data; A substitution module, which is used to substitute a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; A first determination module, which is used to determine a first output ratio of each generator according to the amplitude in the training quantum state; A calculation module, which is used to calculate the unconstrained objective function value based on the first output ratio of each generator; A training module, which is used to train the training parameters of the variational quantum circuit through an optimizer; A response module, which is used to determine the training quantum state after the evolution of the variational quantum circuit as the target quantum state in response to the training parameter or the unconstrained objective function value converging to the target value; A second determination module, which is used to determine the second output ratio of each generator according to the amplitude in the target quantum state; A third determination module, which is used to determine the optimal stop state or optimal working state of each generator according to the second output ratio of each generator and the total load power; Among them, the unconstrained objective function includes the cost function and penalty function of the UC problem. The cost function is used to calculate the sum of the operating costs of all generators in the generator set, and the penalty function is used to constrain the power distribution so that the power generation of each generator depends on the product of the first output proportion of each generator and the total load power.

9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the electronic device executes the computer program instructions, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Quantum computing method, device and equipment for unit commitment optimization and medium

    CN118966371A

  • Quantum calculation method and device for optimizing generator set, equipment and medium

    CN118966730A

  • Quantum computing method and device for optimizing unit commitment, equipment and medium

    CN118967364A

  • Quantum state preparation method, device, equipment and medium

    CN119416904A

  • Quantum state amplitude coding method, device, equipment and medium

    CN119416906A