A QAOA algorithm optimization method, device, terminal and storage medium

By optimizing the quantum line parameters of the QAOA algorithm and increasing the interaction, the error problem caused by too many algorithm layers in NISQ quantum computers is solved, which improves the optimization effect and reduces the depth of the quantum line, making it more suitable for current quantum computing hardware.

CN116187489BActive Publication Date: 2025-02-11ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111424152.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-02-11
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

The existing QAOA algorithms in NISQ quantum computers have accumulated operation errors due to too many algorithm layers, which affects the optimization effect. The quantum circuit depth is relatively large, making it difficult to effectively utilize the current quantum computing hardware.

Method used

By optimizing the target parameters in the quantum circuit of the QAOA algorithm, segmenting the first interaction parameters of the two qubits, making them independent of each other, and adding the second interaction, setting the same parameters and adding preset parameters, optimizing the target parameters and presets Parameters until the optimization termination condition is reached.

Benefits of technology

It improves the optimization effect, reduces the quantum circuit depth of the algorithm, makes it more suitable for NISQ quantum computers, reduces the operation error rate, and improves the computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116187489B_ABST
    Figure CN116187489B_ABST
Patent Text Reader

Abstract

The present invention discloses an optimization method, device, terminal and storage medium of a QAOA algorithm, the method comprising: optimizing a target parameter in a quantum circuit of the QAOA algorithm to a target value; dividing the same parameter used in each first interaction involving two quantum bits in the target parameter so that the parameters corresponding to each first interaction are independent of each other; adding a second interaction involving the two quantum bits, setting the same parameters as the first interaction for the second interaction, and adding preset parameters; optimizing the current target parameters and preset parameters until the preset optimization termination conditions are reached. By using the embodiments of the present invention, the optimization effect can be improved, the circuit depth of the quantum circuit of the algorithm can be reduced, and it is more suitable for the current NISQ quantum computer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum computing technology, and in particular to an optimization method, device, terminal and storage medium for a QAOA algorithm. Background Art

[0002] Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Quantum computers have become a key technology under research because they have the ability to process mathematical problems more efficiently than ordinary computers. For example, they can speed up the time to crack RSA keys from hundreds of years to a few hours.

[0003] Quantum computing simulation is a simulation that uses numerical calculations and computer science to simulate calculations that follow the laws of quantum mechanics. As a simulation program, it uses the basic laws of quantum bits in quantum mechanics and the high-speed computing power of computers to characterize the spatiotemporal evolution of quantum states.

[0004] At present, quantum algorithms play an increasingly important role in solving practical problems. For example, combinatorial optimization problems are a type of problem in which the optimal object is found in a finite set of objects. The introduction of QAOA (Quantum Approximate Optimization Algorithm) solves these problems well, and has wide applications and practical significance in classic maximum cut problems (MaxCut), maximum independent set (MaxIndependent set, MIS), satisfiability problem (Satisfiability Problem), and traveling salesman problem (Traveling Salesman Problem). At the same time, due to the limitations of the current NISQ (Noisy Intermediate-Scale Quantumtechnology) quantum computer hardware, QAOA also faces some problems. Among them, the cumulative error of operations when there are too many algorithm layers will affect the optimization effect, which is a problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of the present invention is to provide an optimization method, device, terminal and storage medium for the QAOA algorithm to solve the deficiencies in the prior art. It can improve the optimization effect, reduce the circuit depth of the algorithm's quantum circuit, and is more suitable for the current NISQ quantum computer.

[0006] An embodiment of the present application provides a method for optimizing a QAOA algorithm, the method comprising:

[0007] Optimize the target parameters in the quantum circuit of the QAOA algorithm to the target values;

[0008] Splitting the same parameter used by each first interaction involving two quantum bits in the target parameter so that the parameters corresponding to each first interaction are independent of each other;

[0009] Adding a second interaction involving the two quantum bits, setting the same parameters for the second interaction as for the first interaction, and adding preset parameters;

[0010] Optimize the current target parameters and preset parameters until the preset optimization termination conditions are reached.

