Quantum computing method and related device

By constructing an initial quantum state with adjustable parameters and adjusting the rotation angle of the rotating door to achieve the tunability of the initial quantum state, the problem of QAOA's poor performance under shallow quantum circuits is solved, and the efficiency and accuracy of the algorithm are improved.

CN115545210BActive Publication Date: 2025-05-16HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110654428.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-11
Publication Date
2025-05-16
Estimated Expiration
2041-06-11

AI Technical Summary

Technical Problem

QAOA performs poorly under shallow quantum circuits, especially when solving the problems of large systems. Over-deep quantum circuits may lead to greater noise impact than the benefits brought by depth, which will make the effect worse.

Method used

By constructing an initial quantum state with tunable parameters, the initial quantum state is allowed to be adjusted in each iteration, thereby improving the performance of QAOA under shallow quantum circuits and suitable for solving more problems. The specific method includes using a rotating door to construct an initial quantum state and achieving adjustability of the initial quantum state by adjusting the rotation angle of the rotating door.

Benefits of technology

This method not only improves the performance of QAOA in shallow lines, but also reduces the demand for deep quantum lines, reduces the impact of noise, and improves the resolution accuracy of computing problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115545210B_ABST
    Figure CN115545210B_ABST
Patent Text Reader

Abstract

The present application provides a method and related device for quantum computing. The method may include: constructing the initial quantum state of n quantum bits in a quantum approximate optimization algorithm QAOA quantum system, the initial quantum state including an adjustable parameter, through which the initial quantum state at each iteration can be controlled, and n is an integer greater than 1; encoding the computational problem as the problem Hamiltonian of the QAOA quantum system; evolving the QAOA quantum system from the initial Hamiltonian to the ground state of the problem Hamiltonian; measuring at least a portion of the n quantum bits to obtain the readout of the QAOA quantum system, and determining the solution to the computational problem from the readout. Through the present application, it can be ensured that the evolution of the quantum state can be achieved not entirely by quantum circuits, but also by iterating the initial quantum state, thereby not only improving the performance of QAOA under shallow circuits, but also being applicable to solving more problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of quantum computing, and more specifically, to a quantum computing method and related devices. Background Art

[0002] The quantum approximate optimization algorithm (QAOA) can achieve certain results in shallow quantum circuits when solving large-scale problems with relatively sparse constraints (such as solving the maximum cut problem where all points have a degree of 3). However, for problems of large systems, quantum circuits that are too shallow will not have very good results. Increasing the number of quantum circuits will give QAOA better performance, but the QAOA algorithm will be affected by noise when running on existing noisy intermediate scale quantum (NISQ) quantum computers. Too deep quantum circuits may cause the impact of noise to be greater than or offset the benefits of depth, making the overall effect worse. The final result may be that the result of the deep circuit is not as good as that of the shallow circuit. Therefore, there is an urgent need to improve QAOA so that it can be applied to solving more problems. Summary of the invention

[0003] The present application provides a quantum computing method and related devices, which can improve the performance of QAOA under shallow circuits and can also be used to solve more problems under shallow circuits.

[0004] In a first aspect, a method for quantum computing is provided. The method may include: constructing an initial quantum state of n quantum bits in a quantum approximate optimization algorithm QAOA quantum system, the initial quantum state including an adjustable parameter, and n being an integer greater than 1; encoding a computational problem into a problem Hamiltonian of the QAOA quantum system; evolving the QAOA quantum system from the initial Hamiltonian to a ground state of the problem Hamiltonian; measuring at least a portion of the n quantum bits to obtain a readout of the QAOA quantum system, and determining a solution to the computational problem from the readout.

[0005] Based on the above technical solution, the initial quantum state includes an adjustable parameter, through which the initial quantum state can be controlled. For example, in the process of evolving the QAOA quantum system from the initial Hamiltonian to the ground state of the problem Hamiltonian, the initial quantum state can be controlled by adjusting the adjustable parameter in each iteration. For example, the adjustable parameter can be determined according to the actual situation of each iteration, thereby determining the initial quantum state of this iteration; or the adjustable parameter can be determined according to the result of the previous iteration, thereby determining the initial quantum state of this iteration, and so on. Since the initial quantum state is controllable and iterative in some cases (such as using the previous optimization result as the initial quantum state for the next optimization to form an iteration), it can be ensured that the evolution of the quantum state can be achieved not entirely by quantum circuits, but also by iterating the initial quantum state, thereby not only improving the performance of QAOA under shallow circuits, but also being applicable to solving more problems.

[0006] In combination with the first aspect, in certain implementations of the first aspect, constructing the initial quantum state of n quantum bits in the QAOA quantum system includes: constructing the initial quantum state of the n quantum bits in the QAOA quantum system through a rotating gate, and the adjustable parameter is the rotation angle of the rotating gate.

[0007] Based on the above technical solution, the adjustable parameter may be, for example, the rotation angle of the revolving door, which not only makes the initial quantum state adjustable but also is simple and easy to implement.

[0008] In combination with the first aspect, in some implementations of the first aspect, the revolving door is R Y Revolving door or R X Revolving door.

[0009] In combination with the first aspect, in some implementations of the first aspect, the initial quantum state is expressed as:

[0010] |ψ initial >=∏ i R y (θ i )|0> i , or, |ψ initial >=∏ i R y (θ i )|1> i

[0011] Among them, |ψ initial > represents the initial quantum state, θ i Indicates an adjustable parameter.

[0012] In combination with the first aspect, in some implementations of the first aspect, evolving the QAOA quantum system from an initial Hamiltonian to a ground state of a problem Hamiltonian includes: obtaining a parameter to be optimized and an optimization number k, where k is an integer greater than 1; starting from the initial Hamiltonian, optimizing the parameter to be optimized k times, and obtaining a ground state of the problem Hamiltonian, wherein the value of the adjustable parameter corresponding to this optimization is determined according to the optimization result of the previous optimization.

[0013] Based on the above technical solution, the previous optimization result can be used as the initial quantum state for the next optimization to form an iteration. In this way, by adopting the method of iteratively updating the initial quantum state for evolution, it is possible to obtain very high-precision results without increasing or even reducing the number of expected times.

[0014] In combination with the first aspect, in some implementations of the first aspect, evolving the QAOA quantum system from an initial Hamiltonian to a ground state of a problem Hamiltonian includes: obtaining a parameter to be optimized and an optimization number k, where k is an integer greater than 1; starting from the initial Hamiltonian, optimizing the parameter to be optimized k times, and obtaining a ground state of the problem Hamiltonian, wherein an initial value of the parameter to be optimized in this optimization is a value of the parameter to be optimized at the end of a previous optimization.

[0015] Based on the above technical solution, the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization. During the iteration process, the requirements for the optimizer used to optimize the parameter to be optimized are not high, and it is not necessary to optimize every iteration. Therefore, more computing resources can be saved while achieving the same effect.

[0016] In combination with the first aspect, in certain implementations of the first aspect, when the difference between the cost functions corresponding to the first two optimizations is greater than or equal to a preset threshold, the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

[0017] In combination with the first aspect, in some implementations of the first aspect, the initial Hamiltonian is the Hamiltonian corresponding to the initial quantum state, and the initial Hamiltonian is expressed as:

[0018]

[0019] Among them, H B represents the initial Hamiltonian, θ i Indicates an adjustable parameter.

[0020] In a second aspect, a quantum computing device is provided. The device may include: a construction module for constructing an initial quantum state of n quantum bits in a quantum approximate optimization algorithm QAOA quantum system, the initial quantum state including an adjustable parameter, and n being an integer greater than 9; an encoding module for encoding a computational problem into a problem Hamiltonian of the QAOA quantum system; an evolution module for evolving the QAOA quantum system from the initial Hamiltonian to a ground state of the problem Hamiltonian; and a measurement module for measuring at least a portion of the n quantum bits to obtain a readout of the QAOA quantum system, and determining a solution to the computational problem from the readout.

[0021] In combination with the second aspect, in certain implementations of the second aspect, the construction module is specifically used to construct the initial quantum state of n quantum bits in the QAOA quantum system through a rotating gate, and the adjustable parameter is the rotation angle of the rotating gate.

[0022] In conjunction with the second aspect, in some implementations of the second aspect, the revolving door is R Y Revolving door or R X Revolving door.

[0023] In conjunction with the second aspect, in some implementations of the second aspect, the initial quantum state is expressed as:

[0024] |ψ initial >=∏ i R y (θ i )|0> i , or, |ψ initial >=∏ i R y (θ i )|1> i

[0025] Among them, |ψ initial > represents the initial quantum state, θ i Indicates an adjustable parameter.

[0026] In combination with the second aspect, in some implementations of the second aspect, the device also includes an acquisition module, the acquisition module is used to obtain the parameters to be optimized and the number of optimizations k, where k is an integer greater than 1; an evolution module, specifically used to optimize the QAOA quantum system from the initial Hamiltonian, optimize the parameters to be optimized k times, and obtain the ground state of the problem Hamiltonian, wherein the value of the adjustable parameter corresponding to this optimization is determined based on the previous optimization result.

[0027] In combination with the second aspect, in some implementations of the second aspect, the device also includes an acquisition module, the acquisition module is used to obtain the parameters to be optimized and the number of optimizations k, where k is an integer greater than 1; an evolution module, specifically used to optimize the QAOA quantum system from the initial Hamiltonian, optimize the parameters to be optimized k times, and obtain the ground state of the problem Hamiltonian, wherein the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

[0028] In combination with the second aspect, in certain implementations of the second aspect, when the difference between the cost functions corresponding to the first two optimizations is greater than or equal to a preset threshold, the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

