A method and apparatus for solving optimization problems

CN119514712BActive Publication Date: 2026-08-14ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-22
Publication Date
2026-08-14

AI Technical Summary

Benefits of technology

[0036]与现有技术相比,本申请先基于第一量子态,获得特定本征态和第一能量,然后利用所述特定本征态和所述第一能量,获得包括所述第一能量和第二能量的第三量子态;再当利用第一测量结果确定保留所述第二量子态时但迭代未终止时,将所述第二量子态作为新的第一量子态,并返回执行基于第一量子态,获得特定本征态和第一能量的步骤;最后当迭代终止时,基于当前第二量子态,确定所述待优化问题的目标解。在本申请中,利用第一测量结果确定是否保留态的更新,而在量子计算中因为测不准原理,第一测量结果是以一定的概率测量得到的,即保留第二量子态存在一定的概率,进而实现了利用Metropolis算法在量子计算中实现求解优化问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119514712B_ABST
    Figure CN119514712B_ABST
Patent Text Reader

Abstract

This application discloses a method and apparatus for solving optimization problems. The method includes: obtaining a specific eigenstate and a first energy based on a first quantum state; obtaining a third quantum state including the first energy and a second energy using the specific eigenstate and the first energy; when it is determined using a first measurement result that the second quantum state should be retained but the iteration has not terminated, using the second quantum state as a new first quantum state and returning to execute the step of obtaining the specific eigenstate and the first energy based on the first quantum state; when the iteration terminates, determining the target solution of the optimization problem based on the current second quantum state. Using embodiments of this application, optimization problems can be solved in quantum computing using the Metropolis algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of quantum computing technology, and in particular to a method and apparatus for solving optimization problems. Background Technology

[0002] Simulated Annealing (SA) is a general optimization algorithm that 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 decreases, it randomly searches for the global optimum in the solution space by combining the probabilistic jump characteristics.

[0003] The classic Metropolis algorithm, the core of the classical annealing algorithm, fails directly when solving optimization problems in quantum systems due to the well-known sign problem in quantum Monte Carlo methods. However, with the increasing scale of optimization problems and the development of quantum computing technology, how to implement the Metropolis algorithm in quantum computing for solving optimization problems has become a pressing issue. Summary of the Invention

[0004] The purpose of this application is to provide a method and apparatus for solving optimization problems, which aims to use the Metropolis algorithm to solve optimization problems in quantum computing.

[0005] One embodiment of this application provides a method for solving optimization problems, the method comprising:

[0006] Based on the first quantum state, a specific eigenstate and a first energy are obtained, wherein the first quantum state is a quantum state that includes a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate;

[0007] Using the specific eigenstate and the first energy, a third quantum state including the first energy and the second energy is obtained, wherein the second quantum state is a quantum state including a feasible solution to the problem to be optimized, obtained based on the specific eigenstate, and the second energy is the energy of the eigenstate of the second quantum state;

[0008] When the iteration does not terminate but the second quantum state is determined to be retained using the first measurement result, the second quantum state is taken as the new first quantum state, and the process returns to the step of obtaining a specific eigenstate and a first energy based on the first quantum state, wherein the first measurement result is the measurement result obtained based on the third quantum state;

[0009] When the iteration terminates, the target solution to the problem to be optimized is determined based on the current second quantum state.

[0010] Optionally, obtaining a specific eigenstate and a first energy based on the first quantum state includes:

[0011] A QPE operation is performed on the first quantum state, and the result is measured to obtain a specific eigenstate and a first energy.

[0012] Optionally, obtaining a third quantum state comprising the first energy and the second energy using the specific eigenstate and the first energy includes:

[0013] A target state transition operation is performed on the specific eigenstate to obtain a second quantum state, wherein the target state transition operation is selected from a pre-defined set of state transition operations for the problem to be optimized;

[0014] Perform the QPE operation on the second quantum state to obtain a third quantum state that includes the first energy and the second energy.

[0015] Optionally, when the iteration has not terminated but the first measurement result determines that the second quantum state is retained, taking the second quantum state as the new first quantum state includes:

[0016] Using a target quantum logic gate acting on a third quantum register, the third quantum state is converted into a superposition of a quantum state representing retention and a quantum state representing rejection, wherein the target quantum logic gate is controlled by a first quantum register and a second quantum register; the first quantum register currently stores the second energy, and the second quantum register currently stores the first energy;

[0017] The third quantum register is measured to obtain a first measurement result;

[0018] When the first measurement result is a preset value representing retention, the second quantum state is taken as the new first quantum state.