[0011] Optionally, optimizing the target parameter in the quantum circuit of the QAOA algorithm to a target value includes:

[0012] The first target parameter and the second target parameter in the quantum circuit of the QAOA algorithm are optimized to the first target value and the second target value that make the cost function the highest or the lowest.

[0013] Optionally, the first interaction is: a two-qubit logic gate action corresponding to two Pauli-Z operators; and the second interaction includes one of the following:

[0014] The two-qubit logic gate function corresponding to two Pauli-X operators, the two-qubit logic gate function corresponding to two Pauli-Y operators, the two-qubit logic gate function corresponding to a Pauli-X operator and a Pauli-Y operator, the two-qubit logic gate function corresponding to a Pauli-X operator and a Pauli-Z operator, and the two-qubit logic gate function corresponding to a Pauli-Y operator and a Pauli-Z operator.

[0015] Optionally, optimizing the current target parameters and the preset parameters until a preset optimization termination condition is reached includes:

[0016] Calculate the gradient of the current target parameter and the preset parameter;

[0017] Determining a parameter to be optimized according to the gradient and a first preset threshold;

[0018] Optimize the parameters to be optimized, and determine whether a preset optimization termination condition is reached according to the energy value represented by the cost function before and after the optimization of the parameters to be optimized and a second preset threshold;

[0019] If so, the optimized parameters are obtained; otherwise, the process returns to the step of calculating the gradients of the current target parameters and the preset parameters.

[0020] Optionally, the calculating the gradient of the current target parameter and the preset parameter includes:

[0021] Using the finite difference method, the gradients of the current target parameters and the preset parameters are calculated.

[0022] Optionally, determining the parameter to be optimized according to the gradient and a first preset threshold includes:

[0023] comparing the absolute value of the gradient with a first preset threshold;

[0024] If the absolute value of the gradient is greater than the first preset threshold, the parameter corresponding to the gradient is determined as the parameter to be optimized.

[0025] Optionally, judging whether a preset optimization termination condition is reached according to the energy value represented by the cost function before and after the optimization of the parameter to be optimized and the second preset threshold value includes:

[0026] Calculate the difference in energy values ​​represented by the cost function before and after the optimization of the parameter to be optimized;

[0027] comparing the difference with a second preset threshold;

[0028] If the difference is smaller than the second preset threshold, the optimization is terminated.

[0029] Another embodiment of the present application provides an optimization device for a QAOA algorithm, the device comprising:

[0030] A first optimization module is used to optimize the target parameters in the quantum circuit of the QAOA algorithm to the target values;

[0031] A segmentation module is used to segment the same parameter used by each first interaction involving two quantum bits in the target parameter, so that the parameters corresponding to each first interaction are independent of each other:

[0032] An adding module, used for adding a second interaction involving the two quantum bits, setting the same parameters for the second interaction as the first interaction, and adding preset parameters;

[0033] The second optimization module is used to optimize the current target parameters and preset parameters until the preset optimization termination conditions are reached.

[0034] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when running.

[0035] Yet another 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 execute any one of the methods described above.

[0036] Compared with the prior art, the optimization method of the QAOA algorithm provided by the present invention first optimizes the target parameters in the quantum circuit of the QAOA algorithm to the target value; divides the same parameters used in each first interaction involving two quantum bits in the target parameters so that the parameters corresponding to each first interaction are independent of each other; adds a second interaction involving the two quantum bits, sets the same parameters as the first interaction for the second interaction, and adds preset parameters; optimizes the current target parameters and preset parameters until the preset optimization termination conditions are reached. By optimizing the algorithm parameters and introducing additional interactions and parameters, the optimization effect is improved, and the circuit depth of the quantum circuit of the algorithm is reduced, so that it is more suitable for the current NISQ quantum computer. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A hardware structure block diagram of a computer terminal for an optimization method of a QAOA algorithm provided by an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of a flow chart of a QAOA algorithm optimization method provided by an embodiment of the present invention;