[0029] In conjunction with the second aspect, in some implementations of the second aspect, the initial Hamiltonian is the Hamiltonian corresponding to the initial quantum state, and the initial Hamiltonian is expressed as:

[0030]

[0031] Among them, H B represents the initial Hamiltonian, θ i Indicates an adjustable parameter.

[0032] In a third aspect, a quantum computer is provided, which can be used to execute the method provided in the first aspect.

[0033] Optionally, the quantum computer includes a quantum bit circuit (or quantum bit circuit) and a quantum bit control device, and the quantum bit control device is used to operate on the quantum bit circuit (or quantum bit circuit).

[0034] In a fourth aspect, a processor is provided for executing the method provided in the first aspect. In the process of executing these methods, the process of obtaining information or parameters in the above methods can be understood as the process of the processor receiving the above information or parameters input. For the acquisition and other operations involved in the processor, if there is no special explanation, or if it does not conflict with its actual role or internal logic in the relevant description, it can be more generally understood as operations such as processor input.

[0035] In the implementation process, the processor may be a processor specifically used to execute these methods, or a processor that executes computer instructions in a memory to execute these methods, such as a general-purpose processor. The memory may be a non-transitory memory, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or may be separately arranged on different chips. The embodiment of the present application does not limit the type of memory and the arrangement of the memory and the processor.

[0036] In a fifth aspect, a computer-readable storage medium is provided, which stores a program code for execution by a device, wherein the program code includes code for executing the method provided in the first aspect.

[0037] According to a sixth aspect, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer is enabled to execute the method provided in the first aspect.

[0038] In a seventh aspect, a chip is provided, comprising a processor and an interface, wherein the processor reads instructions stored in a memory through the interface to execute the method provided in the first aspect.

[0039] Optionally, as an implementation method, the chip may further include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method provided in the first aspect above.

[0040] In an eighth aspect, a system is provided, comprising a quantum computer and a classical computer. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic block diagram of the method proposed according to an embodiment of the present application.

[0042] Figure 2 A schematic diagram of a GQAOA quantum system applicable to an embodiment of the present application is shown.

[0043] Figure 3 A schematic diagram of a quantum circuit diagram applicable to Scheme 1 is shown.

[0044] Figure 4 A schematic diagram of a quantum circuit diagram suitable for Scheme 2 is shown.

[0045] Figure 5 Schematic diagram of 20 regular graphs with degree 3 is shown.

[0046] Figure 6A schematic diagram showing different methods for solving the maximum cut problem of a regular graph of degree 3.

[0047] Figure 7 A schematic diagram showing the variation of ΔE with the number of iterations when the number of layers p=1 and p=2 is shown.

[0048] Figure 8 The changing trend of parameters (β, γ) during the iteration process is shown.

[0049] Fig. 9 A schematic diagram showing how ΔE varies with the number of iterations when optimizing the parameters (β, γ) for a fixed number of steps.

[0050] Fig.10 A schematic diagram showing the simulation results of using Scheme 2 to solve the weighted maximum cut problem of a regular graph with degree 3 and 4 to 20 points.

[0051] Fig.11 A schematic diagram showing a general diagram suitable for embodiments of the present application is shown.

[0052] Fig.12 It shows that the solution 2 is used to solve the Fig.11 Schematic diagram of simulation results for the maximum cut problem of a general graph shown.

[0053] Fig.13 A schematic diagram showing the simulation results of using Scheme 2 to solve the 2-SAT problem of a regular graph of degree 3 with 4 to 20 points.

[0054] Fig.14 A schematic diagram showing the simulation results of using Scheme 2 to solve the maximum independent set problem of a regular graph of degree 3 with 4 to 20 points.

[0055] Fig.15 A schematic diagram showing the simulation results of using Scheme 2 to solve the traveling salesman problem for five cities.

[0056] Fig.16 A schematic block diagram of a device applicable to an embodiment of the present application is shown.

[0057] Fig.17 A schematic structural diagram of a device applicable to an embodiment of the present application is shown.

[0058] Fig.18 A schematic diagram of a system suitable for an embodiment of the present application is shown. DETAILED DESCRIPTION

[0059] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0060] Quantum computing is an interdisciplinary subject that integrates multiple disciplines, such as physics, information science, computer science, etc. To facilitate understanding, we first briefly introduce the relevant concepts of quantum computing.

[0061] 1. Quantum computing: A computing method based on quantum logic. The basic computing unit of quantum computing is the quantum bit (qubit).

[0062] 2. Quantum bit: The basic unit of quantum computing. The quantum bit circuit is a hardware system created to simulate the quantum energy level system in physics. Classical bits exist in the form of either 0 or 1 in classical computers, corresponding to low and high levels respectively. Classical bits represent one state at the same time. Different from classical bits, quantum bits exist in the form of probability. At a certain time, it can have cos 2 The probability of (θ) existing in the 0 state is given by sin 2 The probability of (θ) exists in the 1 state. Before measurement, it can be considered that a quantum bit "simultaneously" represents the 0 state and the 1 state. After measurement, the quantum bit will collapse to a certain state. As an example, a quantum bit can be represented by formula 1.

[0063] |qubit>=cos(θ)|0>+sin(θ)|1>

[0064] Formula 1

[0065] Here, |> is the Dirac symbol.

[0066] It should be understood that in the embodiments of the present application, the classical computer is relative to the quantum computer, and the classical bit is relative to the quantum bit, and their naming does not limit the scope of protection of the embodiments of the present application.

[0067] 3. Quantum circuit: A representation of a quantum universal computer, representing the hardware implementation of the corresponding quantum algorithm / program under the quantum gate model.

[0068] 4. Hamiltonian: A Hermitian conjugate matrix that describes the total energy of a quantum system. Hamiltonian is a physical term, an operator that describes the total energy of a system, usually represented by H.

[0069] 5. Eigenstate: For a Hamiltonian matrix H, the solution that satisfies the equation: H|ψ>=E|ψ> is called the eigenstate |ψ> of H, with eigenenergy E. The ground state corresponds to the lowest energy eigenstate of the quantum system.

[0070] 6. Quantum computer: used for quantum computing. Quantum computers have at least the following advantages.

[0071] 1) The representation space of a quantum computer grows exponentially. If the representation space of each quantum bit is 2, then the representation space of n quantum bits is 2 n , so the representation space of a quantum computer grows exponentially with the number of qubits. For example, when the number of qubits reaches 50, the resulting representation space can approach the sum of the amount of information stored in all the storage units in the world.

[0072] 2) Quantum computing has an advantage in computing speed. Quantum computing can control the amplitude, phase and other information of quantum bits through quantum bit gates. Therefore, for the quantum bit gates used in the calculation, it is equivalent to acting in the entire representation space and controlling all representation states at the same time. Therefore, quantum computing is actually a fully parallel calculation, which has a great advantage in computing speed.

[0073] There are many ways to realize quantum computers. For example, in optics, photons’ polarization and other properties are used for simulation, in ion traps, ions’ energy levels are used for simulation, in superconductors, Josephson junctions are used to prepare multi-level harmonic resonance cavities for simulation, and so on. Among them, superconducting quantum computers made on the basis of superconductors are considered to be one of the most likely solutions for realizing quantum computers because of their high integration and strong scalability.

[0074] 7. Quantum Algorithms: The most discussed quantum algorithms are divided into two categories. One is the related algorithms derived from the quantum Fourier Transform (QFT), and the other is a series of quantum search algorithms derived from the Grover search algorithm. They are introduced below.

[0075] 1) Related algorithms derived from quantum Fourier transform.

[0076] Compared with the classical Fourier transform algorithm, the quantum Fourier transform can improve the speed exponentially. This algorithm has important applications in classic problems such as finding the period of a function, decomposing prime numbers, and cracking codes. The implementation of related algorithms derived from the quantum Fourier transform requires extremely complex quantum logic gate circuits and a huge number of quantum bits.

[0077] 2) A series of quantum search algorithms derived from the Grover search algorithm.

[0078] Among quantum search algorithms, quantum variational algorithms have attracted widespread attention due to their many important advantages, such as their combination of classical computing methods and certain hardware fault tolerance. Among quantum variational algorithms, the variational quantum eigensolver (VQE) and the quantum approximate optimization algorithm (QAOA) have become two quantum variational algorithms with high application potential due to their different characteristics.

[0079] The main application scenarios of VQE include molecular simulation, physical system simulation, etc., which can obtain high-precision results. In simple terms, VQE accurately controls each quantum bit through gate operations according to the Hamiltonian, and then accurately obtains the optimal solution.

[0080] QAOA is more often used in combinatorial optimization problems, such as the classic maximum cut problem (Max-cut), maximum independent set (MIS), satisfiability problem (satisfiability problem), traveling salesman problem (TSP), etc. When facing large-scale featureless or unclear feature combinatorial optimization problems, the effect of classical algorithms is closer to that of random number generators. QAOA can ensure that the correct solution is obtained without setting too many parameters to be optimized and building deep quantum circuits. The following mainly introduces QAOA.

[0081] 8. QAOA: The construction idea is to construct a large solution domain, and then amplify the probability or amplitude of the solution that meets the requirements in the solution domain through the evolution of the Hamiltonian, so that it is easier to obtain the correct solution.

[0082] QAOA can be roughly understood as a combination of the discrete version and the variational version of the quantum annealing algorithm (QAA). It converts an adiabatic time-dependent evolution operator exp(-itH(t)) into a discrete quantum gate-based evolution according to Trotter decomposition, as shown in Formula 2.

[0083]

[0084] Further, we can define Among them, the adjustable parameters Represents a complex matrix The matrix exponential of .

