Enhanced Framework of Quantum Approximate Optimization Algorithm and Its Parameter Setting Strategy
EEnhanced Framework of Quantum Approximate OptimizationAlgorithm and Its Parameter Setting Strategy
Mingyou Wu , Zhihao Liu , and Hanwu Chen School of Computer Science and Engineering, Southeast University, Nanjing 211189, China Key Laboratory of Computer Network and Information Integration (Southeast University), Ministry of Education,Nanjing, 211189, China
December 18, 2020
Abstract
An enhanced framework of quantum approximate optimization algorithm (QAOA) is introduced andthe parameter setting strategies are analyzed. The enhanced QAOA is as effective as the QAOA butexhibits greater computing power and flexibility, and with proper parameters, it can arrive at the optimalsolution faster. Moreover, based on the analysis of this framework, strategies are provided to select theparameter at a cost of O (1). Simulations are conducted on randomly generated 3-satisfiability (3-SAT)of scale of 20 qubits and the optimal solution can be found with a high probability in iterations muchless than O ( √ N ) In 2014, Farhi et al . [1] proposed a quantum classical hybrid variational method, the quantum approximateoptimization algorithm (QAOA) for combinatorial optimization problems (COP). The QAOA defines theproblem Hamiltonian H C and use the transverse field as the mix Hamiltonian H B . These two Hamiltoniansare alternately applied to the quantum state and the evolution time γ and β are introduced as parameters.With proper parameters, the expectation of the quantum state gradually grows and after enough iterations,the optimal solution will be obtained.Recently, Farhi et al . [2] pointed out that the QAOA need to see the whole graph and used the QAOA+ asan example. The QAOA+ adopts the information of graph structure into the problem Hamiltonian insteadof preparing a specific initial state. Based on the comparison between QAOA and QAOA+ on maximumindependent set (MIS), an enhanced framework of QAOA is proposed, which is effective and more flexible.Besides, the complexity of the enhanced QAOA is analyzed and a parameter initial strategy of costs of O (1) is provided. This strategy naturally applies to 3-satisfiability (3SAT) and in a single simulation thesatisfiability can be determined with a probability around 50% for O ( n log m ) iterations, where m is thenumber of constraints valued in O ( n ). For general NP-complete problem, a reduction to 3-SAT is alwaysavailable, and strategies are advised to adjust the parameters.The reminder of this paper is o rganized as follows. Section 2 briefly reviews the QAOA and QAOA+ forMIS. In Section 3, a basis is introduced and developed on this, the enhanced QAOA is proposed and ana-lyzed. Section 4 presents the practical meaning and the setting strategies of parameters, and correspondingsimulations are conducted. Finally, Section 5 concludes this paper.1 a r X i v : . [ qu a n t - ph ] D ec Review of the QAOA
For a combinatorial optimization problem of scale n with m clauses, the objective function can be expressedas follows: C ( z ) = m (cid:88) α =1 C α ( z ) , (1)where string z ∈ { , } n and C α stands for a certain clause α , C α = (cid:26) z satisfies the clause α, z does not satisfy. (2)COP asks for a string z that maximizes the objective function C ( z ). And the approximate optimizationdemands a string z for which C ( z ) is close to the optimal of C .In the QAOA, the initial state is usually the equal superposition state | s (cid:105) = 1 √ n (cid:88) j | j (cid:105) . (3)And the evolution operators of QAOA is a series of operators interleaved with U C ( γ ) = e − iγH C and U B ( γ ) = e − iβH B . γ and β are parameters between 0 and 2 π and varies during the procedure of QAOA. H C is theproblem Hamiltonian which is determined by the problem as H C = diag { C ( z i ) } , (4)and H B is the mix Hamiltonian, which usually is the transverse field written as H B = (cid:88) j σ xj . (5)For p iterations the system state is | z p (cid:105) = U B ( β p ) U C ( γ p ) . . . U B ( β ) U C ( γ ) | s (cid:105) , (6)and here p is call the depth of QAOA. | z p (cid:105) can also be denoted as | γ, β (cid:105) , and the expectation of state | z p (cid:105) on H C is F p ( γ, β ) = (cid:104) γ, β | H C | γ, β (cid:105) . (7) F p ( γ, β ) can be used to select the parameters such that F p − ( γ, β ) < F p ( γ, β ).The maximum independent set (MIS) problem asks for the independent set of the largest possible sizefor the given graph. Farhi [1] first applies the QAOA to the MIS, and use C ( z ) = (cid:88) j z j (8)as the objective function. This definition only considers the number of vertices in each solution, so a special-ized initial state is required, and the quantum adiabatic algorithm is applied to prepare the superpositionof all feasible solutions. Recently Farhi [2] suggested that the QAOA should consider the whole graph, andput forward the QAOA+ with a new objective function C + ( z ) = (cid:88) j z j − (cid:88) u,v A u,v z u z v , (9)where A u,v is the element of the adjacent matrix of given graph. This objective function considers thebasic structure of the graph and has a more powerful computing power, which can handle the MIS problemwithout the help of an appended initial state preparation.2 The enhanced framework of QAOA
Considering the problem Hamiltonians of QAOA and QAOA+ for MIS, the detailed expression is H C = (cid:80) k P k ,H C + = (cid:80) k P k − (cid:80) u,v A u,v P u,v , (10)where P k denotes operator P = diag { , } on the k -th qubit, P u,v denotes P on the u -th and v -th qubits,and A u,v is the element of the adjacent matrix of graph. Both the problem Hamiltonians can be expressedas a linear combination of projection operators. Expand these projection operators to p j = ⊗ ni =1 ( P i ) j i = ( P ) j i ⊗ ( P ) j ⊗ . . . ⊗ ( P n ) j n . (11)Let Z i denote Z on the i -th qubit. The Walsh operator [3] on n qubits is w j = ⊗ ni =1 ( Z i ) j i = ( Z ) j i ⊗ ( Z ) j ⊗ . . . ⊗ ( Z n ) j n . (12)Actually, Z = I − P i , and w j can be represented by p j . w j is an orthonormal basis of dialog matrixes ofdimension 2 n and e − iθ j w j can be implemented by ( n ) basic gates [3]. Obviously, p j also consists a basis andthe implementation cost of e − iγ j p j is O ( n ) [4].Therefore, the unitary operator of any problem Hamiltonian can be rewritten as U C ( γ ) = e − i (cid:80) N − j =0 γp j . (13)Replacing γ in Eq. (13) with γ j , a new unitary operator can be written as U Ce ( γ ) = e − i (cid:80) N − j =0 γ j p j . (14)This is the original idea and basic form of the enhanced QAOA. The evolution operator e − iγH C is replacedby a sequence of control evolution gates that CR j ( γ ) = e − iγ j p j , (15)where if the x -th qubit is a control qubit, then j x = 1. In fact, for the Hamiltonian of majority of COP onlya few bases in { p j } are used. Therefore, the layer of QAOA is defined as the maximum of d ( j ) of all controlevolution gates, where d ( j ) = n (cid:88) x =1 j x (16)is the number of control bits.Denote COP with constraints that engage no more than k variables as COP k . Without an externcomputing power or extra information, a k -layer QAOA can solve COP k but cannot deal with COP k +1 .MIS after specific initial state preparation is in COP . In fact, the evolution operators of 1-layer QAOA arelocal on a single qubit and the entanglement is invariable. It means the 1-layer QAOA does not provide anycomputation power, but only present the computation basis closest to the optimal solution. NP-completeproblem and COP can reduce to each other in polynomial time. In fact, max-cut is in COP and everyproblem in COP can be reduced as a max-cut problem on a weighted graph with loop. COP k is the NP-optimization problem for a constant k such as MIS, 3SAT and E3Lin2 [5]. COP n is the hardest COP ofscale n . In classical computer, it cost exponentially to evaluate the quality of a solution, and in quantumcomputer, the cost of the implementation of the U C is also exponential.It is clear that the enhanced QAOA has a similar framework to QAOA with the same implementationcost, and the parameter γγγ = ( γ j ) enables the Hamiltonian to vary in a larger space which would result in3n increase of the computation capability. For example, consider a simple comparison between the standardQAOA and the enhanced QAOA of 1-layer for the MIS, and the H C can be respectively written as H Cs = (cid:80) j P j ,H Cg = (cid:80) j γ j P j . (17)Because of the lack of control evolution gates that d ( l ) = 2, the 1-layer standard QAOA of n qubits cannotrepresent majority of the constraints and is unable to deal with MIS of scale n . As for the enhanced QAOA,with specific selected parameters γγγ , the enhanced QAOA can solve MIS by increasing the parameters ofthe bases that contain vertices in maximum independent set and decreasing the others. For this case, thecomputation capability of the 1-layer enhanced QAOA mainly comes from the parameters setting, i. e., theparameters optimizer, and the correctness mainly depends on the optimizer. The interface of the enhancedQAOA available for classical computing power increases and so is the computation capability. But whenapplying the enhanced QAOA to certain problem, the quantum computation capability ought to be themain component to execute the calculation task, and the classical computer provides assistance, so the layershould be at least as the same as the standard QAOA.For a fixed layer, the enhanced QAOA can arrive at the target state faster than the standard QAOA.Obviously, the enhanced QAOA cannot be slower than the standard QAOA. For convenience, the parameters γγγ are decomposed into two parts as γγγ = γ s γ r γ r γ r , where γ s is the global phase, and γ r γ r γ r is the relative phase. Theparameters γ r γ r γ r of the standard QAOA are determined by the constraints and are static during the evolutionof algorithm. Use contradiction and suppose the enhanced QAOA is as fast as the standard QAOA. Whenoptimizing the expectation F ( γ s , γ r γ r γ r ), F m ( γ s ) should be equal to F m ( γ s , γ r γ r γ r ), that is ∂F ( γ s , γ r γ r γ r ) ∂γ r γ r γ r = ∂F ( γ s ) ∂γ r γ r γ r = 0 , (18)that is, γ r γ r γ r is independent to F ( γ s , γ r γ r γ r ). This is obviously wrong, such as the 1-layer standard and enhancedQAOA on MIS, and the latter can arrive a larger expectation. Consider the normalization of γ r γ r γ r . Firstly, the Grover Hamiltonian diag { , , . . . , } [6] applied as a search ofQAOA [7] should be normalized and so is the multi-solutions case. And with γ s = π , U ( H C , γγγ ) can best dis-tinguish the optimal and non-optimal solutions. For general case, the best normalization is linearly mappingthe goal values of solutions from [ C min , C max ] to [0 , C max cannot be directly normalized to 1because the value of C max is the algorithm target. Instead, C lim = (cid:80) j γ r,j is adopted and C lim ≥ C max .Therefore, (cid:80) j γ r,j should be normalized to 1 and when negative constraints are occupied, (cid:80) j | γ r,j | = 1.This normalization strategy naturally applies to satisfiability problem. Using 3-SAT as example, problemis satisfiable if C lim = C max , that is, the maximum of the eigenvalue of normalized Hamiltonian is 1. Notingthe periodicity of e − iθ , with parameter γ s = (2 t + 1) π and any t ∈ z , the effective phase shift of optimalsolution is always π , but that of the non-optimal solution varies with the change of t . By modifying t , theangle between the optimal and non-optimal solution would increase. As for unsatisfiable case, the larger thedifference between C lim and C max , the smaller the probability to find the solution of C max . The CTQWpart actually has the form of e − iβH B = He − iβH Z H, (19)where H Z = n − (cid:88) m =0 Z m (20)and Z m is Z on the m -th qubit. Therefore, 1 /n is a good parameter for β because the eigenvalue of H Z canbe normalized to [ − , γ , a linear increase parameter is applied. Here the number of iterations is4
20 40 60 80 100 120 140 160Number of iterations10 P r o b a b ili t y o f t a r g e t Satisfied casesUnsatified cases (a) Case with 2M constraints P r o b a b ili t y o f t a r g e t Satisfied casesUnsatified cases (b) Case with 4M constraints
Figure 1: The average probability of the target computational basis during iterations.Table 1: The average of the maximum probability of target during iterations.constraints 2 M &satisfied 2 M &unsatisfied 4 M &satisfied 4 M &unsatisfiedmax probability 0.4392 0.0018 0.4747 0.0003set to be n log m/ √ t is log m , namely, for p -depth QAOA, γ = (cid:32)(cid:36) √ pn (cid:37) + 1 (cid:33) π, (21)where 1 ≤ p ≤ n log m/ √ M and 4 M and both satisfied and unsatisfied cases are considered, where M = C . The numberof repeated experiments is 50 times for each case. In fact, a fewer number iterations is also feasible as n log (2 m/n ) / √ t is log (2 mn ). The simulation results are shown in Figure 2 andTable 2. The number of constraints values 0 . M , M , 2 M and 4 M and only satisfied case are presented.However, for general COP, a satisfiable solution is very rare, this is, C max is generally much smaller than C lim . Noting the difference ∆ C = | C lim − C max | , with the growth of the scale of problem, the depth requiredto arrive the optimal solution increases, and the influence of ∆ C on optimization might become greater andunpredictable. Therefore, specific strategies are required to adjust the Hamiltonian. In fact, the range of thesolution of a specific COP can be obtained by probability theory and combinatorial Mathematics, and can beadopted as prior knowledge. By multiplying a specific factor which can be gradually adjusted, the maximumof the eigenvalue of problem Hamiltonian can be approximately normalized to 1. Besides, the measurementresult e j ( z ) = (cid:104) z | p j | z (cid:105) of repeat experiments presents the importance of p j and can be used to adjust theparameters γ r,j . And the normalized (cid:8) e αj γ r,j (cid:9) can be adopted as the parameters of next experiment, where α is the adjusting factor and α ≥ . M M M M max probability 0.4815 0.5367 0.5859 0.59215
10 20 30 40 50 60 70 80Number of iterations10 P r o b a b ili t y o f t a r g e t (a) Case with 0.5M constraints P r o b a b ili t y o f t a r g e t (b) Case with M constraints P r o b a b ili t y o f t a r g e t (c) Case with 2M constraints P r o b a b ili t y o f t a r g e t (d) Case with 4M constraints Figure 2: The average probability of the target computational basis for a decreased iterations.
The enhanced QAOA introduced in this paper inherits the properties of the QAOA without any extra cost,and moreover, exhibits many superiorities. The parameters γ and β of the standard QAOA is actually theevolution time and the problem Hamiltonian is static during the iterations. However, with the additionalparameters γ r γ r γ r , the enhanced QAOA can adjust the problem Hamiltonian during algorithm process, whichcan reduce the complexity and provides interface for classical computing power. Furthermore, the extracomputation capability is adjustable and offers more options for researchers. This paper defines the layerof the QAOA that determines the upper bound of the implementation complexity, and presents a series ofproblems COP k that reflect the upper bound of the computability of the QAOA of certain layer. Meanwhile,the QAOA of different layers also provides reference models for the corresponding problems. QAOA providesa scheme combining quantum and classical computing power, while the enhanced QAOA presents a new viewfor the architecture of the QAOA, and would be useful to reconsider and organize the previous work.This enhanced framework of the QAOA more clearly shows the piratical meaning of the parameters andbased on this, parameter setting strategies of the enhanced QAOA are proposed. The simulation shows itsefficiency on 3-SAT, but limited by the simulation complexity of quantum system, only cases with 20 qubitsare analysis. Further experimental and theoretical analysis are urgently required. Besides, the enhancedQAOA reveals other issues like the analysis of the alteration of Hamiltonian under certain parameter settingstrategy. Nevertheless, the enhanced QAOA does not show advantage on matters like the depth analysis ofQAOA, the standard QAOA is still needed in some theoretical derivation.6 eferences [1] Edward Farhi, Jeffrey Goldstone and Sam Gutmann, A Quantum Approximate Optimization Algorithm, arXiv, quant-ph , 1411.4028 (2014).[2] Edward Farhi, David Gamarnik and Sam Gutmann, The Quantum Approximate Optimization Algo-rithm Needs to See the Whole Graph: A Typical Case, arXiv, quant-ph , 2004.09002, (2020).[3] Jonathan Welch, Daniel Greenbaum, Sarah Mostame and Alan Aspuru-Guzik, Efficient quantum circuitsfor diagonal unitaries without ancillas, New J. Phys. Science ChinaPhysics, Mechanics & Astronomy , , 040314 (2018)[5] Edward Farhi and Jeffrey Goldstone and Sam Gutmann, A Quantum Approximate Optimization Algo-rithm Applied to a Bounded Occurrence Constraint Problem, arXiv, quant-ph , 1412.6062 (2015).[6] Lov K. Grover, Quantum Mechanics Helps in Searching for a Needle in a Haystack, Physical ReviewLetters , p. 325 (1997).[7] Zhang Jiang, Eleanor G. Rieffel and Zhihui Wang, Near-optimal quantum circuit for Grover’s unstruc-tured search using a transverse field, Physical Review A ,95