Multiple Query Optimization on the D-Wave 2X Adiabatic Quantum Computer
Total Page:16
File Type:pdf, Size:1020Kb
Multiple Query Optimization on the D-Wave 2X Adiabatic Quantum Computer Immanuel Trummer and Christoph Koch ffirstnameg.flastnameg@epfl.ch Ecole´ Polytechnique Fed´ erale´ de Lausanne ABSTRACT in California. This device is claimed to exploit the laws of The D-Wave adiabatic quantum annealer solves hard combi- quantum physics [6] in the hope to solve NP-hard optimiza- natorial optimization problems leveraging quantum physics. tion problems faster than traditional approaches. The ma- The newest version features over 1000 qubits and was re- chine supports a very restrictive class of optimization prob- lems while it is for instance not capable of running Shor's leased in August 2015. We were given access to such a ma- 1 chine, currently hosted at NASA Ames Research Center in algorithm [40] for factoring large numbers . We will show California, to explore the potential for hard optimization how instances of the multiple query optimization problem problems that arise in the context of databases. can be brought into a representation that is suitable as in- In this paper, we tackle the problem of multiple query put to the quantum annealer. We also report results of an optimization (MQO). We show how an MQO problem in- experimental evaluation that compares the time it takes to stance can be transformed into a mathematical formula that solve MQO problems on the quantum annealer to the time complies with the restrictive input format accepted by the taken by algorithms that run on a traditional computer. We quantum annealer. This formula is translated into weights believe that this is the first paper featuring an experimen- on and between qubits such that the configuration mini- tal evaluation on a quantum computer ever published in the mizing the input formula can be found via a process called database community. The quantum annealer, produced by the Canadian com- adiabatic quantum annealing. We analyze the asymptotic 2 growth rate of the number of required qubits in the MQO pany D-Wave , uses qubits instead of bits. While bits have problem dimensions as the number of qubits is currently a deterministic value (either 0 or 1) at each point in time the main factor restricting applicability. We experimentally during a computation, a qubit may be put into a superposi- compare the performance of the quantum annealer against tion of states (0 and 1) that would be considered mutually other MQO algorithms executed on a traditional computer. exclusive according to the laws of classical physics. Work- While the problem sizes that can be treated are currently ing with qubits instead of bits could in principle allow faster limited, we already find a class of problem instances where optimization than on a classical computer [1]. Thinking of the quantum annealer is three orders of magnitude faster qubit superposition as a specific form of parallelization is than other approaches. certainly simplifying but still gives a first intuition for why this is possible. We provide more explanations on quantum computing and on the quantum annealer in Section 2. 1. INTRODUCTION The quantum annealer that we were experimenting with The database area has motivated a multitude of hard op- has a net worth of around 15 million US dollars. This price timization problems that probably cannot be solved in poly- might make main stream adoption seem illusory in the near- nomial time. Those optimization problems become harder term future. However, the company D-Wave is currently as data processing systems become more complex. This considering flexible provisioning models allowing users to 3 makes it interesting to explore also unconventional opti- buy computation time instead of the hardware . In this mization approaches. In this paper, we explore the poten- scenario, users would use the machine remotely, in a similar tial of quantum computing for a classical database-related way as we did in our experiments. As near-optimal solutions optimization problem, the problem of multiple query opti- to hard problems can usually be found within milliseconds mization (MQO) [37]. We were granted a limited amount (see Section 7), this provisioning model might allow opti- of computation time on a D-Wave 2X adiabatic quantum mization at an affordable rate per instance. Those are some annealer, currently hosted at NASA Ames Research Center of the factors that encourage us to explore the potential of quantum computing already at this point in time. The D-Wave adiabatic quantum annealer has been the subject of controversial discussions in the scientific com- munity. Those discussions have focused on two questions: This work is licensed under the Creative Commons Attribution- NonCommercial-NoDerivatives 4.0 International License. To view a copy 1http://www.dwavesys.com/blog/2014/11/ of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. For response-worlds-first-quantum-computer-buyers-guide any use beyond those covered by this license, obtain permission by emailing 2http://www.dwavesys.com/ [email protected]. 3 Proceedings of the VLDB Endowment, Vol. 9, No. 9 http://spectrum.ieee.org/podcast/computing/hardware/ Copyright 2016 VLDB Endowment 2150-8097/16/05. dwave-aims-to-bring-quantum-computing-to-the-cloud 648 Algorithm 1 How to solve multiple query optimization on hard problem. We use the quantum annealer to solve it. All an adiabatic quantum annealer. other transformations depicted in Algorithm 1 have polyno- 1: // Solves multiple query optimization problem M mial complexity and are executed on a classical computer. 2: function QuantumMQO(M) Based on the solution returned by the quantum annealer, 3: // Map MQO problem to logical energy formula the value assignment to the variables bi which minimizes the 4: lef LogicalMapping(M) physical energy formula, we transform the solution to the 5: // Map logical into physical energy formula physical energy formula into a solution to the logical energy 6: pef PhysicalMapping(lef) formula. Finally, we transform the solution to the logical 7: // Minimize formula on quantum computer energy formula into a solution to the original MQO problem 8: bi QuantumAnnealing(pef) which is the optimal set Pe of query plans to execute. 9: // Transform physical into logical solution MQO problems cannot be solved with our approach if the −1 10: Xp PhysicalMapping (bi) number of qubits required by the physical energy formula 11: // Transform logical solution to MQO solution exceeds the number of qubits available on the quantum an- −1 12: Pe LogicalMapping (Xp) nealer. Albeit doubling the number of qubits compared to 13: // Return best set of query plans to execute the predecessor model, the number of qubits is with slightly 14: return Pe over one thousand qubits still very limited on the D-Wave 15: end function 2X that we experimented with. Correspondingly, the lim- ited number of qubits is in practice the most important fac- tor restricting the size of the problem instances that can be treated with the quantum annealer. For that reason, we an- whether quantum effects play indeed a significant role dur- alyze the \complexity" of our mapping algorithm in terms ing the optimization process [2, 6, 7, 26, 39, 42] and whether of the asymptotic growth rate of the number of required the performance is significantly better than the one of clas- qubits as a function of the MQO problem dimensions. This sical computers [20, 24, 23, 34]. Recent publications seem approach is common in the area of quantum annealing [28, to answer the first question positively [2, 7, 26]. The answer 41]. We find that the number of qubits in the physical en- to the second question depends apparently on the specific ergy formula grows quadratically in the number of plans per class of problems considered, leading for instance to differ- query and at least linearly in the number of queries. ent conclusions for range-limited Ising problems [23] than for In our experimental evaluation, we compare our approach Ising problems without weight limits [20]. Solving problem based on quantum annealing against classical optimization classes that are not natively supported by the quantum an- algorithms executed on traditional computers. We compare nealer requires transformation steps which add a problem against classes of algorithms that have been proposed for class-specific overhead in the problem representation size MQO in prior publications and include integer linear pro- that might prevent the quantum annealer from solving non- gramming, genetic algorithms, and simple greedy heuristics. trivial instances due to its limited number of qubits. Our While the number of available qubits severely limits the class paper adds to the discussion concerning the second question of non-trivial MQO problems that can be treated efficiently by providing a mapping algorithm and experimental results on the quantum annealer, we also find a class of problems for a specific database-related optimization problem. where the quantum annealer discovers near-optimal solu- Prior work on MQO [3, 10, 11, 15, 14, 14, 22, 27, 30, 35, tions at least 1000 times faster than classical approaches. 37, 38] did not consider the potential of quantum computing. In summary, our original scientific contributions in this Prior publications in the area of quantum computing [5, 17, paper are the following: 19, 28, 33, 44, 41] did not treat the MQO problem. Algorithm 1 shows the high-level approach by which we • We map MQO problem instances into a representation obtain solutions to MQO problem instances from a quan- that can be solved on a quantum annealer. tum annealer. The goal of MQO is to select the optimal combination of query plans to execute in order to minimize • We analyze the complexity of our mapping method in execution cost for a batch of queries. Given an MQO prob- terms of the asymptotic number of required qubits as lem instance M, we introduce binary variables Xp for each a function of the MQO problem dimensions.