Quantum circuit optimization method and device based on easy Hamiltonian
By splitting the Hamiltonian into local Hamiltonians and performing phase correction and variable elimination, the quantum circuit structure is optimized, which solves the problem of excessive circuit depth and high computational complexity on NISQ devices, and efficient quantum optimization algorithm deployment and solution is achieved.
Patent Information
- Application Number
- CN202510446810.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-08
AI Technical Summary
When existing quantum circuits based on easy-to-drive Hamiltonian quantum are deployed on a near-medium-term noise quantum device (NISQ), there are problems such as high computational complexity and excessive circuit depth, resulting in limited success rate and executability of quantum approximation optimization algorithms.
The overall Hamiltonian is split into multiple local Hamiltonians, map it to the calculation ground state through the conversion gate, and phase correction is performed, and the phase relationship of other ground states is synchronized. Combined with variable elimination optimization, the Hamiltonian is reconstructed, the circuit depth is reduced and the quantum circuit structure is optimized.
It significantly reduces the depth of quantum circuits and hardware resource consumption, improves the deployability and solution efficiency on NISQ equipment, and especially shows excellent solution capabilities in problems such as facility site selection and graph coloring.
Smart Images

Figure CN120450065A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing technology, and in particular to a quantum circuit optimization method and device based on a commutative Hamiltonian. Background Art
[0002] Quantum computing, as a next-generation computing technology, leverages properties such as quantum superposition and entanglement to provide faster solutions than classical computing for certain problems. Constrained binary optimization problems are widely used in fields such as traffic scheduling, supply chain management, portfolio optimization, and graph theory. Because these problems are NP-hard, classical solution methods (such as integer linear programming and heuristic search) experience exponentially increased computational complexity as the number of variables increases.
[0003] In quantum computing, the Quantum Approximate Optimization Algorithm (QAOA) is an algorithm that uses variational quantum circuits to solve optimization problems. Its basic idea is to construct a quantum circuit using a target Hamiltonian and a driving Hamiltonian; using variational optimization methods to adjust the circuit parameters so that the quantum state converges to the optimal solution.
[0004] The success of QAOA hinges on the construction of the driving Hamiltonian. Currently, there are two main approaches: 1) Penalty-based approaches, where constraints are added as penalty terms to the target Hamiltonian and weight parameters are adjusted to optimize constraint satisfaction. 2) Commutative driving Hamiltonian approaches, where constraints are directly encoded in the driving Hamiltonian. By constructing the driving Hamiltonian so that it commutes with the constraint operators, arbitrary constraints can be encoded, theoretically guaranteeing 100% constraint satisfaction. However, penalty-based approaches cannot guarantee 100% constraint satisfaction, and therefore, commutative driving Hamiltonian approaches have received significant attention.
[0005] Due to the complex form of the Hamiltonian, deployment of the easy-driven Hamiltonian on near- to medium-term noisy quantum devices (NISQs) poses challenges in the deployment and execution efficiency of quantum hardware, including high computational complexity and excessive circuit depth. This limits the success rate and practicability of quantum approximation algorithms, significantly reducing the ability to solve constrained binary optimization problems. To improve the adaptability of QAOA on NISQs, unitary matrix decomposition and Trotter decomposition techniques have been developed.
[0006] Unitary matrix decomposition is a classic quantum simulation method, which is usually used to decompose any quantum operator (such as the exponential evolution of Hamiltonian) into a set of basic quantum gates. However, when dealing with high-dimensional Hamiltonian, unitary matrix decomposition usually requires the calculation of 2 nThe matrix exponential of the dimension is large, and highly entangled multi-bit gates are required when implementing quantum circuits. Therefore, there are problems of high computational complexity and excessive number of quantum gates, and it is only applicable to low-dimensional Hamiltonians. Trotter decomposition technology is a classic quantum simulation method that approximates quantum evolution by decomposing the Hamiltonian exponential evolution into multiple small time steps. The approximation error decreases with the number of steps. However, Trotter decomposition requires a large number of repeated executions of single-step exponential evolutions. operations, resulting in an exponential increase in the number of gates, and the computational complexity usually increases with the step size to O(n 3 ) or higher, and in practical quantum circuits will lead to high gate counts and increased computational cost.
[0007] Therefore, for the current optimization deployment technology based on the commutative driven Hamiltonian, ensuring that the quantum state evolution always meets the constraints, improving the solution accuracy and success rate, and optimizing the circuit structure to adapt it to the hardware conditions of the current NISQ equipment and reduce the computational overhead are issues that need to be urgently addressed. Summary of the Invention
[0008] To solve the above technical problems, the present invention provides a quantum circuit optimization method and device based on the commutative Hamiltonian, which optimizes quantum circuits through Hamiltonian serialization, equivalent decomposition and variable elimination, reduces circuit depth and improves deployability on quantum hardware.
[0009] To achieve the above-mentioned object of the invention, an embodiment provides a quantum circuit optimization method based on a commutative Hamiltonian, comprising the following steps:
[0010] The overall Hamiltonian in the quantum circuit is split into multiple local Hamiltonians. The exponential evolution of each local Hamiltonian is decomposed, the eigenstate of the local Hamiltonian is mapped to the computational ground state, the phase of the target computational ground state is corrected, the phase relationship of other computational ground states is synchronously adjusted, and the original state space is restored.
[0011] Quantify the importance of each variable to the quantum circuit constraints, sort them according to importance, remove the most important variables first, adjust the constraints based on the remaining variables, reconstruct the Hamiltonian, and complete the quantum circuit optimization.
[0012] In one embodiment, the construction of the local Hamiltonian is based on the set of solution vectors of the constraint equations Cu=0, and satisfies the driving Hamiltonian H d =∑ u∈Δ H c (u) commutes with the constraint operator C to ensure that the quantum state evolution satisfies the constraint conditions throughout the process.
[0013] In one embodiment, mapping the eigenstate of the local Hamiltonian to the computational ground state includes: generating a quantum state conversion path based on the constraint solution vector u, and mapping the eigenstate of the local Hamiltonian to the computational ground state through a conversion gate G, wherein the conversion gate G is a combination of a controlled NOT gate and a quantum bit flip gate.
[0014] In one embodiment, the eigenstate |x ± > is represented as: Among them, v n and v′ n Represents two different states of the quantum bit; the computational ground state is represented as: |011...1> and |111...1>.
[0015] In one embodiment, performing phase correction on the target computing base state includes applying a multi-control phase gate P(β) to the target computing base state, adding a phase factor β, and achieving phase correction.
[0016] In one embodiment, the phase relationship of adjusting other computing basis states is adjusted by flipping the first quantum bit through a Pauli-X gate, transferring the phase correction to other related computing basis states, and offsetting the redundant phase.
[0017] In one embodiment, the importance of each variable to the quantum circuit constraint is calculated based on the frequency of non-zero contributions of the variable in the constraint solution vector. i ) is expressed as:
[0018] I(x i )=∑ u∈Δ |u i |,
[0019] Among them, x i is a variable, u is the constraint solution vector, |u i | is the number of non-zero elements in the constraint solution vector, and Δ is the basic solution system.
[0020] In one embodiment, the optimized quantum circuit depth is linearly related to the number of qubits.
[0021] The present invention also provides a quantum circuit optimization device based on commutative Hamiltonian, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to implement the quantum circuit optimization method based on commutative Hamiltonian when executing the computer program.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] (1) The overall Hamiltonian is decomposed into multiple local Hamiltonians. The local Hamiltonians are mapped to basic gates that can be directly executed in the quantum circuit, reducing the circuit depth. The basic gates are directly compiled into the existing quantum gate set without the need for additional gate decomposition. Then, by eliminating the variables with the greatest impact, the dimension of the Hamiltonian is reduced, exponential matrix operations are avoided, hardware resource consumption is greatly reduced, and computational efficiency is improved.
[0024] (2) The quantum circuit optimization method provided by the present invention supports arbitrary linear constrained optimization problems and has strong generalization capabilities, especially in classical problems such as facility site selection, graph coloring, and K-partitioning, showing excellent solving capabilities. In addition, the present invention can also be applied to multiple important application scenarios such as capital budgeting problems, job scheduling problems, set covering problems, and traveling salesman problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for describing the embodiments or the prior art.
[0026] Figure 1 1 is a flow chart of a quantum circuit optimization method based on commutative Hamiltonian provided by the present invention;
[0027] Figure 2 This is a schematic diagram of Hamiltonian serialization provided by the present invention;
[0028] Figure 3 The quantum circuit after equivalent decomposition provided by the present invention;
[0029] Figure 4 A diagram showing the decomposition mechanism of the multi-control phase gate provided by the present invention;
[0030] Figure 5 The variables provided for the present invention eliminate the effects of optimization. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0032] In order to improve the solution efficiency and deployability of quantum optimization algorithms on near- to medium-term noisy quantum devices (NISQ), the embodiment provides a quantum circuit optimization method based on commutative Hamiltonian, including the design of the computational ground state in the quantum circuit and the reconstruction of the Hamiltonian, such as Figure 1 As shown, the following steps are included:
[0033] S1. Split the overall Hamiltonian in the quantum circuit into multiple local Hamiltonians, decompose the exponential evolution of each local Hamiltonian, map the eigenstate of the local Hamiltonian to the computational basis state, perform phase correction on the target computational basis state, synchronously adjust the phase relationship of other computational basis states, and restore to the original state space.
[0034] In the embodiment, for large-scale constrained optimization problems, such as facility location selection (FLP), graph coloring (GCP) and K-partitioning (KPP) problems. These problems usually involve multiple constraint equations, driving the Hamiltonian H d It is necessary to act on multiple quantum bits, and traditional quantum optimization methods require exponentially complex decomposition of the entire Hamiltonian, resulting in excessive computational overhead and excessive circuit depth.
[0035] In the embodiment, NISQ is adapted by Hamiltonian serialization, specifically, 1) constructing a driving Hamiltonian, Given a binary constraint optimization problem, transform it into a linear constraint equation Cx=c, solve its solution space u, and obtain a set of local constraint vectors. By constructing the commutative drive Hamiltonian H d :H d =∑ u∈Δ H c (u), so that the evolution of the system always satisfies the constraints.
[0036] 2) Perform Hamiltonian serialization and split the overall Hamiltonian into multiple local Hamiltonians H c , and solve it separately:
[0037]
[0038] Among them, u is the solution vector of the constraint equation, Δ represents the set of all solutions that satisfy the constraint; each H c (u) only acts on a small number of quantum bits, thereby reducing the computational complexity from O(2 n ) is reduced to O(n), improving the scalability of the algorithm.
[0039] Depend on Figure 2 It can be seen that by decomposing the commutative driving Hamiltonian into multiple local Hamiltonians and acting on the relevant bits separately, the repeated small Hamiltonian operations are reduced, and the circuit depth is reduced from 4000 to 24. In addition, compared with the traditional method, this method reduces the entangled connections between quantum bits, for example: c (u 1 ) only applies to bits q1, q2, q3, H c (u 2 ) only acts on bits q2 and q4, thereby reducing the topological limitations on the physical connections of quantum computers and improving executability.
[0040] When binary optimization problems involve large numbers of variables, traditional methods require the use of Trotter approximation or unitary matrix decomposition techniques to perform the exponential evolution of the Hamiltonian. These methods introduce computational errors and lead to exponential growth in circuit depth. Therefore, based on an equivalent decomposition method using multiple controlled phase gates, a conversion gate G is constructed to directly transform the Hamiltonian's eigenstates into the computational ground state, enabling quantum circuits to achieve exponential Hamiltonian evolution with linear complexity.
[0041] In the embodiment, specifically, for any Hc(u), its eigenstate can be expressed as:
[0042]
[0043] Among them, v n and v′ n Represents two different states of a quantum bit.
[0044] The exponential evolution of this Hamiltonian is equivalent to adding phases to these eigenstates:
[0045]
[0046] The present invention utilizes this mathematical property to Breaks down to:
[0047]
[0048] By converting the ground state transition gate G to the eigenstate |x ± > is mapped to the computational ground states |011...1> and |111...1>, a phase factor is applied to |011...1> through a multi-control phase gate P(β), and the first quantum bit is flipped through a Pauli-X gate (X1 gate), the phase correction is transferred to other related computational ground states (such as |011...1>→|111...1>), and the phase difference is adjusted through a reverse operation P(-β) to offset the redundant phase, and finally based on the inverse conversion gate Restoring the original space and equivalently achieving Hamiltonian evolution. This decomposition method can reduce the circuit depth from exponential to linear, effectively improving the adaptability of QAOA on NISQ devices.
[0049] Algorithm 1 describes in detail the specific implementation process of the ground state transition gate G.
[0050]
[0051] like Figure 3 and Figure 4As shown in the figure, through this quantum circuit equivalent decomposition, the decomposition calculation only involves pattern matching, avoiding exponential tensor calculations; the Hamiltonian is mapped to a directly implementable multi-control phase gate to reduce circuit depth and computational complexity. The conversion gate is used instead of the traditional decomposition, so that the eigenstate of the Hamiltonian |x ± >| can be directly converted to the standard computational ground state |011>, |111>. The phase gate P(β) is used to apply the corresponding phase correction, and X1P(-β)X1 further optimizes the phase flip, making the exponential evolution of the Hamiltonian equivalent to the combination of multiple phase gates. The conversion gate and phase gate can be directly compiled into the existing quantum gate set (such as IBM Q's C Z Door and R Z gates), without the need for additional gate decomposition. The computational complexity of this method is reduced from exponential to linear, reducing the 4 ×, the quantum circuit depth only increases linearly with the number of quantum bits, greatly reducing hardware resource consumption.
[0052] S2. Quantify the importance of each variable to the quantum circuit constraints, sort them by importance, remove the most important variables first, adjust the constraints based on the remaining variables, reconstruct the Hamiltonian, and complete the quantum circuit optimization.
[0053] Constrained binary optimization problems such as the traveling salesman problem (TSP), job scheduling (JSP), and K-partitioning (KPP) usually involve multiple variables sharing constraints, which increases the computational complexity. By eliminating the variables with the greatest influence, the dimension of the Hamiltonian can be reduced and the computational efficiency can be improved.
[0054] like Figure 5 Specifically, in order to decide which variables to exclude, the present invention defines the importance of the variable I(x i ):
[0055] I(x i )=∑ u∈Δ |u i |
[0056] That is, the number of non-zero times of statistical variables in the constraint solution I(x i ), where x i is a variable, u is the constraint solution vector, |u i | is the number of non-zero elements in the constraint solution vector, and Δ is the basic solution system.
[0057] Prioritize removal of I(x i ) to reduce the qubit requirement and the search space. Remove the variable x j After that, the constraint equation is adjusted to: ∑ i≠j c i x i =cc jx j , and then construct a new Hamiltonian H′ d To adapt the remaining variables. Figure 5 As can be seen, after removing the variable x2, the constraint matrix Cu = 0 is transformed into a new matrix C′u′ = 0, reducing the dimensionality of the solution. Due to the reduction in variables, the Hamiltonian only needs to act on three bits, q1, q3, and q4, reducing the circuit depth from 24 to 14 and the quantum bit requirement from 4 to 3. This variable elimination method can reduce the circuit depth by 2.7× while increasing the solution success rate by 46.3×.
[0058] In order to highlight the advantages of this method, it is compared with traditional decomposition techniques:
[0059] Table 1
[0060]
[0061] As can be seen from Table 1, the present invention reduces the computational complexity to O(n) by Hamiltonian serialization and equivalent decomposition compared to unitary matrix decomposition. It adopts local Hamiltonian decomposition and variable elimination technology to reduce the circuit depth from exponential to linear level, reducing the difficulty of hardware execution. In addition, compared with traditional methods, the depth of quantum gates no longer depends on the overall Hamiltonian, but is only related to the local Hamiltonian, which reduces the entanglement connection between quantum bits, for example: H c (u 1 ) only applies to bits q1, q2, q3, H c (u 2 ) only acts on bits q2 and q4, thereby reducing the topological restrictions on the physical connections of quantum computers, improving executability, supporting arbitrary linear constrained optimization problems, and performing well in problems such as facility site selection, graph coloring, and K-partitioning, and can achieve efficient solutions to larger-scale problems.
[0062] Table 2
[0063]
[0064] As shown in Table 2, the present invention strictly constructs the commutative drive Hamiltonian, so that the system evolution naturally satisfies the constraints without approximate calculation. It uses the equivalent decomposition technology to directly map the Hamiltonian to the multi-controlled phase gate, reducing the number of gates and entanglement operations, and reducing the depth of the quantum circuit by 10. 4 ×.
[0065] The embodiment also provides a quantum circuit optimization device based on the commutative Hamiltonian, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to implement the quantum approximate optimization method based on the commutative Hamiltonian when executing the computer program.
[0066] To further verify the advantages of the present invention, experiments were conducted on the IBM 159-qubit Fez quantum platform to compare the solution effects of different methods.
[0067] Table 3
[0068] method Constraint satisfaction rate Success rate (optimal solution) Circuit Depth Calculation time Trotter decomposition 67.1% 9.50% >4000 19.6s Unitary matrix factorization 84.8% 38.2% >1000 16.7s The present invention 100% 67.1% ≤100 7.07s
[0069] The results in Table 3 show that the constraint satisfaction rate of the proposed method reaches 100%, significantly outperforming Trotter decomposition and unitary matrix decomposition. The success rate is increased by 235×, and the optimal solution can be found in a variety of optimization problems, while traditional methods are almost unable to find the optimal solution for large-scale problems. The computation time is reduced by 2.97×, avoiding high-order approximation errors and improving computational efficiency. The circuit depth is reduced by 10 4 ×, more compatible with current NISQ quantum hardware, enabling more efficient quantum optimization. The optimization deployment technology of this invention can be widely applied to combinatorial optimization and constrained optimization problems, demonstrating exceptional solution capabilities in classic problems such as facility location selection (FLP), graph coloring (GCP), and K-partitioning (KPP). Furthermore, this invention is applicable to a number of important application scenarios, including the capital budgeting problem (CBP), the job scheduling problem (JSP), the set cover problem (SCP), and the traveling salesman problem (TSP).
[0070] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A quantum circuit optimization method based on commutative Hamiltonian, characterized in that: The following steps are involved: The overall Hamiltonian in the quantum circuit is split into multiple local Hamiltonians. The exponential evolution of each local Hamiltonian is decomposed, the eigenstate of the local Hamiltonian is mapped to the computational ground state, the phase of the target computational ground state is corrected, the phase relationship of other computational ground states is synchronously adjusted, and the original state space is restored. Quantify the importance of each variable to the quantum circuit constraints, sort them according to importance, remove the most important variables first, adjust the constraints based on the remaining variables, reconstruct the Hamiltonian, and complete the quantum circuit optimization.
2. The quantum circuit optimization method according to claim 1, characterized in that The construction of the local Hamiltonian is based on the set of solution vectors of the constraint equations with Cu = 0, and satisfies the driving Hamiltonian H d =∑ u∈A H c (u) commutes with the constraint operator C to ensure that the quantum state evolution satisfies the constraint conditions throughout the process.
3. The quantum circuit optimization method according to claim 1, characterized in that The mapping of the eigenstate of the local Hamiltonian to the computational ground state includes: generating a quantum state conversion path based on the constraint solution vector u, and mapping the eigenstate of the local Hamiltonian to the computational ground state through a conversion gate G, wherein the conversion gate G is a combination of a controlled NOT gate and a quantum bit flip gate.
4. The quantum circuit optimization method according to claim 3, characterized in that The eigenstate |x ± > is represented as: Among them, v n and v′ n Represents two different states of the quantum bit; the computational ground state is represented as: |011…1> and |111…1>.
5. The quantum circuit optimization method according to claim 1, characterized in that The phase correction of the target calculation base state includes: applying a multi-control phase gate P(β) to the target calculation base state, adding a phase factor β, and realizing phase correction.
6. The quantum circuit optimization method according to claim 1, characterized in that The described adjustment of the phase relationship of other computing basis states flips the first quantum bit through the Pau1i-X gate, transfers the phase correction to other related computing basis states, and offsets the redundant phase.
7. The quantum circuit optimization method according to claim 1, characterized in that The importance of each variable to the quantum circuit constraint is calculated based on the frequency of non-zero contributions of the variable in the constraint solution vector. i ) is expressed as: I(x i )=∑ u∈Δ |u i |, Among them, x i is a variable, u is the constraint solution vector, |u i | is the number of non-zero elements in the constraint solution vector, and Δ is the basic solution system.
8. The quantum circuit optimization method according to claim 1, characterized in that: The depth of the optimized quantum circuit is linearly related to the number of quantum bits.
9. A quantum circuit optimization device based on a commutative Hamiltonian, comprising a memory and a processor, wherein the memory is used to store a computer program, characterized in that: The processor is configured to implement the quantum circuit optimization method based on commutative Hamiltonian according to any one of claims 1 to 8 when executing the computer program.