[0085] It should be understood that is the overall Hamiltonian operator, at the end of the evolution time t i Reach H p , H p Represents the Hamiltonian of the problem to be solved.

[0086] Theoretically, it can be proved that when the time segment is small enough, this method can approximate the adiabatic algorithm. Considering the limited depth of quantum circuits, quantum-classical hybrid computing is currently mainly used to implement it, that is, part of the complexity of the problem is handed over to classical computers to complete. Specifically, it includes the following steps.

[0087] Step 1: Construct Bell state on quantum computer |+> n =|++...+> is the initial state. Taking a single quantum bit as an example, the logical state of a single quantum bit may be in the |0> state, the |1> state, or the superposition state of the |0> state and the |1> state (uncertain state). |+> represents the Bell basis.

[0088] Step 2: Cross-apply U c and U b The quantum gate operates until the set depth p is reached.

[0089] Step 3, measure the expected value in this quantum state and obtain Cost Function = <ψ' p |H p |ψ' p >. Among them, Cost Function represents the cost function.

[0090] Step 4: Feedback to the classical computer based on the measured expected value. The classical computer optimizes and updates the parameters (β, γ) according to the classical optimizer (i.e., the optimizer of the classical computer). Where β = [β1, β2, ..., β p ], γ = [γ1, γ2,..., γ p ]. Repeat steps 1 to 4 until convergence or the maximum number of iterations is reached, then exit.

[0091] The above steps of quantum classical hybrid computing are only simple examples and are not limited to this. In simple terms, quantum classical hybrid computing is a computing paradigm that uses quantum circuits for calculations in the inner layer and uses traditional classical optimizers to adjust the parameters of variational quantum circuits in the outer layer.

[0092] QAOA is a specific quantum circuit structure hypothesis. The quantum states generated by such quantum circuits can be used to approximate the results of non-deterministic polynomial (NP) complete combinatorial optimization problems. It is a typical quantum classical hybrid computing paradigm. When solving large-scale problems with relatively "sparse" constraints (such as solving the maximum cut problem where all points have a degree of 3), QAOA can achieve certain results with very few parameters in shallow quantum circuits (when p is relatively low) because its conditions can be disassembled. If certain conditions are met, the performance of QAOA in shallow circuits may not be restricted. However, in actual simulations, this will bring great pressure to the optimizer. It is often difficult to obtain the optimal value in one optimization. For large systems, it is often necessary to perturb the optimized parameters and then optimize them several times before a relatively good value can be obtained.

[0093] For large-scale system problems, QAOA will not have a very good effect on shallow quantum circuits. VQE also poses a great challenge to the optimizer of classical computers because it must use a lot of parameters to get better results. For variational algorithms, if you want to improve the performance of the algorithm, the quantum circuit of the variational algorithm needs to increase the number of layers, which poses a huge challenge to the reliability of quantum circuit preparation and is difficult to meet at this stage; at the same time, the parameters will also increase with the increase in the number of layers. Under the variational optimization framework, the optimizer may encounter gradient vanishing and other situations, and may converge to a local suboptimal value. Increasing the number of layers of quantum circuits may give QAOA better performance, but the current quantum computing hardware is still in an immature condition. Too deep quantum circuits may cause the impact of noise to be greater than or offset the benefits of depth, making the overall effect worse. The final result may be that the results of deep circuits are not as good as those of shallow circuits.

[0094] In view of this, the embodiment of the present application proposes a solution, which mainly performs the initial quantum state of the quantum bit and its corresponding initial Hamiltonian (such as H B ) is improved to expand the original QAOA, so that the performance of QAOA in shallow lines can be improved, and it can also be used to solve more problems in shallow lines.

[0095] The method provided in the embodiments of the present application can be used in electronic devices, such as computer terminals, such as ordinary computers, quantum computers, etc.; or can also be applied to some simulation platforms, such as quantum software simulation platforms, such as ProjectQ or HiQ. It can be understood that the system architecture and scenarios to which the embodiments of the present application can be applied can be applicable to all systems that can use the QAOA algorithm, such as a noisy intermediate scale quantum (NISQ) quantum computer (NISQ quantum computer).

[0096] The various embodiments provided in the present application will be described in detail below with reference to the accompanying drawings.

[0097] Figure 1 1 is a schematic block diagram of a quantum computing method 100 provided in an embodiment of the present application. The method 100 may include the following steps.

[0098] 110, constructing an initial quantum state of n quantum bits in the QAOA quantum system, the initial quantum state including adjustable parameters, and n is an integer greater than 1;

[0099] 120, encoding the computational problem as the problem Hamiltonian of the QAOA quantum system;

[0100] 130, evolving the QAOA quantum system from the initial Hamiltonian to the ground state of the problem Hamiltonian;

[0101] 140, measuring at least a portion of the n qubits to obtain a readout of the QAOA quantum system, and determining a solution to the computational problem from the readout.

[0102] The target quantum state of the quantum system can be the quantum state that is the result of applying a specific quantum circuit to the initial quantum state of the quantum system. For example, the target quantum state can correspond to the ground state of the Hamiltonian. The specific quantum circuit represents the overall evolution of the quantum system under the Hamiltonian.

[0103] In the embodiment of the present application, the initial quantum state is controllable and iterative, which can ensure that the evolution of the quantum state is not completely implemented by the quantum circuit, but can also be achieved by iterating the initial quantum state.

[0104] The initial quantum state includes an adjustable parameter. Then, in each iteration, the initial quantum state of each iteration can be determined by the adjustable parameter, so that the initial quantum state is controllable.

[0105] Regarding how to construct the initial quantum state, there are at least the following implementation methods.

[0106] Implementation 1: Using a revolving door to construct the initial quantum state. Based on this implementation, the adjustable parameter may be, for example, the rotation angle of the revolving door.

[0107] Implementation method 2: When two qubits in the problem are related, some parameterized two-bit gates can be used to construct this relationship in the initial quantum state, and the strength of this relationship can be controlled by parameters. Based on this implementation method, the adjustable parameters can be, for example, parameterized two-bit gates.

[0108] Implementation method 3, using multi-bit gates to construct the initial quantum state. For example, for some initial quantum states that use multi-bit information, such as using d-level quantum bits (qudits), a gate U(θ) can be constructed for each qudit to control the expression of a qudit. Based on this implementation method, the adjustable parameter can be, for example, θ. Among them, reference can be made to the existing description of qudit and qubit, for example, qubit represents a two-level quantum bit, and qudit represents a d-level quantum bit, which is the so-called multi-level situation.

[0109] It should be understood that the above-mentioned several implementation methods are exemplary and not limiting. Any method that can make the initial quantum state adjustable is applicable to the embodiments of the present application. For example, the initial quantum state can be constructed by referring to the method of constructing the quantum state by VQE, etc.

[0110] The following mainly introduces the above-mentioned implementation method 1.

[0111] Implementation method 1, using a rotating gate to construct the initial quantum state.

[0112] One possible implementation is to use R Y Revolving gate to construct the initial quantum state.

[0113] When constructing the initial quantum state of each quantum bit, a Y-axis rotating gate R is used. y (θ i ) to make the initial quantum state |0>=[1,0] T Rotate an angle θ around the Y axis in the Bloch sphere i , so for n quantum bits, through a set of θ=(θ1,θ2,......,θ i ,......θ n ) to construct the initial quantum state. Among them, the n quantum bits correspond to θ i , can be randomly selected or can be selected according to a certain rule (such as taking values ​​at equal intervals between (0, π)), or can be other methods, which are not limited. iCompared with the existing QAOA, in this implementation, the Hadamard gate for preparing the initial quantum state is replaced by R Y The rotating gate can precisely control the superposition distribution of each quantum bit.

[0114] For example, the optimization result of the previous time can be used as the initial quantum state for the next optimization to form an iteration. That is, the adjustable parameter R Y The rotation angle of the revolving door can determine the initial quantum state for the next optimization based on the previous optimization result. For example, the 0-1 state distribution of each quantum bit can be measured and converted into R Y The rotation angle θ of the revolving door is used, and the previous optimization result is used as the initial quantum state for the next optimization to form an iteration. In this way, by adopting the method of iteratively updating the initial quantum state for evolution, it is possible to obtain a very high-precision result without increasing or even reducing the number of times to obtain the expectation.

