QWIRE: A Core Language for Quantum Circuits

Slides:



Advertisements
Similar presentations
Sml2java a source to source translator Justin Koser, Haakon Larsen, Jeffrey Vaughan PLI 2003 DP-COOL.
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
Architecture Representation
Quantum Computing MAS 725 Hartmut Klauck NTU
1 How to transform an analyzer into a verifier. 2 OUTLINE OF THE LECTURE a verification technique which combines abstract interpretation and Park’s fixpoint.
A Type System for Well-Founded Recursion Derek Dreyer Carnegie Mellon University POPL 2004 Venice, Italy.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
An Introduction to Input/Output Automata Qihua Wang.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
MinML: an idealized programming language CS 510 David Walker.
A Type System for Expressive Security Policies David Walker Cornell University.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Tim Sheard Oregon Graduate Institute Lecture 11: A Reduction Semantics for MetaML CS510 Section FSC Winter 2005 Winter 2005.
Describing Syntax and Semantics
An algebra of Connectors for modeling CommUnity with Tiles joint work with Roberto Bruni Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan.
Introduction to Quantum logic (2) Yong-woo Choi.
ROM-based computations: quantum versus classical B.C. Travaglione, M.A.Nielsen, H.M. Wiseman, and A. Ambainis.
An Introduction to Software Architecture
Typed Lambda Calculus Chapter 9 Benjamin Pierce Types and Programming Languages.
You Did Not Just Read This or did you?. Quantum Computing Dave Bacon Department of Computer Science & Engineering University of Washington Lecture 3:
Linear Algebra. Circuits The circuits in computers and other input devices have inputs, each of which is either a 0 or 1, the output is also 0s and 1s.
14.1/21 Part 5: protection and security Protection mechanisms control access to a system by limiting the types of file access permitted to users. In addition,
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: Chapter 3.
Programming Language Descriptions. What drives PL Development? Computers are “in charge” of extremely important issues Execute a program literally. Exercise.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
T imed Languages for Embedded Software Ethan Jackson Advisor: Dr. Janos Szitpanovits Institute for Software Integrated Systems Vanderbilt University.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Functional Programming
Digital Logic.
Types for Programs and Proofs
ECE 3110: Introduction to Digital Systems
Class 27: Universal Turing Machines CS150: Computer Science
Postulates of Quantum Mechanics
CS 326 Programming Languages, Concepts and Implementation
Module 4 Remote Login.
CS 326 Programming Languages, Concepts and Implementation
Representation, Syntax, Paradigms, Types
Programmable Logic Controllers (PLCs) An Overview.
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Logical architecture refinement
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Patterns.
Representation, Syntax, Paradigms, Types
Chap 4 Quantum Circuits: p
Introduction to Quantum logic (2)
Semantics In Text: Chapter 3.
OSU Quantum Information Seminar
An Introduction to Software Architecture
Problem Solving Skill Area 305.1
Representation, Syntax, Paradigms, Types
Computer Architecture
Quipper : A Scalable Quantum Programming Language
Probabilistic Databases
Automated Analysis and Code Generation for Domain-Specific Models
Representation, Syntax, Paradigms, Types
Chapter 5 Architectural Design.
Basic circuit analysis and design
Copyright © Cengage Learning. All rights reserved.
ECE 352 Digital System Fundamentals
Chapter 13: I/O Systems.
Presentation transcript:

QWIRE: A Core Language for Quantum Circuits Ashlesha Atrey QWIRE: A Core Language for Quantum Circuits

Why is circuit model so successful? Low level of abstraction Qubits are unintuitive from a classical perspective Not much progress in conditionals and recursions Still researchers write complex algorithms in state of art quantum circuit language like quipper So programmers not sure if their approach will work

QRAM model Embedded language like Quipper, LIQUi|>, Q language, Quanum IO Monad Doesnt specify the degree to which the separation is intended

QRAM Model : QWIRE QWIRE design: Separation of classical computation in host language from quantum computation in the circuit language Syntactically separates quantum data inside circuits from classical data, and treats these two syntactic fragments as distinct languages. We need correctness, as they already are expensive and error prone Proving embedded language produces well formed circuits is hard, it means reasoning about the entirety of host language