[0039] Figure 3 A schematic diagram of a QAOA algorithm provided in an embodiment of the present invention;

[0040] Figure 4 A schematic diagram of the structure of an optimization device for a QAOA algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0042] The embodiment of the present invention first provides a method for optimizing the QAOA algorithm, which can be applied to electronic devices such as computer terminals, specifically ordinary computers, quantum computers, etc.

[0043] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal of a QAOA algorithm optimization method provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0044] The memory 104 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the optimization method of the QAOA algorithm in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0046] It should be noted that a true quantum computer is a hybrid structure, which consists of two parts: one part is a classical computer, which is responsible for performing classical calculations and control; the other part is a quantum device, which is responsible for running quantum programs and thus realizing quantum computing. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can be run on a quantum computer, which supports quantum logic gate operations and ultimately realizes quantum computing. Specifically, a quantum program is a sequence of instructions that operate quantum logic gates in a certain sequence.

[0047] In practical applications, due to the limitations of the development of quantum device hardware, quantum computing simulation is usually required to verify quantum algorithms, quantum applications, etc. Quantum computing simulation is the process of simulating the operation of quantum programs corresponding to specific problems using a virtual architecture (i.e., quantum virtual machine) built with the resources of ordinary computers. Usually, it is necessary to build a quantum program corresponding to a specific problem. The quantum program referred to in the embodiment of the present invention is a program written in a classical language to characterize quantum bits and their evolution, in which quantum bits, quantum logic gates, etc. related to quantum computing are represented by corresponding classical codes.

[0048] Quantum circuits, as a manifestation of quantum programs, are also called quantum logic circuits. They are the most commonly used general quantum computing model. They represent circuits that operate on quantum bits in an abstract concept. They are composed of quantum bits, circuits (timelines), and various quantum logic gates. Finally, the results often need to be read out through quantum measurement operations.

[0049] Unlike traditional circuits that are connected by metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as connected by time, that is, the state of the quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated.

[0050] A quantum program as a whole corresponds to a total quantum circuit. The quantum program described in the present invention refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits in the quantum program. It can be understood that a quantum program can be composed of a quantum circuit, measurement operations on quantum bits in the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution process of a quantum program is the process of executing all quantum logic gates in a certain time sequence. It should be noted that the time sequence is the time order in which a single quantum logic gate is executed.

[0051] It should be noted that in classical computing, the most basic unit is the bit, and the most basic control mode is the logic gate, which can achieve the purpose of controlling the circuit through the combination of logic gates. Similarly, the way to process quantum bits is quantum logic gates. Using quantum logic gates, quantum states can evolve. Quantum logic gates are the basis of quantum circuits. Quantum logic gates include single-bit quantum logic gates, such as Hadamard gates (H gates, Hadamard gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), RX gates, RY gates, RZ gates, etc.; two-bit or multi-bit quantum logic gates, such as CNOT gates, CR gates, CZ gates, iSWAP gates, Toffoli gates, etc. Quantum logic gates are generally represented by unitary matrices, which are not only matrix forms, but also operations and transformations. The effect of general quantum logic gates on quantum states is calculated by multiplying the unitary matrix on the left by the matrix corresponding to the right vector of the quantum state.

[0052] When faced with large-scale problems that may be encountered, the QAOA algorithm has shown a certain degree of effectiveness. To understand the QAOA algorithm, we can start with the quantum annealing algorithm (QAA). In quantum mechanics, all mechanical quantities can be described by a unitary matrix. The definition of a unitary matrix is ​​that the transposed conjugate of the matrix is ​​the inverse matrix of the matrix, that is,

[0053]

[0054] Such a matrix is ​​usually called an operator, also called a quantum logic gate in quantum computing. The operator will have at least one non-zero eigenvalue λ and a corresponding eigenstate |ψ>:

[0055] H|ψ>=λ|ψ>

[0056] If the eigenvalue of the operator H corresponds to the energy level distribution of a system, then such an operator can also be called a Hamiltonian. According to the time-dependent Schrödinger equation, from a state |ψ B >Starts to evolve to another state |ψ P > is done using the e index:

[0057] exp(-itH C )|ψ B >=|ψ′ P >

[0058] Among them, H C Yes |ψ P >The corresponding Hamiltonian (target Hamiltonian), |ψ′ P >≠|ψ P >, but |ψ′P >contains a part of |ψ P >component, that is, their inner product <ψ′ P |ψ P >≠0, but this has a very poor effect because if |ψ B >corresponding Hamiltonian is H B (initial Hamiltonian), then |ψ B >is impossible to evolve to |ψ P >in one step. Therefore, a part of H B can be mixed into H C , and the components of the two parts change with time as follows:

[0059]

[0060] where t changes starting from 0, t0 approaches 0, and t i approaches T. In this way, as long as the total time T is large enough and the number of t is large enough, the component of |ψ P >in |ψ′ B >will always slowly decrease, and then <ψ′ P |ψ P >→1. Such a process is similar to slowly "annealing" from one state to another state, so such an algorithm is called the quantum annealing algorithm. Around this type of algorithm, a class of important quantum computers that use physical fields to simulate the annealing process - quantum annealers - have emerged. Quantum annealers can easily manufacture quantum chips with a huge number of qubits. However, quantum annealers only perform well in a specific type of problem, and it is difficult to broaden their application scenarios. Therefore, there is the later more general quantum computer - the logic gate quantum computer. However, in the quantum circuit composed of quantum logic gates, it is relatively difficult to directly prepare a corresponding quantum logic gate. Therefore, a special decomposition - Trotter decomposition - is often used for simplification:

[0061] exp(-i(A + B))|ψ> ≈ exp(-iA)exp(-iB)|ψ>

[0062] The above gives the form of the first-order Trotter decomposition. If A and B commute, the approximate equal sign in the above formula becomes an equal sign, that is, exp(-i(A + B))|ψ> = exp(-iA)exp(-iB)|ψ>. If higher precision is desired, there are other more Trotter decomposition forms such as the second-order and third-order. Thus, the original:

[0063]

[0064] Thus:

[0065]

[0066] In the evolution of QAA, the evolution path, i.e., t0...t i ...t T The setting of is important. Whether the setting is reasonable will directly affect the final |ψ′ P >.

[0067] QAOA has made some modifications on this basis, that is, the evolution path is not set by the user himself, but through the calculation of the cost function (Cost Function), which is fed back to the classical computer, and the optimizer on the classical computer gives reasonable parameters to obtain better results. First, we can define the evolution process:

[0068] |ψ′ P (β P , ...β1,γ p , ...γ1)>=exp(-iβ p H B )exp(-iγ p H C )......exp(-iβ1H B )exp(-iγ1H C )|ψ B >

[0069] Obviously, the value of p represents the number of layers of the algorithm, or the depth of the circuit. The number of layers is artificially given, and the deeper the layer, the closer to the final solution. The next step is to set the cost function, which is the expected value of the Hamiltonian, that is, the energy value of the system:

[0070] E(β p , ...β1,γ p , ...γ1)=<ψ′ P |H P |ψ′ P >

[0071] The cost function can be used as a basis for optimization. Depending on the actual problem, the cost function needs to be as high or as low as possible in the optimization. For example, a QAOA line diagram can be as follows: Figure 3 As shown, running the quantum circuit, the parameters can be obtained by measuring (measure) (variational parameter) corresponding energy value The energy value and parameters are passed to the classic optimizer (optimization), and the classic optimizer will reduce The optimization goal is to select better parameters And the updated parameters are passed to the quantum computer. After several iterations, the energy It keeps decreasing and gradually converges to the minimum value. Thus, we can find the (β, γ) value that can minimize the cost function, where β = [β1, β2...β p ], γ=[γ1,γ2......γ p ].

