Cove: a Practical Quantum Computer Programming Framework
Total Page:16
File Type:pdf, Size:1020Kb
COVE: A PRACTICAL QUANTUM COMPUTER PROGRAMMING FRAMEWORK By Matthew Daniel Purkeypile M.S. Computer Science, American Sentinel University, 2005 B.S. Computer Science, American Sentinel University, 2004 A Dissertation Submitted to the Faculty of Colorado Technical University in Partial Fulfillment of the Requirements for the Degree of Doctor of Computer Science Colorado Springs, Colorado September 2009 Copyright by Matthew Daniel Purkeypile 2009 ABSTRACT While not yet in commercial existence, quantum computers have the ability to solve certain classes of problems that are not efficiently solvable on existing Turing Machine based (classical) computers. For quantum computers to be of use, methods of programming them must exist. Proposals exist for programming quantum computers, but all of the existing ones suffer from flaws that make them impractical in commercial software development environments. Cove is a framework for programming quantum computers that extends existing classical languages to allow for quantum computation, thus providing a quantum computing toolkit for commercial software developers. Since the target users of Cove are commercial developers, it is an object oriented framework that can be used by multiple languages and also places emphasis on complete documentation. The focus of Cove is not so much on the software product, but on the fundamental concepts that make quantum computing practical for common developers. i DEDICATION For Angela and Scarlett. ii ACKNOWLEDGMENTS I’d like to thank Colorado Technical University for providing an excellent Doctoral program. It should go without saying that this work would not be possible without the extensive guidance and input from my committee: Dr. Sandén, Dr. Johnson, and Dr. Thompson. They’ve spent countless hours reading and rereading this dissertation, and their feedback and insights have resulted in a much more complete and solid dissertation. Thank you. I would also like to thank Leo Chan and Stephane Dubois at Xignite for their support through this lengthy endeavor. They have fostered an excellent environment at Xignite that has allowed me to be involved in great projects while still being able to carry out this research. Thanks also goes to Nine Inch Nails and Atmosphere, whose music I’ve listened to more times while working on this dissertation than my wife cares for. My family and friends have also lent endless support and encouragement. My parents Bob and Jan have always supported my education and I’d like to thank them. Finally I’d like to thank my Wife Angela and Daughter Scarlett for their support. They have sacrificed much more than I have to make this possible. iii TABLE OF CONTENTS Page DEDICATION ............................................................................................................. ii ACKNOWLEDGMENTS ........................................................................................... iii LIST OF TABLES ....................................................................................................... vii LIST OF FIGURES ..................................................................................................... viii I. INTRODUCTION ........................................................................................... 1 II. BACKGROUND AND RELATED WORK ................................................... 7 2.1 Quantum Computing ............................................................................ 7 2.1.1 Basics of Quantum Mechanics ................................................. 8 2.1.2 Example: Tossing Quantum Coins .......................................... 30 2.1.3 Introduction to Quantum Computing and Information ............ 33 2.1.4 Example: Entanglement ........................................................... 39 2.1.5 Foundations of Quantum Computing....................................... 43 2.1.6 Limitations of Quantum Computing ........................................ 49 2.1.7 Classical Parallel Languages .................................................... 57 2.1.8 D-Wave Systems ...................................................................... 58 2.1.9 Limitations of Simulating a Quantum Computer on a Classical Computer.................................................................................. 59 2.1.10 Quantum Algorithms ............................................................... 63 2.1.11 Example: Factoring (Shor’s Algorithm) .................................. 67 2.1.12 Replacing Step 2 with a Quantum Computer .......................... 71 2.1.13 Factoring 15 ............................................................................. 73 2.1.14 Further Scaling ......................................................................... 80 2.2 Quantum Computer Programming ....................................................... 81 2.2.1 Survey of Procedural and Object Oriented Quantum Computer Programming Techniques ........................................................ 81 2.2.2 Brief Overview of Select Other Quantum Programming Techniques ............................................................................... 95 2.3 Framework Design ............................................................................... 105 III. HYPOTHESIS AND PROOF CRITERIA ...................................................... 116 3.1 Hypothesis............................................................................................ 116 3.2 Proof Criteria ....................................................................................... 118 iv 3.2.1 Quantum Computing Components .......................................... 119 3.2.2 Limitations of Quantum Computing ........................................ 120 3.2.3 Limitations of the Local Simulation ........................................ 120 3.2.4 Quantum Operations ................................................................ 120 3.2.5 Quantum States ........................................................................ 130 3.2.6 Measurement of Quantum Data Types .................................... 132 3.2.7 Potential Measurement Pitfall in Simulations: Entanglement . 132 3.2.8 Conversion of Qubits to Classical Types ................................. 135 3.2.9 Accessing a Remote Quantum Resource ................................. 135 IV. METHODOLOGY .......................................................................................... 138 4.1 Proof-of-concept Prototype .................................................................. 139 4.2 Methods and Procedures ...................................................................... 139 4.2.1 Gathering Examples ................................................................. 140 4.2.2 Design of Interfaces ................................................................. 140 4.2.3 Implementation of Interfaces via a Classical Simulation ........ 145 4.2.4 Automated Unit Testing ........................................................... 146 4.2.5 Other Potential Implementations ............................................. 147 4.2.6 Documentation ......................................................................... 150 4.3 Quantum Circuit Diagrams .................................................................. 154 4.3.1 Quantum Coin Toss ................................................................. 158 4.3.2 Entanglement ........................................................................... 159 4.3.3 Shor’s algorithm....................................................................... 160 V. COVE: PROPERTIES, DESIGN AND IMPLEMENTATION ...................... 175 5.1 Assumptions, Limitations, Dependencies, and Constraints ................. 175 5.1.1 Cove is Hardware Independent ................................................ 177 5.1.2 Users not Concerned with Error Correction ............................ 177 5.1.3 No Time Limit for Execution .................................................. 178 5.1.4 Local Simulation Not Excessively Concerned with Round Off Errors........................................................................................ 179 5.1.5 Only Quantum Operations Supplied ........................................ 180 5.1.6 No Delayed Execution of Operations ...................................... 180 5.1.7 Maximum Number of Qubits in a Register for the Local Simulation ................................................................................ 181 5.1.8 QRAM Model is Viable ........................................................... 183 5.2 Expanded QRAM Model ..................................................................... 184 5.3 Common Tasks and Philosophy........................................................... 190 5.3.1 Applying Operations in Cove .................................................. 190 5.3.2 Ordering of Registers and Operations in Cove ........................ 192 5.4 Examples of Quantum Computation in Cove ...................................... 195 5.4.1 Quantum Coin Toss ................................................................. 196 5.4.2 Entanglement ........................................................................... 200 v 5.4.3 Shor’s Algorithm ..................................................................... 203 5.5 Implementation of Cove in C# ............................................................. 214 5.5.1 Selection of C# ......................................................................... 214 5.5.2 C# Specifics ............................................................................