Type safety languages Ensure Well formed circuit dont get stuck Semantics for programs in terms of quantum mechanics Selinger’s QPL language (Selinger 2004) quantum lambda calculus (Selinger and Valiron 2009) QML (Altenkirch and Grattage 2005), ProtoQuipper (Ross 2015). However, these are toy languages, not designed for implementation in a conventional programming environment

QWIRE: Type safety Keeping circuit language minimal and pushing the remaining infrastructure to host language Quipper and LIQUi|i do not cleanly separate embedded circuits from the host language Run time error can only occur in host language in QWIRE

Qwire A core language for quantum circuits Safe: Linear types for wires Type safety & strong normalization Denotational semantics Expressive: Structured based on QRAM model Embedded in our favourite classical host language

Circuit Language Wire types: Type judgment: unit (has no data), a bit or qubit, or a tuple of wire types W ::= 1 | bit | qubit | W1 ⊗ W2 Type judgment: Γ ; Ω ⊢ C : W C is a circuit Ω = w1 : W1, . . . , wn : Wn is a context of input wire names with their wire types Γ = x1 :A1, . . . , xn : An is a context of host language variables with their host language types W is the output type of the circuit.

Examples: Gate A gate can be applied to a pattern of wires when permitted by the signature of the gate. The output of that gate is then decomposed by another pattern. The wires exiting the gate can then be used in the remainder of the circuit. Gate Model: G(W1, W2) for the set of gates with input W1 and output W2.

Examples: Compose We compose circuits by connecting the output of one circuit to the input wires of another. This operation differs from sequential composition in that the second circuit may have additional inputs.

Host Language: HOST The classical computer communicates with the quantum computer by sending it instructions—that is, circuits in QWIRE. For each wire type there is a corresponding classical type—for example, a host- level boolean might correspond to the qubit and bit wire types, and tensor wire types correspond to pairs.

Types of Hosts Types of Hosts: A ::= · · · | Unit | Bool | A × A | Circ(W1, W2)

Typing rules for QWIRE OUTPUT GATE COMPOSE LIFT UNBOX BOX

Boxes The type Circ(W1, W2) is a wrapper around QWIRE circuits of the form Γ ; Ω ⊢ C : W2, where the wires in Ω come from a pattern destructing the input type W1. Boxes

Communication: Dynamic and static lifting Quantum computer communicating with classical computer Γ ; · ⊢ C :bit Γ ⊢ run C :Bool Wire Types to classical types: |bit| = Bool |qubit| = Bool |1| = Unit |W1 ⊗ W2| = |W1| × |W2|

Running circuit: static lifting Run is a static lifting operator, meaning that there is no residual state left on the quantum computer after run C has completed.

Dynamic Lifting: communicate with classical x ⇐ lift p; C to mean that the wires in p are measured, lifted to the classical computer as the host variable x, and used to compute the circuit C Dynamic lifting is expensive because while the classical computer is computing the rest of the circuit, the existing state on the quantum computer must continuously undergo error correction to prevent degradation

Circuit Normalization Circuits in QWIRE represent instructions to be executed on a quantum computer: either apply a particular gate, or request a dynamic lifting operation. Eliminate unboxing and composition Two rules: Operate only on bit and qubit - concrete circuit Consists only of gate applications, outputs, and dynamic lifting operations - Normal circuit

Advantages of QWIRE: Interface to circuit is minimal Host language is extensible, since changes to host language dont induce changes to the circuit language Relationship between circuit language and host language can be easily axiomatized Every circuit can be promoted to the host language via a box operator, and then unboxed to be reused inside of other circuits.

In paper Operational semantics of circuit Proof of type safety Progress and preservation threomes Proof of strong normalization Denotational semantics: proof of soundness Dependently typed circuits

Denotational Semantic Quantum system describe as density matrix W1 to W2 interpreted as a superoperator mapping density matrices corresponding to W1 to density matrices corresponding to W Measure

Dependent Types Circuit with n inputs and n outputs Types can depend on terms, but only terms of classical (non-linear) type

Summary Minimal and highly modular core language 5 commands with two eliminated using Normalization Not attached to any specific core language Uses linear types to enforce no-cloning Safe, small circuit level language

Discussion Parametric Operators on Circuits Automatic generation of Quantum Oracles Scalability Quantum Data Types

THANK YOU! Questions?

References QWIRE: a core language for quantum circuits. Jennifer Paykin, Robert Rand, Steve Zdancewic. POPL'17.