Classical Variational Simulation of the Quantum Approximate Optimization Algorithm ✉ Matija Medvidović 1,2 and Giuseppe Carleo3
Total Page:16
File Type:pdf, Size:1020Kb
www.nature.com/npjqi ARTICLE OPEN Classical variational simulation of the Quantum Approximate Optimization Algorithm ✉ Matija Medvidović 1,2 and Giuseppe Carleo3 A key open question in quantum computing is whether quantum algorithms can potentially offer a significant advantage over classical algorithms for tasks of practical interest. Understanding the limits of classical computing in simulating quantum systems is an important component of addressing this question. We introduce a method to simulate layered quantum circuits consisting of parametrized gates, an architecture behind many variational quantum algorithms suitable for near-term quantum computers. A neural-network parametrization of the many-qubit wavefunction is used, focusing on states relevant for the Quantum Approximate Optimization Algorithm (QAOA). For the largest circuits simulated, we reach 54 qubits at 4 QAOA layers, approximately implementing 324 RZZ gates and 216 RX gates without requiring large-scale computational resources. For larger systems, our approach can be used to provide accurate QAOA simulations at previously unexplored parameter values and to benchmark the next generation of experiments in the Noisy Intermediate-Scale Quantum (NISQ) era. npj Quantum Information (2021) 7:101 ; https://doi.org/10.1038/s41534-021-00440-z 1234567890():,; INTRODUCTION perform a variational parameter sweep on a 1D cut of the The past decade has seen a fast development of quantum parameter space. The method is contrasted with state-of-the-art technologies and the achievement of an unprecedented level of classical simulations based on low-rank Clifford group decom- 26 control in quantum hardware1, clearing the way for demonstra- positions , whose complexity is exponential in the number of 29 tions of quantum computing applications for practical uses. non-Clifford gates as well as tensor-based approaches . Instead, However, near-term applications face some of the limitations limitations of the approach are discussed in terms of the QAOA intrinsic to the current generation of quantum computers, often parameter space and its relation to different initializations of the referred to as Noisy Intermediate-Scale Quantum (NISQ) hard- stochastic optimization method used in this work. ware2. In this regime, a limited qubit count and absence of quantum error correction constrain the kind of applications that RESULTS can be successfully realized. Despite these limitations, hybrid classical-quantum algorithms3–6 have been identified as the ideal The Quantum Approximate Optimization Algorithm candidates to assess the first possible advantage of quantum The Quantum Approximate Optimization Algorithm (QAOA) is a computing in practical applications7–10. variational quantum algorithm for approximately solving discrete The Quantum Approximate Optimization Algorithm (QAOA)5 is combinatorial optimization problems. Since its inception in the 5,12 a notable example of variational quantum algorithm with seminal work of Farhi, Goldstone, and Gutmann , QAOA has been applied to Maximum Cut (Max-Cut) problems. With prospects of quantum speedup on near-term devices. Devised 30 to take advantage of quantum effects to solve combinatorial competing classical algorithms offering exact performance — optimization problems, it has been extensively theoretically bounds for all graphs, an open question remains can QAOA 11–16 perform better by increasing the number of free parameters? characterized , and also experimentally realized on state-of- 31,32 the-art NISQ hardware17. While the general presence of quantum In this work, we study a quadratic cost function associated = advantage in quantum optimization algorithms remains an open with a Max-Cut problem. If we consider a graph G (V, E) with – fi question18 21, QAOA has gained popularity as a quantum edges E and vertices V, the Max-Cut of the graph G is de ned by 22–25 the following operator: hardware benchmark . As its desired output is essentially a X classical state, the question arises whether a specialized classical C¼ w Z Z; fi 26 ij i j (1) algorithm can ef ciently simulate it , at least near the variational i;j2E optimum. In this paper, we use a variational parametrization of the many-qubit state based on Neural Network Quantum States where wij are the edge weights and Zi are Pauli operators. The (NQS)27 and extend the method of ref. 28 to simulate QAOA. This classical bitstring B that minimizes hjCBB jiis the graph partition approach trades the need for exact brute force exponentially with the maximum cut. QAOA approximates such a quantum state fi scaling classical simulation with an approximate, yet accurate, through a quantum circuit of prede ned depth p: classical variational description of the quantum circuit. In turn, we γ; β β γ β γ ; ji¼UBð pÞUCð pÞÁÁÁUBð 1ÞUCð 1Þþji (2) obtain an heuristic classical method that can significantly expand the possibilities to simulate NISQ-era quantum optimization where jiþ is a symmetric superposition of all computational basis N N algorithms. We successfully simulate the Max-Cut QAOA cir- states: jiþ ¼ H ji0 for N qubits. The set of 2p real numbers γi 5,11,17 cuit for 54 qubits at depth p = 4 and use the method to and βi for i = 1…p define the variational parameters to be 1Center for Computational Quantum Physics, Flatiron Institute, New York, NY, USA. 2Department of Physics, Columbia University, New York, NY, USA. 3Institute of Physics, École ✉ Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland. email: giuseppe.carleo@epfl.ch Published in partnership with The University of New South Wales M. Medvidović and G. Carleo 2 optimized over by an external classical optimizer. The unitary global phase. The replacement rules read: fi β Qgates de ning the parametrized quantum circuit read UBð Þ¼ W 2 ϕ ; W 2 ϕ β γ ic ¼À Að Þ jc ¼ Að Þ eÀi Xi and U ðγÞ¼eÀi C. (7) i2V C a ! a þAðϕÞ; a ! a ÀAðϕÞ; Optimal variational parameters γ and β are then found through i i j ÀÁj an outer-loop classical optimizer of the following quantum where AðϕÞ = Arccosh eiϕ and C = 2. Derivations of replace- expectation value: ment rules for these and other common one and two-qubit gates can be found in Sec. Methods. Cðγ; βÞ¼hjCγ; β jiγ; β (3) Not all gates can be applied through solving Eq. (6). Most notably, gates thatQ form superpositions belong in this category, β ItP is known that, for QAOA cost operators of the general form including U ðβÞ¼ eÀi Xi required for running QAOA. This ; ¼ ; B i C¼ kCkðZ1 ZNÞ, the optimal value asymptotically con- happens simply because a linear combination of two or more verges to the minimum value: RBMs cannot be exactly represented by a single new RBM through a simple variational parameter change. To simulate those gates, lim Cp ¼ minhjCB jiB (4) p!1 B we employ a variational stochastic optimization scheme. We take Dðϕ; ψÞ¼1 À Fðϕ; ψÞ as a measure of distance where Cp is the optimal cost value at QAOA depth p and B are between two arbitrary quantum states jiϕ and jiψ , where F(ϕ, ψ) classical bit strings. With modern simulations and implementa- is the usual quantum fidelity: tions still being restricted to lower p-values, it is unclear how large jhϕjψij2 p has to get in practice before QAOA becomes comparable with its Fðϕ; ψÞ¼ : (8) classical competition. hϕjϕihψjψi In this work we consider 3-regular graphs with all weights wij set In order to find variational parameters θ, which approximate a = to unity at QAOA depths of p 1, 2, 4. target state jiϕ well (jiψθ jiϕ , up to a normalization constant), we minimize Dðψθ; ϕÞ using a gradient-based optimizer. In this – Classical variational simulation work we use the Stochastic Reconfiguration (SR)37 39 algorithm to Consider a quantum system consisting of N qubits. The Hilbert achieve that goal. N γ space is spanned by the computational basis fBji: B2f0; 1g g For larger p, extra hidden units introduced when applying UC( ) of classical bit strings B¼ðB ; ¼ ; B Þ. A general state can be at each layer can result in a large number of associated 1234567890():,; 1 PN ψ ψ parameters to optimize over that are not strictly required for expanded in this basis as ji¼ B ðBÞji B .Theconvention Bi accurate output state approximations. So to keep the parameter ZijiB ¼ðÀ1Þ jiB is adopted. In order to perform approximate classical simulations of the QAOA quantum circuit, we use a count in check, we insert a model compression step, which halves neural-network representation of the many-body wavefunction the number of hidden units immediately after applying UC ψ fi doubles it. Specifically we create an RBM with fewer hidden units ðBÞ associated with this system, and speci cally adopt a fi shallow network of the Restricted Boltzmann Machine (RBM) and t it to the output distribution of the larger RBM (output of type33–35: UC). Exact circuit placement of compression steps are shown on !"# ! Fig. 1 and details are provided in Methods. As a result of the PN QNh PN compression step, we are able to keep the number of hidden units ψðBÞ ψθðBÞ exp ajBj Á 1 þ exp bk þ WjkBj : (5) in our RBM ansatz constant, explicitly controlling the variational j¼1 k¼1 j¼1 parameter count. The RBM provides a classical variational representation of the quantum state27,36. It is parametrized by a set of complex Simulation results for 20 qubits parameters θ = {a, b, W}—visible biases a = (a1, …, aN), hidden In this section we present our simulation results for Max-Cut ; ¼ ; = = … = … 40–42 biases b ¼ðb1 bNh Þ and weights W (Wj,k: j 1 N, k 1 QAOA on random regular graphs of order N . In addition, we Nh). The complex-valued ansatz given in Eq. (5) is, in general, not discuss model limitations and its relation to current state-of-the- normalized.