Building an Adiabatic Quantum Computer Simulation in the Classroom
Total Page:16
File Type:pdf, Size:1020Kb
This document is published at : Rodríguez-Laguna, J. y Santalla, S. (2018). Building an adiabatic quantum computer simulation in the classroom. American Journal of Physics, 86(5), pp. 360-367. DOI: https://doi.org/10.1119/1.5021360 © 2018 American Association of Physics Teachers. Building an adiabatic quantum computer simulation in the classroom Javier Rodrıguez-Laguna Dto. Fısica Fundamental, Universidad Nacional de Educacion a Distancia (UNED), Madrid 28040, Spain Silvia N. Santalla Dto. Fısica & GISC, Universidad Carlos III de Madrid, Madrid 28911, Spain (Received 18 August 2017; accepted 2 January 2018) We present a didactic introduction to adiabatic quantum computation (AQC) via the explicit construction of a classical simulator of quantum computers. This constitutes a suitable route to introduce several important concepts for advanced undergraduates in physics: quantum many- body systems, quantum phase transitions, disordered systems, spin-glasses, and computational complexity theory. VC 2018 American Association of Physics Teachers. https://doi.org/10.1119/1.5021360 I. INTRODUCTION absent. Therefore, it is closer to the concept of quasistatic process. 1,2 Interest in quantum computation is increasing lately, This article is organized as follows. In Sec. II, we intro- 3 since it might be the next quantum technology to take off. duce the type of problems that we intend to solve. Section III Exciting new spaces for exploration have appeared, such as discusses the general idea of analog computers, while the 4,5 the IBM Quantum Experience, where a few-qubit com- philosophy of adiabatic quantum computation is discussed in puters can be programmed remotely. Being a crossroad for Sec. IV in intuitive terms. In Sec. V, we descend to techni- physicists and computer scientists, it presents a steep learn- calities and describe the AQC process by giving precise ing curve for newcomers. Among the different flavors, we instructions to build a classical simulator. The last section 6–8 have chosen adiabatic quantum computation (AQC) and discusses the roadmap that opens up before the students after developed a gentle introduction which can be delivered in this experience, along with the expected results and limita- two sessions, a theoretical and a practical one. The aim is to tions of the AQC approach. enable the readers to write their own code to simulate a quantum computer. The proposed simulation is very light II. WHAT TO SOLVE computationally, and can run even on a small laptop.9 The reasons to include quantum computation in the When computer scientists talk about problems they have a undergraduate syllabus for physicists are manifold. Beyond rather precise notion in mind. Let us take a look at several the promise to develop true quantum supremacy, i.e., com- examples before providing a general definition:19 putational power beyond classical capabilities, it constitutes • The traveling salesperson problem (TSP). You are given a a suitable path to introduce several important areas in the list of cities and the distances between them, and you have classroom: quantum many-body physics, quantum phase to provide the shortest route to visit them all. transitions, the physics of disordered systems and spin • The knapsack problem. You are given the weights and val- glasses, combinatorial optimization, and computational ues of a set of objects and you have to provide the most complexity theory. Moreover, the fundamental interest is valuable subset of them to take with you, given a certain increasing following the recent proposals to explain gravity bound on the total weight. and the structure of space-time itself in terms of quantum • Sorting. Given N numbers, return them in non-ascending computation.10,11 order. There are several proposals in the literature to introduce • The integer factorization problem. You are given a big quantum computation in the classroom, such as those of number M, and you have to provide two integer factors, p Scarani,12 as early as 1998, or the more recent and compre- and q, such that M ¼ pq. hensive proposal of Candela.13 They focus on quantum logic • The satisfactibility problem (SAT). You are given a bool- gates and their chosen applications are usually in cryptogra- ean expression of many variables x 2f0; 1g, for example, phy, such as the work of Gerjuoy.14 We present a novel pro- i Pðx ; x ; x ; x Þ¼x Úx Ù ðx Úx Þ.20 Then, you are asked posal, based on the alternative route of AQC. Both approaches 1 2 3 4 1 2 3 4 whether there is a valuation of those variables which will are known to be equally powerful in principle,15 but AQC make the complete expression true. For example, in that presents some interesting pedagogical advantages, such as the case, making all x ¼ 1 is a valid solution. facility with which new problems can be approached. i Moreover, there is an ongoing effort in the scientific and tech- Notice that all these problems have a similar structure: nical communities to implement the AQC in practical devi- you are given certain input data (the initial numbers, the list ces,16 including the D-wave machine17 (whose performance is of the cities, the list of objects or the integer to factorize) and still subject to discussion18). you are asked to provide a response. The first two problems The term adiabatic in AQC may present some difficulties are written as optimization problems, in which a certain tar- for the students, since in this context it is totally unrelated to get function should be minimized (or maximized). The sort- the usual meaning in thermodynamics. In quantum mechan- ing problem can be restated as an optimization problem: we ics, a process is adiabatic when the external parameters can design a penalty function to be minimized, by counting evolve so slowly that the system is always able to adapt itself the misplaced consecutive numbers. The factorization prob- perfectly and smoothly, so non-equilibrium effects are lem can also be expressed in that way: find p and q such that 360 Am. J. Phys. 86 (5), May 2018 http://aapt.org/ajp VC 2018 American Association of Physics Teachers 360 X X 2 E ¼ðM À pqÞ becomes minimal—and zero if possible. Eðs1; …; sNÞ¼ Jijsisj þ hisi: (1) SAT can also be regarded as an optimization problem in i;j i which the evaluation of the boolean formula should be maximized. Let hi ¼ 0 for now. If the wiring graph is 1-dimensional Thus, all those problems are combinatorial optimization (without any loops) the problem is trivial: give any value to problems.21,22 This means that, in order to solve them by the first spin, and then set all in order changing value only brute force, a finite number of possibilities must be checked. if the coupling is AF. When the graph presents loops this But this number of possibilities grows very fast with the solution can run into contradictions, due to the possibility number of variables or the size of the input. Typically, they of frustration: maybe not all couplings can be satisfied grow exponentially. simultaneously. Choosing which ones to leave out is a very Not all optimization problems are equally hard. Let us delicate problem. If the graph is 2-dimensional (it can be focus on the minimal possible time required to solve them as drawn on a plane without any links crossing), then there is a function of the input size. If a problem can be solved in a very clever polynomial algorithm to solve it.32 If the 23 polynomial time, then it is said to belong to class P.Ifa graph is 3D, the problem becomes NP-complete. candidate solution can be evaluated in polynomial time, then The spin-glass problem has a physical origin, but it can it is said to belong to class NP. Of course, every problem in also be considered in a more abstract way, e.g., to study res- P is also in NP, but it is not known whether every NP prob- toration of images which have undergone some degrada- 19,24,25 lem is in P or not. In fact, the P¼ ?NP question is one tion30 or to select an optimal subset among a set of 26 of the most relevant open problems in mathematics. Most incompatible goals.31 practicioners believe that P6¼ NP, i.e.: an easy-to-check problem does not necessarily have an easy solution. But this III. ANALOG COMPUTERS conjecture appears to be amazingly difficult to prove.25 See, for example, Ref. 27 for a recent attempt at a proof of their Nature optimizes. Soap films minimize area, which means inequivalence.28 that they minimize the energy.33 In order to predict which All the problems in the list above are NP: given a candi- shape will a soap film acquire, when constrained between date solution, it can always be checked in polynomial time. certain wires and walls, we find the surface of minimal area But only one of them is known to be in P: the sorting prob- with those constraints. Or, if we are interested in knowing lem, because it can always be solved in time OðN logðNÞÞ,29 which kind of lattice will be formed by a certain type of mol- which is less than OðN2Þ. For the factorization problem we ecules, then a first approximation proceeds as follows. First, do not know whether it is in P or not. The other three belong we determine the interaction energy between pairs of atoms, to a special subset: they are NP-complete. This means that as a function of their relative position, Vð~r2 À ~r1Þ. Now, we they belong to a special group with this property: if a polyno- minimize the following energy function: mial algorithm to solve one of them is ever found, then we X will have a polynomial algorithm to solve all NP problems.