[0115] It should be understood that the embodiments of the present application mainly adopt R Y The example of using a rotating gate to construct an initial quantum state is used for illustrative purposes, and is not limited to this. For example, different gates can be used to construct an iterative initial quantum state, such as R x (θ) gate or any similar (R y (θ)·R x (θ')) can be a single-bit revolving gate.

[0116] Optionally, the initial Hamiltonian H associated with the initial quantum state can be chosen B .

[0117] A possible implementation method, H B is the Hamiltonian of the initial quantum state, or H B The corresponding eigenvector has a large overlap with the prepared initial quantum state.

[0118] Using the above R Y As an example, we use a revolving door to construct the initial quantum state. y (θ i ) after rotation, it actually falls into the xz plane in the Bloch sphere, and the corresponding vector is [cos(θ i ), sin(θ i )], construct the corresponding intrinsic Hamiltonian H B As shown in formula 3.

[0119]

[0120] The above describes the initial quantum state and the initial Hamiltonian H respectively. B The following combination Figure 2 A quantum system applicable to the embodiment of the present application is introduced. For the sake of distinction, the QAOA derivative algorithm proposed in the embodiment of the present application is denoted as GQAOA.

[0121] Figure 2 A schematic diagram of a GQAOA quantum system applicable to an embodiment of the present application is shown.

[0122] like Figure 2 As shown, the GQAOA quantum system may include a variational parameter module, which is similar to the variational parameter module in the QAOA quantum system. For example, the variational parameter module includes a first parameter module and a second parameter module, such as Figure 2 shown and R x,B . Among them, γ, β are variational parameters, γ∈[0,π], β∈[0,π]. Represents the complex matrix -iγH c Matrix index. After the variational parameter module in the GQAOA quantum system, the output state of the GQAOA quantum system can be expressed as: |ψ(β,γ,p)|. Where p represents the number of layers of the quantum circuit. Substituting the output state of the GQAOA quantum system into the quantum optimization problem, the objective function of the quantum optimization problem can be obtained. The objective function can be, for example, a loss function. A possible implementation method is that the classical part of the GQAOA quantum system can use a variational method or a gradient-based optimization algorithm (for example, a stochastic gradient algorithm or Adam) to optimize the parameter vector β and the parameter vector γ in the iterative objective function, and the optimized parameter vector is fed back to the GQAOA quantum system. Through optimization iterations, until the optimal condition is met or the preset parameter threshold is reached, the optimized parameter vectors are recorded as β* and γ*. Finally, the GQAOA quantum system outputs a state close to the optimal solution of the quantum optimization problem and the corresponding approximate target value. Regarding the variational parameter module, you can refer to the variational parameter module in the existing QAOA quantum system, which will not be repeated here.

[0123] like Figure 2 As shown, the GQAOA quantum system can include an initial quantum state, which is denoted as As mentioned above, in the embodiment of the present application, the initial quantum state is adjustable, that is, θ in the initial quantum state is adjustable.

[0124] To use R Y Taking the revolving door as an example to construct the initial quantum state, the present application embodiment provides two optimization schemes, which are recorded as scheme 1 and scheme 2 for distinction. The two schemes are introduced below.

[0125] Solution 1

[0126] Scheme 1 may include the following steps.

[0127] 1) Set the optimization number k, where k is an integer greater than 1 or equal to 1.

[0128] In the calculation, k optimizations may be performed according to a set number of optimizations k.

[0129] 2) Determine the initial value of the parameter to be optimized: θ = (θ1, θ2, ..., θ i ,......θ n ), β=(β1,β2,......,β i ,……β p ),γ=(γ1,γ2,......,γ i ,……γ p ). It can be seen that in the embodiment of the present application, the parameters to be optimized include not only the variational parameters γ, β, but also the adjustable parameter θ.

[0130] 3) Use θ and n Y-axis revolving doors R y (θ i ), construct the initial quantum state and H from the |0> state B .

[0131] Constructed H B As shown in Formula 3. The constructed initial quantum state can be expressed as Formula 4, for example.

[0132]

[0133] 4) Construct the Hamiltonian according to the problem, such as H p . Set the number of layers p, the evolution module U of the i-th layer B,i (θ,β i ), U p,i (γ i ), where β i ∈(β1,β2,......,β i ,......β p ), γ i ∈(γ1,γ2,......,γ i ,......γ p ), θ=(θ1,θ2,......,θ i ,......θ n ).

[0134] As an example, Figure 3 A quantum circuit diagram applicable to Scheme 1 is shown. Figure 3 As shown, in the p-layer circuit, each layer includes an evolution module U B (θ,β) and U p(γ).

[0135] 5) Optimize k times according to the optimization number k.

[0136] In the calculation of this example, the number of parameters is (n+2p). Considering that one optimization may not be sufficient to optimize to the optimal value, a possible implementation method is to set a specific optimization number k (for example, k is greater than 1) and optimize k times according to the optimization number k. For example, the initial value of each optimized parameter is the final value at the end of the last parameter optimization.

[0137] After k optimizations, the final optimized values ​​(θ', β', γ') are obtained. By reconstructing (θ', β', γ') according to the quantum circuit, the final state can be obtained by measurement.

[0138] Solution 1 is introduced above, and Solution 2 is introduced below.

[0139] Solution 2

[0140] Solution 2 may include the following steps.

[0141] 1) Set the number of optimizations k.

[0142] 2) Given a set of different values ​​of θ=(θ1,θ2,......,θ i ,......θ n ). For example, it can be a set of values ​​determined randomly; or it can be a set of values ​​determined according to a certain rule, such as taking values ​​at equal intervals between (0, π), etc., and there is no limitation on this.

[0143] 3) Use θ and n Y-axis revolving doors R y (θ i ), construct the initial quantum state and H from the |0> state B . Constructed H B As shown in Formula 3. The constructed initial quantum state can be expressed as Formula 4, for example.

[0144] 4) Construct the Hamiltonian H according to the problem p . Set the number of layers p and construct the evolution module U of the i-th layer B,i (θ,β i ), U p,i (γ i ), where β i ∈(β1,β2,......,β i ,......β p ), γ i ∈(γ1,γ2,……,γ i ,......γ p ), θ = (θ1, θ2,..., θi , ...θ n ).

[0145] As an example, Figure 4 A quantum circuit diagram suitable for Scheme 2 is shown. Figure 4 As shown, in the p-layer circuit, each layer includes an evolution module U B,i (θ,β i ) and U p,i (γ i ).

[0146] 5) Determine (β′, γ′).

[0147] The first possible implementation method is to use a classical computer optimizer to optimize the parameters β = (β1, β2, ... β p ), γ = (γ1, γ2,...γ p ), and obtain the optimized parameters (β′, γ′). p |H p |ψ′ p >) and the initial quantum state |ψ initial >, use the classical computer optimizer to optimize the parameters and obtain the optimized parameters (β′, γ′).

[0148] The second possible implementation method is that (β′, γ′) is the last (β, γ). In other words, the last (β, γ) is assigned to (β′, γ′).

[0149] Optionally, which of the above implementations to use to determine (β′, γ) may be selected according to the number of iterations or the iteration result.

[0150] For example, when the iteration number is 1 (such as k=1), the first possible implementation method mentioned above can be used to determine (β′, γ′), that is, using a classical computer optimizer to optimize the parameters β, γ; when the iteration number is greater than 1, the second possible implementation method mentioned above can be used to determine (β′, γ), that is, taking the previous (β, γ) and assigning it to (β′, γ′).

[0151] For example, when the difference between the current and previous iteration results is less than the preset threshold δ, the first possible implementation method mentioned above can be used to determine (β′, γ′), that is, using a classical computer optimizer to optimize the parameters β, γ; when the difference between the current and previous iteration results is greater than or equal to the preset threshold δ, the second possible implementation method mentioned above can be used to determine (β′, γ′), that is, taking the previous (β, γ) and assigning it to (β′, γ′).

[0152] 6) Using (θ, β', γ'), construct |ψ′p >, measure the probability distribution of 01 for each bit and convert it into θ′. If the probability of the i-th quantum bit taking 0 is P i , then θ′ is as shown in Formula 5.

[0153]

[0154] According to the measured probability of each bit, θ′ is obtained according to the above formula.

[0155] 7) Check whether the number of iterations reaches the set value k. If so, the measurement result of the last iteration is used as the final result. If not, (θ, β', γ') is returned to step 2 and assigned to (θ, β, γ).

[0156] For clarity, pseudo code applicable to the above example is as follows.

[0157] In Scheme 2, the single-bit control parameter θ is controlled and updated by iterative measurement. From the pseudocode, it can be seen that the remaining parameters (β, γ) in the iterative process do not have high requirements on the optimizer and do not need to be optimized in each iteration. Therefore, while achieving the same effect, Scheme 2 can save more computing resources.

[0158] The following introduces the application of GQAOA provided in the embodiments of the present application in different types of problems.

[0159] Problem 1, maximum cut problem.

[0160] The maximum cut problem can be simply described as the following problem: for a graph consisting of edges connecting points, divide the points into two subsets: subset A and subset B. If there is an edge connecting the points in subset A and subset B, then such an edge can be recorded as a "cut". The maximum cut problem is to find a classification method that contains the largest number of cuts.

[0161] The following is an explanation of several different types of maximum cut problems.

[0162] 1. The maximum cut problem of a regular graph with degree 3 and 4 to 20 points.

[0163] The number of edges connected to a vertex in a graph is called the degree of the vertex. All vertices in a regular graph have the same degree. For example, Figure 5 Twenty regular graphs of degree 3 are shown.

[0164] The following describes an implementation method of using an embodiment of the present application to solve the maximum cut problem of a regular graph with degree 3 of 4 to 20 points.

[0165] Generally speaking, the steps to solve a problem include: 1) encoding the problem and constructing the problem Hamiltonian (i.e., H p );2) The target problem is to solve the Hamiltonian H p The optimal solution at a specific line depth. In the embodiment of the present application, the Hamiltonian H of this problem can be solved by GQAOA p Optimal solution at a specific line depth.

[0166] The coding and construction of the Hamiltonian H in this problem p : As mentioned above, in the maximum cut problem, each point can be divided into two categories. A quantum bit is used to represent a point. The |0> state of the quantum bit indicates that the point belongs to the A subset, and the |1> state indicates that the point belongs to the B subset. Therefore, when two points on an edge are classified as (|0>, |1>) or (|1>, |0>), the edge can be recorded as a cut, but not vice versa.

[0167] In this problem, the Hamiltonian H p We need to calculate the number of cuts in each classification method. Before that, we can define the role of some operators. As an example, we can define the operator E 1 、E 0 , as follows.

[0168]

[0169] E 1 |0>=0,E 1 |1>=|1>

[0170] Formula 7

[0171] E 0 |0>=|0>,E 0 |1>=0

[0172] Formula 8

[0173] Operator E 1 、E 0 , which can also be recorded as a judgment operator, can be used to determine whether a state is a |1> state or a |0> state. If there is an edge between points i and j (such as {i, j}), then the following operator can be used to determine whether this edge is a cut:

[0174]

[0175] It can be concluded that H p{i,j} |0 i 0 j >=0,H p{i,j} |1 i 1 j >=0,Hp{i,j} |1 i 0 j >=|1 i 0 j >, H p{i,j} |0 i 1 j >=|0 i 1 j >. The Hamiltonian H p Judge each edge {i, j}∈Edge in the graph, as shown in Formula 10.

[0176]

[0177]

[0178] The problem of constructing the Hamiltonian H p After that, the initial quantum state can be constructed by the method for constructing the initial quantum state as described above, and the initial Hamiltonian H can be constructed by the method for constructing the initial Hamiltonian as described above. B Then, the solution can be obtained on a quantum computer or simulator according to the process described in Scheme 1 or Scheme 2 until convergence or a termination condition is reached (such as reaching a maximum number of optimizations or iterations, or reaching a set threshold, etc.), and then the loop is exited.

[0179] As an example, Figure 6 A schematic diagram showing different methods for solving the maximum cut problem of a regular graph of degree 3.

[0180] like Figure 6 As shown in FIG. 1 , it is assumed that QAOA, Scheme 1 and Scheme 2 are respectively used to solve the maximum cut problem of a regular graph with degree 3 of 4 to 20 points. The number of optimizations set in Scheme 1 is 10 times, and the number of iterations set in Scheme 2 is 25 times. Figure 6 The regular graph used in the calculation may be a result of randomly selecting at least 3 different regular graphs for calculation and averaging the results calculated based on the different regular graphs.

[0181] like Figure 6 As shown, the vertical axis represents <c> / C min The horizontal axis represents the number of points n (n can be 4 to 20), and the curve graph represents <c> / C min The changing trend with the number of graph points n. <c> / C min It can be expressed as formula 11.

[0182]

[0183] Among them, E ideal represents the ideal cost function, which is the number of maximum cuts in the graph, that is, the cost function corresponding to the correct solution. calculation represents the cost function calculated in the actual simulation. <c> / C min The higher the value, the better the result. Figure 6 As can be seen from the figure, for QAOA, as the number of layers p increases, the performance of QAOA gets better and better. <c> / C min , as the number of graph points n continues to increase, <c> / C min The value of remains basically unchanged, which makes it seem that QAOA will get a good solution to the maximum cut problem of 12 points, 20 points, or even 40 points when the number of layers p=3. However, the value of the cost function sometimes cannot represent the direct performance of the algorithm. The probability of the correct solution appearing in the final state (also known as the success rate) can more accurately describe the quality of an algorithm. Therefore, ΔE can be defined as:

[0184] ΔE=E ideal -E calculation

[0185] Formula 12

[0186] The smaller ΔE is, the better the calculated solution |ψ′ is. p > and the correct solution |ψ ideal >The closer the number, the better the algorithm works. Figure 6 All points converge to ΔE<10 -1 , in this case the corresponding success rate (in |ψ′ p >The probability of finding the correct solution) is already higher than 95%.

[0187] For QAOA, Figure 6 As can be seen from the figure, as the number of graph points n continues to increase, <c> / C min The value of remains basically unchanged, but in fact, as the number of graph points n increases, the actual maximum cut value E ideal is also growing, so although <c> / C min If the value of does not change, the value of ΔE will continue to increase, resulting in a decrease in the success rate.

[0188] For the GQAOA proposed in the embodiment of the present application, a ΔE<10 can be found after a certain number of iterations or optimizations. -1 The solution is not only <c> / C min It has achieved great advantages in comparison, and the actual success rate is greater than 95%.

[0189] In addition, by using the GQAOA proposed in the embodiment of the present application, there is no need to calculate the cost function too many times, so less computing resources can be consumed. Taking the solution 2 proposed in the embodiment of the present application as an example, Figure 6 As shown, taking n = 14 as an example. The horizontal axis can represent the number of layers p for QAOA, and the number of iterations for Scheme 2. It can be seen that Scheme 2 can achieve the effect that can be achieved by the deeper quantum circuit of QAOA by using one layer of quantum circuit (i.e. p = 1), which greatly reduces the cost of constructing quantum circuits.

[0190] In addition, with the GQAOA proposed in the embodiment of the present application, there is no need to calculate the cost function too many times, so less computing resources can be consumed. For the calculation of the cost function, the cost function is mainly calculated by measuring the quantum state multiple times and then taking the average value. After the measurement, the quantum state collapses, so it can no longer be used. In order to measure again, it is generally necessary to use the quantum circuit to construct this quantum state again. Therefore, the calculation of the cost function consumes a lot of resources. The number of calculations of the cost function is used to represent the consumption of resources. As an example, based on simulation experience, Table 1 shows the number of calculations of the cost function corresponding to different algorithms (i.e., QAOA, Scheme 1, and Scheme 2) in the maximum cut problem of 20 regular graphs with a degree of 3.

[0191] Table 1

[0192]

[0193] The QAOA column in Table 1 describes the number of calculations required to optimize the parameters (β, γ) to the optimal value in the process of p = 1 to 3; the Scheme 1 column describes the number of calculations required empirically to achieve the optimization number; the Scheme 2 column describes the number of calculations required empirically to achieve the iteration number. It can be seen from Table 1 that using Scheme 2 can save more computing resources.

[0194] Below, mainly taking Solution 2 proposed in the embodiment of the present application as an example, the application of Solution 2 in different problems is introduced. The application of Solution 1 in different problems can refer to the application of Solution 2 in different problems, which will not be repeated here.

[0195] Optionally, when using Solution 2 to solve the problem, rapid convergence can be achieved by appropriately increasing the number of layers of quantum circuits.

[0196] As an example, Figure 7 The figure shows the change of ΔE with the number of iterations when the number of layers p = 1 and p = 2. Assume that Scheme 2 is used to solve the maximum cut problem of a regular graph with 20 points and degree 3, and the number of iterations is set to 18. Figure 7 The variation of ΔE during the iterations is shown. Figure 7 The difference between the two figures is that the ordinate representing ΔE in one figure adopts a linear coordinate, while the ordinate representing ΔE in the other figure adopts a logarithmic coordinate.

[0197] The smaller ΔE is, the better the calculated solution |ψ′ is. p > and the correct solution |ψ ideal >The closer, the better the algorithm effect. Figure 7 As shown, when p = 1, after about 10 iterations, ΔE can approach 10 -1 Comparing the curves corresponding to p = 1 and p = 2, it can be seen that for scheme 2, as the number of layers p increases, or the depth of the quantum circuit increases, the number of iterations required to achieve the same accuracy will decrease. Therefore, rapid convergence can be achieved by appropriately increasing the number of layers of the quantum circuit.

[0198] Optionally, when using solution 2 to solve the problem, it is not necessary to optimize the parameters (β, γ) every time during the iteration process.

[0199] In a possible implementation, whether the parameters (β, γ) need to be optimized may be determined according to a preset threshold.

[0200] As an example, Figure 8 The figure shows the changing trend of the parameters (β, γ) during the iteration process. Assume that Scheme 2 is used to solve the maximum cut problem of a regular graph with 20 points and degree 3, and the number of iterations is set to 18. Assume that the parameters (β, γ) are optimized in each iteration. Figure 8 The variation of the parameters (β, γ) during the iteration process when p=1 and the variation of the parameters (β, γ) during the iteration process when p=2 are shown.

[0201] from Figure 8 It can be seen that when p=1 or p=2, the values ​​of each parameter basically vary within a certain interval, and only a small number of points are not within the interval. Therefore, the parameters (β, γ) can be optimized with a fixed number of steps by designing a preset threshold δ. The optimization of the parameters (β, γ) with a fixed number of steps can be understood as not needing to optimize the parameters (β, γ) every time. The parameters (β, γ) can be optimized again under certain conditions, otherwise the (β, γ) used last time will be used.

[0202] Taking the first and second iterations as examples, the parameters (β, γ) are optimized in the first iteration, and the (β, γ) used in the second iteration is the same as the (β, γ) used in the first iteration, and the cost function of the second iteration is obtained. If the change value of the cost function of the second iteration compared with the first is less than δ, then the parameters (β, γ) can be optimized in the next (i.e., third) iteration; if the change value of the cost function of the second iteration compared with the first is greater than or equal to δ, then in the next iteration, the parameters (β, γ) can be optimized without using the same parameters (β, γ) as the first iteration; if the change value of the cost function of the second iteration compared with the previous one is less than 0, then this iteration is invalidated, and the optimization of the parameters (β, γ) starts directly in this iteration.

[0203] It should be understood that in each iteration, a method similar to the first and second methods described above can be used to determine whether the parameters (β, γ) need to be optimized next time.

[0204] As an example, Fig. 9 A schematic diagram showing how ΔE varies with the number of iterations when optimizing the parameters (β, γ) for a fixed number of steps.

[0205] Compare Fig. 9 and Figure 7 In the case of p = 1, Figure 7 The curve corresponding to p=1 is the simulation result when the parameters (β, γ) are optimized in each iteration; Fig. 9 The curve shown is the simulation result of optimizing the parameters (β, γ) for a fixed number of steps. Fig. 9 The re-optimization point shown in can be understood as the point where the parameters (β, γ) are re-optimized. Fig. 9 and Figure 7 It can be seen that optimizing the parameters (β, γ) with a fixed number of steps can achieve the goal of achieving better results with fewer optimizations. Figure 7 compared to, Fig. 9 The method shown in can save a lot of computing resources. If the state construction-measurement process is repeated multiple times each time the cost function is calculated, and the cost function is calculated once for each optimization step, then the optimization for each iteration can greatly reduce the computational cost compared with the optimization for a fixed number of steps.