[0072] Due to the technical limitations of hardware, quantum computing will be in the NISQ era in the near future. The operations of most existing quantum computers will be disturbed by noise and can only achieve near-field entanglement. Therefore, in order to achieve long-distance interaction, multiple SWAP gates are required to perform exchange operations. However, NISQ quantum computers have a certain error rate in operations. The increase in the number of SWAP gates will increase the error rate of operations and affect the optimization effect.

[0073] For QAOA, at a certain scale, the number of optimization layers required increases with the scale, which means that the number of operation gates increases (including the number of SWAP gates), which will also increase the error rate of the operation, and even the influence of noise will offset the optimization effect brought by the increase of p.

[0074] See also Figure 2 , Figure 2 A schematic flow chart of a QAOA algorithm optimization method provided in an embodiment of the present invention may include the following steps:

[0075] S201, optimizing the target parameters in the quantum circuit of the QAOA algorithm to the target values;

[0076] Specifically, the first target parameter and the second target parameter in the quantum circuit of the QAOA algorithm may be optimized to the first target value and the second target value that make the cost function the highest or the lowest.

[0077] Taking the above example, the first target parameter can be β = [β1, β2...β p ], the second target parameter can be γ=[γ1,γ2......γ p ], we can use the classic optimizer on the classic computer, such as the SLSQP function in the scipy library, the COBYLA function, etc., to optimize to the best, so that the cost function is the highest or lowest (depending on the actual needs), and get the first target value Second target value

[0078] S202, dividing the same parameter used by each first interaction involving two quantum bits in the target parameter, so that the parameters corresponding to each first interaction are independent of each other;

[0079] Exemplarily, the first interaction may be: the two-qubit logic gate action corresponding to two Pauli-Z operators, referred to as ZZ interaction. The Pauli operator or Pauli matrix includes: Pauli-X, Pauli-Y, Pauli Z, and the specific form is: They form a complete basis with the two-dimensional unit operator, and any single-qubit operation can be obtained by linearly combining this basis.

[0080] Specifically, all ZZ interactions in the original QAOA line use the same parameter γ k , k = 1, ..., p. In order to release the degrees of freedom of the parameters, the parameters of each ZZ interaction can be separated and made independent, so that each ZZ interaction uses independent parameters. To enhance the line representation capability and reduce the line depth. The initial value of the parameter can be

[0081] S203, adding a second interaction involving the two quantum bits, setting the same parameters as the first interaction for the second interaction, and adding preset parameters;

[0082] Specifically, the second interaction may include one of the following: a two-qubit logic gate action corresponding to two Pauli-X operators, a two-qubit logic gate action corresponding to two Pauli-Y operators, a two-qubit logic gate action corresponding to a Pauli-X operator and a Pauli-Y operator, a two-qubit logic gate action corresponding to a Pauli-X operator and a Pauli-Z operator, and a two-qubit logic gate action corresponding to a Pauli-Y operator and a Pauli-Z operator.

[0083] Exemplarily, a second interaction (referred to as two-body interaction) may be:

[0084] PQ∈{YZ,YY,XY,XZ,XX}

[0085] Here, Y represents the Pauli-Y operator, Z represents the Pauli-Z operator, and X represents the Pauli-X operator.

[0086] Taking the SK model (Sherrington-Kirkpatrick Model) as an example, H C =∑ i < j w ij Z i Z j For each layer of lines in QAOA, the operation changes as shown below:

[0087]

[0088] Among them, β k represents the rotation angle of the single-qubit logic gate, γ k , It controls the rotation angle of the two-qubit logic gate, w ij is a given coefficient. The additional two-body interaction M introduced in the circuit ij Following the ZZ interaction, the SWAP gate can be saved and the new parameter α is added k Used to control the two-body interaction M ij The overall strength of the parameter can be: k =0, k=1, ..., p.

[0089] S204, optimizing the current target parameters and preset parameters until the preset optimization termination condition is reached.

[0090] In a specific implementation, optimizing the current target parameters and the preset parameters until a preset optimization termination condition is reached may include:

[0091] S2401, calculating the gradient of the current target parameter and the preset parameter;

[0092] Specifically, the finite difference method can be used to calculate the gradients of the current target parameters and the preset parameters.