[0019] Optionally, the target quantum logic gate is a W gate;

[0020] The W gate is:

[0021]

[0022] in, β = 1 / T, where T is the current annealing temperature and E is the annealing temperature. k For the first energy, E i This is the second energy.

[0023] Optionally, when the first measurement result is not the preset value, the method further includes:

[0024] A target operation is performed on the first quantum register, the second quantum register, the third quantum register, and the fourth quantum register, wherein the fourth quantum register currently stores a second quantum state, and the target operation is the inverse operation determined by the operation between obtaining the first measurement result based on the specific eigenstate;

[0025] The first quantum register and the second quantum register are measured to obtain the second measurement result and the third measurement result, respectively.

[0026] If the second measurement result is the same as the third measurement result, and the quantum state currently stored in the fourth quantum register is taken as the first quantum state, then the process of obtaining the specific eigenstate and the first energy based on the first quantum state is returned.

[0027] Optionally, the method further includes:

[0028] In response to the second measurement result being different from the third measurement result, the quantum state currently stored in the fourth quantum register is taken as the specific eigenstate, and the step of obtaining a third quantum state including the first energy and the second energy is returned to be executed using the specific eigenstate and the first energy.

[0029] Another embodiment of this application provides an optimization problem solving apparatus, the apparatus comprising:

[0030] A first acquisition module is used to acquire a specific eigenstate and a first energy based on a first quantum state, wherein the first quantum state is a quantum state that includes a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate;

[0031] The second obtaining module is used to obtain a third quantum state including the first energy and the second energy by utilizing the specific eigenstate and the first energy, wherein the second quantum state is a quantum state including a feasible solution of the problem to be optimized based on the specific eigenstate, and the second energy is the energy of the eigenstate of the second quantum state;

[0032] A retention module is configured to, when determining that the second quantum state should be retained based on the first measurement result but the iteration has not terminated, use the second quantum state as a new first quantum state and return to execute the first acquisition module, wherein the first measurement result is a measurement result obtained based on the third quantum state;

[0033] A determination module is used to determine the target solution of the problem to be optimized based on the current second quantum state when the iteration terminates.

[0034] One embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to implement the method described in any of the above-described embodiments when running.

[0035] One embodiment of this 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 the method described in any of the above-described embodiments.

[0036] Compared with existing technologies, this application first obtains a specific eigenstate and a first energy based on a first quantum state, and then uses the specific eigenstate and the first energy to obtain a third quantum state including the first energy and a second energy. Next, when the first measurement result determines that the second quantum state should be retained, but the iteration has not terminated, the second quantum state is used as the new first quantum state, and the process returns to the step of obtaining the specific eigenstate and the first energy based on the first quantum state. Finally, when the iteration terminates, the target solution to the optimization problem is determined based on the current second quantum state. In this application, the first measurement result is used to determine whether to retain the state update. In quantum computing, due to the uncertainty principle, the first measurement result is obtained with a certain probability, meaning there is a certain probability of retaining the second quantum state. This allows the Metropolis algorithm to be used to solve optimization problems in quantum computing. Attached Figure Description

[0037] Figure 1 This is a network block diagram of an optimization problem solving system provided in an embodiment of this application;

[0038] Figure 2 A flowchart illustrating an optimization problem-solving method provided in an embodiment of this application;

[0039] Figure 3 A flowchart illustrating another optimization problem-solving method provided in this application embodiment;

[0040] Figure 4 This is a schematic diagram of an optimization problem solving device provided in an embodiment of this application. Detailed Implementation

[0041] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0042] Figure 1This is a network block diagram of an optimization problem solving system provided in an embodiment of this 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 memory, classical processor, quantum processor and other devices not shown.

[0043] Network 110 is a medium used to provide communication links between various devices and computers connected together within an 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 can be wired, wireless communication links, or fiber optic cables.

[0044] Server 120 and client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computational processes. Client 140 may be a personal computer or a network computer, so the data may also be provided by server 120. Wireless device 130 may be a smartphone, tablet, laptop, smart wearable device, etc. Storage unit 150 may include database 151, which can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.

[0045] 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 program 162 (application program 173). The application program 162 (application program 173) may be used to implement a quantum algorithm compiled according to the optimization problem solving method provided in the embodiments of this application.

[0046] 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 executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0047] It should be noted that a true quantum computer has a hybrid structure, which includes at least... Figure 1 The system consists of two main parts: 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 computing.