[0206] From the above method, it can be seen that the accuracy requirements for parameters (β, γ) are not high, so when choosing the optimizer of the classical computer, there are more options, such as the Bayesian optimizer. The Bayesian optimization method can make predictions for black box functions based on a small number of samples, which has great advantages over the general trend prediction function and gradient descent function in the case of a small number of steps. For optimizations that do not require high accuracy, using the Bayesian optimization method can greatly reduce the cost of calculations.

[0207] 2. The weighted maximum cut problem with degree 3 for 4 to 20 points.

[0208] The weighted maximum cut problem is to introduce a weight (0,1] for each edge in the maximum cut problem. The corresponding problem Hamiltonian H p As shown in formula 13.

[0209]

[0210] Among them, w i,j Indicates the weight of edge {i, j}. The weight of each edge can be determined according to the actual situation, or it can be determined randomly, and there is no limitation on this. For example, in the following example, the numpy.random.uniform module can be used to randomly give the weight of each edge.

[0211] Determine the Hamiltonian H corresponding to the problem p After that, the subsequent processing is similar to the processing flow of the maximum cut problem of the regular graph with degree 3 of 4 to 20 points mentioned above, which will not be repeated here.

[0212] Since the weight of each edge is different, the question of which edge to cut and which edge to cut first becomes more important. Taking Solution 2 as an example, assuming that the number of layers p = 1, Fig.10 A schematic diagram showing the simulation results of using Scheme 2 to solve the weighted maximum cut problem of a regular graph with degree 3 and 4 to 20 points.

[0213] The condition for terminating the iteration can be reaching a preset number of iterations, or other conditions, such as ΔE reaching a certain value. The condition for terminating the iteration is ΔE<10 -1 For example, ΔE reaches 10 -1 Stop iterating when . Fig.10 The regular graph used in the simulation can be the same regular graph generated randomly. In the simulation results mentioned in the embodiments of the present application, all of them can be obtained by repeated calculations, such as repeating the calculations three times. The figure may show the result of one of the calculations, which will not be repeated below. Fig.10 It can be seen that as the number of graph points n increases, the number of iterations has an upward trend, and the upward trend is not obvious. Therefore, when facing a very large weighted maximum cut problem, the solution of the embodiment of the present application (such as Solution 2) can achieve a higher accuracy in the number of steps of the low-power polynomial of n, such as achieving ΔE<10 -1 accuracy.

[0214] The above questions 1 and 2 are both about solving the maximum cut problem of regular graphs. Now, combined with question 3, we will introduce the solution to the maximum cut problem of general graphs.

[0215] 3. The maximum cut problem of general graphs.

[0216] For a regular graph with degree 3, because its degree is low and each point has the same degree, when considering the problem in the end, each point is equivalent in basic characteristics, and the search will be relatively easy. For general graphs (i.e., non-regular graphs), especially graphs with different degrees for each point and high average degree, the ability of the search algorithm is more tested.

[0217] As an example, Fig.11 A schematic diagram showing a general diagram suitable for embodiments of the present application is shown.

[0218] like Fig.11 As shown in Figure 2, the average degree of each of the four graphs is greater than 4. Similarly, the problem is first encoded and the problem Hamiltonian (i.e., H p ). Then, the initial quantum state can be constructed by the method for constructing the initial quantum state as described above, and the initial Hamiltonian H can be constructed by the method for constructing the initial Hamiltonian as described above. B Taking Scheme 2 as an example, the solution can be obtained on a quantum computer or simulator according to the process described in Scheme 2 until convergence or reaching the iteration termination condition (such as reaching the maximum number of iterations or reaching the set threshold), and then exit the loop. Taking Scheme 2 as an example, assuming that the number of layers p = 1, Fig.12 It shows that the solution 2 is used to solve the Fig.11 The schematic diagram of the simulation results of the maximum cut problem of a general graph is shown in . Fig.12 As shown, the ordinate represents ΔE, and the abscissa represents the number of iterations. Fig.12 The four curves shown correspond to Fig.11 The simulation results of the four figures ((a), (b), (c), (d)) are shown. Fig.12 It can be seen that the maximum cut problem of a general graph can be efficiently solved by adopting the solution of the embodiment of the present application (such as Solution 2).

[0219] The above introduces the application of the embodiment of the present application in solving the maximum cut problem in conjunction with Problem 1. It can be seen that when the solution of the embodiment of the present application is applied to solve the maximum cut problem, it can not only achieve higher accuracy, but also reduce certain computing costs and reduce the consumed computing resources.

[0220] Question 2, satisfiability problem.

[0221] The satisfiability problem can be simply described as follows: a series of Boolean values ​​and their connectors (and, or, not, etc.) together form an expression, in which the Boolean value arrangement is called a "sentence". The connectors in the expression are fixed, and the Boolean values ​​are variable. If the value obtained for a sentence in the expression is true, it can be called a "satisfactory" sentence. The problem of finding such a sentence is called the satisfiability problem.

[0222] If the length of the expression is no longer than 2, then the problem becomes a 2-satisfiability problem (2-SAT). Taking 2-SAT as an example, for such a problem, the Hamiltonian can simply give the following rules: First, clarify what kind of sentences meet the conditions. For example, this definition can be completed in combination with the graph in the previous problem 1: each point is a Boolean value in the sentence, and the two points on an edge can be considered as two Boolean values ​​in a sentence. It can be simply defined that when the length of the sentence is 1 (point), the expression is true when its Boolean value is true; when the length of the sentence is 2 (edge), it is required to be true when the two Boolean values ​​are equal. Then the Hamiltonian H corresponding to the 2-SAT problem is p It can be as formula 14.

[0223]

[0224] The problem of constructing the Hamiltonian H p After that, the initial quantum state can be constructed by the method for constructing the initial quantum state as described above, and the initial Hamiltonian H can be constructed by the method for constructing the initial Hamiltonian as described above. B Taking Scheme 2 as an example, the solution can be obtained on a quantum computer or simulator according to the process described in Scheme 2 until convergence or reaching the iteration termination condition (such as reaching the maximum number of iterations or reaching the set threshold), and then exit the loop. Taking Scheme 2 as an example, assuming that the number of layers p = 1, Fig.13 The following is a schematic diagram showing the simulation results of using Scheme 2 to solve the 2-SAT problem of a regular graph with degree 3 and 4 to 20 points. Fig.13 It can be seen that the solution of the embodiment of the present application (such as Solution 2) can efficiently solve the satisfiability problem.

[0225] Problem 3, the maximum independent set problem.

[0226] Take a regular graph with degree 3 as an example. As mentioned above, each graph consists of points and edges. All points constitute a point set (such as Node), and all edges constitute an edge set (such as Edge). If there is a point set Then Node' is called the sub-point set of Node. If any two points in the sub-point set do not form an edge, that is, Then Node' is called an independent set. The size of an independent set is evaluated by the number of points it contains. The maximum independent set problem is to find the largest independent set in a graph.

[0227] The coding and construction of the Hamiltonian H in this problem p :Similar to the maximum cut problem, the difference is that the |0> state means that the point does not belong to the independent set, and the |1> state means that the point belongs to the independent set. There are two tasks here: first, it is necessary to output how many points in the result belong to the independent set, that is, how many |1> are output; second, not all points with the state of |1> meet the requirements, so it is necessary to identify whether the points connected to |1> are all |0>.

[0228] As an example, the first task, that is, determining how many points in the output result belong to the independent set, can be completed by formula 15.

[0229]

[0230] To complete the second task, we need to first clarify: for {i,j}∈Edge, we need to ensure |0 i 0 j >、|0 i 1 j >、|1 i 0 j >All meet the requirements, only |1 i 1 j > does not meet the requirements, so the second task can be completed by formula 16.

[0231]

[0232] In actual operation, there may be a problem of repeated deletion, that is, for edge {i,j} is |1 i 1 j >, after subtraction, there is another edge {i,k} connected to point i, which is also |1 i 1 k >, so point i is subtracted twice. Because the optimal solution will not have a situation where both sides of an edge are |1>, such repeated deletion will not affect the optimal solution.

[0233] Coding and constructing the problem Hamiltonian H p After that, we can start from the initial Hamiltonian to the problem Hamiltonian H p The ground state evolution of B , you can refer to the above description, which will not be repeated here.

[0234] Assume that we already know a solution to the maximum independent set. Based on this solution, we can choose any state as |0 s >The point s flips it to |1 s >. If a point s is in the same state as another state |1 i >, then both point s and point i must be deleted from the independent set, so the independent set obtained is less than the known maximum independent set points, which is not the optimal solution; if point s is not connected to any point in the current independent set, it means that point s should belong to the independent set, which means that the maximum independent set known in the hypothesis is not the maximum independent set, which violates the above assumption. It can also be proved that if there is an edge with two points in the hypothetical solution that are both |0>, then flip them to |1>, and the solution obtained seems to be the same as the hypothetical solution, but this is also wrong. If there is such an edge, then it means that there must be a point that can belong to the maximum independent set, which violates the assumption. This can be extrapolated to all situations.

[0235] Compared with QAOA, the solution provided in the embodiment of the present application can be applied to the above settings. For QAOA, the above settings may bring some problems. Because although the optimal solution is correct and unique, the suboptimal solution may have unreasonable situations in the above proof, that is, the obtained solution is not an independent set, but the same as the most suboptimal solution of the independent set, which will cause great problems when the scale of the problem becomes larger. Because for practical applications, the cost of solving the optimal solution is very high, such as requiring a very large number of measurements or a very deep line depth, at this time, obtaining a suboptimal solution is often a better solution. QAOA is more likely to obtain a suboptimal solution when facing larger-scale problems, but if the suboptimal solution may not be a reasonable solution that meets the "independent set" requirements, this requires a series of processing that leads to an increase in computational costs, or directly changing the Hamiltonian, which will further increase the complexity of the single-layer line and the cost will be very high.