[0093] For example, all parameters are calculated using the finite difference method. The gradient is:

[0094]

[0095]

[0096] Among them, g(θ) is the gradient, E(θ) is the energy value of the cost function, and ∈ is a small number that can be a preset value.

[0097] S2402, determining a parameter to be optimized according to the gradient and a first preset threshold;

[0098] Specifically, the absolute value of the gradient may be compared with a first preset threshold; if the absolute value of the gradient is greater than the first preset threshold, the parameter corresponding to the gradient is determined as the parameter to be optimized.

[0099] For example, parameters whose absolute values ​​of gradients are greater than the first preset threshold δ1, that is, parameters that have a greater impact on the results, may be selected as parameters to be optimized and added to the set A.

[0100] S2403, optimizing the parameters to be optimized, and judging whether a preset optimization termination condition is reached according to the energy value represented by the cost function before and after the optimization of the parameters to be optimized and a second preset threshold value;

[0101] Specifically, the difference in energy values ​​represented by the cost function before and after the optimization of the parameter to be optimized may be calculated; the difference may be compared with a second preset threshold; if the difference is less than the second preset threshold, the optimization is terminated.

[0102] For example, the parameters in set A may be optimized using a classical optimizer. If the decrease in energy value before and after optimization (ie, the difference) is less than a second preset threshold δ2, it indicates that the optimization termination condition is met and the optimization ends.

[0103] S2404, if achieved, obtain the optimized parameters, otherwise, return to execute the step of calculating the gradient of the current target parameters and the preset parameters.

[0104] After reaching the optimization termination condition, the parameters in the optimized set A and its corresponding QAOA algorithm circuit can be obtained. In the optimized QAOA algorithm, in addition to the existing ZZ interaction in the corresponding circuit, other two-body interactions are also considered to offset some of the non-adiabatic effects and accelerate the evolution; secondly, the parameter freedom is increased so that each two-body interaction has its own independent parameters, which can enhance the circuit representation capability and reduce the circuit depth.

[0105] It can be seen that by optimizing the target parameters in the quantum circuit of the QAOA algorithm to the target value; dividing the same parameters used in each first interaction involving two quantum bits in the target parameters so that the parameters corresponding to each first interaction are independent of each other; adding a second interaction involving the two quantum bits, setting the same parameters for the second interaction as the first interaction, and adding preset parameters; optimizing the current target parameters and preset parameters until the preset optimization termination conditions are reached. By optimizing the algorithm parameters and introducing additional interactions and parameters, the optimization effect is first improved, and the circuit depth of the algorithm's quantum circuit is reduced, so that it is more suitable for the current NISQ quantum computer.

[0106] See also Figure 4 , Figure 4 A schematic diagram of a QAOA algorithm optimization device provided by an embodiment of the present invention, and Figure 2 Corresponding to the process shown, the device includes:

[0107] A first optimization module 401 is used to optimize the target parameters in the quantum circuit of the QAOA algorithm to the target values;

[0108] A segmentation module 402 is used to segment the same parameter used by each first interaction involving two quantum bits in the target parameter, so that the parameters corresponding to each first interaction are independent of each other;

[0109] An adding module 403 is used to add a second interaction involving the two quantum bits, set the same parameters for the second interaction as the first interaction, and add preset parameters;

[0110] The second optimization module 404 is used to optimize the current target parameters and preset parameters until the preset optimization termination condition is reached.

[0111] Specifically, the first optimization module is specifically used to:

[0112] The first target parameter and the second target parameter in the quantum circuit of the QAOA algorithm are optimized to the first target value and the second target value that make the cost function the highest or the lowest.

[0113] Specifically, the first interaction is: a two-qubit logic gate action corresponding to two Pauli-Z operators; the second interaction includes one of the following:

[0114] The two-qubit logic gate function corresponding to two Pauli-X operators, the two-qubit logic gate function corresponding to two Pauli-Y operators, the two-qubit logic gate function corresponding to a Pauli-X operator and a Pauli-Y operator, the two-qubit logic gate function corresponding to a Pauli-X operator and a Pauli-Z operator, and the two-qubit logic gate function corresponding to a Pauli-Y operator and a Pauli-Z operator.