[0048] The aforementioned classical processing system 160 and quantum processing system 170 can be integrated into a single device or distributed across two different devices. For example, the first device, including the classical processing system 160, runs a classical computer operating system that provides quantum application development tools and services, as well as the storage and network services required for quantum applications. Users develop quantum applications using the quantum application development tools and services on the second device and send the quantum program to the second device, including the quantum processing system 170, via the network services. The second device runs a quantum computer operating system, which parses the code of the quantum program and compiles it into instructions that can be recognized and executed by the quantum computer control system. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on these instructions.

[0049] In the classic silicon-based processing system 160, the units of the classic processor 161 are CMOS transistors. These computing units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, the number of these computing units in a silicon chip is sufficient; currently, a classic processor contains tens of thousands of computing units. The sufficient number of computing units and the fixed selectable computing logic of the CMOS transistors, such as AND logic, allow for computational efficiency through a combination of numerous CMOS transistors and limited logic functions.

[0050] Unlike the logic units in the classical processing system 160, the basic computational unit of the quantum processor 171 in the quantum processing system 170 is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its available usage time and is not always readily available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is one of the representative indicators of its performance. Each qubit performs computational functions through on-demand configured logic functions. Given the limited number of qubits and the diverse logic functions available in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), X gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum computing requires combining a limited number of qubits with diverse logic function combinations to achieve computational effects.

[0051] Based on these differences, the design of logical functions applied to qubits (including the design of whether qubits are used and the design of the efficiency of each qubit) is crucial to improving the computational performance of quantum computers and requires special design. The aforementioned design considerations for qubits are technical problems that ordinary computing devices do not need to address. Therefore, this application proposes a method and apparatus for solving optimization problems using the Metropolis algorithm in quantum computing, aiming to achieve this in quantum computing.

[0052] See Figure 2 , Figure 2 A flowchart illustrating an optimization problem-solving method provided in this application embodiment may include the following steps:

[0053] S201: Based on the first quantum state, obtain a specific eigenstate and a first energy, wherein the first quantum state is a quantum state that includes a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate.

[0054] The first quantum state is determined based on the problem to be optimized; different problems may correspond to different first quantum states. The first quantum state can be a superposition of all feasible solutions to the problem, or it can include a single feasible solution. A feasible solution can be a conjectured solution to the problem, a known solution obtained empirically, and so on. Based on the first quantum state, evolutionary operations are performed to obtain specific eigenstates and a first energy. The Hamiltonian of the problem to be optimized 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 through analysis of the problem.

[0055] In some possible implementations of this application, obtaining a specific eigenstate and a first energy based on a first quantum state may include:

[0056] A QPE operation is performed on the first quantum state, and the result is measured to obtain a specific eigenstate and a first energy.

[0057] A quantum state can be stored in a quantum register, which can contain multiple qubits. The number of qubits in each quantum register is determined by the data stored. Performing quantum phase estimation on the quantum register storing the first quantum state and the first quantum register, the first quantum state |ψ> becomes... The first quantum register is initially in state 0. The result of the operation is then measured. Collapsed to That is, the quantum state stored in the quantum register that stores the first quantum state becomes The quantum state of the first quantum register becomes |E k >

[0058] QPE (quantum phase estimation) is a quantum computing operation based on the quantum Fourier transform, which can provide a certain degree of accuracy in estimating the phase of a target quantum state. For a quantum state with n qubits, phase estimation requires an additional r qubits as auxiliary bits, the specific size of which depends on the required accuracy. According to relevant theoretical derivations, generally speaking:

[0059]

[0060] Here, ε is the required estimation accuracy. The phase estimation operation is performed on these n+r qubits, storing the phase information of the original n-qubit quantum state into the computational basis of the auxiliary qubits.

[0061] Specifically, QPE can evolve for |ψ>|0<, and specifically, it constructs unitary gates e using quantum simulation of the Hamiltonian H of the problem to be optimized. iHθ |ψ> can be a superposition of several H eigenstates, and phase estimation can be performed on it to obtain Where E j Actually, it's E j The binary representation of θ / 2π. After measurement, a specific value is obtained. At this point, E can be... k It can be considered a classic piece of information.

[0062] The quantum state in the first quantum register changes from the |0> state to the |E> state. k After that, E k The backup from the first quantum register to the second quantum register is straightforward. Since the information stored in the first quantum register is classical after measurement, it can be backed up to the second quantum register through simple qubit operations, a process that does not violate the no-cloning principle of quantum states. To store additional energy, the first quantum register needs to be reset, returning its quantum state to its initial state, i.e., state 0. This backup operation can be a swap operation or any other operation that transfers the first energy from the first quantum register to the second quantum register.