[0236] Taking scheme 2 as an example, assuming the number of layers p = 1, Fig.14 A schematic diagram showing the simulation results of using Scheme 2 to solve the maximum independent set problem of a regular graph of degree 3 with 4 to 20 points. Fig.14 Some points with obvious change trends represent the points for re-optimization. Fig.14 It can be seen that by adopting the solution of the embodiment of the present application (such as Solution 2), ΔE<10 can be achieved with a relatively small number of iterations. -1 As mentioned above, the success rate has reached more than 95%, and the optimal solution can be found efficiently.

[0237] Problem 4, Traveling Salesman Problem.

[0238] The traveling salesman problem is a path planning problem, which has many applications in real life, such as timetable planning, finding the shortest path, etc.

[0239] The traveling salesman problem can be simply described as the following problem: a traveling salesman who makes a living by selling goods has to start from his home city A, go to several different cities to sell goods and finally return home. The distances between cities are different, so it is necessary to help the traveling salesman plan the shortest path. The traveling salesman problem is divided into two categories. One is that all cities are connected, so the traveling salesman problem becomes a sorting problem; the other is that cities are not all connected to each other, so the problem becomes two: first, it is necessary to determine whether there is a circle on the existing map that traverses every city, that is, the Hamiltonian circle problem, and secondly, to find the shortest circle. The embodiment of this application mainly takes the first type of problem as an example for illustrative explanation.

[0240] The traveling salesman problem is symmetrical, that is, it does not matter where you start. As long as the two adjacent cities of each city are the same when sorting, the solutions are the same. Therefore, when sorting, you can choose a fixed city as the starting point to sort the remaining cities, so as to break this symmetry. Therefore, to solve the traveling salesman problem of n cities, you can calculate the order of n-1 cities. Below, we mainly take the solution of the traveling salesman problem with n=5 as an example to illustrate. Assume that the 5 cities are recorded as: City 0, City 1, City 2, City 3, and City 4.

[0241] The coding and construction of the Hamiltonian H in this problem p :Assume that the starting city is city 0, and actually encode the remaining cities 1 to 4. Assume that the order of the cities is represented by the order of quantum bits, and the value of the quantum bits is used to represent the city number, and the encoding is binary code. For example, |00 01 10 11> actually represents the order of cities: 0, 1, 2, 3, 4, 0, and so on. It can be seen that at this time, every two quantum bits represent a city, and these two quantum bits can be regarded as a qudit. The number of quantum bits contained in each qudit can be recorded as m, so it can be simply obtained that m is log2(n-1) rounded up.

[0242] Hamiltonian has two tasks in this problem. The first task is to calculate the length of the entire path. A judgment operator can be defined, as shown in Formula 17.

[0243]

[0244] Among them, k represents the decimal number l of the bit string to be judged i is a binary number, k=l=l12 m-1 +l22 m-2 +…l m The subscript i represents the i-th qudit. This judgment operator can determine whether a qudit is the desired k after being converted to decimal.

[0245] The distance can be calculated using formula 18.

[0246]

[0247] Because city 0 is not encoded and city 0 is the starting point, the last two items calculate the distance from city 0 to the first city and the distance from the n-1th city to city 0.

[0248] Through the above formula, we can complete the calculation of the distance, that is, complete the first task.

[0249] The second task is to prevent unreasonable cities from appearing. In the traveling salesman problem of n cities, unreasonable cities refer to some cities that appear 2 times or more or do not appear at all. Therefore, it is necessary to ensure that this part of the Hamiltonian is the lowest when all cities appear only once. This can be achieved by constructing a quadratic function, as shown in Formula 19.

[0250]

[0251] Where c is a set constant. By setting c, it can be ensured that the final solution converges to the correct solution.

[0252] For the case of m<(n-1), the second unreasonable situation is the appearance of "non-existent" cities. For example, for the calculation of 6 cities, there are 5 encoded cities, and the number of each qudit is log25 rounded up (that is, 3). 3 quantum bits can represent 8 cities, so non-existent cities (such as cities 6, 7, and 8) may appear in the solution. For this situation, it can be solved by setting the distance between these cities and other cities to be very large.

[0253] Based on the above analysis, the Hamiltonian H of the traveling salesman problem of n cities is constructed p As shown in formula 20.

[0254] H p =H p,count -H p,limit

[0255] Formula 20

[0256] Taking scheme 2 as an example, assuming the number of layers p = 1, Fig.15 Figure 2 shows a schematic diagram of the simulation results of using Scheme 2 to solve the traveling salesman problem of 5 cities. Fig.15 As shown, the ordinate represents ΔE, and the abscissa represents the number of iterations. Fig.15 It can be seen that the traveling salesman problem can be solved efficiently by adopting the solution of the embodiment of the present application (such as Solution 2).

[0257] The above text introduces the application of the embodiments of the present application in different problems in combination with Questions 1 to 4.

[0258] It should be understood that in some of the above embodiments, by R Y The example of constructing the initial quantum state by a revolving door is used for illustrative explanation and is not limited to this.

[0259] Combination of the above Figures 1 to 15 The method of this application is described in detail. Figures 16 to 18 It should be understood that the description of the device embodiment corresponds to the description of the method embodiment, so the contents not described in detail can be referred to the method embodiment above, and will not be repeated here for the sake of brevity.

[0260] Fig.16 1600 is a schematic block diagram of a device provided by an embodiment of the present application. The device 1600 may include a construction module 1610, which is used to construct an initial quantum state of n quantum bits in a quantum approximate optimization algorithm QAOA quantum system, wherein the initial quantum state includes an adjustable parameter, and n is an integer greater than 9; an encoding module 1620, which is used to encode a computational problem into a problem Hamiltonian of the QAOA quantum system; an evolution module 1630, which is used to evolve the QAOA quantum system from the initial Hamiltonian to the ground state of the problem Hamiltonian; and a measurement module 1640, which is used to measure at least a portion of the n quantum bits to obtain a readout of the QAOA quantum system, and determine a solution to the computational problem from the readout.

[0261] In one example, construction module 1610 is specifically used to construct the initial quantum state of n quantum bits in the QAOA quantum system through a rotating gate, and the adjustable parameter is the rotation angle of the rotating gate.

[0262] Another example, the revolving door is R Y Revolving door or R X Revolving door.

[0263] As another example, the initial quantum state is represented as:

[0264] |ψ initial >=∏ i R y (θ i )|0> i , or, |ψ initial >=∏ i R y (θ i )|1> i

[0265] Among them, |ψ initial > represents the initial quantum state, θ i Indicates an adjustable parameter.

[0266] In another example, the device also includes an acquisition module for obtaining the parameters to be optimized and the number of optimizations k, where k is an integer greater than 1; an evolution module 1630, specifically for optimizing the parameters to be optimized k times starting from the initial Hamiltonian of the QAOA quantum system to obtain the ground state of the problem Hamiltonian, wherein the value of the adjustable parameter corresponding to this optimization is determined based on the previous optimization result.

[0267] In another example, the device also includes an acquisition module, which is used to obtain the parameters to be optimized and the number of optimizations k, where k is an integer greater than 1; the evolution module 1630 is specifically used to optimize the parameters to be optimized k times starting from the initial Hamiltonian of the QAOA quantum system to obtain the ground state of the problem Hamiltonian, wherein the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

[0268] In another example, when the difference between the cost functions corresponding to the previous two optimizations is greater than or equal to a preset threshold, the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

[0269] As another example, the initial Hamiltonian is the Hamiltonian corresponding to the initial quantum state, and the initial Hamiltonian is expressed as:

[0270]

[0271] Among them, H B represents the initial Hamiltonian, θ i Indicates an adjustable parameter.

[0272] The device 1600 can implement the steps or processes corresponding to the method embodiment according to the embodiment of the present application. The device 1600 may include a method for executing Figure 1 Furthermore, each unit in the device 1600 and the above-mentioned other operations and / or functions are respectively for implementing Figure 1 The corresponding process of the method implementation example in FIG.

[0273] It should be understood that the specific process of each unit or module executing the above corresponding steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.

[0274] It should also be understood that the division of the above-mentioned units or modules is merely an exemplary description and is not intended to be limiting.

[0275] like Fig.17 As shown, the embodiment of the present application further provides a device 1700. The device 1700 includes a processor 1710. Optionally, the device 1700 includes one or more processors 1710.

[0276] Alternatively, if Fig.17 As shown, the device 1700 may further include a memory 1720. Optionally, the memory 1720 included in the device 1700 may be one or more. The processor 1710 is coupled to the memory 1720, and the memory 1720 is used to store computer programs or instructions and / or data. The processor 1710 is used to execute the computer programs or instructions and / or data stored in the memory 1720, so that the method in the above method embodiment is executed. Optionally, the memory 1720 may be integrated with the processor 1710, or separately arranged.

[0277] Optionally, the device 1700 may further include an input device 1730 and an output device 1740. Optionally, the input device 1730 and the output device 1740 are integrated together or separately arranged. The input device 1730 may be used to receive input digital or character information, and to generate relevant signal inputs involved in the above method, such as parameters to be optimized input from a classical computer. The output device 1740 may be used to output results, or may also include some display devices to display data or results, etc.

[0278] Optionally, the processor 1710, the memory 1720, the input device 1730 and the output device 1740 may be connected via a bus or other means. Fig.17 The example of connecting through bus is taken in the following.

