Optimization problem solving method and device
By performing measurement evolution and target state transfer operations on Hamiltonian's problem in quantum computing, combined with Metropolis acceptance criteria, the problem of optimization problem solving in quantum computing is solved, and an efficient optimization problem solving method is realized.
Patent Information
- Application Number
- CN202311064550.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2043-08-22
AI Technical Summary
In quantum computing, how to effectively use the Metropolis algorithm to solve optimization problems, especially when the scale of the problem to be solved gradually increases, it is difficult for the existing technology to effectively solve this problem.
By performing a measurement evolution operation on the initial quantum state of the first register storing feasible solutions to the problem to be solved, the first energy corresponding to one of the Hamiltonian eigenstates of the problem to be solved is obtained; then the target state transfer operation and the measurement evolution operation are performed on the first register sizing the evolution operation to obtain the second energy corresponding to the other eigenstate; finally, based on the first energy and the second energy, it is determined that the eigenstate corresponding to the second energy that reaches the Metropolis acceptance criterion is the target solution of the problem to be solved.
The method of effectively solving optimization problems using Metropolis algorithm and quantum computing is realized, and the target solutions can be found in large-scale problems, improving the efficiency and accuracy of solving optimization problems.
Smart Images

Figure CN119514713A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of quantum computing technology, and in particular to a method and device for solving optimization problems. Background Art
[0002] Simulated Annealing (SA) is a general optimization algorithm. Its starting point is based on the similarity between the annealing process of solid materials in physics and general optimization problems. Starting from a certain initial temperature, as the temperature continues to drop, it combines the probabilistic jump characteristics to randomly search for the global optimal solution in the solution space.
[0003] The classic Metropolis algorithm is the core of the simulated classical annealing algorithm. When simulating quantum systems to solve optimization problems, it fails directly due to the famous sign problem in the quantum Monte Carlo method. However, with the increasing scale of the problems to be solved and the development of quantum computing technology, how to use the Metropolis algorithm and quantum computing to solve optimization problems has become an urgent problem to be solved. Summary of the invention
[0004] The purpose of this application is to provide a method and device for solving optimization problems, aiming to solve optimization problems using the Metropolis algorithm and quantum computing.
[0005] An embodiment of the present application provides a method for solving an optimization problem, the method comprising:
[0006] Performing a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to the problem to be solved, and obtaining a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved;
[0007] Executing the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved;
[0008] Based on the first energy and the second energy, it is determined that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
[0009] Optionally, the measurement evolution operation is a quantum phase estimation operation and a measurement operation.
[0010] Optionally, the target state transfer operation is determined by iteratively updating from a state transfer operation set;
[0011] The state transfer operation set is determined by the Hamiltonian of the problem to be solved and the state transfer operation set satisfies the state transfer detailed balance condition.
[0012] Optionally, when the problem to be solved is a molecular docking problem, the state transfer operation set is a set of operations for implementing multiple molecular docking methods.
[0013] Optionally, when the problem to be solved is a coloring problem, the state transition operation set is a set of operations for achieving a variety of coloring effects.
[0014] Optionally, achieving the Metropolis acceptance criterion includes an acceptance condition determined based on the first energy and the second energy and a preset iteration termination condition, wherein the acceptance condition is used to determine whether to accept the eigenstate corresponding to the second energy.
[0015] Optionally, if the eigenstate corresponding to the second energy is accepted but a preset iteration termination condition is not satisfied, the method further includes:
[0016] After performing the same target state transfer operation as that for obtaining the second energy on the quantum state of the second register, a measurement evolution operation is performed on the second register of the target state transfer operation, and the currently determined target state transfer operation and measurement evolution operation are performed on the second register of the measurement evolution operation to obtain updated first energy and second energy, wherein the quantum state of the second register is a conjugate state of the initial quantum state of the first register.
[0017] Optionally, if the eigenstate corresponding to the second energy is rejected but a preset iteration termination condition is not satisfied, the method further includes:
[0018] A measurement evolution operation is performed on the quantum state of the second register, and a currently selected target state transfer operation and a measurement evolution operation are performed on the second register after the measurement evolution operation to obtain updated first energy and second energy.
[0019] Another embodiment of the present application provides an optimization problem solving device, the device comprising:
[0020] A first obtaining module is used to perform a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to the problem to be solved, so as to obtain a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved;
[0021] A second obtaining module is used to perform the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved;
[0022] A determination module is used to determine, based on the first energy and the second energy, that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
[0023] An embodiment of the present application provides a storage medium, in which a computer program is stored, wherein the computer program is configured to implement any of the above methods when running.
[0024] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement any of the above methods.
[0025] Compared with the prior art, the present application first performs a measurement evolution operation on the initial quantum state of the first register storing the feasible solution to the problem to be solved, and obtains a first energy corresponding to an eigenstate of the Hamiltonian of the problem to be solved; then performs the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved; finally, based on the first energy and the second energy, the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is determined to be the target solution to the problem to be solved. In the present application, quantum computing is used to transfer the state and obtain the energy of the quantum state before and after the transfer. Based on the two energies, the Metropolis acceptance criterion is used to determine whether the target solution is obtained, thereby realizing the solution of the optimization problem using Metropolis and quantum computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a network block diagram of an optimization problem solving system provided in an embodiment of the present application;
[0027] Figure 2 A flowchart of a method for solving an optimization problem provided in an embodiment of the present application;
[0028] Figure 3 A flowchart of another optimization problem solving method provided in an embodiment of the present application;
[0029] Figure 4 A schematic diagram of the structure of an optimization problem solving device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and should not be construed as limiting the present application.
[0031] Figure 11 is a network block diagram of an optimization problem solving system provided by an embodiment of the present application. The optimization problem solving system may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.
[0032] The network 110 is a medium for providing communication links between various devices and computers connected together in the optimization problem solving system, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. The connection method may be wired, wireless communication links or optical fiber cables, etc.
[0033] The server 120 and the client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.
[0034] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 162 (application 173). The application 162 (application 173) may be used to implement a quantum algorithm compiled according to the optimization problem solving method provided in an embodiment of the present application.
[0035] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0036] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical processing system 160, which is responsible for performing classical calculations and control; and the quantum processing system 170, which is responsible for running quantum programs and thus realizing quantum calculations.
[0037] The classical processing system 160 and the quantum processing system 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum processing system 170 through the network services thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0038] In the classic processing system 160 based on silicon chips, the unit of the classic processor 161 is a CMOS tube. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and is available at any time. In addition, in silicon chips, the number of such computing units is also sufficient. Currently, the number of computing units in a classic processor is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, for example: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.
[0039] Unlike this logic unit in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a quantum bit, and the input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. In quantum computing, it is necessary to use limited quantum bits combined with a variety of logical functions to achieve the computing effect.
[0040] Based on these differences, the design of the logical function acting on quantum bits (including the design of whether the quantum bits are used or not and the design of the efficiency of the use of each quantum bit) is the key to improving the computing performance of quantum computers, and requires special design. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. Based on this, in order to implement the Metropolis algorithm to solve optimization problems in quantum computing, this application proposes a method and device for solving optimization problems, aiming to use the Metropolis algorithm and quantum computing to solve optimization problems.
[0041] See also Figure 2 , Figure 2 A flowchart of a method for solving an optimization problem provided in an embodiment of the present application may include the following steps:
[0042] S201: performing a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to a problem to be solved, and obtaining a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved.
[0043] The initial quantum state is determined based on the problem to be solved, and different problems to be solved may correspond to different initial quantum states. During the initial solution, the feasible solution can be a guessed solution to the problem to be solved, or a known solution to the problem to be solved based on experience, and so on. The Hamiltonian of the problem to be solved can be obtained in advance. Specifically, it can be obtained based on the mapping relationship between the optimization problem and the Hamiltonian, or it can be constructed by analyzing the problem to be solved. The first register is used to store the quantum state of the quantum system (problem to be solved) currently under study. The stored quantum states include the initial quantum state, which is the quantum state of the first register at the beginning of each iteration of the minimum unit during the iterative solution process. The initial quantum state is measured and evolved, and the measured quantum state will collapse to a certain eigenstate of the Hamiltonian of the problem to be solved. It can be called the first eigenstate, and the energy corresponding to the measured eigenstate is the first energy.
[0044] In some possible implementations of the present application, the measurement evolution operation may be a quantum phase estimation operation and a measurement operation. The specific operation may be:
[0045] Performing a QPE operation on an initial quantum state of a first register whose quantum state is an initial quantum state and a third register whose quantum state is a 0 state;
[0046] A measurement operation is performed on the third register to obtain a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved.
[0047] QPE (quantum phase estimation) is a quantum computing operation based on quantum Fourier transform, which can give a certain accuracy estimate of the phase of a target quantum state. For a quantum state of n qubits, phase estimation requires an additional r qubits as auxiliary bits, and its specific size is related to the required accuracy. According to relevant theoretical derivations, in general:
[0048]
[0049] Where ε is the required estimation accuracy. The phase estimation operation acts on these n+r qubits, storing the phase information of the original n-bit quantum state in the calculation basis of the auxiliary bit.
[0050] Specifically, the QPE operation can evolve |ψ>|0>. Specifically, the unitary gate U=e is constructed using the quantum simulation of the Hamiltonian H of the problem to be solved. iHθ , the QPE operation is to obtain the eigenvalue of U, because Hamiltonian is an energy operator, and in quantum mechanics, the eigenvalue obtained is energy. |ψ> is the initial quantum state stored in the first register, which can be a superposition state of several H eigenstates. The phase estimation is obtained Where E j Actually, E j The binary representation of θ / 2π. After measurement, we get a specific At this time, E k Consider it a classic message.
[0051] In the present application, the first register and the third register are quantum registers. The quantum registers may include multiple quantum bits. The number of quantum bits in each quantum register may be determined based on the stored data. The number of quantum bits in the first register is determined by the problem to be solved, and may be determined specifically by the problem scale of the problem to be solved. The QPE operation is performed on the first register and the third register, and the quantum state of the first register changes from |ψ> to The quantum bit of the third register is the auxiliary bit mentioned above. The number of quantum bits is determined by the initial quantum state and the estimated accuracy. The quantum state of the third register is 0. Since the quantum states of the first and third registers are entangled due to the QPE operation, when the third register is measured, the quantum state of the first register is Collapse to At the same time, the first energy E is obtained k After obtaining the first energy, the third register is reset so that the quantum state of the third register is 0, which is convenient for subsequent operations.
[0052] S202: Execute the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved.
[0053] After the measurement evolution operation is performed on the first register, the quantum state currently stored in the first register is the eigenstate corresponding to the first energy, which can be called the first eigenstate. The target state transfer operation is performed on the first eigenstate, so that the first eigenstate evolves into a new quantum state. The measurement evolution operation is performed on the new quantum state again to obtain the second energy. The target state transfer operation updates the first eigenstate, converting from one quantum state to another quantum state that represents the solution to the problem to be solved, which is similar to the state transfer operation in the classical algorithm.
[0054] The target state transfer operation can be determined by iterative updating from the state transfer operation set. In each minimum iteration unit, the target state transfer operation needs to be determined from the state transfer operation set. The state transfer operation set is a unitary positive operation set {S}, {S} needs to satisfy the detailed balance condition of the state transfer, and the detailed balance condition of the state transfer is the detailed balance condition of the Markov chain. The specific unitary positive operation is related to the Hamiltonian of the problem to be solved, and can be set in advance for the problem to be solved. Specifically, different state transfer operation sets can be set based on different problems to be solved, but the only requirement is that the probability of selecting S must be equal to the probability of selecting The state transfer operation set is to convert the quantum state representing one solution of the problem to be solved to the quantum state representing one or more other solutions of the problem to be solved. When the problem to be solved is a molecular docking problem, the state transfer operation set is a set of operations to achieve multiple molecular docking methods, and the unitary positive operation can be to transform the first eigenstate representing one docking method into a second quantum state containing at least one docking method. When the problem to be solved is a coloring problem, the state transfer operation set is a set of operations to achieve multiple coloring effects. Specifically, the unitary positive operation can be to flip the state of a specific quantum bit in the first eigenstate, and evolve the first eigenstate into the second quantum state.
[0055] In the embodiment of the present application, a state transfer operation can be selected randomly or in other ways that meet the detailed balance conditions as the target state transfer operation, and act on the first eigenstate so that the first eigenstate Updated to That is, the quantum state stored in the first register changes from the first eigenstate Update to a new quantum state Performing QPE and measurement operations on the new quantum state can obtain the second energy E i The QPE operation and measurement on the new quantum state are the same as the QPE operation and measurement on the first quantum state.
[0056] Different first eigenstates can be evolved using different target state transfer operations, and the evolution result of the first eigenstate is measured. The evolution result collapses to another eigenstate of the Hamiltonian of the problem to be solved, which can be called the second eigenstate.
[0057] In some possible implementations of the present application, the step of performing the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved includes:
[0058] Obtain a state transition operation set, and select one from the state transition operation set as a target state transition operation;
[0059] Performing a target state transfer operation on the first register to evolve the quantum state of the first quantum register from the first eigenstate to a new quantum state;
[0060] Based on the new quantum state, a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved is obtained by utilizing QPE operation and measurement operation.
[0061] S203: Based on the first energy and the second energy, determine that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
[0062] The first energy and the second energy can be in the form of classical data, and can be specifically stored in classical registers. The Metropolis acceptance criterion can be determined based on the difference between the first energy and the second energy. When the Metropolis acceptance criterion is reached, it means that the target solution of the problem to be solved is obtained: the optimal solution or the approximate optimal solution. At this time, the second eigenstate can be determined as the target solution of the problem to be solved. Specifically, there is a certain relationship between the second eigenstate and the target solution. How to process the second eigenstate to obtain the target solution is different for different problems to be solved. For some optimization problems, the solution corresponding to the second eigenstate can be used as the target solution of the problem to be solved; for other optimization problems, the second eigenstate can be measured multiple times, and the solution with the highest probability can be selected as the target solution.
[0063] Meeting the Metropolis acceptance criteria may include an acceptance condition determined based on the first energy and the second energy and a preset iteration termination condition, wherein the acceptance condition is used to determine whether to accept the eigenstate corresponding to the second energy, and specifically, whether to accept the second eigenstate may be determined based on the difference between the first energy and the second energy. The acceptance condition may be calculated first Among them, β = 1 / T, T is the current annealing temperature, and then calculate the size relationship between the generated random number and f. Based on the size relationship, determine whether to accept the eigenstate corresponding to the second energy. If it is less than, then accept; if it is not less than, then reject. Of course, you can also calculate Based on the size of f and a number, determine whether to accept the eigenstate corresponding to the second energy. The number can be a fixed number, a random number that changes with iterations, or a number that is calculated first. Then, the ratio of f to a random number is calculated, and then based on the size relationship between the ratio and a fixed number, it is determined whether to accept the second eigenstate. In the embodiment of the present application, after measuring the first energy and the second energy, the corresponding energies are sent to the classical processor respectively. After obtaining the second energy, the classical processor determines whether the Metropolis acceptance criterion is met to determine whether the target solution is obtained.
[0064] In the embodiment of the present application, an iteration at an annealing temperature is regarded as a basic iteration unit. In a basic iteration unit, each iteration of whether the Metropolis acceptance criterion is met is regarded as a minimum iteration unit. When in a basic iteration unit, the number of times the second eigenstate is accepted reaches a preset threshold value using the acceptance condition, the annealing temperature is then increased to perform the operation of the next basic iteration unit. The preset termination iteration condition can be that in a basic iteration unit, the second energy obtained for several consecutive times (which can be set according to actual conditions) is the same or the difference is within a preset range, indicating that the second eigenstate includes the optimal solution or approximate optimal solution to the problem to be solved at this time, and the iteration can be terminated at this time, or when the iteration of a basic iteration unit ends and the annealing temperature reaches the preset temperature, the iteration is terminated; or when the iteration of a basic iteration unit ends and the number of iterations of the basic iteration unit has reached the preset threshold value, the iteration is terminated; of course, there may be other conditions for terminating the iteration, as long as they meet the characteristics of the classical simulated annealing algorithm, which will not be described one by one here.
[0065] In some embodiments of the present application, if the eigenstate corresponding to the second energy is accepted but the preset iteration termination condition is not satisfied, the method may further include:
[0066] After performing the same target state transfer operation as that for obtaining the second energy on the quantum state of the second register, a measurement evolution operation is performed on the second register performing the target state transfer operation, and the currently determined target state transfer operation and measurement evolution operation are performed on the two registers performing the measurement evolution operation to obtain updated first energy and second energy, wherein the quantum state of the second register is a conjugate state of the initial quantum state of the first register.
[0067] In some specific implementations of the present application, the conjugate state of the initial quantum state is obtained by performing a conjugate state backup operation on a first register whose quantum state is the initial quantum state and a second register whose quantum state is 0.
[0068] One of the difficulties in quantum generalization of the classical Metropolis algorithm occurs in the step of retaining / rejecting the newly generated state. Taking the optimal configuration of a molecule as an example, in the classical algorithm, from a system configuration C old Departure, through C old The new configuration C is obtained by operation new After that, a copy of the old configuration can still be retained. After comparing the energy difference between the new and old configurations, the new configuration is accepted with a certain probability based on the energy difference weight. However, for quantum computing, C old It must be stored in a group of quantum bits, and the new configuration C is obtained after the state transfer operation on the configuration new After that, if energy measurement is to be performed, it will inevitably lead to irreversible collapse, thereby losing the information of the old configuration. In the present application, the information of the old configuration is retained through conjugated state backup, making it possible to return from the new configuration to the old configuration.
[0069] In a basic iteration unit, at the beginning of an iteration, the first register stores the initial quantum state, the quantum state of the second register is 0, the H gate is applied to the first quantum register, and then the CNOT gate controlled by the first register is applied to the second register, so that the two quantum registers are in the maximum entangled state. The prepared maximum entangled state can be expressed as a linear superposition of all eigenstates and their conjugate entangled states:
[0070]
[0071] If the phase of the first register is estimated and measured, the result will collapse to a certain eigenstate |ψ i >, and the second register will also collapse to the conjugate state due to entanglement. Since the energy eigenvalue of the conjugate state corresponds to the conjugate H of the original Hamiltonian * , so when the second eigenstate needs to be rejected in the subsequent step, there is no need to re-prepare the first eigenstate, but the conjugate state stored in the second register can be used
[0072] For an optimization problem solving system including a quantum processing system and a classical processing system, the quantum processing system sends the first energy and the second energy to the classical processing system respectively. After obtaining the two energies, the classical processing system determines whether the Metropolis acceptance criterion is met. If not, the determination result is fed back to the quantum processing system, and the quantum processing system performs the next operation. It should be noted that after the quantum processing system determines the target state transfer operation, it is necessary to record the information of the operation. When accepting the second eigenstate, the same target state transfer operation needs to be performed on the conjugate state of the first eigenstate. Exemplarily, the target state transfer operation acting on the first eigenstate is S1, and the target state transfer operation acting on the conjugate state of the first eigenstate is also S1. The purpose of such an operation is to enable the conjugate state of the first eigenstate to be transformed into the new quantum state mentioned above, thereby realizing the acceptance of the second eigenstate, that is, accepting the update of the quantum state.
[0073] In some possible implementations of the present application, after performing the target state transfer operation that is the same as that for obtaining the second energy on the quantum state of the second register, performing the measurement evolution operation on the second register of the target state transfer operation, and performing the currently determined target state transfer operation and the measurement evolution operation on the second register of the measurement evolution operation to obtain updated first energy and second energy, wherein the quantum state of the second register is a conjugate state of the initial quantum state of the first register, which may include:
[0074] Performing a target state transfer operation on the second register that is the same as the target state transfer operation for obtaining the second energy, so that the quantum state of the second register evolves from a conjugate state of the first eigenstate to a new initial quantum state, wherein the conjugate state of the first eigenstate is obtained by measuring the conjugate state of the first quantum state;
[0075] The second register is used as a new first register, and the original first register is reset to be used as a new second register.
[0076] When it is determined to accept the second eigenstate, the quantum state of the second register is the conjugate state of the first eigenstate. Since the second register is in an entangled state with the quantum state of the first register, when the quantum state of the first register collapses from the initial quantum state to the first eigenstate, the quantum state of the second register collapses from the conjugate state of the initial quantum state to the conjugate state of the first eigenstate. The conjugate state of the initial quantum state of the second register can be obtained by backup or by other means.
[0077] When the second register performs the corresponding target state transfer operation, the quantum state becomes a new quantum state. At this time, the new quantum state needs to be used as the new initial quantum state. The specific operation can be to use the second register as the new first register, and the original first register is reset as the new second register. Exemplarily, the third register is used to assist in the execution of the QPE operation, including quantum bits q0~q3, the first register includes quantum bits q4~q7, and the second register includes quantum bits q8~q10. If the second eigenstate is accepted, q0~q7 are cleared, and after a target state transfer operation is performed on q8~q10, q8~q10 are renamed q4~q7, and the original q4~q7 are renamed q8~q10, and then the iteration continues.
[0078] In some embodiments of the present application, if the eigenstate corresponding to the second energy is rejected but the preset iteration termination condition is not met, the method may further include:
[0079] A measurement evolution operation is performed on the quantum state of the second register, and a currently selected target state transfer operation and a measurement evolution operation are performed on the second register after the measurement evolution operation to obtain updated first energy and second energy.
[0080] When the eigenstate corresponding to the second energy is rejected but the preset iteration termination condition is not met, it means that the updated solution may not be as good as the original solution. The update of the quantum state is rejected and the evolution is performed again with the first eigenstate. However, because the first eigenstate has changed through the target state transfer operation, the first eigenstate cannot be obtained. At this time, the second register can be operated. The second register stores the conjugate state of the first eigenstate and uses the conjugate state as the new initial quantum state. The same operation is performed on the second register to obtain the first energy and the second energy. Specifically, the second register can be used as a new first register, and the original first register can be reset as a new second register.
[0081] The conjugate state of the first eigenstate currently stored in the second register needs to be used as the new first register for the convenience of subsequent operations, that is, the number of the quantum register is changed, and the original first register is used as the new second register. Based on the above operation, the conjugate state of the first eigenstate becomes the new initial quantum state.
[0082] It can be seen that the present application first performs a measurement evolution operation on the initial quantum state of the first register storing the feasible solution to the problem to be solved, and obtains a first energy corresponding to an eigenstate of the Hamiltonian of the problem to be solved; then performs the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved; finally, based on the first energy and the second energy, the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is determined to be the target solution to the problem to be solved. In the present application, quantum computing is used to transfer the state and obtain the energy of the quantum state before and after the transfer. Based on the two energies, the Metropolis acceptance criterion is used to determine whether the target solution is obtained, thereby realizing the solution of the optimization problem using Metropolis and quantum computing.
[0083] Figure 3 A flow chart of another optimization problem solving method provided in an embodiment of the present application, wherein the first register is used to store the quantum state of the quantum system under study (problem to be solved), the second register is used to back up the conjugate state of the first quantum state, and the third quantum register is used to assist in the QPE operation. After the quantum state of the first register is backed up, a QPE operation is performed, and then the first energy is measured and recorded, the first energy is stored in the classical register, and the third register is reset. The selected state transfer operation, i.e., the target state transfer operation, is then performed on the quantum state of the first register, and then the QPE operation and the measurement operation are performed to obtain the second energy, and then it is determined whether to accept the state update based on the energy stored in the classical register. Based on the determination result, the initial quantum state required for the next iteration is determined, and then the process continues. Figure 3 The operation shown.
[0084] See also Figure 4 , Figure 4 A schematic diagram of a device for solving an optimization problem provided in an embodiment of the present application, and Figure 2 Corresponding to the process shown, the device includes:
[0085] A first obtaining module 401 is used to perform a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to the problem to be solved, to obtain a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved;
[0086] A second obtaining module 402 is used to perform the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved;
[0087] The determination module 403 is used to determine, based on the first energy and the second energy, that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
[0088] In some possible implementations of the present application, the measurement evolution operation may be a quantum phase estimation operation and a measurement operation.
[0089] In some possible implementations of the present application, the target state transition operation can be determined by iteratively updating the state transition operation set;
[0090] The state transfer operation set can be determined by the Hamiltonian of the problem to be solved and the state transfer operation set satisfies the state transfer detailed balance condition.
[0091] In some possible implementations of the present application, when the problem to be solved is a molecular docking problem, the state transfer operation set may be a set of operations for implementing a variety of molecular docking methods.
[0092] In some possible implementations of the present application, when the problem to be solved is a coloring problem, the state transition operation set may be a set of operations for achieving a variety of coloring effects.
[0093] In some possible implementations of the present application, achieving the Metropolis acceptance criterion includes an acceptance condition determined based on the first energy and the second energy and a preset iteration termination condition, wherein the acceptance condition is used to determine whether to accept the eigenstate corresponding to the second energy.
[0094] In some possible implementations of the present application, the device may further include:
[0095] The first operation module is used to perform a target state transfer operation on the quantum state of the second register that is the same as that for obtaining the second energy if the eigenstate corresponding to the second energy is accepted but a preset iteration termination condition is not met, and then perform a measurement evolution operation on the second register that performs the target state transfer operation, and perform the currently determined target state transfer operation and measurement evolution operation on the two registers that perform the measurement evolution operation to obtain updated first energy and second energy, wherein the quantum state of the second register is a conjugate state of the initial quantum state of the first register.
[0096] In some possible implementations of the present application, the device may further include:
[0097] The first operation module is used to perform a measurement evolution operation on the quantum state of the second register if the eigenstate corresponding to the second energy is rejected but the preset iteration termination condition is not met, and to perform the currently selected target state transfer operation and measurement evolution operation on the second register after the measurement evolution operation to obtain updated first energy and second energy.
[0098] It can be seen that the present application first performs a measurement evolution operation on the initial quantum state of the first register storing the feasible solution to the problem to be solved, and obtains a first energy corresponding to an eigenstate of the Hamiltonian of the problem to be solved; then performs the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved; finally, based on the first energy and the second energy, the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is determined to be the target solution to the problem to be solved. In the present application, quantum computing is used to transfer states and obtain the energies of the quantum states before and after the transfer. Based on the two energies, the Metropolis acceptance criterion is used to determine whether the target solution is obtained, thereby realizing the solution of optimization problems using Metropolis and quantum computing.
[0099] An embodiment of the present application further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to implement the steps of any of the above method embodiments when executed.
[0100] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for implementing the following steps:
[0101] S201: performing a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to the problem to be solved, to obtain a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved;
[0102] S202: Execute the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved;
[0103] S203: Based on the first energy and the second energy, determine that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
[0104] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the steps in any one of the above method embodiments.
[0105] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0106] Specifically, in this embodiment, the processor may be configured to implement the following steps through a computer program:
[0107] S201: performing a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to the problem to be solved, to obtain a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved;
[0108] S202: Execute the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved;
[0109] S203: Based on the first energy and the second energy, determine that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
[0110] The present application also provides a computer program product comprising instructions, which, when executed by a computer, enables the computer to solve the optimization problem in any of the above-mentioned embodiments.
[0111] It can be understood that in the various implementations of this specification, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of this specification.
[0112] It can be understood that the various embodiments described in this specification can be implemented individually or in combination, and the embodiments of this specification are not limited to this.
[0113] Unless otherwise specified, all technical and scientific terms used in the embodiments of this specification have the same meaning as those generally understood by those skilled in the art of the technical field of this specification. The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the scope of this specification. The term "and / or" used in this specification includes any and all combinations of one or more related listed items. The singular forms of "a", "above", and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0114] It can be understood that the processor of the embodiment of this specification can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method implementation can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiment of this specification can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of this specification can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0115] It is understood that the memory in the embodiments of this specification may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasablePROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0116] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0117] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.
[0118] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0120] In addition, each functional unit in each embodiment of the present specification may be integrated into one processing system, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0121] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0122] The above is only a specific implementation of this specification, but the protection scope of this application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, the protection scope of this application should be based on the protection scope of the claims.
Claims
1. A method for solving an optimization problem, characterized in that: The method comprises: Performing a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to the problem to be solved, and obtaining a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved; Executing the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved; Based on the first energy and the second energy, it is determined that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
2. The method according to claim 1, characterized in that The measurement evolution operation includes a quantum phase estimation operation and a measurement operation.
3. The method according to claim 1, characterized in that The target state transfer operation is determined by iteratively updating from a state transfer operation set; The state transfer operation set is determined by the Hamiltonian of the problem to be solved and the state transfer operation set satisfies the state transfer detailed balance condition.
4. The method according to claim 1, characterized in that When the problem to be solved is a molecular docking problem, the state transfer operation set is a set of operations for realizing multiple molecular docking modes.
5. The method according to claim 1, characterized in that When the problem to be solved is a coloring problem, the state transfer operation set is a set of operations for achieving a variety of coloring effects.
6. The method according to claim 1, characterized in that Meeting the Metropolis acceptance criteria includes an acceptance condition determined based on the first energy and the second energy and a preset iteration termination condition, wherein the acceptance condition is used to determine whether to accept the eigenstate corresponding to the second energy.
7. The method according to claim 6, characterized in that If the eigenstate corresponding to the second energy is accepted but the preset iteration termination condition is not met, the method further includes: After performing the same target state transfer operation as that for obtaining the second energy on the quantum state of the second register, a measurement evolution operation is performed on the second register performing the target state transfer operation, and the currently determined target state transfer operation and measurement evolution operation are performed on the two registers performing the measurement evolution operation to obtain updated first energy and second energy, wherein the quantum state of the second register is a conjugate state of the initial quantum state of the first register.
8. The method according to claim 6, characterized in that If the eigenstate corresponding to the second energy is rejected but the preset iteration termination condition is not met, the method further includes: A measurement evolution operation is performed on the quantum state of the second register, and a currently selected target state transfer operation and a measurement evolution operation are performed on the second register after the measurement evolution operation to obtain updated first energy and second energy.
9. An optimization problem solving device, characterized in that: The device comprises: A first obtaining module is used to perform a measurement evolution operation on an initial quantum state of a first register storing a feasible solution to the problem to be solved, so as to obtain a first energy corresponding to an eigenstate of a Hamiltonian corresponding to the problem to be solved; A second obtaining module is used to perform the currently determined target state transfer operation and the measurement evolution operation on the first register of the measurement evolution operation to obtain a second energy corresponding to another eigenstate of the Hamiltonian of the problem to be solved, wherein the target state transfer operation is determined by the Hamiltonian of the problem to be solved; A determination module is used to determine, based on the first energy and the second energy, that the eigenstate corresponding to the second energy that meets the Metropolis acceptance criterion is a target solution to the problem to be solved.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to implement the method according to any one of claims 1 to 8 when executed.
11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the computer program to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Wavelet weighted multi-mode blind equalization method based on mixed monkey group optimization
CN107018104A
Wavelet weighted multi-modulus blind equalization method based on simulated annealing wolf pack optimization
CN107070825A
Quantum circuit-based nonlinear equation set solving method and device
CN114969629A
Quantum computing method and related device
CN115545210A
Monte Carlo Quantum Computing
US20230016119A1
Cited By
Coding method and device for quantum optimization solution, program and storage medium
CN121457653A
Encoding methods, devices, programs, and storage media for quantum optimization solutions
CN121457653B