[0063] S202: Using the specific eigenstate and the first energy, obtain a third quantum state including the first energy and the second energy, wherein the second quantum state is a quantum state that includes a feasible solution to the problem to be optimized, obtained based on the specific eigenstate, and the second energy is the energy of the eigenstate of the second quantum state.

[0064] An evolutionary operation is performed on a specific eigenstate, updating it once to obtain a second quantum state. This second quantum state can be a superposition state. The difference between the first and second quantum states lies in the different feasible solutions they contain. Then, operations are performed based on the second quantum state and a first energy to obtain a third quantum state. In the embodiments of this application, as long as the third quantum state can be obtained using the specific eigenstate and the first energy, the specific implementation can be varied.

[0065] In some possible embodiments of this application, obtaining a third quantum state comprising the first energy and the second energy using the specific eigenstate and the first energy includes:

[0066] A target state transition operation is performed on the specific eigenstate to obtain a second quantum state, wherein the target state transition operation is selected from a pre-defined set of state transition operations for the problem to be optimized;

[0067] Perform the QPE operation on the second quantum state to obtain a third quantum state that includes the first energy and the second energy.

[0068] The set of state transition operations is a known set of unitary operations {S}. {S} must satisfy the detailed balance condition for state transitions, which is the detailed balance condition for Markov chains. The specific unitary operations are related to the Hamiltonian of the problem to be optimized, but the only requirement is that the probability of selecting S must be equal to the probability of selecting... The unitary positing operation varies depending on the problem to be optimized. For example, in the coloring problem, the unitary positing operation can flip the state of a specific qubit in a specific eigenstate, evolving the specific eigenstate into a second quantum state. In the molecular docking problem, the unitary positing operation can transform a specific eigenstate representing one docking mode into a second quantum state containing multiple docking modes. In the embodiments of this application, a state transition operation can be randomly selected or selected using other methods that satisfy detailed balance conditions as the target state transition operation, and applied to the quantum register storing the specific eigenstate, such that the specific eigenstate... Updated to That is, the quantum state stored in the quantum register that stores a specific eigenstate is derived from the eigenstate. Updated to

[0069] A QPE operation is performed on the quantum register storing the second quantum state and the first quantum register to obtain the third quantum state, which may include...

[0070] One of the difficulties in the quantum generalization of the classical Metropolis algorithm lies in the retention / rejection step of the newly generated states. Taking the solution of the optimal molecular configuration as an example, in the classical algorithm, starting from a system configuration C... old Starting from C old The operation yields a new configuration C. new Afterwards, a copy of the old configuration can still be retained. After comparing the energy differences between the old and new configurations, the new configuration is accepted with a certain probability, weighted by the energy difference. However, for quantum computing, C... old It must be stored in a set of qubits, and a new configuration C is obtained after performing a state transfer operation on the configuration. new Subsequently, performing energy measurements would inevitably lead to irreversible collapse, resulting in the loss of information about the old configuration. In this application, the information about the old configuration is obtained by acquiring a second energy through state transfer operations and QPE operations without measurement, thereby preserving the information about the old configuration and making it possible to return from the new configuration to the old configuration.

[0071] S203: When it is determined that the second quantum state should be retained using the first measurement result but the iteration has not terminated, the second quantum state is taken as the new first quantum state and the process returns to execute S201, wherein the first measurement result is the measurement result obtained based on the third quantum state.

[0072] The first energy is measured. In quantum computing, different measurement results correspond to different probabilities. Using the QPE operation, the eigenenergy of the second quantum state is measured to obtain the second energy. The type of second energy obtained also has a certain probability. Based on this, the determination of whether to retain the second quantum state using the first measurement result also has a certain probability. This satisfies the basic principle of the Metropolis algorithm, that is, to use the Metropolis criterion to determine whether to retain the state update.

[0073] Determining whether to retain the second quantum state using the first measurement result can be achieved by utilizing the relationship between the first and second energies to determine whether to accept the state update. The key here is determining the relationship between the first and second energies; various methods can be used, but only the magnitude relationship is considered. When it is determined to retain the second quantum state based on the magnitude relationship, it is necessary to determine whether to terminate the iteration. If not, the second quantum state is used as the new quantum state, and S201 is executed. Using the second quantum state as the new first quantum state is from the perspective of quantum programming. From the perspective of the quantum register, the quantum state of the quantum register evolves with different operations. Directly performing a QPE operation on the second quantum state in the quantum register can obtain a new specific eigenstate and a new first energy.

