240 likes | 374 Views
An Algebraic Foundation for Quantum Programming Languages. Andrew Petersen and Mark Oskin Department of Computer Science The University of Washington. What is quantum computation? Why is it interesting?. How is Quantum Different?. Quantum describes the “world of the small”
E N D
An Algebraic Foundation for Quantum Programming Languages Andrew Petersen and Mark Oskin Department of Computer Science The University of Washington
How is Quantum Different? • Quantum describes the “world of the small” • Quantum effects dominate as feature sizes decrease • Qubits can store more data than bits • A qubit’s state space is a combination of the states 0 and 1 • Quantum effects change the computing model • Superposition: qubits can be in multiple states at once • Entanglement: multiple qubits can share related states • Measurement: observing a qubit destroys superposition • “No-cloning”: copying of quantum state is prohibited
Superposition H = + = H = - =
Entanglement Unentangled Entangled = CNot
Measurement M M
Quantum Computing… …is based upon quantum physics, rather than classical physics. …offers the potential for exponential speedup over classical Turing machines. …enables unbreakable encryption and communication privacy. But only if we can harness it.
The Quantum Divide • Advances in Quantum Hardware • 7-bit (and larger) quantum computers developed • Scalable silicon devices proposed • Solid-state qubits entangled • Stagnation in Quantum Software • New algorithms not being discovered • Reasoning about quantum interactions remains difficult • Little discussion of higher level languages
What’s the Problem? • No more quantum algorithms exist…? • We’re just not smart enough…? • Traditional quantum formalisms were not developed for quantum computing. • Dirac notation: describes state • Matrix notation: represents computations • Quantum circuits: illustrate algorithms
A Quick Example: Coin Flipping In Dirac notation: In matrix notation: |> = |0> Apply Hadamard: |> =2-1/2(|0> + |1>) Measure
Problems with the Existing Formalisms • Quantum effects like superposition and entanglement are not made explicit. • Structures like named variables and procedures are not readily available. • The state space is exponential, so it is hard to represent.
Previous Work • QCL (Ömer): An imperative language in an interpreted environment. • Features procedures which can be defined by the user. • Built upon the matrix notation. • qGCL (Sanders and Zuliani): A probablistic, guarded command language. • Uses a refinement calculus to compute quantum states. • Facilitates the verification of algorithms but not their development.
Previous Work • Quantum C++ (Bertelli): Quantum computation in a classical framework. • Defines a clear separation between quantum and classical operations. • Stores quantum operations as classical data structures. • Block-QPL (Selinger): A functional, graph-based computational model. • Features a type system and stresses “quantum data, classical control.” • Relies on a relaxed form of Dirac notation in addition to the matrix notation.
A New Quantum Algebra: the Qubit Superposition State Name Weight
A New Quantum Algebra: the Procedure Parameter Body || separates the cases and flags possible superposition Name
Example Revisited: Coin Flipping In matrix notation:
Benefit: Entanglement Unentangled (a) Unentangled (a) Entangled (b) Entangled (b)
Benefit: Procedures The Hadamard for a one bit space is to the left and the Hadamards for a two bit space are below. The definition of the Hadamard for the algebra is to the right.
Applications With some extensions, this algebra becomes… • A notation for reasoning about quantum computation • A basis for a quantum calculus • A grammar and semantics have been developed. • Typechecking can be used to ensure quantum properties like the no-cloning theorem. • A basis for higher level quantum languages • High level structures can be mapped onto the framework of the algebra.