[0115] Specifically, the second optimization module includes:

[0116] A calculation unit, used to calculate the gradient of the current target parameter and the preset parameter;

[0117] A determination unit, configured to determine a parameter to be optimized according to the gradient and a first preset threshold;

[0118] A judgment unit, configured to optimize the parameter to be optimized, and judge whether a preset optimization termination condition is reached according to the energy value represented by the cost function before and after the optimization of the parameter to be optimized and a second preset threshold;

[0119] The obtaining unit is used to obtain the optimized parameters when the preset optimization termination condition is met, otherwise, return to execute the step of calculating the gradient of the current target parameter and the preset parameter.

[0120] Specifically, the computing unit is specifically used for:

[0121] Using the finite difference method, the gradients of the current target parameters and the preset parameters are calculated.

[0122] Specifically, the determining unit is specifically used to:

[0123] comparing the absolute value of the gradient with a first preset threshold;

[0124] If the absolute value of the gradient is greater than the first preset threshold, the parameter corresponding to the gradient is determined as the parameter to be optimized.

[0125] Specifically, the judging unit is specifically used for:

[0126] Calculate the difference in energy values ​​represented by the cost function before and after the optimization of the parameter to be optimized;

[0127] comparing the difference with a second preset threshold;

[0128] If the difference is smaller than the second preset threshold, the optimization is terminated.

[0129] It can be seen that by optimizing the target parameters in the quantum circuit of the QAOA algorithm to the target value; dividing the same parameters used in each first interaction involving two quantum bits in the target parameters so that the parameters corresponding to each first interaction are independent of each other; adding a second interaction involving the two quantum bits, setting the same parameters for the second interaction as the first interaction, and adding preset parameters; optimizing the current target parameters and preset parameters until the preset optimization termination conditions are reached. By optimizing the algorithm parameters and introducing additional interactions and parameters, the optimization effect is first improved, and the circuit depth of the algorithm's quantum circuit is reduced, so that it is more suitable for the current NISQ quantum computer.

[0130] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0131] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:

[0132] S1, optimize the target parameters in the quantum circuit of the QAOA algorithm to the target value;

[0133] S2, dividing the same parameter used by each first interaction involving two quantum bits in the target parameter, so that the parameters corresponding to each first interaction are independent of each other;

[0134] S3, adding a second interaction involving the two quantum bits, setting the same parameters for the second interaction as those for the first interaction, and adding preset parameters;

[0135] S4, optimizing the current target parameters and preset parameters until the preset optimization termination conditions are reached.

[0136] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0137] An embodiment of the present invention 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 execute the steps in any one of the above method embodiments.

[0138] 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.

[0139] Specifically, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0140] S1, optimize the target parameters in the quantum circuit of the QAOA algorithm to the target value;

[0141] S2, dividing the same parameter used by each first interaction involving two quantum bits in the target parameter, so that the parameters corresponding to each first interaction are independent of each other;

[0142] S3, adding a second interaction involving the two quantum bits, setting the same parameters for the second interaction as those for the first interaction, and adding preset parameters;

[0143] S4, optimizing the current target parameters and preset parameters until the preset optimization termination conditions are reached.

[0144] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.

Claims

1. A QAOA algorithm optimization method, characterized in that: The method comprises: Optimizing a target parameter in a quantum circuit of the QAOA algorithm to a target value, wherein the target parameter is the rotation angle of a variable-angle quantum bit logic gate in the quantum circuit of the QAOA algorithm; Splitting the same parameter used by each first interaction involving two quantum bits in the target parameter so that the parameters corresponding to each first interaction are independent of each other, wherein the first interaction is: a two-qubit logic gate action corresponding to two Pauli-Z operators; Adding a second interaction involving the two quantum bits, setting the same parameters as the first interaction for the second interaction, and adding preset parameters, wherein the preset parameters are parameters used to control the overall strength of the second interaction, and the second interaction includes one of the following: Two-qubit logic gate functions corresponding to two Pauli-X operators, two-qubit logic gate functions corresponding to two Pauli-Y operators, two-qubit logic gate functions corresponding to a Pauli-X operator and a Pauli-Y operator, two-qubit logic gate functions corresponding to a Pauli-X operator and a Pauli-Z operator, and two-qubit logic gate functions corresponding to a Pauli-Y operator and a Pauli-Z operator; Optimize the current target parameters and preset parameters until the preset optimization termination conditions are reached.