[0074] In some possible embodiments of this application, the step of using the second quantum state as the new first quantum state when it is determined using the first measurement result to retain the second quantum state but the iteration has not terminated may include:

[0075] Using a target quantum logic gate acting on a third quantum register, the third quantum state is converted into a superposition of a quantum state representing retention and a quantum state representing rejection, wherein the target quantum logic gate is controlled by a first quantum register and a second quantum register; the first quantum register currently stores the second energy, and the second quantum register currently stores the first energy;

[0076] The third quantum register is measured to obtain a first measurement result;

[0077] When the first measurement result is a preset value representing retention, the second quantum state is taken as the new first quantum state.

[0078] To ensure that the quantum state has a chance to return to the state before the update, the second quantum register cannot be measured. One possible approach is to divide the third quantum state based on the extra bits of the third quantum register, dividing it into a superposition of two states: characterization retention and characterization rejection.

[0079] The specific method involves using a multi-controlled single-bit gate applied to the M register to perform the following unitary transformation:

[0080]

[0081] in, This is precisely the state transition probability scale required by the classic Metropolis algorithm; therefore, the first term on the right-hand side of the above equation is retained and updated accordingly. The probability is also exactly the |x| required by the algorithm. i | 2 f i .

[0082] Based on the unitary transformation described above, the single-bit gate of the target quantum logic gate acting on the third register should be the W gate, and the matrix corresponding to the W gate can be:

[0083]

[0084] The W gate is related to the specific form of the problem to be optimized and the required estimation accuracy; it is controlled by the first quantum register and the second quantum register.

[0085] In this embodiment of the application, the third quantum register may contain only one quantum bit. The first measurement result is either 1 or 0, where 1 represents retention and 0 represents rejection. When the first measurement result is 1, it means that the second quantum state is retained, and the second quantum state can be used as the new first quantum state.

[0086] Before performing the next round of QPE operations after retaining the second quantum state, because retaining the second quantum state still results in a superposition state, i.e., ∑ i x i |ψ i >|E i >|E k To ensure the feasibility of the operation, it is desirable to start from this ∑. i x i |ψ i > Perform phase estimation and obtain a certain and the corresponding energy E k′ Then, the unitary operation S is performed, which requires resetting the first quantum register, the second quantum register, and the third quantum register to their initial state.

[0087] S204: When the iteration terminates, determine the target solution of the problem to be optimized based on the current second quantum state.

[0088] In this embodiment, an iteration at an annealing temperature is considered a basic iterative unit. Within a basic iterative unit, when the number of times the second quantum state is retained reaches a preset threshold, the annealing temperature is increased, and the operation of the next basic iterative unit is performed. If the second quantum states obtained consecutively (the specific values ​​can be set according to actual conditions) are the same or not significantly different within a basic iterative unit, it indicates that the second quantum state contains the optimal solution or near-optimal solution to the problem to be optimized. At this point, the iteration can be terminated. Alternatively, the iteration can be terminated when a basic iterative unit ends and the annealing temperature reaches the preset temperature. Of course, other conditions for terminating the iteration may also exist, as long as they conform to the characteristics of the classical simulated annealing algorithm, which will not be elaborated here.

[0089] After the iteration terminates, a certain relationship exists between the second quantum state and the target solution. How to process the second quantum state to obtain the target solution varies depending on the optimization problem. For some optimization problems, the solution corresponding to the eigenstate with the highest probability in the second quantum state can be used as the target solution. For other optimization problems, the second quantum state can be measured, and the target solution can be determined based on the measured energy. For example, multiple measurements of the second quantum state can be performed to obtain multiple energies, and the solution corresponding to the eigenstate with the lowest energy can be selected as the target solution.

[0090] In some possible embodiments of this application, when the first measurement result is not the preset target value, the method further includes:

[0091] A target operation is performed on the first quantum register, the second quantum register, the third quantum register, and the fourth quantum register, wherein the fourth quantum register currently stores a second quantum state, and the target operation is the inverse operation determined by the operation between obtaining the first measurement result based on the specific eigenstate;

[0092] The first quantum register and the second quantum register are measured to obtain the second measurement result and the third measurement result, respectively.

[0093] If the second measurement result is the same as the third measurement result, and the quantum state currently stored in the fourth quantum register is taken as the first quantum state, then the process returns to step S201.

