Quantum computing method, device, equipment and medium for optimizing power generation units
The quantum system corresponding to the generator set is constructed through quantum computing methods, which solves the problem of high computational complexity in large-scale power systems in traditional methods, and achieves rapid, accurate solution and efficient processing of unit combination optimization problems.
Patent Information
- Application Number
- CN202411450877.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-10-17
AI Technical Summary
The traditional unit combination optimization problem is highly complex in large-scale power systems, and it is difficult to meet the real-time change needs. Especially as the number of units increases, the search space increases exponentially, reducing the accuracy of the solution results.
By using quantum computing method, by constructing a quantum system corresponding to the generator set, the objective function and constraints are converted into Hamiltonian of the quantum system, the quantum circuit with adjustable parameters is used to adjust the expected value until converges, and the optimal value is obtained through measurement operations. untie.
It realizes rapid and accurate solution to unit combination optimization problems, improves work efficiency, can cope with real-time changes in complex units, and reduces training time.
Smart Images

Figure CN118966730B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing, and in particular to a quantum computing method, device, computing equipment and computer-readable storage medium for optimizing a generator set. Background Art
[0002] The unit commitment (UC) problem is a core issue in power system planning and operation. Its purpose is to minimize the power generation cost and meet the user's demand for electricity by reasonably dispatching the generators in the power system. The essence of this problem is a mixed-integer programming (MIP) problem, which involves both continuous and discrete variables, making the solution of the problem particularly complex.
[0003] Traditional solutions to unit combination optimization problems rely on professional MIP solvers such as CPLEX, Gurobi, SCIP, and COPT. These solvers have the ability to handle complex mathematical optimization problems and can find optimal or near-optimal solutions. However, with the continuous expansion of the scale of power systems, the computational complexity of unit combination optimization problems has also increased, which has placed higher requirements on the performance of traditional optimizers. Although these solvers integrate multiple algorithms, traditional optimizers still face the problem of long calculation time when dealing with large-scale UC problems, making it difficult to cope with real-time changes in power systems. In addition, as the number of units increases, this will cause the search space to grow exponentially, making the problem very difficult to solve and reducing the accuracy of the solution results. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the present invention proposes a quantum computing method, device, equipment and medium for optimizing a generator set, so as to achieve a rapid solution to the UC problem and meet the real-time requirements of a large-scale power system.
[0005] According to one aspect of the present application, the present application provides a quantum computing method for optimizing a generator set, including: determining the objective function, power balance constraint, and upper and lower limits of active output constraints of the UC problem based on the generator set data, wherein the objective function is used to calculate the sum of the operating costs of all generators in the generator set, the power balance constraint includes that the power generation power of the generator set is equal to the total load power; the upper and lower limits of active output constraints include that the power generation power of each generator in the generator set is within the range from the minimum power generation power of the generator to the maximum power generation power of the generator; converting the power balance constraint into a first penalty item, and converting the upper and lower limits of active output constraints into a second penalty item and a third penalty item , adding the first penalty term, the second penalty term and the third penalty term to the objective function to form an unconstrained objective function; mapping the unconstrained objective function to the Hamiltonian of the quantum system; constructing a quantum system corresponding to the generator set, wherein the generator in the generator set corresponds to the quantum bit in the quantum system; constructing a quantum circuit containing adjustable parameters based on the quantum system; adjusting the parameter value in the quantum circuit to reduce the expected value of the quantum system with respect to the Hamiltonian until the expected value with respect to the Hamiltonian converges; measuring the quantum circuit when the expected value converges, and taking the measurement result as the optimal solution to the UC problem; determining the generator corresponding to the quantum bit in the optimal solution to the UC problem based on the corresponding relationship between the quantum bit and the generator.
[0006] According to the quantum computing method as described above, the first penalty term includes a smooth monotonically increasing function with a first difference obtained by subtracting the total load power from the power generation power of the generator set as an independent variable and a function value greater than or equal to zero; the second penalty term includes a smooth monotonically increasing function with a second difference obtained by subtracting the first slack variable and the minimum power generation power of each generator from the power generation power of each generator in the generator set as an independent variable and a function value greater than or equal to zero; the third penalty term includes a smooth monotonically increasing function with a third difference obtained by subtracting the maximum power generation power of each generator from the sum of the power generation power of each generator in the generator set and the second slack variable as an independent variable and a function value greater than or equal to zero.
[0007] In the quantum computing method as described above, the smooth monotonically increasing function is a power function.
[0008] In the quantum computing method as described above, the exponent of the power function is an even number greater than or equal to 2.
[0009] In the quantum computing method as described above, the quantum circuit with adjustable parameters includes multiple layers of quantum circuit units connected end to end, and the adjustable parameter value in each layer of quantum circuit can be adjusted independently during the adjustment process.
[0010] In the quantum computing method as described above, each layer of quantum circuit units includes a single-bit rotation gate acting on each quantum bit and a CNOT gate acting on two adjacent quantum bits, wherein the quantum bit with a smaller serial number is the control bit of the CNOT gate, and the quantum bit with a larger serial number is the target bit of the CNOT gate.
[0011] In the quantum computing method as described above, the operating cost of each generator in the objective function is expressed as the product of the operating cost of each generator and the first variable of each generator, wherein the first variable is used to characterize whether each generator is in an on state or an off state; the power generation of the generator group in the first penalty term is expressed as the sum of the power generation of all generators in the generator group, and the power generation of each generator is expressed as the product of the power generation of each generator and the first variable of each generator; the maximum power generation of each generator in the third penalty term is the product of the maximum power generation of each generator and the first variable of each generator, and the minimum power generation of each generator in the second penalty term is the product of the minimum power generation of each generator and the first variable of each generator. Correspondingly, the unconstrained objective function is mapped to the Hamiltonian expression of the quantum system by converting the first variable in the unconstrained objective function into a Pauli Z operator expression.
[0012] According to a second aspect of the present application, a quantum computing device for optimizing a generator set is provided, comprising: a function construction module, configured to determine an objective function, a power balance constraint, and an upper and lower limit constraint of active output of a UC problem based on generator set data, wherein the objective function is used to calculate the sum of the operating costs of all generators in the generator set, the power balance constraint comprises that the power generation power of the generator set is equal to the total load power; the upper and lower limit constraint of active output comprises that the power generation power of each generator in the generator set is within the range from the minimum power generation power of the generator to the maximum power generation power of the generator; a function conversion module, configured to convert the power balance constraint into a first penalty term, convert the upper and lower limit constraint of active output into a second penalty term and a third penalty term, and increase the first penalty term, the second penalty term, and the third penalty term. The invention relates to a method for obtaining a quantum computer system comprising: adding a quantum computer system to a quantum system and a quantum computer program product to the quantum computer program product of the invention to a quantum computer program product of the invention; and adding the quantum computer system to the objective function to form an unconstrained objective function; a Hamiltonian construction module, configured to map the unconstrained objective function to the Hamiltonian of the quantum system; a quantum system construction module, configured to construct a quantum system corresponding to the generator set, wherein the generator in the generator set corresponds to the quantum bit in the quantum system; a quantum circuit module, configured to construct a quantum circuit containing adjustable parameters based on the quantum system; a parameter adjustment module, configured to adjust the parameter value in the quantum circuit so that the expected value of the quantum system with respect to the Hamiltonian is reduced until the expected value with respect to the Hamiltonian converges; an optimal solution acquisition module, configured to measure the quantum circuit when the expected value converges, and use the measurement result as the optimal solution to the UC problem; and determining the generator corresponding to the quantum bit in the optimal solution to the UC problem based on the corresponding relationship between the quantum bit and the generator.
[0013] According to a third aspect of the present application, there is provided an electronic device, comprising a processor and a memory, wherein the memory stores computer instructions, and the processor executes the quantum computing method for optimizing a generator set as described above when running the computer instructions.
[0014] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the quantum computing method for optimizing a generator set as described above is executed.
[0015] This application uses quantum computing methods to solve the unit combination optimization problem, and can accurately solve the unit combination that minimizes the power generation cost. Furthermore, from the perspective of operating time, the training time of the technical solution of this application is relatively short, which improves the work efficiency of solving the unit combination problem and can cope with the real-time changes of complex units. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The preferred embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein:
[0017] Figure 1 It is a flow chart of a quantum computing method for optimizing a generator set according to one embodiment of the present application.
[0018] Figure 2 It is a schematic diagram of a quantum circuit structure according to an embodiment of the present application.
[0019] Figure 3 It is a flow chart of a quantum circuit parameter adjustment method according to an embodiment of the present invention.
[0020] Figure 4 It is a schematic diagram of the structure of the line ansatz to be trained according to an embodiment of the present application.
[0021] Figure 5 It is a schematic diagram of measurement results according to an embodiment of the present application.
[0022] Figure 6 It is a principle block diagram of a quantum computing device for unit combination optimization according to an embodiment of the present application.
[0023] Figure 7 It is a principle block diagram of a quantum computing system for unit combination optimization according to an embodiment of the present application.
[0024] Figure 8 It is a principle block diagram of a quantum computing system for unit combination optimization according to another embodiment of the present application.
[0025] Fig. 9 It is a structural principle block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] 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 conjunction with the drawings in 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.
[0027] In the following detailed description, reference may be made to the various specification drawings that are part of the present application and are used to illustrate specific embodiments of the present application. In the accompanying drawings, similar reference numerals describe substantially similar components in different figures. The various specific embodiments of the present application are described below in sufficient detail so that a person of ordinary skill in the art with relevant knowledge and skills in the art can implement the technical solutions of the present application. It should be understood that other embodiments may also be used or structural, logical or electrical changes may be made to the embodiments of the present application.
[0028] This application uses quantum computing to solve the UC problem to optimize the combination of generator sets, which not only ensures the accuracy of the solution results, but also has efficient computing performance and can quickly solve the optimal solution for the generator set.
[0029] Figure 1 FIG. 1 is a flow chart of a quantum computing method for optimizing a generator set according to an embodiment of the present application. Figure 1 As shown,
[0030] S11, determining the objective function, power balance constraint and upper and lower limits of active output of the UC problem based on the data of the generator set, wherein the objective function is used to calculate the sum of the operating costs of all generators in the generator set, the power balance constraint includes that the power generation of the generator set is equal to the total load power; the upper and lower limits of active output constraint includes that the power generation of each generator in the generator set is within the range from the minimum power generation of the generator to the maximum power generation of the generator;
[0031] S12, converting the power balance constraint condition into a first penalty term, converting the upper and lower limit constraints of active output into a second penalty term and a third penalty term, and adding the first penalty term, the second penalty term and the third penalty term to the objective function to form an unconstrained objective function;
[0032] S13, mapping the unconstrained objective function into the Hamiltonian of the quantum system;
[0033] S14, constructing a quantum system corresponding to the generator set, wherein the generators in the generator set correspond to the quantum bits in the quantum system;
[0034] S15, constructing quantum circuits with adjustable parameters based on quantum systems;
[0035] S16, adjusting the parameter value in the quantum circuit so that the expectation value of the quantum system with respect to the Hamiltonian is reduced until the expectation value with respect to the Hamiltonian converges;
[0036] S17, measuring the quantum circuit when the expected value converges, and taking the measurement result as the optimal solution to the UC problem;
[0037] S18, based on the correspondence between quantum bits and generators, determine the generator corresponding to the quantum bits in the optimal solution to the UC problem.
[0038] The operating cost of each generator in the objective function is expressed as the product of the operating cost of each generator and the first variable of each generator, wherein the first variable is used to characterize whether the generator is in an on state or an off state. The objective function is expressed by the following formula:
[0039] ; (1)
[0040] ; (2)
[0041] Among them, F is the operating cost of all generators in the generator set, A i is the operating cost of the i-th generator, y i The first variable indicates whether the generator is on or off. represents the output power of the i-th generator or the generated power, is the fixed cost coefficient generated when the i-th generator is started, , are the fixed linear and quadratic coefficients of the i-th generator respectively.
[0042] In this embodiment, the first variable y i The value of is a binary number, which is either 0 or 1, and is used as the decision variable to determine the start and stop of the current generator. Therefore, in the objective function, the operating cost of each generator is expressed as the generator operating cost A i and the first variable y indicating whether the generator is on or off i The product of .
[0043] The power balance constraint is expressed as follows:
[0044] ; (3)
[0045] in, represents the power generated by the i-th generator, y i The first variable indicates whether the generator is in the on or off state, L is the total load power, and the total number of generators in the generator set is N.
[0046] The upper and lower limits of active output are expressed by the following formula:
[0047] ; (4)
[0048] in, represents the power generated by the i-th generator, represents the maximum power generation of the i-th generator, represents the minimum power generation of the i-th generator.
[0049] Based on the aforementioned constraints, when converting the constraints into penalty items of the objective function in step S12, the power balance constraints are converted into the first penalty item, the upper and lower limit constraints of active output are converted into the second penalty item and the third penalty item, and the first penalty item, the second penalty item and the third penalty item are added to the objective function to form an unconstrained objective function.
[0050] Since the present application needs to map the unconstrained objective function to the Hamiltonian of the quantum system in the subsequent steps, and the Hamiltonian represents energy and cannot produce mutations, and for the convenience of optimization, the penalty term of the present invention adopts a smooth monotonic function. In order to generate a penalty value in the objective function when the constraint condition is not satisfied, and to be 0 in the objective function when the constraint condition is satisfied, the function value of the smooth monotonic function corresponding to the penalty term should be greater than or equal to 0. In one embodiment, the smooth monotonic function is a power function, and further, the power function exponent is greater than or equal to an even number of 2.
[0051] Of course, the first penalty term and the second penalty term may also be other functions. For example, the first penalty term may be an exponential function or a sigmoid function with e as the base and the first difference between the power generation power of the generator set and the load power as the independent variable. A person skilled in the art may select any function according to application habits.
[0052] According to one embodiment of the present application, the first penalty term includes a smooth monotonically increasing function with a first difference obtained by subtracting the total load power from the power generation power of the power generation set as an independent variable and a function value greater than or equal to zero. The power generation power of the power generation set in the first penalty term is expressed as the sum of the power generation powers of all the generators in the power generation set, and the power generation power of each generator is expressed as the product of the power generation power of each generator and the first variable of each generator.
[0053] The first penalty term is expressed as follows:
[0054] ; (5)
[0055] According to one embodiment of the present application, the second penalty term includes a smooth monotonically increasing function whose second difference is obtained by subtracting the first slack variable and the minimum power generation of each generator from the power generation of each generator in the generator set as an independent variable and whose function value is greater than or equal to zero. The minimum power generation of each generator in the second penalty term is the product of the minimum power generation of each generator and the first variable of each generator.
[0056] The second penalty term is expressed as follows:
[0057] ; (6)
[0058] in, is the first slack variable of the i-th generator.
[0059] According to one embodiment of the present application, the third penalty term includes a smooth monotonically increasing function in which the third difference obtained by subtracting the maximum power generation of each generator from the sum of the power generation of each generator in the generator set and the second slack variable is the independent variable and the function value is greater than or equal to zero. The maximum power generation of each generator in the third penalty term is the product of the maximum power generation of each generator and the first variable of each generator.
[0060] The third penalty term is expressed using the following formula:
[0061] ; (7)
[0062] in, is the second slack variable of the i-th generator.
[0063] The first penalty term, the second penalty term, and the third penalty term are added to the objective function to form an unconstrained objective function, i.e., a global optimization formula. The unconstrained objective function is expressed by the following formula:
[0064] ; (8)
[0065] in, is the weight value of the first penalty term. The weight coefficient determines the weight of the balanced power constraint condition. Increasing the coefficient value will make the corresponding balanced power constraint more strictly satisfied. On the contrary, reducing the coefficient value will relax the corresponding constraint.
[0066] According to formula (5), when the power generation of the generator set is equal to the total load power, that is, when formula (3) is satisfied, the result of formula (5) is 0. According to formula (8), this means that when the power balance constraint is satisfied, the cost calculation result of the objective function is not penalized; and when the power generation of the generator set is not equal to the total load power, that is, when formula (3) is not satisfied, the result of formula (5) is greater than 0. According to formula (8), this means that when the power balance constraint is not satisfied, a penalty value is generated in the cost calculation result of the objective function, and the size of the penalty value is proportional to the square of the degree of deviation from the constraint.
[0067] By adding the first slack variable and the second slack variable The upper and lower limits of active output are introduced into the constraints, and the upper and lower limits of active output are converted into the second and third penalty terms of the objective function. Among them, the first slack variable and the second slack variable It can be a constant estimated from experiments.
[0068] Therefore, when optimizing and finding the minimum value of a new objective function (8) containing cost terms and penalty terms, it means that the unit combination with the minimum cost can be obtained while satisfying the power balance constraint and the upper and lower limit constraints of active output.
[0069] In this embodiment, the penalty term uses a power function with an exponent of 2. However, it can be known that the exponent can also be other values. In order to ensure that a positive penalty value can be generated for the cost calculation result of the objective function when the condition is not met, the exponent of the power function can also be other even numbers greater than 2.
[0070] In step S13, when the unconstrained objective function is mapped to the Hamiltonian expression of the quantum system, it can be seen from the spin-binary transformation that the binary 0 and 1 have a corresponding relationship with the Pauli Z operator in the quantum system. In this embodiment, referring to formula (8), it can be seen that when the generator set data is determined, only the first variable y in the unconstrained objective function i is an uncertain variable, and the values of other parameters are all known. i is a binary quantity, so the first variable y i Convert to Pauli Z operator expression:
[0071] (9)
[0072] in, Represents the Hamiltonian exist =0 when the energy value is Represents the Hamiltonian exist =1 when the energy value.
[0073] According to the spin-binary transformation, the objective function and the first penalty term, the second penalty term and the third penalty term are converted into the following formula:
[0074] ; (10)
[0075] ; (11)
[0076] in, ;
[0077] ; (12)
[0078] Combining the above two we get:
[0079] ; (13)
[0080] in, .
[0081] The unconstrained objective function is mapped to the Hamiltonian of the quantum system. After expanding the unconstrained objective function and merging similar terms, the following equation (14) involving the spin-coupled multi-body Hamiltonian is finally obtained:
[0082] ; (14)
[0083] in, ;
[0084] ;
[0085] ;
[0086] ;
[0087] .
[0088] In step S15, when constructing a quantum circuit with adjustable parameters, the number of quantum bits in the quantum circuit is equal to the number N of generators in the generator set. Therefore, the quantum state of each quantum bit in the quantum circuit can be used to represent the working state of the corresponding generator. Among them, the quantum circuit with adjustable parameters can be an ansatz of N quantum bits with sufficient expression ability to be trained. This ansatz can be based on hardware efficient simulation (HEA) or other applicable quantum circuit forms. The structure of ansatz should be designed to fully utilize the potential of quantum resources and ensure efficient operation on existing quantum hardware.
[0089] In step S15, according to the Hamiltonian expression (14), it can be known that there are two Pauli Z operators including a single Pauli Z operator and a product relationship. The Pauli Z operator can be realized by a single-bit rotation gate. For the single Pauli Z operator, it is embodied by a single-bit rotation gate acting on a single quantum bit. For the product relationship, it can be embodied by an entanglement gate (such as a CNOT gate) acting on two adjacent quantum bits. Among them, the rotation angle of the rotation gate is used as an adjustable parameter. In order to improve the expression ability of the quantum circuit, this embodiment uses the quantum gate that realizes the Hamiltonian expression (10) as a quantum circuit unit. The entire quantum circuit includes multiple layers of quantum circuit units connected end to end. The adjustable parameter values in each layer of quantum circuit can be adjusted independently during the adjustment process. Each layer of quantum circuit units includes a single-bit rotation gate acting on each quantum bit and a CNOT gate acting on two adjacent quantum bits, wherein the quantum bit with a smaller sequence number is the control bit of the CNOT gate, and the quantum bit with a larger sequence number is the target bit of the CNOT gate.
[0090] Figure 2 FIG. 1 is a schematic diagram of a quantum circuit structure according to an embodiment of the present application. Figure 2As shown in the figure, in this embodiment, the quantum circuit includes an input part, multiple layers of quantum circuit units connected end to end, and a measurement part. The multiple layers of quantum circuit units connected end to end are shown in the dotted box in the figure. The principle of each layer of quantum circuit unit is as follows Figure 2 As shown in the solid box in the figure, it includes a revolving gate R(θ) acting on each quantum bit. The revolving gate R(θ) can be R X , R Y or R Z , the rotation angle θ is an adjustable parameter. It can be known that the revolving door R(θ) can be one or more. Figure 2 Only one is shown in the schematic diagram. Entanglement gates are set between all two adjacent quantum bits, such as the CNOT gate in the figure. The number of quantum bits is N. In one embodiment, the N quantum bits correspond to the generators in the generator set one by one. In the present invention, the parameter value in the quantum circuit is adjusted by a classical optimizer (such as Adam, BFGS, etc.) in a way that reduces the expected value of the Hamiltonian of the quantum system, that is, the rotation angle θ of each rotating gate, until the expected value of the Hamiltonian converges.
[0091] Figure 3 is a flow chart of a quantum circuit parameter adjustment method according to an embodiment of the present invention, combined with Figure 2 , the parameter adjustment method comprises the following steps:
[0092] Step S161, setting each parameter value θ in the quantum circuit by a classical optimizer, and sending the parameter value θ to a quantum computing device, wherein the classical optimizer is implemented by a classical processor, and the quantum computing device is implemented by a quantum processor, Figure 3 The quantum processor in can be the processor of a real quantum machine or a classical processor that implements a quantum simulator.
[0093] Step S162, initializing the quantum state of all quantum bits to zero state.
[0094] Step S163, executing the Hadamard gate on all quantum bits respectively to obtain a mixed uniform state, wherein this step is an optional step.
[0095] Step S164, setting the number of quantum circuit layers t=1.
[0096] Step S165, traverse i from 1 to N, and perform i Execute a revolving door.
[0097] Step S166, traverse i from 1 to N, and execute the CNOT gate on two adjacent quantum bits.
[0098] Step S167, set the number of quantum circuit layers t=t+1.
[0099] Step S168, determine whether the quantum circuit layer number t is equal to the current total number of quantum circuit layers T. If the quantum circuit layer number t is equal to the current total number of quantum circuit layers T, it means that the current quantum circuit has evolved and the evolved quantum state is generated. , then execute step S169. If the number of quantum circuit layers t is not equal to the total number of quantum circuit layers T, then return to step S165 and execute the next quantum circuit unit.
[0100] Step S169, measuring the Pauli Z operator of each quantum bit and the Pauli Z operators of two adjacent quantum bits, and sending the measurement results to the classical optimizer;
[0101] Step S1610, the classical optimizer calculates the expected value of the Hamiltonian H based on equation (14) and the measurement results;
[0102] Step S1611, the classical optimizer calculates the expected value descent gradient of the current Hamiltonian H;
[0103] Step S1612, determine whether the descent gradient is zero, that is, whether the currently calculated Hamiltonian H is decreasing. If it is decreasing, it means that the expected value of the current Hamiltonian H has not converged, and then return to step S161 to continue adjusting the specific value of parameter θ. If the descent gradient is zero, it means that the expected value of the currently calculated Hamiltonian H is no longer decreasing, and it is considered that the expected value of Hamiltonian H has converged, and the output is Evolved quantum state , the parameter adjustment is completed, and the energy of the system is the lowest at this time.
[0104] After the parameter adjustment is completed, in step S17, the quantum circuit is measured at the time of expected value convergence. The measurement result corresponds to the ground state of the quantum bit of the generator, which corresponds to the optimal solution of the UC problem. Basis measurement quantum state Repeat this process several times and the resulting string of 01 is the solution to the original problem.
[0105] That is, when the ground state of the quantum bit is 1, the generator corresponding to the quantum bit is turned on, and when the ground state of the quantum bit is 0, the generator corresponding to the quantum bit is turned off, thereby obtaining a generator combination that satisfies the lowest cost and the constraints at the same time. Among them, whether the optimal solution can be obtained in the measurement result is usually related to the total number of quantum circuit layers T, which cannot be too small or too large. A more suitable total number of quantum circuit layers T can be obtained through a limited number of experiments.
[0106] The above describes the implementation methods and advantages of the embodiments of the present application through multiple embodiments. This application describes the specific processing process of the embodiments of the present application in detail with reference to specific examples.
[0107] Assume that the generator set includes three generators numbered #1, #2 and #3, and the relevant data of the three generators are shown in Table 1 below:
[0108]
[0109] Among them, p i For the power generation, in order to verify the upper and lower limits of the output, the power of the unit numbered #1 is not within the maximum power generation and minimum power generation between.
[0110] According to the above theoretical process, the Hamiltonian H for the above data is set, and is 10.
[0111] Use quantum software to construct a circuit to be trained ansatz such as Figure 4 Shown. Participate Figure 4 , the circuit ansatz to be trained has 3 quantum bits in total, corresponding to the three generators in Table 1. The number of quantum circuit layers in the training circuit ansatz is 5, that is, the quantum circuit unit is repeated 5 times.
[0112] Balanced power Total load power Take 50, 100, 150, and 200 respectively, and conduct four simulation tests. Each test is measured 1000 times. The measurement results are as follows Figure 5 Compared with the traditional exhaustive method, the following table 2 is obtained. Figure 5 As can be seen from Table 2, the exhaustive method, i.e. the traditional solution method, only considers the results of the constraint conditions of balanced power.
[0113] Table 2
[0114]
[0115] When the total load power is 50, the results of the exhaustive method, quantum algorithm (power balance), and quantum algorithm (power balance + upper and lower limits) are the same, all of which are "100", that is, the generator numbered #3 is working, and the minimum total cost is 2049.145;
[0116] When the total load power is 100, the results of the exhaustive method are both "010" and "001", that is, the generator numbered #2 is working, and the generator numbered #1 is working. The minimum total cost is 1258.03; the probability of the result of the quantum algorithm (power balance) being "010" is 0.218, that is, the generator numbered #2 is working, and the probability of the result being "001" is 0.782, that is, the generator numbered #1 is working; the probability of the result of the quantum algorithm (power balance + upper and lower limits) being "010" is 1, that is, the generator numbered #2 is working, and the total cost of the three is 1258.03, and so on.
[0117] As can be seen from Table 2, the 01 strings obtained by the variational quantum algorithm and the exhaustive method for solving the technical solution of the present application are highly consistent, indicating that the technical solution of the present application can obtain an accurate solution to the corresponding problem model. The simulation experiment conducted by the quantum computing software MindSpore Quantum in the above test shows that for a specific power load L, the technical solution of the present invention can obtain an accurate solution to the corresponding problem model. This result not only fully demonstrates the accuracy of the technical solution of the present invention, but also verifies its feasibility and effectiveness. Further, according to the running time of the quantum computing software, the training time of the technical solution of the present invention is only about 0.2 seconds, which improves the work efficiency of solving the unit combination problem and can cope with the real-time changes of complex units. Finally, the design of the quantum circuit of the present application only needs to use a single quantum bit gate and a CNOT gate between adjacent quantum bits, without the need for complex multi-qubit gate operations. This simplified circuit design significantly reduces the complexity of the physical implementation, making the technical solution easier to deploy and execute in an experimental environment.
[0118] In another aspect, the present invention also provides a quantum computing device for optimizing a power generation unit. Figure 6 , Figure 6 1 is a principle block diagram of a quantum computing device for optimizing a generator set according to an embodiment of the present application. The unit combination optimization device 10 in this embodiment includes:
[0119] The function construction module 11 is configured to determine the objective function, power balance constraint and active output upper and lower limit constraint of the UC problem based on the generator set data, wherein the objective function is used to calculate the sum of the operating costs of all generators in the generator set, the power balance constraint includes that the power generation of the generator set is equal to the total load power; the active output upper and lower limit constraint includes that the power generation of each generator in the generator set is within the range from the minimum power generation of the generator to the maximum power generation of the generator;
[0120] A function conversion module 12 is configured to convert the power balance constraint condition into a first penalty term, convert the active output upper and lower limit constraints into a second penalty term and a third penalty term, and add the first penalty term, the second penalty term and the third penalty term to the objective function to form an unconstrained objective function;
[0121] A Hamiltonian construction module 13, configured to map the unconstrained objective function into a Hamiltonian of a quantum system;
[0122] A quantum system construction module 14 is configured to construct a quantum system corresponding to a generator set, wherein the generators in the generator set correspond to the quantum bits in the quantum system;
[0123] A quantum circuit module 15, configured to construct a quantum circuit containing adjustable parameters based on a quantum system, wherein the quantum bits in the quantum circuit correspond one-to-one to the generators in the generator set;
[0124] A parameter adjustment module 16, configured to adjust the parameter value in the quantum circuit so that the expectation value of the quantum system with respect to the Hamiltonian is reduced until the expectation value with respect to the Hamiltonian converges;
[0125] The optimal solution acquisition module 17 is configured to perform a measurement operation on the quantum circuit when the expected value converges, and use the measurement result as the optimal solution to the UC problem; based on the corresponding relationship between the quantum bit and the generator, determine the working state of the generator corresponding to the quantum bit in the optimal solution to the UC problem.
[0126] See also Figure 7 , Figure 7It is a principle block diagram of a quantum computing system for optimizing a generator set according to an embodiment of the present application. The system includes a classical computing device 100 and a quantum computing device 200, wherein the classical computing device 100 includes a classical data processing module 110 and an optimizer 120, wherein the classical data processing module 110 determines the objective function, balance constraints and output upper and lower limit constraints of the UC problem based on the generator set data, and then converts the power balance constraints and output upper and lower limit constraints into the first penalty term, the second penalty term and the third penalty term of the objective function respectively, and adds the first penalty term, the second penalty term and the third penalty term to the objective function to form an unconstrained objective function; the unconstrained objective function is mapped to the Hamiltonian expression of the quantum system, a quantum circuit is constructed, and the quantum circuit is sent to the quantum computing device 200. The optimizer 120 communicates with the quantum computing device 200, adjusts the parameters of the quantum circuit to determine the parameters when the Hamiltonian expectation value converges, and then the quantum computing device 200 performs the ground state measurement of the quantum state and sends the measurement result to the classical computing device 100. The classical data processing module 110 determines the generator corresponding to the optimal solution of the UC problem according to the quantum state measurement result returned by the quantum computing device 200. In this embodiment, the quantum computing device 200 can be an ion trap computer, an optical quantum computer, a superconducting quantum computer, a neutral atom quantum computer, and the like.
[0127] See also Figure 8 , Figure 8 1 is a block diagram of a quantum computing system for optimizing a generator set according to another embodiment of the present application. The system is implemented by a classical computing device 100, which includes a classical data processing module 110, an optimizer 120, and a quantum simulator 130. Figure 6 The difference between the system shown in the figure is that the quantum computing device is replaced by a quantum simulator 130 in this embodiment, but the working process and principle of the system in this embodiment are the same as those in the embodiment shown in the figure. Figure 6 The system is similar and will not be described here.
[0128] On the other hand, an embodiment of the present invention further provides an electronic device, see Fig. 9 , Fig. 9 is a structural principle block diagram of an electronic device according to an embodiment of the present application, such as Fig. 9 As shown, the electronic device includes a processor and a memory, wherein the memory stores computer instructions, and when the processor runs the computer instructions, the quantum computing method for optimizing the generator set provided by the present invention is executed.
[0129] 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.
[0130] In one example, Fig. 9 The 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.
[0131] 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.
[0132] On the other hand, an embodiment of the present invention further provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the aforementioned quantum computing method for optimizing a generator set is implemented. The computer-readable storage medium is, for example, a classical computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device, or a storage medium for storing quantum information and readable by a quantum computer, such as a quantum random access memory (QRAM). QRAM can be regarded as a quantum version of RAM in a classical computer. Through QRAM, a quantum superposition state containing information can be created. Compared with RAM, which needs to be read one by one, superimposed data can be read with superimposed addresses. QRAM can be implemented in physical ways such as optics, semiconductor quantum dots, superconducting circuits, ion traps, etc.
[0133] 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 a specified function or action, or by a combination of dedicated hardware and computer instructions. 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.
[0134] The above embodiments are only used to illustrate the present invention, but not to limit the present invention. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the scope of the present invention. Therefore, all equivalent technical solutions should also fall within the scope of the present invention.
Claims
1. A quantum computing method for optimizing a generator set, characterized in that: include: Based on the data of the generator set, the objective function, power balance constraint and upper and lower limits of active output of the UC problem are determined. The objective function is used to calculate the sum of the operating costs of all generators in the generator set. The power balance constraint includes that the power generation of the generator set is equal to the total load power. The upper and lower limits of active output constraint include that the power generation of each generator in the generator set is within the range from the minimum power generation of the generator to the maximum power generation of the generator. The power balance constraint condition is converted into the first penalty term, the upper and lower limit constraints of active output are converted into the second penalty term and the third penalty term, and the first penalty term, the second penalty term and the third penalty term are added to the objective function to form an unconstrained objective function; Mapping the unconstrained objective function into a Hamiltonian of a quantum system; Constructing a quantum system corresponding to the generator set, wherein the generators in the generator set correspond to the quantum bits in the quantum system; constructing a quantum circuit including adjustable parameters based on the quantum system; Adjust the parameter value in the quantum circuit to reduce the expectation value of the quantum system with respect to the Hamiltonian until the expectation value with respect to the Hamiltonian converges; Perform measurement operations on the quantum circuit when the expected value converges, and use the measurement results as the optimal solution to the UC problem; Based on the correspondence between quantum bits and generators, determine the generator corresponding to the quantum bits in the optimal solution to the UC problem. Among them, the first penalty term includes a smooth monotonically increasing function with a first difference value obtained by subtracting the total load power from the power generation power of the generator set as the independent variable and a function value greater than or equal to zero; the second penalty term includes a smooth monotonically increasing function with a second difference value obtained by subtracting the first slack variable and the minimum power generation power of each generator from the power generation power of each generator in the generator set as the independent variable and a function value greater than or equal to zero; the third penalty term includes a smooth monotonically increasing function with a third difference value obtained by subtracting the maximum power generation power of each generator from the sum of the power generation power of each generator in the generator set and the second slack variable as the independent variable and a function value greater than or equal to zero.
2. The quantum computing method according to claim 1, characterized in that: The smooth monotonically increasing function is a power function.
3. The quantum computing method according to claim 2, characterized in that: The exponent of the power function is an even number greater than or equal to 2.
4. The quantum computing method according to any one of claims 1 to 3, characterized in that: The quantum circuit with adjustable parameters comprises multiple layers of quantum circuit units connected end to end, and the adjustable parameter value in each layer of quantum circuit can be adjusted independently during the adjustment process.
5. The quantum computing method according to claim 4, characterized in that: Each layer of quantum circuit units includes a single-bit rotation gate that acts on each quantum bit and a CNOT gate that acts on two adjacent quantum bits. The quantum bit with a smaller serial number is the control bit of the CNOT gate, and the quantum bit with a larger serial number is the target bit of the CNOT gate.
6. The quantum computing method according to claim 1, characterized in that: The operating cost of each generator in the objective function is expressed as the product of the operating cost of each generator and the first variable of each generator, wherein the first variable is used to characterize whether each generator is in an on state or an off state; the power generation of the generator set in the first penalty term is expressed as the sum of the power generation of all generators in the generator set, and the power generation of each generator is expressed as the product of the power generation of each generator and the first variable of each generator; the maximum power generation of each generator in the third penalty term is the product of the maximum power generation of each generator and the first variable of each generator, and the minimum power generation of each generator in the second penalty term is the product of the minimum power generation of each generator and the first variable of each generator. Correspondingly, the unconstrained objective function is mapped to the Hamiltonian expression of the quantum system by converting the first variable in the unconstrained objective function into a Pauli Z operator expression.
7. A quantum computing device for optimizing a generator set, characterized in that: include: a function building module, configured to determine an objective function, a power balance constraint, and an upper and lower limit constraint of active output of the UC problem based on the generator set data, wherein the objective function is used to calculate the sum of the operating costs of all generators in the generator set, the power balance constraint includes that the power generated by the generator set is equal to the total load power; and the upper and lower limit constraint of active output 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; A function conversion module is configured to convert the power balance constraint condition into a first penalty term, convert the active output upper and lower limit constraints into a second penalty term and a third penalty term, and add the first penalty term, the second penalty term and the third penalty term to the objective function to form an unconstrained objective function; A Hamiltonian construction module configured to map the unconstrained objective function into a Hamiltonian of a quantum system; A quantum system building module configured to build a quantum system corresponding to a generator set, wherein the generators in the generator set correspond to the quantum bits in the quantum system; A quantum circuit module configured to construct a quantum circuit including adjustable parameters based on a quantum system; A parameter adjustment module, configured to adjust the parameter value in the quantum circuit so that the expectation value of the quantum system with respect to the Hamiltonian is reduced until the expectation value with respect to the Hamiltonian converges; The optimal solution acquisition module is configured to measure the quantum circuit when the expected value converges, and use the measurement result as the optimal solution to the UC problem; based on the corresponding relationship between the quantum bit and the generator, determine the generator corresponding to the quantum bit in the optimal solution to the UC problem, Among them, the first penalty term includes a smooth monotonically increasing function with a first difference value obtained by subtracting the total load power from the power generation power of the generator set as the independent variable and a function value greater than or equal to zero; the second penalty term includes a smooth monotonically increasing function with a second difference value obtained by subtracting the first slack variable and the minimum power generation power of each generator from the power generation power of each generator in the generator set as the independent variable and a function value greater than or equal to zero; the third penalty term includes a smooth monotonically increasing function with a third difference value obtained by subtracting the maximum power generation power of each generator from the sum of the power generation power of each generator in the generator set and the second slack variable as the independent variable and a function value greater than or equal to zero.
8. An electronic device comprising a processor and a memory, characterized in that: The memory stores computer instructions, and when the processor runs the computer instructions, the quantum computing method for optimizing a generator set according to any one of claims 1 to 6 is performed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the quantum computing method for optimizing a generator set according to any one of claims 1 to 6 is executed.