CN115545210A - Method and related apparatus for quantum computing - Google Patents

Method and related apparatus for quantum computing Download PDF

Info

Publication number
CN115545210A
CN115545210A CN202110654428.8A CN202110654428A CN115545210A CN 115545210 A CN115545210 A CN 115545210A CN 202110654428 A CN202110654428 A CN 202110654428A CN 115545210 A CN115545210 A CN 115545210A
Authority
CN
China
Prior art keywords
quantum
initial
hamiltonian
parameter
optimization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110654428.8A
Other languages
Chinese (zh)
Inventor
黄子耕
吕定顺
柴雅卉
翁文康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202110654428.8A priority Critical patent/CN115545210A/en
Publication of CN115545210A publication Critical patent/CN115545210A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/14Fourier, Walsh or analogous domain transformations, e.g. Laplace, Hilbert, Karhunen-Loeve, transforms

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Algebra (AREA)
  • Artificial Intelligence (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Superconductor Devices And Manufacturing Methods Thereof (AREA)

Abstract

The application provides a quantum computing method and a related device. The method can comprise the following steps: constructing initial quantum states of n quantum bits in a QOA quantum system of a quantum approximation optimization algorithm, wherein the initial quantum states comprise adjustable parameters, the initial quantum states in each iteration can be regulated and controlled through the adjustable parameters, and n is an integer greater than 1; encoding the computational problem as a problem hamiltonian of the QAOA quantum system; evolving the QOA quantum system from an initial Hamiltonian to a ground state of a problem Hamiltonian; 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. By the method and the device, the evolution of the quantum state can be realized by not completely handing over the quantum line, and the evolution of the quantum state can also be realized by iterating the initial quantum state, so that the performance of the QOA under the shallow line can be improved, and the method and the device can be suitable for solving more problems.

Description

Method and related apparatus for quantum computation
Technical Field
The present application relates to the field of quantum computing, and more particularly, to a method of quantum computing and related apparatus.
Background
A Quantum Approximation Optimization Algorithm (QAOA) can achieve a certain effect on a shallow quantum line when solving a large-scale problem with sparse constraint conditions (e.g., solving a maximum cut problem with all points having a degree of 3). However, for large system problems, too shallow a quantum wire will not work well. The QAOA can perform better by increasing the number of layers of the quantum lines, but the QAOA algorithm is influenced by noise when running on the existing medium-scale Noisy (NISQ) quantum computer, the influence of the noise may be larger than or offset from the benefit of the depth by the quantum lines in an excessively deep layer, and the overall effect may be worse, and the final result may be that the deep layer line does not have the same result as the shallow layer line. Therefore, improvements in QAOA are needed to be suitable for solving more problems.
Disclosure of Invention
The application provides a quantum computation method and a related device, which can improve the performance of QOA under a shallow line and is also suitable for solving more problems under the shallow line.
In a first aspect, a method of quantum computation is provided. The method can comprise the following steps: constructing initial quantum states of n quantum bits in a QOA quantum system of a quantum approximation optimization algorithm, wherein the initial quantum states comprise adjustable parameters, and n is an integer greater than 1; encoding the computational problem as a problem Hamiltonian for a QOA quantum system; evolving the QOA quantum system from an initial Hamiltonian to a ground state of a problem Hamiltonian; 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.
Based on the technical scheme, the initial quantum state comprises adjustable parameters, and the adjustable parameters can realize the adjustability of the initial quantum state. For example, in evolving a QAOA quantum system from an initial hamiltonian to a ground state of a problem hamiltonian, each iteration may manipulate the initial quantum state by adjusting the adjustable parameter. For example, the adjustable parameter may be determined according to the actual situation of each iteration, so as to determine the initial quantum state of the current iteration; or the adjustable parameter can be determined according to the last iteration result, so as to determine the initial quantum state of the iteration, and the like. Because the initial quantum state is adjustable and controllable and can be iterated under certain conditions (for example, the last optimization result is used as the initial quantum state for starting the next optimization to form iteration), the evolution of the quantum state can be ensured to be realized by not completely handing over to a quantum circuit, and can also be realized by iterating the initial quantum state, so that the performance of the QOA in a shallow circuit can be improved, and the QOA can be suitable for solving more problems.
With reference to the first aspect, in certain implementations of the first aspect, constructing initial quantum states of n qubits in a QAOA quantum system comprises: the initial quantum states of n quantum bits in the QAOA quantum system are constructed by a revolving gate, and the adjustable parameter is the rotation angle of the revolving gate.
Based on the technical scheme, the adjustable parameter can be, for example, the rotation angle of the revolving door, so that the adjustability of the initial quantum state can be realized, and the method is simple and easy to realize.
With reference to the first aspect, in certain implementations of the first aspect, the revolving door is R Y Revolving door or R X A door is rotated.
With reference to the first aspect, in certain implementations of the first aspect, the initial quantum state is represented as:
initial >=∏ i R yi )|0> i or, | ψ initial >=∏ i R yi )|1> i
Wherein, | ψ initial >Representing the initial quantum state, θ i Indicating an adjustable parameter.
With reference to the first aspect, in certain implementations of the first aspect, evolving the QAOA quantum system from an initial hamiltonian amount to a ground state of a problem hamiltonian amount includes: obtaining a parameter to be optimized and an optimization number k, wherein k is an integer larger than 1; and optimizing the QOA quantum system for k times from the initial Hamiltonian to-be-optimized parameter to obtain the ground state of the problem Hamiltonian, wherein the value of the adjustable parameter corresponding to the optimization is determined according to the previous optimization result.
Based on the technical scheme, iteration can be formed by taking the previous optimization result as the initial quantum state at the beginning of the next optimization, and thus, the method for updating the initial quantum state by iteration is adopted for evolution, so that the result with very high precision can be obtained under the condition of not increasing or even reducing the expected times.
With reference to the first aspect, in certain implementations of the first aspect, evolving the QAOA quantum system from an initial hamiltonian amount to a ground state of a problem hamiltonian amount includes: obtaining a parameter to be optimized and an optimization number k, wherein k is an integer larger than 1; and optimizing the QOA quantum system for k times from the initial Hamiltonian to the parameter to be optimized to obtain the ground state of the Hamiltonian of the problem, wherein the initial value of the parameter to be optimized at this time is the value of the parameter to be optimized at the end of the previous optimization.
Based on the technical scheme, the initial value of the parameter to be optimized at this time is the value of the parameter to be optimized at the end of the previous optimization, the requirement on the optimizer for optimizing the parameter to be optimized in the iteration process is not high, and the optimization is not required to be carried out every iteration, so that more computing resources can be saved under the condition of achieving the same effect.
With reference to the first aspect, in some implementation manners of the first aspect, when a difference between cost functions corresponding to previous two optimizations is greater than or equal to a preset threshold, an initial value of a parameter to be optimized at this time is a value of the parameter to be optimized at the end of the previous optimization.
With reference to the first aspect, in certain implementations of the first aspect, the initial hamiltonian is a hamiltonian corresponding to the initial quantum state, and the initial hamiltonian is expressed as:
Figure RE-GDA0003236434590000021
wherein H B Representing the initial Hamiltonian, θ i Indicating an adjustable parameter.
In a second aspect, a quantum computing device is provided. The apparatus may include: a construction module for constructing initial quantum states of n quantum bits in a quantum approximation optimization algorithm QOA quantum system, the initial quantum states including adjustable parameters, n being an integer greater than 9; an encoding module for encoding the computational problem as a problem Hamiltonian of the QOA quantum system; the evolution module is used for evolving the QOA quantum system from the initial Hamiltonian to the ground state of the problem Hamiltonian; a measurement module for measuring at least a portion of the n quantum bits to obtain a readout of the QOA quantum system and determining a solution to the computational problem from the readout.
With reference to the second aspect, in certain implementations of the second aspect, the construction module is specifically configured to construct initial quantum states of n qubits in the QAOA quantum system by means of a revolving gate, and the adjustable parameter is a rotation angle of the revolving gate.
With reference to the second aspect, in certain implementations of the second aspect, the revolving door is R Y Revolving doors or R X A door is rotated.
With reference to the second aspect, in certain implementations of the second aspect, the initial quantum state is represented as:
initial >=∏ i R yi )|0> i or, | ψ initial >=∏ i R yi )|1> i
Wherein, | ψ initial >Representing the initial quantum state, theta i Indicating an adjustable parameter.
With reference to the second aspect, in some implementation manners of the second aspect, the apparatus further includes an obtaining module, configured to obtain a parameter to be optimized and an optimization number k, where k is an integer greater than 1; and the evolution module is specifically used for optimizing the QOA quantum system from the initial Hamiltonian for k times to the parameter to be optimized to obtain a basic state of the problem Hamiltonian, wherein the value of the adjustable parameter corresponding to the optimization is determined according to the previous optimization result.
With reference to the second aspect, in some implementation manners of the second aspect, the apparatus further includes an obtaining module, configured to obtain a parameter to be optimized and an optimization number k, where k is an integer greater than 1; and the evolution module is specifically used for optimizing the QOA quantum system from the initial Hamiltonian for k times to obtain the basic state of the problem Hamiltonian, wherein the initial value of the parameter to be optimized at this time is the value of the parameter to be optimized when the previous optimization is finished.
With reference to the second aspect, in some implementation manners of the second aspect, when a difference between cost functions corresponding to previous two optimizations is greater than or equal to a preset threshold, an initial value of a parameter to be optimized at this time is a value of the parameter to be optimized at the end of the previous optimization.
With reference to the second aspect, in some implementations of the second aspect, the initial hamiltonian is a hamiltonian corresponding to the initial quantum state, and the initial hamiltonian is expressed as:
Figure RE-GDA0003236434590000031
wherein H B Representing the initial Hamiltonian, θ i Indicating an adjustable parameter.
In a third aspect, a quantum computer is provided, which can be used to perform the method provided in the first aspect.
Optionally, the quantum computer comprises a qubit line (or qubit circuit) and a qubit control device for operating on the qubit line (or qubit circuit).
In a fourth aspect, a processor is provided for performing the method provided by the first aspect. In the course of executing these methods, the process of acquiring information or parameters in the above methods may be understood as a process of receiving input of the above information or parameters by a processor. The operations related to the processor, such as acquisition, etc., may be more generally understood as operations related to the processor input, etc., if not specifically stated, or if not inconsistent with the actual functioning or inherent logic thereof in the related description.
In implementation, the processor may be a processor dedicated to performing the methods, or may be a processor executing computer instructions in a memory to perform the methods, such as a general-purpose processor. The Memory may be a non-transitory (non-transitory) Memory, such as a Read Only Memory (ROM), which may be integrated on the same chip as the processor or may be separately disposed on different chips.
In a fifth aspect, a computer-readable storage medium is provided, which stores program code for execution by a device, the program code comprising instructions for performing the method provided by the first aspect.
In a sixth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method provided in the first aspect above.
In a seventh aspect, a chip is provided, where the chip includes a processor and an interface, and the processor reads instructions stored in a memory through the interface to execute the method provided in the first aspect.
Optionally, as an implementation manner, the chip may further include a memory, where the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, and when the instructions are executed, the processor is configured to execute the method provided in the first aspect.
In an eighth aspect, a system is provided that includes a quantum computer and a classical computer.
Drawings
Fig. 1 is a schematic block diagram of a proposed method according to an embodiment of the present application.
Fig. 2 shows a schematic diagram of a GQAOA quantum system suitable for use in embodiments of the present application.
Fig. 3 shows a schematic diagram of a quantum wire diagram suitable for scheme 1.
Fig. 4 shows a schematic diagram of a quantum wire diagram suitable for scheme 2.
FIG. 5 shows a schematic of a 20-point degree 3 canonical graph.
FIG. 6 shows a schematic of the max-cut problem for a canonical graph with a degree of 3 using a different approach.
Fig. 7 shows a diagram of Δ E as a function of the number of iterations for the number of layers p =1 and p = 2.
Fig. 8 shows the trend of the parameters (β, γ) in the iterative process.
Fig. 9 shows a diagram of Δ E as a function of the number of iterations when the parameters (β, γ) are optimized in fixed steps.
FIG. 10 shows a schematic diagram of simulation results of solving the weight max cut problem for 4-20 point degree 3 regular graph using scheme 2.
FIG. 11 shows a schematic diagram of a generic diagram suitable for use in embodiments of the present application.
Fig. 12 shows a schematic diagram of simulation results for solving the maximum cut problem of the general graph shown in fig. 11 using scheme 2.
FIG. 13 shows a schematic of the simulation results of a 2-SAT problem using solution 2 to solve a 4-20 point degree 3 regularization graph.
FIG. 14 shows a schematic diagram of simulation results of solving the maximum independent set problem of a degree 3 regular graph of 4-20 points using scheme 2.
Fig. 15 shows a schematic diagram of simulation results for solving the traveler problem for the 5 cities using scenario 2.
Fig. 16 shows a schematic block diagram of an apparatus suitable for use in embodiments of the present application.
Fig. 17 shows a schematic block diagram of an apparatus suitable for use in embodiments of the present application.
FIG. 18 shows a schematic diagram of a system suitable for use in embodiments of the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings.
Quantum computing is a cross-type subject combining multiple subjects, such as physics, informatics, computer science and the like. For ease of understanding, a brief introduction will first be made to the relevant concepts of quantum computing.
1. Quantum computing: based on the quantum logic computation method, the basic unit of quantum computation is a quantum bit (qubit).
2. Quantum bit: basic operation units of quantum computation. A qubit line is a hardware system created to simulate the energy level system of a quantum in physics. The classical bit exists in a classical computer in a form other than 0, i.e. 1, corresponding to a low level and a high level, respectively, and represents a state at the same time. Unlike classical bits, qubits exist in probability, which may have cos at a time 2 The probability of (θ) exists in the 0 state, in sin 2 The probability of (θ) exists in the 1 state, and before no measurement, a qubit can be considered to represent the 0 state and the 1 state "simultaneously", and after measurement, the qubit will collapse to a certain determined state. As an example, one qubit may be represented by equation 1.
|qubit>=cos(θ)|0>+sin(θ)|1>
Equation 1
Wherein | > is a dirac symbol.
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 the nomenclature thereof does not limit the scope of the embodiments of the present application.
3. Quantum wires: one representation of a quantum general purpose computer represents a hardware implementation of a corresponding quantum algorithm/program under a quantum gate model.
4. Hamiltonian (Hamiltonian): a matrix describing the hermitian conjugate of the total energy of the quantum system. The hamiltonian is a physical word, an operator describing the total energy of the system, usually denoted by H.
5. The eigenstate: for a Hamiltonian matrix H, the equation is satisfied: the solution of H | ψ > = E | ψ > is called the eigenstate | ψ > of H, with the eigenenergy E. The ground state corresponds to the lowest energy eigenstate of the quantum system.
6. Quantum computer: for performing quantum computations. Quantum computers include at least the following advantages.
1) The representation space of quantum computers grows exponentially. If the representation space of each qubit is 2, then the representation space of n qubits is 2 n Therefore, the representation space of a quantum computer grows exponentially as the number of quantum bits increases. For example, when the number of sub-bits reaches 50, the resulting representation space may approach the sum of the amounts of stored information of the memory cells all over the world.
2) The computation speed of quantum computation is advantageous. The quantum computation can regulate and control the amplitude, phase and other information of the quantum bit through the quantum bit gate, so that the quantum bit gate used in the computation is equivalent to act in the whole representation space and simultaneously regulates and controls all representation states, and thus the quantum computation is actually a full parallel computation and has great advantage in computation speed.
There are many methods for quantum computer implementation. For example, optical modeling is performed using properties such as polarization of photons, ion traps are modeled using energy levels of ions, superconducting modeling is performed using josephson junctions to create resonant cavities with multiple harmonic levels, and so on. Among them, the superconducting quantum computer manufactured based on the superconductor is considered as one of the most possible schemes for realizing the quantum computer because of its characteristics of high integration level, strong expansibility, etc.
7. Quantum algorithm: currently, many Quantum algorithms are classified into two categories, one is a related algorithm derived based on The Quantum Fourier Transform (QFT), and The other is a series of Quantum search algorithms derived by using The Grover search algorithm as a representative. Described separately below.
1) A correlation algorithm derived based on a quantum fourier transform.
Compared with a classical Fourier transform algorithm, the quantum Fourier transform can improve the acceleration of exponential level. The algorithm has important application in solving the classical problems of function period, prime number decomposition, cipher decoding and the like. The implementation of correlation algorithms derived based on the quantum fourier transform requires extremely complex quantum logic gate lines and a huge number of qubits.
2) A series of derived quantum search algorithms are represented by a Grover search algorithm.
In quantum search algorithms, quantum variational algorithms are widely concerned because of a great deal of important advantages such as a calculation mode combined with classical methods and a certain hardware fault tolerance rate. In quantum variational algorithms, a variational quantum eigenvalue solver (VQE) and a Quantum Approximation Optimization Algorithm (QAOA) become two quantum variational algorithms with high application potential due to different characteristics.
The main application scenes of VQE comprise molecular simulation, physical system simulation and the like, and high-precision results can be obtained. Briefly, VQE is to manipulate each qubit by a gate operation according to the hamilton accurately, and thus obtain an optimal solution accurately.
QAOA is more used among the problems of combinatorial optimization such as the classical maximal cut problem (Max-cut), the Maximal Independent Subset (MIS), the satisfiability problem (satisfiability problem), the Traveling Salesman Problem (TSP), etc. When a large-scale featureless or unobvious combined optimization problem is faced, the effect of the classical algorithm is closer to that of a random number generator, and the QOA can ensure that a correct solution is obtained under the precondition that too many parameters to be optimized and deep quantum lines are not required to be set. The QOA is mainly described below.
8. QAOA: the construction idea is to construct a large solution domain, and then amplify the probability or amplitude of a solution meeting the requirements in the solution domain through the evolution of a Hamiltonian quantity, so as to obtain a correct solution more easily.
QAOA, can be understood approximately as a complex of discrete and variant versions of the Quantum Annealing Algorithm (QAA). An adiabatic time-dependent evolution operator exp (-itH (t)) is decomposed according to Trotter and can be converted into discrete quantum gate-based evolution, such as formula 2.
Figure RE-GDA0003236434590000061
Further, it is possible to define,
Figure RE-GDA0003236434590000062
wherein the adjustable parameter
Figure RE-GDA0003236434590000063
Representing a matrix of complex numbers
Figure RE-GDA0003236434590000064
The matrix index of (c).
It should be understood that the following description,
Figure RE-GDA0003236434590000065
is an integral Hamiltonian at evolution end time t i To H p , H p Representing Hamiltonian of the problem to be solved.
It can be shown in theory that when the time period of the segmentation is sufficiently small, the method can approximate an adiabatic algorithm. Considering that the depth of a quantum circuit is limited, quantum classical hybrid computation is mainly adopted at present, namely part of complexity of a problem is handed to a classical computer to complete. Specifically, the following steps are included.
Step 1, constructing Bell state | +on quantum computer> n =|++...+>Is in the initial state. Illustrated with a single qubit, the logic state of a single qubit may be at |0>State, |1>State, |0>Sum of states |1>Superposed state of states (indeterminate state), | +>The expression of the Bell base is shown,
Figure RE-GDA0003236434590000066
step 2, cross-applying U c And U b The quantum gate operates until a set depth p is reached.
Step 3, measuring the expected value in the quantum state to obtain the Cost Function =<ψ' p |H p |ψ' p >. Wherein the Cost Function represents a Cost Function.
And 4, feeding back to the classical computer according to the measurement expected value. The classical computer optimizes the update parameters (β, γ) according to a classical optimizer (i.e. the optimizer of the classical computer). Wherein, β = [ β = 1 ,β 2 ,……,β p ]、γ=[γ 1 ,γ 2 ,……,γ p ]. And (5) repeating the steps 1 to 4 until convergence or the maximum iteration number is reached, and then exiting.
The above steps related to the quantum classical hybrid computation are only simple exemplary illustrations, and are not limited thereto. Briefly, the classical quantum hybrid computation is a computation paradigm in which the inner layer is computed using a quantum line and the outer layer is used to adjust the parameters of the variational quantum line using a conventional classical optimizer.
QAOA is a specific quantum wire structure hypothesis that the quantum states generated by such quantum wires can be used to approximate the results of a fully combinatorial mathematical optimization problem of Non-deterministic polynomials (NPs), which are typical of the classical mixed-quantum computational paradigm. When the QAOA solves a large scale problem in which some constraint conditions are relatively "sparse" (for example, solves the maximum segmentation problem in which all points have a degree of 3), the QAOA can achieve a certain effect with few parameters in a shallow quantum line (when p is relatively low) because the condition can be broken. When a certain condition is met, the performance of the QAOA in a shallow line may not be limited, however, in an actual simulation, a huge pressure is brought to an optimizer, an optimal value is often difficult to obtain through one-time optimization, and a relatively good value can be obtained through optimizing several times after the optimized parameters are disturbed for a large system.
QAOA does not work well for large system problems in shallow quantum wires. VQE, in turn, because it must use a particularly large number of parameters if it is to achieve a good result, presents a significant challenge to classical computer optimizers. For the variational algorithm, if the performance of the algorithm is to be improved, the number of layers of quantum lines of the variational algorithm needs to be improved, which provides a huge challenge to the reliability of quantum line preparation and is difficult to meet at the present stage; meanwhile, parameters are increased along with the increase of the number of layers, and under a variation optimization framework, an optimizer may encounter the situations of gradient disappearance and the like, and further may converge to a local sub-optimal value. While QAOA may perform better by increasing the number of layers of quantum wires, under the immature conditions of current quantum computing hardware, too deep quantum wires may cause noise to affect more than or offset the benefits of depth, and the overall effect may be worse, and the end result may be that deep wires do not result as well as shallow wires.
In view of this, the embodiments of the present application provide a scheme for mainly determining the initial quantum state of a qubit and the corresponding initial hamiltonian (e.g., denoted as H) B ) The improvement is carried out to expand the original QOA, so that the performance of the QOA under a shallow line can be improved, and the method can be suitable for solving more problems under the shallow line.
The method provided by the embodiment of the application can be used for electronic equipment, such as computer terminals, specifically common computers, quantum computers and the like; or it can be applied to some simulation platforms, such as quantum software simulation platforms, specifically project q or HiQ. It is understood that the system architecture and scenario applicable to the embodiments of the present application can be applied to all systems that can use QAOA algorithms, such as a medium-scale Noisy (NISQ) quantum computer (NISQ quantum computer).
Various embodiments provided by the present application will be described in detail below with reference to the accompanying drawings.
Fig. 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.
Constructing initial quantum states of n quantum bits in the QOA quantum system, the initial quantum states including adjustable parameters, n being an integer greater than 1;
encoding 120 the computational problem as a problem Hamiltonian of the QOA quantum system;
evolving the QOA quantum system from the initial Hamiltonian to a ground state of the problem Hamiltonian 130;
at least a portion of the n qubits are measured 140 to obtain a readout of the QAOA quantum system, and a solution to the computational problem is determined from the readout.
The target quantum state of the quantum system may be a quantum state that is the result of applying a particular quantum circuit to an initial quantum state of the quantum system. For example, the target quantum state may correspond to the ground state of Hamiltonian. A specific quantum circuit represents the overall evolution of the quantum system under Hamiltonian.
In the embodiment of the application, the initial quantum state is adjustable and controllable and is iterative, so that the evolution of the quantum state can be realized by not completely handing over the quantum circuit, and can also be realized by iterating the initial quantum state.
The initial quantum state includes a tunable parameter, and at each iteration, the initial quantum state of each iteration can be determined by the tunable parameter such that the initial quantum state is tunable.
The construction method of the initial quantum state includes at least the following implementation methods.
Implementation 1, a spin gate is used to construct the initial quantum state. Depending on the implementation, the adjustable parameter may be, for example, the angle of rotation of the revolving door.
In implementation mode 2, when some two qubits in the problem are associated, some parameter-containing double-bit gates can be used to construct the relationship in the initial quantum state, and the strength of the relationship can be regulated by using parameters. Based on this implementation, the adjustable parameter may be, for example, a parameter-containing two-bit gate.
Implementation 3, a multi-bit gate is used to construct the initial quantum state. For example, for some initial quantum states that use multi-bit information, such as d-level quantum bits (qudit), a gate U (θ) may be constructed for each qudit to control the expression of one qudit. Based on this implementation, the adjustable parameter may be, for example, θ. Reference is made to the existing description for qudit and qudit, for example, qudit denotes a two-level qubit and qudit denotes a d-level qubit, i.e. the so-called multi-level case.
It should be understood that the above-described several implementations are illustrative and not limiting. Any manner in which the initial quantum state may be made adjustable is suitable for use in the embodiments of the present application. For example, the initial quantum state may be constructed with reference to how VQE constructs the quantum state, and so on.
Next, the above-described embodiment 1 will be mainly described.
Implementation 1, a spin gate is used to construct the initial quantum state.
One possible implementation is to use R Y The gates are rotated to build the initial quantum states.
In constructing the initial quantum state of each qubit, a Y-axis rotating gate R is used yi ) To make the initial quantum state |0>=[1,0] T Rotated by an angle theta about the Y-axis in a Bloch sphere i Such that for n qubits, there is a set of θ = (θ) 12 ,......,θ i ,......θ n ) To build up the initial quantum state. Wherein n qubits correspond to theta i The value may be taken randomly or at regular intervals (for example, the value is taken at equal intervals between (0, pi)), or may be taken in other manners, which are not limited herein. On initialization, n qubits correspond to theta i May be different. In contrast to existing QAOAs, in this implementation the initial quantum state is prepared by replacing the hadamard gate for R Y And rotating the gate, so that the superposition distribution of each qubit can be precisely regulated and controlled.
For example, an iteration may be formed using the previous optimization result as the initial quantum state from which the next optimization begins. That is, the adjustable parameter R Y The rotation angle of the revolving door can determine the initial quantum state of the next optimization starting according to the previous optimization result. For example, a 0-1 state distribution measurement for each qubit can be converted to R Y The rotation angle theta of the revolving door, and then the previous optimization result is used as the next optimization resultForming an iteration by sub-optimizing the initial quantum state at which it begins. Therefore, by adopting the iterative method for updating the initial quantum state for evolution, the result with very high precision can be obtained under the condition of not increasing or even reducing the expected times.
It should be understood that the embodiments of the present application are primarily intended to employ R Y The example of rotating gates to construct initial quantum states is not limited in this regard, and for example, different gate configurations may be used to iteratively construct initial quantum states, such as R x (theta) gates or any similar (R) y (θ)·R x (θ')) may be used.
Alternatively, an initial Hamiltonian H associated with the initial quantum state may be selected B
A possible implementation, H B Is the Hamiltonian of the initial quantum state, or H B The corresponding eigenvectors have a large degree of overlap with the initial quantum states produced.
With the above-mentioned adoption of R Y Example of a rotating gate to construct an initial quantum state, R yi ) After rotation, in the Bloch sphere, it falls substantially in the xz plane, and the corresponding vector is [ cos (θ) i ),sin(θ i )]Constructing the corresponding intrinsic Hamiltonian H B As in equation 3.
Figure RE-GDA0003236434590000091
The initial quantum state and initial Hamiltonian H are described above B . The quantum system suitable for the embodiment of the present application is described below with reference to fig. 2, and for the sake of distinction, the QAOA derivation algorithm proposed in the embodiment of the present application is denoted as GQAOA.
Fig. 2 shows a schematic diagram of a GQAOA quantum system suitable for use in embodiments of the present application.
As shown in fig. 2, the GQAOA quantum system may include a variational parameter module similar to that in the QAOA quantum system. For example, the variation parameter module comprises a first parameter module and a second parameter module, such as2 is shown in
Figure RE-GDA0003236434590000093
And R x,B . Wherein, gamma, beta are variation parameters, gamma belongs to [0, pi ]],β∈[0,π]。
Figure RE-GDA0003236434590000094
Representing a complex matrix-i γ H c The matrix index of (c). Through the variation 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 wire. The target function of the quantum optimization problem can be obtained by substituting the output state of the GQAOA quantum system into the quantum optimization problem, and the target function can be, for example, a loss function (loss function). One possible implementation, the classical part of the GQAOA quantum system, such as the parameter vector β and the parameter vector γ inside the iterative objective function, can be optimized using a variational method or a gradient-based optimization algorithm (e.g., a stochastic gradient algorithm or Adam), and the optimized parameter vectors are fed back to the GQAOA quantum system. And (4) iterating through optimization until an optimal condition is met or a preset parameter threshold value is reached, and recording optimized parameter vectors as beta and gamma. Finally, the GQOA quantum system outputs a state close to the optimal solution of the quantum optimization problem and a corresponding approximate target value. For the variation parameter module, reference may be made to the variation parameter module in the existing QAOA quantum system, and details are not described here.
As shown in FIG. 2, the GQAOA quantum system may include initial quantum states, as noted
Figure RE-GDA0003236434590000092
As previously described, in the embodiments of the present application, the initial quantum state is tunable, that is, θ in the initial quantum state is tunable.
To use R Y The example of constructing the initial quantum state by using the revolving gate provides two optimization schemes, which are denoted as scheme 1 and scheme 2 for distinguishing. Both schemes are described below.
Scheme 1
Scheme 1 may include the following steps.
1) And setting the optimization times k, wherein k is an integer larger than 1 or equal to 1.
In the calculation, k times may be optimized according to the set optimization number k.
2) Determining an initial value of a parameter to be optimized: θ = (θ) 12 ,......,θ i ,......θ n ),β=(β 12 ,......,β i ,……β p ),γ=(γ 12 ,......,γ i ,……γ p ). It can be seen that, in the embodiment of the present application, the parameter to be optimized includes not only the variation parameters γ, β, but also the adjustable parameter θ.
3) Rotating gate R by theta and n Y-axes yi ) From |0>State construction of initial Quantum states and H B
Constructed of H B As shown in equation 3. The constructed initial quantum state can be expressed as equation 4, for example.
Figure RE-GDA0003236434590000101
4) Problem Hamiltonian quantity is constructed from the problem, as denoted by H p . Evolution module U with set layer number p and ith layer B,i (θ,β i )、 U p,ii ) Wherein, β i ∈(β 12 ,......,β i ,......β p ),γ i ∈(γ 12 ,......,γ i ,......γ p ),θ=(θ 12 ,......,θ i ,......θ n )。
As an example, fig. 3 shows a quantum wire diagram suitable for scheme 1. In the p-layer lines, each layer includes an evolution module U, as shown in fig. 3 B (theta, beta) and U p (γ)。
5) And optimizing the k times according to the optimization times k.
In the calculation of this example, the number of parameters is (n +2 p), and considering that one optimization may not be enough to optimize to an optimal value, a possible implementation may set a specific optimization number k (for example, k is greater than 1), and k is optimized according to the optimization number k. Illustratively, the initial value of the parameter for each optimization is the final value of the last optimization of the parameter.
And (5) after k times of optimization, obtaining final optimized values (theta ', beta ', gamma '). By reconstructing (θ ', β ', γ ') as a quantum wire, the measurement will result in the final state.
Scheme 1 is described above and scheme 2 is described below.
Scheme 2
Scheme 2 may include the following steps.
1) And setting the optimization times k.
2) Give a set of numerically different values of θ = (θ) 12 ,......,θ i ,......θ n ). For example, it may be a set of values determined randomly; or, the value may be obtained according to a certain rule, such as being obtained at equal intervals between (0, pi), etc., which is not limited herein.
3) Rotating gate R by theta and n Y-axes yi ) From |0>State building initial quantum states and H B . Constructed of H B As shown in equation 3. The constructed initial quantum state can be expressed as equation 4, for example.
4) Constructing a problem Hamiltonian H from the problem p . Setting the number p of layers and constructing an evolution module U of the ith layer B,i (θ,β i )、 U p,ii ) Wherein, β i ∈(β 1 ,β 2 ,......,β i ,......β p ),γ i ∈(γ 1 ,γ 2 ,......,γ i ,......γ p ),θ=(θ 1 ,θ 2 ,......,θ i ,......θ n )。
As an example, fig. 4 shows a quantum wire diagram suitable for scheme 2. In the p-layer lines, each layer includes an evolution module U, as shown in fig. 4 B,i (θ,β i ) And U p,ii )。
5) (β ', γ') was determined.
In a first possible implementation, the parameter β = (β) may be optimized using a classical computer optimizer 1 ,β 2 ,......β p ),γ=(γ 1 ,γ 2 ,......γ p ) And obtaining optimized parameters (beta ', gamma'). E.g. according to a Cost Function (e.g. Cost Function =)<ψ′ p |H p |ψ′ p >) From the initial quantum state | ψ initial >And optimizing the parameters by using a classical computer optimizer to obtain optimized parameters (beta ', gamma').
A second possible implementation, (β ', γ') is (β, γ) taken last. That is, the last assignment of (β, γ) is taken to (β ', γ').
Alternatively, which of the above implementations is used for determining (β', γ) may be selected according to the number of iterations or the iteration result.
For example, at an iteration number of 1 (e.g., k = 1), (β ', γ') may be determined using the first possible implementation described above, i.e., using a classical computer optimizer to optimize the parameters β, γ; in case the number of iterations is larger than 1, (β ', γ) can be determined using the second possible implementation described above, i.e. taking the last assignment of (β, γ) to (β ', γ ').
For another example, when the difference between the current iteration result and the previous iteration result is smaller than the preset threshold δ, (β ', γ') may be determined using the first possible implementation manner, that is, using a classical computer optimizer to optimize the parameters β, γ; in the case that the difference between the current iteration result and the previous iteration result is greater than or equal to the preset threshold δ, (β ', γ') may be determined using the second possible implementation manner, that is, the last assignment of (β, γ) is taken as (β ', γ').
6) Using (θ, β ', γ'), | ψ 'is constructed' p >For which a 01 probability distribution of each bit is measured and converted into theta', if the probability that the ith qubit gets 0 is P i Then, θ' is as in equation 5.
Figure RE-GDA0003236434590000111
From the measured probability of each bit, θ' is obtained according to the above equation.
7) Checking whether the iteration number reaches a set value k, if so, taking the measurement result of the last iteration as a final result, and if not, (theta, beta ', gamma') is returned to the step 2 and is assigned to (theta, beta, gamma).
For clarity, the pseudo code applicable to the above example is as follows.
In the scheme 2, the single-bit regulation parameter θ is regulated and updated by iterative measurement, and as can be seen from the pseudo code, the requirement of actually remaining parameters (β, γ) on the optimizer in the iterative process is not high, and the optimization is not required to be performed every iteration, so that more computing resources can be saved by adopting the scheme 2 under the condition of achieving the same effect.
The application of the GQAOA provided by the embodiments of the present application to different types of problems is described below.
Problem 1, maximum cut problem.
The maximum cut problem, can be described simply as the following: for a graph consisting of edges connected to points, the points are divided into two subsets of points: the a subset is connected to the B subset, and if there is an edge between the a subset point and the B subset point exactly, such an edge can be denoted as a "cut". The maximum cut problem, i.e. to find the classification method containing the maximum number of cuts.
The following description is made in connection with several different types of maximum segmentation problems.
1. The degree of 4-20 points is the maximum cut problem of the 3 regular graph.
The number of edges connected by a point in a graph is called the degree of the point, and all points in a regular graph (regular graph) have the same degree. As an example, FIG. 5 shows a 20-point degree 3 regular graph.
The following describes an implementation manner of solving the maximum segmentation problem of a 3-degree regular graph with 4-20 points by using the embodiment of the present application.
Generally, the step of solving the problem includes: 1) To the problem goLine coding, problem Hamiltonian of problem construction (i.e. H) p ) (ii) a 2) The objective problem is to solve the problem by the Hamiltonian H p Optimal solution at a specific line depth. In the embodiment of the present application, the problem Hamiltonian H can be solved by GQAOA p Optimal solution at a specific line depth.
Coding under the problem and constructing the problem Hamiltonian H p : as described above, in the max-cut problem, each point can be classified into two categories. Representing a point by a qubit, |0 of the qubit>State indicates that the point belongs to A subset, |1>The state indicates that the point belongs to the B subset. Therefore, when two points on one edge are classified as (| 0)>,|1>) Or (| 1)>,|0>) Then the edge may be written as a cut, otherwise it may not.
Under this problem, the problem Hamiltonian H p The number of cuts in each classification method needs to be calculated. Before this, the role of some operators may be defined. As an example, operator E may be defined 1 、E 0 The following formula.
Figure RE-GDA0003236434590000121
E 1 |0>=0,E 1 |1>=|1>
Equation 7
E 0 |0>=|0>,E 0 |1>=0
Equation 8
Operator E 1 、E 0 Or may be recorded as a decision operator, which can be used to determine whether a state is |1>State or |0>State. If there is an edge (e.g., denoted as { i, j }) between the points i, j, then it can be determined whether the edge is a cut by the following operators:
Figure RE-GDA0003236434590000122
can be found out that p{i,j} |0 i 0 j >=0,H p{i,j} |1 i 1 j >=0,H p{i,j} |1 i 0 j >=|1 i 0 j >,H p{i,j} |0 i 1 j >=|0 i 1 j >. Problem Hamilton quantity H p And judging each Edge { i, j }. Epsilon. Edge in the graph, as shown in a formula 10.
Figure RE-GDA0003236434590000123
Figure RE-GDA0003236434590000131
Problem Hamiltonian H of the build problem p Thereafter, the initial quantum state may be constructed by the method for constructing the initial quantum state as described above, and the initial hamiltonian H may be constructed by the method for constructing the initial hamiltonian as described above B . The solution can then be performed on a quantum computer or simulator according to the procedure described in scheme 1 or scheme 2 until convergence or a termination condition is reached (e.g., a maximum number of optimizations or iterations is reached, or a set threshold is reached, etc.), and then the loop exits.
As an example, FIG. 6 shows a schematic of the max-cut problem for a canonical graph with a different method resolution of 3.
As shown in fig. 6, assuming that QAOA, solution 1 and solution 2 are used, the maximum cut problem of the regular graph with a degree of 3 at 4 to 20 points is solved. The number of optimization times set in scheme 1 is 10, and the number of iterations set in scheme 2 is 25. The regular graph used in fig. 6 may be the result of randomly taking at least 3 different regular graphs for calculation and averaging the results calculated based on the different regular graphs.
As shown in fig. 6, the ordinate represents<C>/C min The abscissa represents the number n of points (n may be 4 to 20), and the graph represents<C>/C min The variation trend along with the number n of the graph points.<C>/C min Can be expressed as formula 11.
Figure RE-GDA0003236434590000132
Wherein, E ideal Represents an ideal cost function, here the number of the largest cuts of the graph, i.e. the cost function for which the correct solution corresponds. E calculation Representing the cost function calculated in the actual simulation.<C>/C min The higher the representative result, the better. As can be seen from fig. 6, QAOA performs better and better as the number of layers p increases for QAOA. If only observe<C>/C min And as the number of the graph points n continues to increase,<C>/C min the values of (a) remain substantially unchanged, giving a solution as if the maximum cut problem of 12 points, 20 points, or even 40 points, where QAOA would all yield a solution as good as the number of layers p = 3. However, the value of the cost function sometimes cannot represent the direct expression of the algorithm, and the probability (also called success rate) of the final state is correctly solved, so that the quality of an algorithm can be more accurately described. Thus, Δ E can be defined:
ΔE=E ideal -E calculation
equation 12
The smaller Δ E, the more illustrative is the solution | ψ' p >And correct solution of | ψ ideal >The closer together, the better the algorithm works. All the points in FIG. 6 converge to Δ E < 10 -1 Corresponding success rate in this case (at | ψ' p >The probability of detecting the correct solution) is already higher than 95%.
As can be seen from fig. 6 for QAOA, although as the number of points n continues to increase,<C>/C min the value of (d) is substantially constant, but in practice, as the number of points n increases, the value of the actual maximum cut E increases ideal Also getting larger, therefore despite<C>/C min The value of Δ E is not changed and the value of Δ E is continuously increased, resulting in a decrease in success rate.
The GQAOA proposed by the embodiment of the present application can be applied toFinding a delta E < 10 after a certain number of iterations or optimization -1 Not only in<C>/C min The comparison of (1) obtains great advantages, and actually, the success rate is also more than 95 percent.
In addition, with the GQAOA proposed by the embodiment of the present application, cost functions do not need to be calculated too many times, and thus, less computing resources can be consumed. Taking scheme 2 proposed in the embodiment of the present application as an example, as shown in fig. 6, n =14 is taken as an example. The abscissa may represent the number of layers p for QAOA and the number of iterations for scenario 2. It can be seen that the solution 2 can achieve the effect achieved by the quantum wires of the deeper layers of QAOA by using one layer of quantum wires (i.e., p = 1), and the cost of constructing the quantum wires is greatly reduced.
In addition, with the GQAOA proposed by the embodiment of the present application, cost functions do not need to be calculated too many times, and thus, fewer 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 an average value is taken. After measurement, the quantum state collapses and is therefore no longer usable. To make a re-measurement, it is generally necessary to re-use the quantum circuit to construct this quantum state. The calculation of the cost function consumes a lot of resources. The resource consumption is expressed by the number of times of calculation of the cost function, and as an example, table 1 shows the number of times of calculation of the cost function corresponding to different algorithms (i.e., QAOA, scheme 1, and scheme 2) in the maximum segmentation problem of the 20-point degree 3 regular graph according to simulation experience.
TABLE 1
Figure RE-GDA0003236434590000141
Described in the QOA column in Table 1 are: the number of calculations required to optimize the parameters (β, γ) to an optimal value in the process of p =1 to 3; scheme 1 depicted in column are: the optimization times and the calculation times needed empirically are reached; scheme 2 described in the column are: the number of iterations is achieved, the number of calculations needed empirically. As can be seen from table 1, the scheme 2 can save more computing resources.
In the following, mainly taking the scheme 2 proposed in the embodiment of the present application as an example, the application of the scheme 2 in different problems is described. The application of scheme 1 in different problems can refer to the application of scheme 2 in different problems, and details are not repeated here.
Alternatively, in solving the problem using the scheme 2, rapid convergence can be achieved by appropriately increasing the number of layers of the quantum wire.
As an example, fig. 7 shows a diagram of Δ E as a function of the number of iterations for the number of layers p =1 and p = 2. Assuming that the maximum cut problem of the 20-point regular graph with the degree of 3 is solved by adopting the scheme 2, the iteration number is set to be 18, and fig. 7 shows the change of Δ E in the iteration process. The two graphs in fig. 7 differ in that the ordinate representing Δ E in one graph is taken in linear coordinates and the ordinate representing Δ E in the other graph is taken in logarithmic coordinates.
The smaller Δ E, the more the solution | ψ 'is calculated' p >And correct solution of | ψ ideal >The closer together, the better the algorithm works. As shown in fig. 7, when p =1, Δ E can approach 10 in about 10 left and right iterations -1 . Comparing the corresponding graphs for 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 wire increases, the number of iterations required to achieve the same accuracy decreases. Therefore, it is possible to achieve rapid convergence by appropriately increasing the number of layers of the quantum wire.
Alternatively, in solving the problem using scheme 2, the parameters (β, γ) need not be optimized each time during the iteration.
In one possible implementation, whether the parameters (β, γ) need to be optimized may be determined according to a preset threshold.
As an example, fig. 8 shows the trend of the parameters (β, γ) in the iterative process. Assuming that the maximum cut problem of the 20-point regular graph with the degree of 3 is solved by adopting the scheme 2, the iteration number is set to be 18. Assuming that the parameter (β, γ) is optimized at each iteration, fig. 8 shows the change of the parameter (β, γ) during the iteration when p =1, and the change of the parameter (β, γ) during the iteration when p = 2.
As can be seen from fig. 8, when p =1 or p =2, the values of the respective parameters basically change within a certain interval, and only a small number of points do not exist within the interval. Therefore, the parameters (β, γ) can be optimized for a fixed number of steps by designing the preset threshold δ. The parameters (β, γ) are optimized in fixed steps, and it is understood that the parameters (β, γ) need not be optimized each time, and the parameters (β, γ) can be optimized again when a certain condition is satisfied, otherwise the parameters (β, γ) used in the previous time are used.
Taking the first and second iterations as an example, the parameters (β, γ) are optimized at the first iteration, and the cost function for the second iteration is found using (β, γ) that is the same as (β, γ) used at the first iteration. If the cost function of the second iteration changes less than δ from the first, then the parameters (β, γ) can be optimized at the next (i.e., third) iteration; if the change value of the cost function of the second iteration compared with the first iteration is larger than or equal to delta, then at the next iteration, the parameters (beta, gamma) are not optimized, and the same parameters (beta, gamma) as the first iteration are still used; if the cost function of the second iteration is smaller than 0 compared with the change value of the last iteration, the iteration is invalidated, and the parameters (beta, gamma) are optimized directly at the beginning of the iteration.
It will be appreciated that at each iteration, a determination may be made as to whether the parameters (β, γ) need to be optimized next time, in a manner similar to the first and second iterations described above.
As an example, fig. 9 shows a schematic diagram of Δ E as a function of the number of iterations when the parameters (β, γ) are optimized for a fixed number of steps.
Comparing the case of p =1 in fig. 9 and fig. 7, the curve corresponding to p =1 in fig. 7 is a simulation result obtained by optimizing the parameters (β, γ) at each iteration; the graph shown in fig. 9 is a simulation result in which the parameters (β, γ) are optimized by a fixed number of steps. The re-optimization point shown in fig. 9 can be understood as a point at which the parameters (β, γ) are re-optimized. As can be seen from a comparison between fig. 9 and fig. 7, optimization of the parameters (β, γ) by a fixed number of steps can achieve the object of obtaining a good effect with a small number of optimizations. The approach shown in fig. 9 may save a significant amount of computing resources compared to fig. 7. If the state construction-measurement process is repeated for many times when the cost function is calculated every time, and the cost function is calculated every time when one-step optimization is performed, the optimization is performed every iteration, and compared with the optimization of the fixed step number, the calculation cost can be greatly reduced by performing the optimization of the fixed step number.
In the above way, it can be seen that the precision requirement for the parameters (β, γ) is not high, so that more choices are possible when choosing the optimizer of the classical computer, e.g. the bayesian optimizer. The Bayesian optimization method can predict the black box function according to a small amount of samples, and has great advantages in the case of few steps compared with the general trend prediction function and the gradient descent function. For optimization with low precision requirement, the Bayesian optimization method can be used for greatly reducing the operation cost.
2. The weight maximum cut problem with a degree of 3 at 4 to 20 points.
The weighted maximum cut problem is to introduce a value of (0, 1) for each edge in the maximum cut problem]Weight of (b), problem Hamiltonian H corresponding thereto p As in equation 13.
Figure RE-GDA0003236434590000151
Wherein, w i,j Representing the weight of the edge i, j. The weight of each edge may be determined in accordance with actual circumstances or may be randomly determined, and is not limited thereto. For example, in the following example, the weight of each edge may be randomly given using a module of numpy.
Determining problem Hamiltonian H corresponding to the problem p Then, the subsequent processing is similar to the processing flow of the maximum segmentation problem of the regular graph with the degree of 3 at 4-20 points, and is not described here again.
The problem of which edge to cut, which edge to cut first, becomes more important because of the different weights of each edge. Taking the case of the solution 2 as an example, assuming that the number of layers p =1, fig. 10 shows a schematic diagram of a simulation result of solving the weight maximum cut problem of the regular graph with the degree of 3 at 4 to 20 points by using the solution 2.
The condition for terminating the iteration may be that a preset number of iterations is reached, or may be other conditions, such as Δ E reaching a certain value. With the condition of iteration termination being Δ E<10 -1 For example, Δ E reaches 10 -1 The iteration is stopped. The regular graph used for simulation in FIG. 10 can be the same regular graph that is randomly generated. In the simulation results mentioned in the embodiments of the present application, the results obtained by repeating the calculation for multiple times, for example, repeating the calculation for 3 times, may show the calculation result of a certain time in the figure, and will not be described in detail below. As can be seen from fig. 10, as the number n of points increases, the number of iterations tends to increase, and the increasing tendency is not significant. Therefore, when the problem of maximum cut with very large weight is faced, by adopting the scheme (such as scheme 2) of the embodiment of the application, higher precision can be achieved in the step number of the polynomial with the lower power of n, such as realizing Delta E<10 -1 The accuracy of (2).
In the above, the maximum cut problem of the regular graph is solved in the above combination of the first problem and the second problem, and in the following, a solution to the maximum cut problem of the general graph is introduced in combination with the third problem.
3. The biggest cut problem of the general graph.
A degree-3 canonical graph, because its degrees are lower and every point degree is the same, so when considering the problem finally, every point is equivalent in basic nature, and searching would be relatively easy. The capability of the search algorithm is tested for general graphs (i.e. irregular graphs), especially graphs with different degrees of each point and higher average degree.
By way of example, fig. 11 shows a schematic diagram of a general diagram suitable for use in embodiments of the present application.
As shown in fig. 11, the average of each of the four graphs is greater than 4. Similarly, the problem is first encoded, and the problem Hamiltonian (i.e., H) of the problem is constructed p ). The initial quantum state may then be constructed using the method of construction of the initial quantum state as described above, using for exampleThe method for constructing the initial Hamiltonian H described above constructs the initial Hamiltonian H B . Taking scheme 2 as an example, the solution can be performed on a quantum computer or a simulator according to the process described in scheme 2 until convergence or an iteration termination condition (such as reaching the maximum number of iterations or reaching a set threshold value) is reached, and then the loop is exited. Taking case of scheme 2 as an example, assuming that the number of layers p =1, fig. 12 shows a schematic diagram of a simulation result of solving the maximum cut problem of the general graph shown in fig. 11 using scheme 2. As shown in fig. 12, the ordinate indicates Δ E, the abscissa indicates the number of iterations, and the four curves shown in fig. 12 correspond to the simulation results of the four graphs ((a), (b), (c), (d)) shown in fig. 11, respectively. As can be seen from fig. 12, the solution (e.g., solution 2) of the embodiment of the present application can efficiently solve the maximum cut problem of the general graph.
The application of the embodiments of the present application to solve the maximum cutback problem is described above in connection with problem 1. It can be seen that, when the scheme of the embodiment of the application is applied to solving the maximum segmentation problem, not only can higher precision be realized, but also certain calculation cost can be reduced, and consumed calculation resources are reduced.
Problem 2, satisfiability problem.
The satisfiability problem can be described simply as the following: for a series of Boolean values and their connectors (and, or, not, etc.) together form an expression, wherein the Boolean value arrangement is called "sentence", the connectors in the expression are fixed, and the Boolean values are variable. If the value obtained in the expression for a sentence is true, it can be called a "condition-satisfying" sentence, and the question of finding such a sentence is called a satisfiability question.
If the sentence of the expression requires no more than 2 at the longest, the problem becomes a 2-satisfiability problem (2-SAT). Taking the 2-SAT example, for such a problem, the Hamiltonian can be given simply the following rule: it is first clear what sentences satisfy the conditions. This definition may be done, for example, in conjunction with the previous diagram in problem 1: each point is a Boolean value in a sentence, and two points on an edge can be considered as two Boolean values in a sentenceIt can be simply defined that, when the length of a sentence is 1 (point), the boolean value is required to be true, the expression is true; for sentence length of 2 (edge), it is true that two Boolean values are required to be equal, then the question Hamilton H corresponding to the 2-SAT question p As can be seen in equation 14.
Figure RE-GDA0003236434590000171
Problem Hamiltonian H of the build problem p Thereafter, the initial quantum state may be constructed by the method for constructing the initial quantum state as described above, and the initial hamiltonian H may be constructed by the method for constructing the initial hamiltonian as described above B . Taking case of scheme 2, the solution can be performed on a quantum computer or a simulator according to the procedure described in scheme 2 until convergence or an iteration termination condition (such as reaching a maximum number of iterations or reaching a set threshold), and then the loop is exited. Taking case of solution 2 as an example, assuming that the number of layers p =1, fig. 13 shows a schematic diagram of a simulation result of solving the 2-SAT problem of the regular graph with a degree of 3 at 4 to 20 points using solution 2. As can be seen from fig. 13, with the solution (e.g., solution 2) of the embodiment of the present application, the satisfiability problem can be solved efficiently.
Problem 3, maximum independent set problem.
Take a regular graph with a degree of 3 as an example. As previously described, each graph is composed of points and edges, with all points constituting a set of points (e.g., denoted as Node) and all edges constituting a set of edges (e.g., denoted as Edge). If there is a certain set of points
Figure RE-GDA0003236434590000175
Then Node 'is called a Node's set of children. If any two points in the set of sub-points do not form an edge, i.e. if no edge is formed between any two points in the set of sub-points
Figure RE-GDA0003236434590000172
Then Node' is called the independent set. The size of the independent set is evaluated by the number of points contained therein. The maximum independent set problem is to find the maximum independent set in a graph.
Coding under the problem and constructing the problem Hamiltonian H p : similar to the max cut problem, except that |0>The state represents that the point does not belong to the independent set, |1>The state represents 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 independent sets, i.e., how many | 1's are output>(ii) a Second, not all states are |1>Are satisfactory, and therefore need to be authenticated with |1>Whether or not the connected points are all |0>。
As an example, the first task can be accomplished by equation 15, i.e. determining how many points in the output result belong to the independent set.
Figure RE-GDA0003236434590000173
The second task needs to be completed explicitly: for { i, j }. Epsilon. Edge, it is necessary to guarantee |0 i 0 j >、|0 i 1 j >、|1 i 0 j >Are all satisfactory, only |1 i 1 j >Is not satisfactory, and therefore, the second task can be completed by equation 16.
Figure RE-GDA0003236434590000174
In practice, the problem of duplicate pruning, i.e. |1 for edges { i, j }, may occur i 1 j >The other edge { i, k } connected to point i after having been subtracted is also |1 i 1 k >Thus point i is subtracted twice. Because the optimal solution does not have one edge and two edges both being |1>So such repeated pruning does not affect the optimal solution.
Coding and constructing problem Hamiltonian H p Thereafter, the starting from the initial Hamiltonian to the problem Hamiltonian H p The ground state of (2) evolves. With respect to initial quantum state and initial Hamiltonian H B Reference may be made to the above description, which is not repeated herein.
Given that a solution for the largest independent set is known, one state can optionally be |0 on the basis of this solution s >Point s of (a) flips it to |1 s >. If the point s is |1 with another state i >If the points i are connected, the points s and the points i are deleted from the independent set, so that the obtained independent set is less than the known maximum independent set point and is not an optimal solution; if the point s is not connected to any of the points in the current independent set, it indicates that the point s should belong to the independent set, which means that the known largest independent set in the hypothesis is not the largest independent set, which violates the above-mentioned hypothesis. It can also be shown that if two points with one edge in the hypothetical solution are both |0>Then both are turned to |1>The resulting solution seems to be the same as the hypothetical solution, but this is also not true, if such an edge is present, then it is stated that there must be a point that can belong to the largest independent set, which in turn is contrary to the hypothesis. From which it can be extrapolated to all cases.
In contrast to QAOA, the solution provided by the embodiments of the present application can be applied to the above-described setup. For QAOA, the above arrangement may cause some problems. Because although the optimal solution is correct and unique, the sub-optimal solution may have the unreasonable situation presented in the above proof that the resulting solution is not an independent set but is the same as the best solution of an independent set, which causes a big problem when the problem becomes large in size. Because the cost of obtaining the optimal solution is very large for practical applications, such as requiring a very large number of measurements or a very deep line depth, obtaining a sub-optimal solution is often a better solution. QAOA is more likely to get a sub-optimal solution when faced with larger scale problems, but if the sub-optimal solution is likely not a reasonable solution to meet the "independent set" requirement, this requires a series of processing leading to an increase in computational cost, or direct modification of the hamilton amount, which further increases the complexity of the single layer line and is costly.
Taking the case of the scheme 2 as an example, assuming that the number of layers p =1, fig. 14 shows a schematic diagram of a simulation result of solving the problem of the maximum independent set of the regular graph with the degree of 3 of 4 to 20 points by using the scheme 2.Some points in fig. 14 where the trend is significant represent points of re-optimization. As can be seen from FIG. 14, with the scheme (e.g., scheme 2) of the embodiment of the present application, Δ E can be achieved with a relatively small number of iterations<10 -1 The success rate reaches over 95 percent, and the optimal solution can be efficiently found.
Question 4, traveler question.
The problem of travelers is a path planning problem, and has a plurality of applications in real life, such as schedule planning, finding the shortest path and the like.
The traveler question, can be described simply as the following: a travel businessman taking the goods as the stock is sent from a home city A of the travel businessman, goes to a plurality of different cities to sell the goods and finally returns to the home, and the distance between the cities is different, so that the travel businessman needs to be helped to plan the shortest path. The problem of the travelers is divided into two types, one type is that all cities are communicated, so that the problem of the travelers becomes a sequencing problem; the other is that cities are not all interconnected, then the problem becomes two: firstly, whether a circle traversing each city exists on the existing map or not is determined, namely, the Hamiltonian problem exists, and secondly, the shortest circle is found. The embodiments of the present application mainly take the first kind of problems as examples for illustration.
The problem of travelers has symmetry, namely, it is unimportant from where to start, as long as two adjacent cities of each city are the same during sorting, the scheme is the same, so that one city can be selected and fixed as a starting point during sorting, and the rest cities are arranged, thereby achieving the purpose of breaking the symmetry. Therefore, the problem of tourists in n cities is solved, and the sequence of n-1 cities can be calculated. Next, explanation will be given mainly on the case of solving the traveler problem of n = 5. Suppose 5 cities are respectively noted as: city No. 0, city No. 1, city No. 2, city No. 3, and city No. 4.
Coding and constructing problem Hamiltonian H under the problem p : assuming that the initial city is the No. 0 city, the rest No. 1-4 cities are actually coded. Suppose thatThe ordering of the sub-bits is used for representing the ordering of cities, the value of the sub-bits is used for representing city numbers, and binary coding is adopted for coding during numbering. For example, |00 01 10 11>The actual represented cities are ranked as: 0. 1, 2, 3, 4, 0, and so on. It can be seen that, at this time, every two qubits represent a city, and these two qubits can be regarded as a qubit, and the number of qubits included in each qubit can be recorded as m, which can be obtained simply, where m is log 2 Rounding up of (n-1).
The hamiltonian has two tasks under this problem. The first task, calculates the length of the entire journey. A decision operator can be defined, as in equation 17.
Figure RE-GDA0003236434590000191
Where k denotes the decimal number l of the bit string to be judged i Is a binary number with k = l 1 2 m-1 +l 2 2 m-2 +…l m . The subscript i represents the ith qudit, and the judgment operator can judge whether a certain qudit is the desired k after being converted into decimal.
The distance can be calculated by equation 18.
Figure RE-GDA0003236434590000192
Since city number 0 is not coded and city number 0 is used as a starting point, the last two calculations are the distance from city number 0 to the first city and the distance from city number n-1 to city number 0.
By the above formula, the calculation of the distance, that is, the first task, can be completed.
The second task prevents unreasonable cities from appearing. In the traveler's problem of n cities, unreasonable cities mean that some cities appear 2 times or more or do not appear, so it is necessary to ensure that the hamilton quantity is the lowest when all cities appear only once, and the part can be realized by constructing a quadratic function, as shown in formula 19.
Figure RE-GDA0003236434590000193
Where c is a set constant, by setting c it is ensured that the final solution converges to the correct solution.
For m<(n-1), and unreasonable and second is the appearance of "non-existent" cities. For example, for the case of 6 cities being counted, the coded cities have 5 cities, the number of each qudit being log 2 Rounding up of 5 (i.e., 3). 3 qubits may represent 8 cities, so non-existing cities (e.g., cities 6, 7, 8) may appear in the solution. For this case, it can be solved by setting the distance of these cities from other cities to be very large.
Problem Hamilton quantity H of traveler problem of n cities constructed based on the analysis p As in equation 20.
H p =H p,count -H p,limit
Equation 20
Taking solution 2 as an example, assuming that the number of layers p =1, fig. 15 shows a schematic diagram of a simulation result of solving the traveler problem in 5 cities by using solution 2. As shown in fig. 15, the ordinate represents Δ E, and the abscissa represents the number of iterations, and it can be seen from fig. 15 that the traveler problem can be solved efficiently by using the solution of the embodiment of the present application (e.g., solution 2).
The application of the embodiments of the present application to different problems is described above in connection with problems 1 to 4.
It will be appreciated that in some of the embodiments described above, R may be passed Y The example of the spin gate for constructing the initial quantum state is illustrated, and is not limited thereto.
The method of the present application is described in detail above with reference to fig. 1 to 15, and the apparatus of the present application is described in detail below with reference to fig. 16 to 18. It should be understood that the description of the apparatus embodiments corresponds to the description of the method embodiments, and therefore, for brevity, details are not repeated here, since the details that are not described in detail may be referred to the above method embodiments.
Fig. 16 is a schematic block diagram of an apparatus provided by an embodiment of the present application. The apparatus 1600 may include a construction module 1610 configured to construct initial quantum states of n qubits in a quantum approximation optimization algorithm QAOA quantum system, the initial quantum states including adjustable parameters, n being an integer greater than 9; an encoding module 1620 configured to encode the computational problem as a problem Hamiltonian of the QOA quantum system; an evolution module 1630 for evolving the QAOA quantum system from the initial hamiltonian to a ground state of the problem hamiltonian; a measurement module 1640 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.
An example, the building block 1610 is specifically configured to build initial quantum states of n quantum bits in a QAOA quantum system through a revolving gate, and the adjustable parameter is a rotation angle of the revolving gate.
As yet another example, the revolving door is R Y Revolving door or R X A door is rotated.
In yet another example, the initial quantum state is represented as:
initial >=∏ i R yi )|0> i or, | ψ initial >=∏ i R yi )|1> i
Wherein, | ψ initial >Representing the initial quantum state, θ i Indicating an adjustable parameter.
In another example, the apparatus further includes an obtaining module, configured to obtain a parameter to be optimized and an optimization number k, where k is an integer greater than 1; the evolution module 1630 is specifically configured to optimize, k times, a parameter to be optimized of the QAOA quantum system from the initial hamiltonian to obtain a ground state of the problem hamiltonian, where a value of an adjustable parameter corresponding to the optimization is determined according to a previous optimization result.
In another example, the apparatus further includes an obtaining module, configured to obtain a parameter to be optimized and an optimization number k, where k is an integer greater than 1; the evolution module 1630 is specifically configured to optimize, k times, a parameter to be optimized from an initial hamiltonian of the QAOA quantum system, and obtain a ground state of the hamiltonian of the problem, where an initial value of the parameter to be optimized at this time is a value of the parameter to be optimized when the previous optimization is completed.
In another example, when the difference between the cost functions corresponding to the previous two optimizations is greater than or equal to the preset threshold, the initial value of the parameter to be optimized at this time is the value of the parameter to be optimized at the end of the previous optimization.
As another example, the initial hamiltonian is a hamiltonian corresponding to the initial quantum state, and the initial hamiltonian is expressed as:
Figure RE-GDA0003236434590000201
wherein H B Representing the initial Hamiltonian, θ i Indicating an adjustable parameter.
The apparatus 1600 may implement steps or flows corresponding to the method embodiments according to the present application, and the apparatus 1600 may include units or modules for executing the method in fig. 1. Also, the units and other operations and/or functions described above in the apparatus 1600 are respectively for realizing the corresponding flow of the method embodiment in fig. 1.
It should be understood that, the specific processes of each unit or module for executing the corresponding steps are already described in detail in the foregoing method embodiments, and are not described herein again for brevity.
It should also be understood that the division of the above units or modules is only an exemplary illustration and is not limiting.
As shown in fig. 17, the present embodiment also provides an apparatus 1700. The apparatus 1700 includes a processor 1710. Optionally, the apparatus 1700 includes one or more processors 1710.
Optionally, as shown in fig. 17, the apparatus 1700 may further include a memory 1720. Optionally, the apparatus 1700 may include one or more memories 1720. The processor 1710 is coupled with the memory 1720, the memory 1720 is used to store computer programs or instructions and/or data, and the processor 1710 is used to execute the computer programs or instructions and/or data stored by the memory 1720, so that the methods in the above method embodiments are performed. Alternatively, the memory 1720 may be integrated with the processor 1710 or may be separate.
Optionally, the apparatus 1700 may further comprise an input device 1730 and an output device 1740. Alternatively, the input device 1730 and the output device 1740 may be integrated together or may be separately provided. Input device 1730 may be used to receive input numeric or character information and to generate relevant signal inputs involved in the methods described above, such as parameters to be optimized input from a classical computer. The output means 1740 may be used for outputting the results or may also comprise some display device to display data or results etc.
Alternatively, the processor 1710, memory 1720, input device 1730, and output device 1740 can be connected by a bus or other means, such as by a bus in fig. 17.
It should be understood that fig. 17 is only an exemplary illustration, and any structure capable of implementing the above method is applicable to the embodiments of the present application.
The embodiment of the application also provides a system 1800. The system 1800 may include, for example, quantum hardware 1810 (e.g., quantum processor, quantum computer, etc.).
Quantum hardware 1810 includes one or more qubit lines 1811 (or alternatively referred to as qubit circuits 1811). Qubit line 1811 may include a qubit that is prepared to an initial state and on which a quantum gate may be applied to operate. Reference is made to the above process examples for the preparation of the initial state. The type of physical implementation of the qubit lines included in the qubit hardware 1810 may vary. For example, in some embodiments, quantum hardware 1810 may comprise superconducting qubit lines (or superconducting qubit line circuits), such as superconducting charge qubit lines, superconducting flux qubit lines, or superconducting phase qubit lines. In general, qubit line 1811 may be frequency tunable.
Quantum hardware 1810 may also optionally include a qubit control device 1812. Qubit control devices 1812 include devices configured to operate on one or more qubit lines 1811. For example, qubit control device 1812 may include hardware to implement quantum logic gates. In practical application, a plurality of quantum bit circuits can form a quantum circuit, a plurality of quantum circuits can be manufactured on one chip, and a plurality of quantum circuits on one chip can share one set of control equipment.
Optionally, system 1800 may also include a classical processor 1820 (e.g., a classical computer). System 1800 can be configured to perform quantum computations in conjunction with classical computations using quantum hardware 1810 and classical processor 1820, such as to perform methods in method embodiments.
Classical processor 1820 may be configured to execute quantum controlled programs. For example, classical processor 1820 is configured to construct control pulses for implementing respective quantum gates. For example, classical processor 1820 can receive data, such as input data, that specifies a particular unitary quantum gate or a sequence of unitary quantum gates. Classical processor 1820 may then design a control pulse, which may be generated by qubit control device 1812 and applied to one or more qubit lines 1811.
Alternatively, classical processor 1820 may include a universal cost function generator 1821 operable to define a universal quantum control cost function for a corresponding quantum gate or sequence of quantum gates.
Optionally, the classical processor 1820 may include one or more optimization toolboxes 1822 that provide maximization or minimization functionality while satisfying constraints, such as solving linear programming, quadratic programming, nonlinear programming, constrained linear least squares, nonlinear equations, and so forth. Illustratively, the optimization toolset 1822 may be used to generate the parameters γ, β to be optimized as described above.
Briefly, a classical processor 1820 may be used in cooperation with quantum hardware 1810 to collectively address some computational issues.
It should be understood that fig. 18 is merely an exemplary illustration and is not strictly limited with respect to the specific structure of quantum hardware 1810 and the specific devices included in system 1800.
Embodiments of the present application also provide a computer-readable storage medium on which computer instructions for implementing the method in the above method embodiments are stored.
Embodiments of the present application also provide a computer program product containing instructions, which when executed by a computer, cause the computer to implement the method in the above method embodiments.
For the explanation and beneficial effects of the related content in any one of the above-mentioned apparatuses, reference may be made to the corresponding method embodiments provided above, and details are not repeated here.
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 computer processor. Or may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off the shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be understood that the memory referred to in the embodiments of the present application may be volatile memory and/or non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM). For example, RAM can be used as external cache memory. By way of example and not limitation, RAM may include the following forms: static Random Access Memory (SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced Synchronous DRAM (ESDRAM), synchronous Link DRAM (SLDRAM), and direct bus RAM (DR RAM).
It should be noted that when the processor is a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, the memory (memory module) may be integrated into the processor.
It should also be noted that the memory described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
Those of ordinary skill in the art will appreciate that the various illustrative elements and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. Furthermore, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to implement the scheme provided by the application.
In addition, functional units in the embodiments of the present application may be integrated into one unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. For example, the computer may be a personal computer, a server, or a network appliance, among others. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. For example, the aforementioned usable medium may include, but is not limited to, various media capable of storing program code, such as a U disk, a removable disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. A method of quantum computation, comprising:
constructing initial quantum states of n quantum bits in a quantum approximation optimization algorithm QOA quantum system, wherein the initial quantum states comprise adjustable parameters, and n is an integer greater than 1;
encoding a computational problem as a problem Hamiltonian of the QOA quantum system;
evolving the QOA quantum system from an initial Hamiltonian amount to a ground state of the problem Hamiltonian amount;
measuring at least a portion of the n qubits to obtain a readout of the QOA quantum system, and determining a solution to the computational problem from the readout.
2. The method of claim 1, wherein constructing the initial quantum states of the n qubits in a QAOA quantum system comprises:
constructing initial quantum states of the n quantum bits in the QOA quantum system through a revolving gate, the adjustable parameter being a rotation angle of the revolving gate.
3. The method of claim 2, wherein the turnstile is R Y Revolving doors or R X A revolving door.
4. A method according to claim 2 or 3, wherein the initial quantum state is represented as:
initial >=∏ i R yi )|0> i or, | ψ initial >=∏ i R yi )|1> i
Wherein, | ψ initial >Representing said initial quantum state, θ i Representing the adjustable parameter.
5. The method of any of claims 1 to 4, wherein said evolving said QOA quantum system from said initial Hamiltonian to a ground state of said problem Hamiltonian comprises:
obtaining a parameter to be optimized and an optimization number k, wherein k is an integer larger than 1;
optimizing the QOA quantum system from the initial Hamiltonian for k times on the parameter to be optimized to obtain the ground state of the problem Hamiltonian,
and the value of the adjustable parameter corresponding to the optimization is determined according to the previous optimization result.
6. The method of any of claims 1 to 5, wherein said evolving said QOA quantum system from said initial Hamiltonian to a ground state of said problem Hamiltonian comprises:
obtaining a parameter to be optimized and an optimization number k, wherein k is an integer larger than 1;
optimizing the QOA quantum system from the initial Hamiltonian for k times on the parameter to be optimized to obtain the ground state of the problem Hamiltonian,
and the initial value of the parameter to be optimized in the current optimization is the value of the parameter to be optimized when the previous optimization is finished.
7. The method of claim 6,
and under the condition that the difference value between the cost functions corresponding to the previous two times of optimization is greater than or equal to a preset threshold value, the initial value of the parameter to be optimized at the current time is the value of the parameter to be optimized when the previous time of optimization is finished.
8. The method of any of claims 1-7, wherein the initial Hamiltonian is a Hamiltonian corresponding to the initial quantum state, and wherein the initial Hamiltonian is represented as:
Figure FDA0003112023360000011
wherein H B Representing said initial Hamiltonian, θ i Representing the adjustable parameter.
9. A quantum computing apparatus, comprising:
a construction module for constructing initial quantum states of n quantum bits in a quantum approximation optimization algorithm QOA quantum system, the initial quantum states including adjustable parameters, n being an integer greater than 9;
an encoding module for encoding a computational problem into a problem Hamiltonian of the QOA quantum system;
an evolution module for evolving the QOA quantum system from an initial Hamiltonian to a ground state of the problem Hamiltonian;
a measurement module for measuring at least a portion of the n qubits to obtain a readout of the QOA quantum system and determining a solution to the computational problem from the readout.
10. The apparatus of claim 9,
the building module is specifically configured to build initial quantum states of the n qubits in the QAOA quantum system through a revolving gate, and the adjustable parameter is a rotation angle of the revolving gate.
11. The apparatus of claim 10, wherein the apparatus is a portable deviceIn that, the revolving door is R Y Revolving door or R X A revolving door.
12. The apparatus of claim 10 or 11, wherein the initial quantum state is represented as:
initial >=∏ i R yi )|0〉 i or, | ψ initial >=∏ i R yi )|1> i
Wherein, | ψ initial >Representing said initial quantum state, θ i Representing the adjustable parameter.
13. The apparatus of any one of claims 9 to 12, further comprising an acquisition module,
the acquisition module is used for acquiring parameters to be optimized and the optimization times k, wherein k is an integer larger than 1;
the evolution module is specifically configured to optimize the QOA quantum system from the initial Hamiltonian to the parameter to be optimized for k times to obtain a ground state of the problem Hamiltonian,
and the value of the adjustable parameter corresponding to the optimization is determined according to the previous optimization result.
14. The apparatus of any one of claims 9 to 13, further comprising an acquisition module,
the acquisition module is used for acquiring parameters to be optimized and the optimization times k, wherein k is an integer larger than 1;
the evolution module is specifically configured to optimize the QOA quantum system from the initial Hamiltonian to the parameter to be optimized for k times to obtain a ground state of the problem Hamiltonian,
and the initial value of the parameter to be optimized in the current optimization is the value of the parameter to be optimized when the previous optimization is finished.
15. The apparatus of claim 14,
and under the condition that the difference value between the cost functions corresponding to the previous two times of optimization is greater than or equal to a preset threshold value, the initial value of the parameter to be optimized at the current time is the value of the parameter to be optimized when the previous time of optimization is finished.
16. The apparatus of any of claims 9-15, wherein the initial hamiltonian is a hamiltonian corresponding to the initial quantum state, and wherein the initial hamiltonian is represented as:
Figure FDA0003112023360000021
wherein H B Representing said initial Hamiltonian, θ i Representing the adjustable parameter.
17. A quantum computer, comprising: a qubit line and a control device for the qubit,
a control device for the qubit for operating on the qubit line in order to implement the method of any one of claims 1 to 8.
18. A computer-readable storage medium, having stored thereon a computer program or instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 8.
CN202110654428.8A 2021-06-11 2021-06-11 Method and related apparatus for quantum computing Pending CN115545210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110654428.8A CN115545210A (en) 2021-06-11 2021-06-11 Method and related apparatus for quantum computing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110654428.8A CN115545210A (en) 2021-06-11 2021-06-11 Method and related apparatus for quantum computing