[0094] In this embodiment, if the first measurement result is 0, it means the update is rejected, and the fourth register (the register storing the quantum state of the quantum system to be optimized) needs to be rolled back to the quantum state before the update. In classical computing, returning to the original state simply requires retaining a backup of the original state. However, in quantum computing, this method is limited by the no-cloning principle of quantum states, requiring the inverse operation of the entire state update, i.e., performing the target operation. The target operation includes the inverse operations of the target state transition operation, the QPE operation, and the controlled W-gate operation. After execution, the quantum state may return to the state at the time of the target state transition operation, and the first and second quantum registers store the corresponding energy information. If these two quantum registers are measured, and the measured energies of the two registers are consistent, it indicates that the original state has been returned to, and the next basic iteration process can proceed.

[0095] In some possible embodiments of this application, the method further includes:

[0096] In response to the fact that the second measurement result is different from the third measurement result, the quantum state currently stored in the fourth quantum register is taken as the specific eigenstate, and the process returns to step S202.

[0097] If the second measurement result and the third measurement result are inconsistent, the quantum state currently stored in the fourth quantum register is taken as the specific eigenstate, and the process of obtaining the second quantum state based on the specific eigenstate through the target state transfer operation is returned until the results are consistent.

[0098] As can be seen, this application first obtains a specific eigenstate and a first energy based on a first quantum state, and then uses the specific eigenstate and the first energy to obtain a third quantum state including the first energy and the second energy. Next, when the first measurement result determines that the second quantum state should be retained, but the iteration has not terminated, the second quantum state is used as the new first quantum state, and the process returns to the step of obtaining the specific eigenstate and the first energy based on the first quantum state. Finally, when the iteration terminates, the target solution to the problem to be optimized is determined based on the current second quantum state. In this application, the first measurement result is used to determine whether to retain the state update. However, due to the uncertainty principle in quantum computing, the first measurement result is obtained with a certain probability, meaning there is a certain probability of retaining the second quantum state. This allows the Metropolis algorithm to be used to solve optimization problems in quantum computing.

[0099] Figure 3 This is a flowchart illustrating another optimization problem-solving method provided in this application embodiment. The fourth quantum register stores the quantum state of the quantum system under study (the optimization problem). The second quantum register stores the energy information of the state required for the phase estimation process. The third quantum register is used to back up the energy information of the state. The fourth quantum register may contain only one qubit, the measurement result of which determines whether to retain the updated state. The fourth quantum register is the key part for realizing the retain / reject state transition and can also be called a Metropolis register, or M register for short. By performing corresponding operations on the four quantum registers, the quantum states stored in the four quantum registers also change. At the end of the first stage, the quantum states of the four quantum registers change from |ψ>|0>|0>|0> to... After the QPE operation is performed in the second stage, the quantum states of the four quantum registers become Based on the measurement results of the fourth quantum register, perform the corresponding retain operation or reject the update operation.

[0100] See Figure 4 , Figure 4 This is a schematic diagram of the structure of an optimization problem solving device provided in an embodiment of this application. Figure 2 Corresponding to the process shown, the apparatus includes:

[0101] The first obtaining module 401 is used to obtain a specific eigenstate and a first energy based on a first quantum state, wherein the first quantum state is a quantum state including a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate;

[0102] The second obtaining module 402 is used to obtain a third quantum state including the first energy and the second energy by utilizing the specific eigenstate and the first energy, wherein the second quantum state is a quantum state including a feasible solution of the problem to be optimized based on the specific eigenstate, and the second energy is the energy of the eigenstate of the second quantum state;

[0103] The retention module 403 is used to retain the second quantum state as a new first quantum state when the second quantum state is determined to be retained using the first measurement result but the iteration has not terminated, and then returns to execute the first obtaining module 401, wherein the first measurement result is a measurement result obtained based on the third quantum state;

[0104] The determination module 404 is used to determine the target solution of the problem to be optimized based on the current second quantum state when the iteration terminates.

[0105] In some possible implementations of this application, the first obtaining module 401 may be specifically used for:

[0106] A quantum phase estimation (QPE) operation is performed on the first quantum state, and the result of the operation is measured to obtain the specific eigenstate and the first energy.

[0107] In some possible embodiments of this application, the second obtaining module 402 may be specifically used for:

[0108] A target state transition operation is performed on the specific eigenstate to obtain a second quantum state, wherein the target state transition operation is selected from a pre-defined set of state transition operations for the problem to be optimized;

[0109] Perform the QPE operation on the second quantum state to obtain a third quantum state that includes the first energy and the second energy.

[0110] In some possible embodiments of this application, the retention module 403 may include:

[0111] A conversion unit is used to convert the third quantum state into a superposition of a quantum state representing retention and a quantum state representing rejection using a target quantum logic gate acting on a third quantum register, wherein the target quantum logic gate is controlled by a first quantum register and a second quantum register; the first quantum register currently stores the second energy, and the second quantum register currently stores the first energy;

[0112] The measurement unit is used to measure the third quantum register and obtain a first measurement result;

[0113] The determining unit is configured to, when the first measurement result is a preset value representing retention, use the second quantum state as a new first quantum state.

[0114] In some possible implementations of this application, the target quantum logic gate may be a W gate;

[0115] The W gate can be:

[0116]

[0117] in, β = 1 / T, where T is the current annealing temperature and E is the annealing temperature. k For the first energy, E i This is the second energy.

[0118] In some possible embodiments of this application, the apparatus may further include:

[0119] The inverse operation module is used to perform a target operation on the first quantum register, the second quantum register, the third quantum register, and the fourth quantum register when the first measurement result is not the preset value. The fourth quantum register currently stores a second quantum state, and the target operation is the inverse operation determined by the operation between the first measurement result obtained based on the specific eigenstate.

[0120] The measurement module is used to measure the first quantum register and the second quantum register to obtain the second measurement result and the third measurement result, respectively.

[0121] The first response module is configured to respond to the fact that the second measurement result is the same as the third measurement result, and to take the quantum state currently stored in the fourth quantum register as the first quantum state, and then return to execute the first acquisition module 401.

[0122] In some possible embodiments of this application, the apparatus may further include:

[0123] The second response module is used to respond to the fact that the second measurement result is different from the third measurement result, and to take the quantum state currently stored in the fourth quantum register as the specific eigenstate and return to execute the second acquisition module.

[0124] As can be seen, this application first obtains a specific eigenstate and a first energy based on a first quantum state, and then uses the specific eigenstate and the first energy to obtain a third quantum state including the first energy and the second energy. Next, when the first measurement result determines that the second quantum state should be retained, but the iteration has not terminated, the second quantum state is used as the new first quantum state, and the process returns to the step of obtaining the specific eigenstate and the first energy based on the first quantum state. Finally, when the iteration terminates, the target solution to the problem to be optimized is determined based on the current second quantum state. In this application, the first measurement result is used to determine whether to retain the state update. However, due to the uncertainty principle in quantum computing, the first measurement result is obtained with a certain probability, meaning there is a certain probability of retaining the second quantum state. This allows the Metropolis algorithm to be used to solve optimization problems in quantum computing.

[0125] This application also provides a storage medium storing a computer program, wherein the computer program is configured to implement the steps in any of the above method embodiments when running.

[0126] Specifically, in this embodiment, the storage medium can be configured to store a computer program for implementing the following steps:

[0127] S201: Based on the first quantum state, obtain a specific eigenstate and a first energy, wherein the first quantum state is a quantum state that includes a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate;

[0128] S202: Using the specific eigenstate and the first energy, obtain a third quantum state including the first energy and the second energy, wherein the second quantum state is a quantum state including a feasible solution to the problem to be optimized, obtained based on the specific eigenstate, and the second energy is the energy of the eigenstate of the second quantum state;

[0129] S203: When it is determined that the second quantum state should be retained using the first measurement result but the iteration has not terminated, the second quantum state is taken as the new first quantum state, and the process returns to execute S201, wherein the first measurement result is the measurement result obtained based on the third quantum state;

[0130] S204: When the iteration terminates, determine the target solution of the problem to be optimized based on the current second quantum state.

[0131] This application also 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 of the above method embodiments.

[0132] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.

[0133] Specifically, in this embodiment, the processor described above can be configured to implement the following steps via a computer program:

[0134] S201: Based on the first quantum state, obtain a specific eigenstate and a first energy, wherein the first quantum state is a quantum state that includes a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate;

[0135] S202: Using the specific eigenstate and the first energy, obtain a third quantum state including the first energy and the second energy, wherein the second quantum state is a quantum state including a feasible solution to the problem to be optimized, obtained based on the specific eigenstate, and the second energy is the energy of the eigenstate of the second quantum state;

[0136] S203: When it is determined that the second quantum state should be retained using the first measurement result but the iteration has not terminated, the second quantum state is taken as the new first quantum state, and the process returns to execute S201, wherein the first measurement result is the measurement result obtained based on the third quantum state;

[0137] S204: When the iteration terminates, determine the target solution of the problem to be optimized based on the current second quantum state.