2. The method according to claim 1, characterized in that The step of optimizing the target parameters in the quantum circuit of the QAOA algorithm to the target values ​​comprises: The first target parameter and the second target parameter in the quantum circuit of the QAOA algorithm are optimized to the first target value and the second target value that make the cost function the highest or the lowest.

3. The method according to claim 2, characterized in that The optimizing of the current target parameters and the preset parameters until the preset optimization termination condition is reached includes: Calculate the gradient of the current target parameter and the preset parameter; Determining a parameter to be optimized according to the gradient and a first preset threshold; Optimize the parameters to be optimized, and determine whether a preset optimization termination condition is reached according to the energy value represented by the cost function before and after the optimization of the parameters to be optimized and a second preset threshold; If so, the optimized parameters are obtained; otherwise, the process returns to the step of calculating the gradients of the current target parameters and the preset parameters.

4. The method according to claim 3, characterized in that The step of calculating the gradient of the current target parameter and the preset parameter includes: Using the finite difference method, the gradients of the current target parameters and the preset parameters are calculated.

5. The method according to claim 3, characterized in that: Determining the parameter to be optimized according to the gradient and the first preset threshold comprises: comparing the absolute value of the gradient with a first preset threshold; If the absolute value of the gradient is greater than the first preset threshold, the parameter corresponding to the gradient is determined as the parameter to be optimized.

6. The method according to claim 3, characterized in that The step of judging whether a preset optimization termination condition is reached according to the energy value represented by the cost function before and after the optimization of the parameter to be optimized and the second preset threshold value comprises: Calculate the difference in energy values ​​represented by the cost function before and after the optimization of the parameter to be optimized; comparing the difference with a second preset threshold; If the difference is smaller than the second preset threshold, the optimization is terminated.

7. An optimization device for a QAOA algorithm, characterized in that: The device comprises: A first optimization module is used to optimize a target parameter in a quantum circuit of a QAOA algorithm to a target value, wherein the target parameter is a rotation angle of a quantum bit logic gate with a variable angle in the quantum circuit of the QAOA algorithm; A segmentation module is used to segment the same parameter used by each first interaction involving two quantum bits in the target parameter so that the parameters corresponding to each first interaction are independent of each other, wherein the first interaction is: a two-qubit logic gate action corresponding to two Pauli-Z operators; An adding module is used to add a second interaction involving the two quantum bits, set the same parameters as the first interaction for the second interaction, and add preset parameters, wherein the preset parameters are parameters used to control the overall strength of the second interaction, and the second interaction includes one of the following: Two-qubit logic gate functions corresponding to two Pauli-X operators, two-qubit logic gate functions corresponding to two Pauli-Y operators, two-qubit logic gate functions corresponding to a Pauli-X operator and a Pauli-Y operator, two-qubit logic gate functions corresponding to a Pauli-X operator and a Pauli-Z operator, and two-qubit logic gate functions corresponding to a Pauli-Y operator and a Pauli-Z operator; The second optimization module is used to optimize the current target parameters and preset parameters until the preset optimization termination conditions are reached.

8. A computer terminal, characterized in that: The method comprises a machine-readable storage medium and a processor, wherein the machine-readable storage medium stores a computer program, and the processor is configured to run the computer program to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Quantum computing simulation method and device, storage medium and electronic device

    CN110188885A

  • Quantum principal component analysis method and device, electronic equipment and computer readable storage medium

    CN111242306A