[0279] It should be understood that Fig.17 This is only an exemplary description, and any structure that can implement the above method is applicable to the embodiments of the present application.

[0280] The embodiment of the present application also provides a system 1800. The system 1800 may include, for example, quantum hardware 1810 (eg, a quantum processor, a quantum computer, etc.).

[0281] Quantum hardware 1810 includes one or more quantum bit circuits 1811 (or may also be referred to as quantum bit circuits 1811). Quantum bit circuit 1811 may include quantum bits that are prepared to an initial state and to which quantum gates can be applied. The method for preparing the initial state can refer to the method embodiment above. The physical implementation type of the quantum bit circuit included in quantum hardware 1810 may vary. For example, in some embodiments, quantum hardware 1810 may include a superconducting quantum bit circuit (or a superconducting quantum bit circuit circuit), such as a superconducting charge quantum bit circuit, a superconducting flux quantum bit circuit, or a superconducting phase quantum bit circuit. Typically, quantum bit circuit 1811 can be frequency-adjustable.

[0282] Optionally, quantum hardware 1810 may also include a qubit control device 1812. The qubit control device 1812 includes a device configured to operate on one or more qubit circuits 1811. For example, the qubit control device 1812 may include hardware for implementing a quantum logic gate. In practical applications, multiple qubit circuits may form a quantum circuit, multiple quantum circuits may be fabricated on a chip, and multiple quantum circuits on a chip may share a set of control devices.

[0283] Optionally, the system 1800 may also include a classical processor 1820 (eg, a classical computer). The system 1800 may be configured to use the quantum hardware 1810 and the classical processor 1820 to perform quantum computing and classical computing in combination, such as performing the method in the method embodiment.

[0284] The classical processor 1820 can be configured to execute a program for quantum control. For example, the classical processor 1820 is configured to construct control pulses for implementing various quantum gates. For example, the classical processor 1820 can receive data, such as input data, that specifies a sequence of a particular unitary quantum gate or multiple unitary quantum gates. The classical processor 1820 can then design a control pulse that can be generated by the control device 1812 of the quantum bit and applied to one or more quantum bit circuits 1811.

[0285] Optionally, the classical processor 1820 may include a universal cost function generator 1821, which may be used to define a universal quantum control cost function for a corresponding quantum gate or quantum gate sequence.

[0286] Optionally, the classical processor 1820 may include one or more optimization toolboxes 1822, which provide maximization or minimization functions while satisfying constraints, such as solving linear programming, quadratic programming, nonlinear programming, constrained linear least squares, nonlinear least squares, or nonlinear equations, etc. For example, the optimization toolbox 1822 can be used to generate the parameters γ, β to be optimized as described above.

[0287] In simple terms, the classical processor 1820 can be used to cooperate with the quantum hardware 1810 to jointly solve some computing problems.

[0288] It should be understood that the above Fig.18 This is merely an exemplary description, and no strict limitation is imposed on the specific structure of quantum hardware 1810 and the specific devices included in system 1800.

[0289] The embodiment of the present application also provides a computer-readable storage medium on which computer instructions for implementing the method in the above method embodiment are stored.

[0290] The embodiment of the present application also provides a computer program product including instructions, which, when executed by a computer, enables the computer to implement the method in the above method embodiment.

[0291] The explanation of the relevant contents and beneficial effects of any of the above-mentioned devices can be referred to the corresponding method embodiments provided above, which will not be repeated here.

[0292] It should be understood that the processor mentioned in the embodiments of the present application may be, for example, a quantum processor, i.e., a quantum-level computer processor. Alternatively, it may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0293] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory and / or a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM). For example, RAM can be used as an external cache. By way of example and not limitation, RAM may include the following forms: static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0294] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.

[0295] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0296] Those of ordinary skill in the art will appreciate that the units and steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of protection of this application.

[0297] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0298] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement the solution provided by the present application.

[0299] In addition, each functional unit in each embodiment of the present application may be integrated into one unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0300] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. For example, the computer can be a personal computer, a server, or a network device, etc. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)). For example, the aforementioned available medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0301] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / c> < / c> < / c> < / c> < / c> < / c> < / c> < / c> < / c>

Claims

1. A method of quantum computing, characterized in that: include: Constructing an initial quantum state of n quantum bits in a quantum approximate optimization algorithm QAOA quantum system, wherein the initial quantum state includes an adjustable parameter, and n is an integer greater than 1; encoding a computational problem into a problem Hamiltonian of the QAOA quantum system; evolving the QAOA quantum system from an initial Hamiltonian to a ground state of the problem Hamiltonian, wherein the initial Hamiltonian is a Hamiltonian associated with the initial quantum state; At least a portion of the n qubits are measured to obtain a readout of the QAOA quantum system, and a solution to the computational problem is determined from the readout.

2. The method according to claim 1, characterized in that The method of constructing the initial quantum state of n quantum bits in the QAOA quantum system includes: The initial quantum states of the n quantum bits in the QAOA quantum system are constructed by a rotating gate, and the adjustable parameter is the rotation angle of the rotating gate.

3. The method according to claim 2, characterized in that The revolving door is R Y Revolving door or R X Revolving door.

4. The method according to claim 3, characterized in that The initial quantum state is expressed as: ψinitial > = P iRy ( θi ) | 0 > i , or, ψinitial > = P iRy ( θi ) | 1 > i Among them, ψ initial> represents the initial quantum state, θ i represents the adjustable parameter.

5. The method according to any one of claims 1 to 4, characterized in that The step of evolving the QAOA quantum system from the initial Hamiltonian to the ground state of the problem Hamiltonian comprises: Get the parameters to be optimized and the number of optimizations k, where k is an integer greater than 1; Starting from the initial Hamiltonian, the QAOA quantum system is optimized k times for the parameters to be optimized to obtain the ground state of the Hamiltonian of the problem. The values ​​of the adjustable parameters corresponding to this optimization are determined according to the previous optimization results.

6. The method according to any one of claims 1 to 4, characterized in that The step of evolving the QAOA quantum system from the initial Hamiltonian to the ground state of the problem Hamiltonian comprises: Get the parameters to be optimized and the number of optimizations k, where k is an integer greater than 1; Starting from the initial Hamiltonian, the QAOA quantum system is optimized k times for the parameters to be optimized to obtain the ground state of the Hamiltonian of the problem. The initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

7. The method according to claim 6, characterized in that When the difference between the cost functions corresponding to the previous two optimizations is greater than or equal to a preset threshold, the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

8. The method according to any one of claims 1 to 4, characterized in that The initial Hamiltonian is the Hamiltonian corresponding to the initial quantum state, and the initial Hamiltonian is expressed as: Among them, H B represents the initial Hamiltonian, θ i represents the adjustable parameter.

9. A quantum computing device, characterized in that: include: A construction module, used to construct an initial quantum state of n quantum bits in a quantum approximate optimization algorithm QAOA quantum system, wherein the initial quantum state includes adjustable parameters, and n is an integer greater than 9; An encoding module, used for encoding a computational problem into a problem Hamiltonian of the QAOA quantum system; An evolution module, used for evolving the QAOA quantum system from an initial Hamiltonian to a ground state of the problem Hamiltonian, wherein the initial Hamiltonian is a Hamiltonian associated with the initial quantum state; A measurement module is configured to measure at least a portion of the n qubits to obtain a readout of the QAOA quantum system and determine a solution to the computational problem from the readout.

10. The device according to claim 9, characterized in that The construction module is specifically used to construct the initial quantum state of the n quantum bits in the QAOA quantum system through a revolving gate, and the adjustable parameter is the rotation angle of the revolving gate.

11. The device according to claim 10, characterized in that The revolving door is R Y Revolving door or R X Revolving door.

12. The device according to claim 11, characterized in that The initial quantum state is expressed as: ψinitial > = P iRy ( θi )| 0 > i , or, ψinitial > = P iRy ( θi )| 1 > i Among them, ψ initial > represents the initial quantum state, θ i Represents the adjustable parameter.

13. The device according to any one of claims 9 to 12, characterized in that The device also includes an acquisition module, The acquisition module is used to obtain the parameters to be optimized and the optimization times k, where k is an integer greater than 1; The evolution module is specifically used to optimize the parameters to be optimized k times starting from the initial Hamiltonian of the QAOA quantum system to obtain the ground state of the problem Hamiltonian. The values ​​of the adjustable parameters corresponding to this optimization are determined according to the previous optimization results.

14. The device according to any one of claims 9 to 12, characterized in that The device also includes an acquisition module, The acquisition module is used to obtain the parameters to be optimized and the optimization times k, where k is an integer greater than 1; The evolution module is specifically used to optimize the parameters to be optimized k times starting from the initial Hamiltonian of the QAOA quantum system to obtain the ground state of the problem Hamiltonian. The initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

15. The device according to claim 14, characterized in that When the difference between the cost functions corresponding to the previous two optimizations is greater than or equal to a preset threshold, the initial value of the parameter to be optimized in this optimization is the value of the parameter to be optimized at the end of the previous optimization.

16. The device according to any one of claims 9 to 12, characterized in that The initial Hamiltonian is the Hamiltonian corresponding to the initial quantum state, and the initial Hamiltonian is expressed as: Among them, H B represents the initial Hamiltonian, θ i represents the adjustable parameter.

17. A quantum computer, characterized in that: include: Quantum bit circuits and quantum bit control devices, The control device of the quantum bit is used to operate on the quantum bit circuit so as to implement the method according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method, device and equipment for eliminating noise influence of QAOA quantum circuit, and medium

    CN111882068A

  • Integer decomposition optimization method and system based on Grover quantum computing search algorithm

    CN112182494A