[0138] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the optimization problem solution in any of the above embodiments.

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

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

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

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

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

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

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

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

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

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

[0149] If the aforementioned functions are implemented as 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 solutions of this specification, in essence, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0150] The above description is merely a specific embodiment of this specification, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for solving optimization problems, characterized in that, The method includes: Based on the first quantum state, a specific eigenstate and a first energy are obtained, wherein the first quantum state is a quantum state that includes a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate; A quantum phase estimation (QPE) operation is performed on the first quantum state, and the result of the operation is measured to obtain the specific eigenstate and the first energy. A target state transition operation is performed on the specific eigenstate to obtain a second quantum state. The target state transition operation is selected from a pre-defined set of state transition operations for the problem to be optimized. The second quantum state is a quantum state that includes feasible solutions to the problem to be optimized, obtained based on the specific eigenstate. Perform the QPE operation on the second quantum state to obtain a third quantum state including the first energy and the second energy, wherein the second energy is the energy of the eigenstate of the second quantum state; Using a target quantum logic gate acting on a third quantum register, the third quantum state is converted into a superposition of a quantum state representing retention and a quantum state representing rejection, wherein the target quantum logic gate is controlled by a first quantum register and a second quantum register; the first quantum register currently stores the second energy, and the second quantum register currently stores the first energy; The third quantum register is measured to obtain a first measurement result; When the first measurement result is a preset value for characterization retention, the second quantum state is taken as the new first quantum state, and the process returns to the step of obtaining a specific eigenstate and a first energy based on the first quantum state, wherein the first measurement result is a measurement result obtained based on the third quantum state; When the iteration terminates, the target solution to the problem to be optimized is determined based on the current second quantum state.

2. The method according to claim 1, characterized in that, The target quantum logic gate is a W gate; The W gate is: in, , , The current annealing temperature, For the first energy, This is the second energy.

3. The method according to claim 2, characterized in that, When the first measurement result is not the preset value, the method further includes: A target operation is performed on the first quantum register, the second quantum register, the third quantum register, and the fourth quantum register, wherein the fourth quantum register currently stores a second quantum state, and the target operation is the inverse operation determined by the operation between obtaining the first measurement result based on the specific eigenstate; The first quantum register and the second quantum register are measured to obtain the second measurement result and the third measurement result, respectively. If the second measurement result is the same as the third measurement result, and the quantum state currently stored in the fourth quantum register is taken as the first quantum state, then the process of obtaining the specific eigenstate and the first energy based on the first quantum state is returned.

4. The method according to claim 3, characterized in that, The method further includes: In response to the second measurement result being different from the third measurement result, the quantum state currently stored in the fourth quantum register is taken as the specific eigenstate, and the step of obtaining a third quantum state including the first energy and the second energy is returned to be executed using the specific eigenstate and the first energy.

5. An optimization problem solving apparatus, characterized in that, The device includes: A first acquisition module is used to acquire a specific eigenstate and a first energy based on a first quantum state, wherein the first quantum state is a quantum state that includes a feasible solution to the problem to be optimized, the specific eigenstate is an eigenstate of the Hamiltonian of the problem to be optimized, and the first energy is the energy of the specific eigenstate; The second acquisition module is used to perform a quantum phase estimation (QPE) operation on the first quantum state and measure the operation result to obtain a specific eigenstate and a first energy; to perform a target state transition operation on the specific eigenstate to obtain a second quantum state; and to perform the QPE operation on the second quantum state to obtain a third quantum state including the first energy and the second energy. The target state transition operation is selected from a preset set of state transition operations for the problem to be optimized; the second quantum state is a quantum state that includes a feasible solution to the problem to be optimized, obtained based on the specific eigenstate; and the second energy is the energy of the eigenstate of the second quantum state. A retention module is used to convert the third quantum state into a superposition of a quantum state representing retention and a quantum state representing rejection using a target quantum logic gate acting on a third quantum register, wherein the target quantum logic gate is controlled by a first quantum register and a second quantum register; the first quantum register currently stores the second energy, and the second quantum register currently stores the first energy; the third quantum register is measured to obtain a first measurement result; when the first measurement result is a preset value representing retention, the second quantum state is taken as the new first quantum state, and the execution of the first acquisition module is returned, wherein the first measurement result is a measurement result obtained based on the third quantum state; A determination module is used to determine the target solution of the problem to be optimized based on the current second quantum state when the iteration terminates.

6. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to implement the method described in any one of claims 1 to 4 when it is run.

7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to implement the method according to any one of claims 1 to 4.