Publications (1)

Publication Number Publication Date
CN115545210A true CN115545210A (en) 2022-12-30

Family

ID=84705583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110654428.8A Pending CN115545210A (en) 2021-06-11 2021-06-11 Method and related apparatus for quantum computing

Country Status (1)

Country Link
CN (1) CN115545210A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116050528A (en) * 2023-02-07 2023-05-02 合肥本源量子计算科技有限责任公司 Method and device for constructing amplitude amplification circuit, medium and electronic device
CN118014094A (en) * 2024-04-09 2024-05-10 国开启科量子技术(安徽)有限公司 Quantum computing method, quantum circuit, device and medium for determining function classification

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116050528A (en) * 2023-02-07 2023-05-02 合肥本源量子计算科技有限责任公司 Method and device for constructing amplitude amplification circuit, medium and electronic device
CN118014094A (en) * 2024-04-09 2024-05-10 国开启科量子技术(安徽)有限公司 Quantum computing method, quantum circuit, device and medium for determining function classification

Similar Documents

Publication Publication Date Title
US10664762B2 (en) Cost function deformation in quantum approximate optimization
Cerezo et al. Variational quantum algorithms
Gentile et al. Learning models of quantum systems from experiments
Zhan et al. A fast kriging-assisted evolutionary algorithm based on incremental learning
d'Aspremont et al. First-order methods for sparse covariance selection
Kroer et al. Faster first-order methods for extensive-form game solving
Anshu et al. A survey on the complexity of learning quantum states
US10824373B2 (en) Effective quantum RAM architecture for quantum database
Henzinger et al. Almost tight error bounds on differentially private continual counting
CN115545210A (en) Method and related apparatus for quantum computing
Abbas et al. On quantum ensembles of quantum classifiers
Bhattacharyya et al. Community detection in networks using graph distance
Zhang et al. PS-Tree: A piecewise symbolic regression tree
US20230054391A1 (en) Calibration of quantum measurement device
Nüsken et al. Interpolating between BSDEs and PINNs: deep learning for elliptic and parabolic boundary value problems
CN114565021A (en) Financial asset pricing method, system and storage medium based on quantum circulation neural network
de Franca et al. Interaction-transformation symbolic regression with extreme learning machine
Cherrat et al. Quantum reinforcement learning via policy iteration
Dias et al. Diffusive operator spreading for random unitary free fermion circuits
US11699089B2 (en) Quantum recommendation system
Yoganathan A condition under which classical simulability implies efficient state learnability
Davis An $ O (n\log (n)) $ Algorithm for Projecting Onto the Ordered Weighted $\ell_1 $ Norm Ball
CN115329971A (en) Method and apparatus for eliminating amplitude damping noise, electronic device, and medium
Necoara et al. Minibatch stochastic subgradient-based projection algorithms for feasibility problems with convex inequalities
Dinh et al. The shape of the one-dimensional phylogenetic likelihood function

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination