National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Quantum Computing for Programmers Paul E. Black

Slides:



Advertisements
Similar presentations
Department of Computer Science & Engineering University of Washington
Advertisements

Quantum Computation and Quantum Information – Lecture 2
Quantum Computation and Quantum Information – Lecture 3
Use of Time as a Quantum Key By Caleb Parks and Dr. Khalil Dajani.
Quantum Computing MAS 725 Hartmut Klauck NTU
Analysis of Algorithms
Cove: A Practical Quantum Computer Programming Framework Matt Purkeypile Fall 2008.
Quantum Packet Switching A. Yavuz Oruç Department of Electrical and Computer Engineering University of Maryland, College Park.
Department of Computer Science & Engineering University of Washington
Superdense coding. How much classical information in n qubits? Observe that 2 n  1 complex numbers apparently needed to describe an arbitrary n -qubit.
The Integration Algorithm A quantum computer could integrate a function in less computational time then a classical computer... The integral of a one dimensional.
CSEP 590tv: Quantum Computing
Quantum Key Establishment Wade Trappe. Talk Overview Quantum Demo Quantum Key Establishment.
Advanced Computer Architecture Lab University of Michigan Quantum Noise and Distance Patrick Cassleman More Quantum Noise and Distance Measures for Quantum.
Quantum Mechanics from Classical Statistics. what is an atom ? quantum mechanics : isolated object quantum mechanics : isolated object quantum field theory.
Quantum Cryptography Prafulla Basavaraja CS 265 – Spring 2005.
Elementary Data Structures and Algorithms
Quantum Computation and Quantum Information – Lecture 2 Part 1 of CS406 – Research Directions in Computing Dr. Rajagopal Nagarajan Assistant: Nick Papanikolaou.
Paraty, Quantum Information School, August 2007 Antonio Acín ICFO-Institut de Ciències Fotòniques (Barcelona) Quantum Cryptography.
Quantum Communication, Quantum Entanglement and All That Jazz Mark M. Wilde Communication Sciences Institute, Ming Hsieh Department of Electrical Engineering,
Quantum Information Processing
CSEP 590tv: Quantum Computing Dave Bacon June 29, 2005 Today’s Menu Administrivia Complex Numbers Bra’s Ket’s and All That Quantum Circuits.
Algorithm Cost Algorithm Complexity. Algorithm Cost.
Classical Versus Quantum. Goal: Fast, low-cost implementation of useful algorithms using standard components (gates) and design techniques Classical Logic.
Alice and Bob’s Excellent Adventure
Week 2 CS 361: Advanced Data Structures and Algorithms
Recursion, Complexity, and Searching and Sorting By Andrew Zeng.
1 Growth of Functions CS 202 Epp, section ??? Aaron Bloomfield.
Analysis CS 367 – Introduction to Data Structures.
SEARCHING, SORTING, AND ASYMPTOTIC COMPLEXITY Lecture 12 CS2110 – Fall 2009.
Quantum Information Jan Guzowski. Universal Quantum Computers are Only Years Away From David’s Deutsch weblog: „For a long time my standard answer to.
Recursion, Complexity, and Sorting By Andrew Zeng.
Chapter 12 Recursion, Complexity, and Searching and Sorting
Analysis of Algorithms
October 1 & 3, Introduction to Quantum Computing Lecture 1 of 2 Introduction to Quantum Computing Lecture 1 of 2
An Introduction to Quantum Phenomena and their Effect on Computing Peter Shoemaker MSCS Candidate March 7 th, 2003.
Analysis of Algorithms These slides are a modified version of the slides used by Prof. Eltabakh in his offering of CS2223 in D term 2013.
 DATA STRUCTURE DATA STRUCTURE  DATA STRUCTURE OPERATIONS DATA STRUCTURE OPERATIONS  BIG-O NOTATION BIG-O NOTATION  TYPES OF DATA STRUCTURE TYPES.
Solving mutual exclusion by using entangled Qbits Mohammad Rastegari proff: Dr.Rahmani.
Algorithm Analysis (Algorithm Complexity). Correctness is Not Enough It isn’t sufficient that our algorithms perform the required tasks. We want them.
CSC 211 Data Structures Lecture 13
You Did Not Just Read This or did you?. Quantum Computing Dave Bacon Department of Computer Science & Engineering University of Washington Lecture 3:
Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy Walters, and Godfrey Muganda Modified for use by MSU Dept. of Computer Science.
Data Structure Introduction.
Quantum Cryptography Slides based in part on “A talk on quantum cryptography or how Alice outwits Eve,” by Samuel Lomonaco Jr. and “Quantum Computing”
Nawaf M Albadia
1 Modeling Quantum Information Systems Paul E. Black National Institute of Standards and Technology Andrew W. Lane University of Kentucky.
CMSC 341 Asymptotic Analysis. 2 Complexity How many resources will it take to solve a problem of a given size? –time –space Expressed as a function of.
Quantum Convolutional Coding Techniques Mark M. Wilde Communication Sciences Institute, Ming Hsieh Department of Electrical Engineering, University of.
CSEP 590tv: Quantum Computing Dave Bacon July 20, 2005 Today’s Menu n Qubit registers Begin Quantum Algorithms Administrivia Superdense Coding Finish Teleportation.
1 Algorithms  Algorithms are simply a list of steps required to solve some particular problem  They are designed as abstractions of processes carried.
Quantum Computing Michael Larson. The Quantum Computer Quantum computers, like all computers, are machines that perform calculations upon data. Quantum.
E.G.M. PetrakisAlgorithm Analysis1  Algorithms that are equally correct can vary in their utilization of computational resources  time and memory  a.
Searching Topics Sequential Search Binary Search.
Page 1 COMPSCI 290.2: Computer Security “Quantum Cryptography” including Quantum Communication Quantum Computing.
IPQI-2010-Anu Venugopalan 1 qubits, quantum registers and gates Anu Venugopalan Guru Gobind Singh Indraprastha Univeristy Delhi _______________________________________________.
Quantum Cryptography and Quantum Computing. Cryptography is about a)manipulating information b)transmitting information c)storing information.
Big O David Kauchak cs302 Spring Administrative Assignment 1: how’d it go? Assignment 2: out soon… Lab code.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Algorithm Analysis with Big Oh ©Rick Mercer. Two Searching Algorithms  Objectives  Analyze the efficiency of algorithms  Analyze two classic algorithms.
Chapter 15 Running Time Analysis. Topics Orders of Magnitude and Big-Oh Notation Running Time Analysis of Algorithms –Counting Statements –Evaluating.
Beginner’s Guide to Quantum Computing Graduate Seminar Presentation Oct. 5, 2007.
Richard Cleve DC 3524 Introduction to Quantum Information Processing CS 467 / CS 667 Phys 667 / Phys 767 C&O 481 / C&O 681 Lecture.
COMPSCI 290.2: Computer Security
Introduction to Quantum Computing Lecture 1 of 2
For computer scientists
A Ridiculously Brief Overview
OSU Quantum Information Seminar
Searching, Sorting, and Asymptotic Complexity
Presentation transcript:

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Quantum Computing for Programmers Paul E. Black

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 2 An Experience in Torpor Steps in reading a computer chip design –Add gates to “not done” list –Process gates from top to bottom –Remove gate from “not done” list Big designs were very slow Why??? Note: gates added to head of list

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce How long does it take to delete gates? Total time is about n 2 / 2 Computing the Execution Paul Black3  n n-1  n-2  n 

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce How Long to Search an Array? Code for linear search: while (a[++i].key != value …); Average number of steps for linear search is n/2 Paul Black 4 n

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 5 How Long for Random Search? Code for random search: while (a[rand(0,a.size)].key != value); Expected number of steps for random search is n

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 6 Expected number of steps for binary search is log 2 n How Long for Binary Search?

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 7 Compare Performance Type#LoopsTime for n=1,000,000 Random: n 1,000,000 x c R Linear: n/2 500,000 x c L Binary: log 2 n ~20 x c B where c is time for 1 loop Ignoring constant multiples, we say random search is O(n) linear search is O(n) binary search is O(log n)

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 8 Definition of O(m) Informally, saying f(n) = O(g(n)) means f(n) is less than a constant times g(n) Formally: there exist positive constants c and k such that 0  f(n)  cg(n) for all n  k. Big-O notation can also express memory use, messages sent, average time, worst case, etc. f(n) cg(n) k

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 9 Definition of θ(m) Informally, saying f(n) = θ(g(n)) means f(n) equals, or grows as fast as, g(n) Formally: there exist positive constants c 1, c 2, k such that c 1 g(n)  f(n)  c 2 g(n) for all n  k. There are also notations for “greater than”, “less than or equal to”, etc. f(n) c 2 g(n) k c 1 g(n)

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 10 Example: Sort Algorithms Comparison of some sort algorithms Sort TypicalWorst Case Bubble sort Θ(n 2 ) same QuicksortO(n log n) O(n 2 ) Heap sortO(n log n) same Bubble sort: repeatedly pass through the list swapping items until all are in order Improvements(?) –Bidirectional bubble sort: go both directions –Don’t go beyond last swap

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 11 Polynomial vs. Exponential Traveling Salesman: find shortest route to visit every city on a list and return home. Best exact algorithm is Θ(n!) ≈ Θ((n/e) n ) where n is the number of cities. Algorithms tend to fall into two classes: polynomial, Θ(n p ), and exponential, Θ(b n ). These classes are distinct: –Polynomials of polynomials are polynomials –Any exponential eventually exceeds any polynomial

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 12 Factoring, or What good is a quantum computer? RSA, a good encryption scheme, is secure because factoring large numbers is hard After centuries of work, the best factoring algorithm is the Number Field Sieve Factor a D-digit number in steps A key 8 times longer –Takes 64 times longer to multiply, but –Squares the time to factor e  D(log D) 2 3

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 13 Shor’s Quantum Algorithm Using quantum computing, numbers can be factored in D 2 log D log log D steps Classical factoring is exponential, but quantum factoring is polynomial!

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce DEAD or ALIVE Schrödinger’s cat

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul E. Black 15 What Math Should We Use?  = ? 15 ºC 21 ºC 10 L5 L Water Alcohol

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 16 Polarization is really a measurement A filter yields only photons with the same alignment. A second filter at right angles blocks all photons. A third filter in between those two allows some photons to pass.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 17 Polarization is a vector. What Really Happens?

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 18 X Y Polarization is a vector. What Really Happens? Measurement projects the vector onto a new basis.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 19 Polarization is a vector. What Really Happens? Measurement projects the vector onto a new basis. X Y

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 20 Polarization is a vector. What Really Happens? Measurement projects the vector onto a new basis. Polarizer passes one basis.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 21 X Y Polarization is a vector. What Really Happens? Measurement projects the vector onto a new basis. Polarizer passes one basis. Next polarizer measures “back into” original basis.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 22 Polarization is a vector. What Really Happens? Measurement projects the vector onto a new basis. Polarizer passes one basis. Next polarizer measures “back into” original basis.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 23 Superposition Single slit makes a normal distribution

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 24 Superposition Single slit makes a normal distribution Two slits make interference patterns, even with only one photon at a time

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 25 Superposition A quantum system’s state may be several potential places, spins, etc. at once. Quantum algorithms often start with qubits in a superposition of 1s and 0s.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 26 Entanglement Measuring the polarization of A changes the result of measuring B and vice versa. A B A B Entangle

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 27 ? Heads are “entangled”: there is a 100% correlation between getting one head and getting the other. We don’t know when we will get heads, but we know we will always get them together. Fakey Entanglement Demonstration We get an even number of heads from any number of coin tosses. How?

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 28 How Do We Represent a State? Classical (binary) Example for 2 variables: a = {00, 01, 10, 11} Use 1 bit per variable Limitation: Can’t represent superposition or entanglement 1 0

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Dirac or “ket” notation Quantum bit or qubit: … a quantum system with two discrete states. 1 States are expressed in ket notation: Multiple states are combined using a tensor product in some fixed order : Tensor product may be implicit and is associative, but not commutative : Paul Black29

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce What is a Tensor Product? Paul Black30

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce How do kets represent superposition? Superpositions are sums of states, each with “amplitude”: a complex number Probability is norm squared amplitude, e.g. above is found in state |0> with probability 1/2 –Complex numbers needed for interference A general 2 qubit system is in state Paul Black31

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Can We Copy an Unknown State? We might measure exactly by copying an unknown state onto many other particles. Formally, assume there is U such that Is there a consistent definition for U ? In other words, what is the value of Paul Black32

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Proof of the No-Cloning Theorem Paul Black33

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 34 Quantum Gates

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Basic Gate: Controlled-Not (CNOT) If control qubit ψ is 1, data qubit φ is flipped. Here is CNOT in ket notation Paul Black35

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce CNOT if input is in superposition If control qubit ψ is 1, data qubit φ is flipped. What happens if input is a superposition? The output is entangled! Paul Black36

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce CCNOT: A More Useful Gate Controlled-Controlled Not or Toffolli If both control qubits ψ 1 and ψ 2 are 1, the data qubit φ is flipped. This is the quantum computing version of AND gate Paul Black37

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Basic Gate: Hadamard Rotate 90° or “square root of not” Paul Black H

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 39 Dirac or “ket” Notation Equivalent to a vector on the surface of a 3-dimensional Bloch sphere You have reached an imaginary number. Rotate your phone 90° and try again.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 40 BB84: Detectable Eavesdropping

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 41 Alice chooses random bases and polarizations to send photons Alice’s Basis: Alice Sends: Bob then chooses random bases to measure the photons Bob’s Basis: Bob Receives: Key Value: Photons are discarded when Alice and Bob choose a different basis. Alice and Bob wish to generate a shared secure private key If Bases differ, Bob measures randomly polarized photon If Bases match, Bob measures same polarization as Alice sent Basic BB84

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 42 An eavesdropper (Eve) measures the photons sent by Alice in her own random basis and then forwards them to Bob: Alice’s Basis: Alice Sends: Eve’s Basis: Eve Sends: Bob’s Basis: Bob Receives: Eve’s measurement creates a 25% error rate in the key generation Error! Key Value: Error! = BB84 With Eavesdropping

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 43 The Quantum Processor Checklist  Well-defined quantum states for qubits  State preparation or initialization  Scalable –Pure states –High-fidelity operations “on demand”  Entangling operations and quantum gates –Controlled-Not Gate –Phase Gate  Efficient readout  Little “noise” (decoherence) per operation

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce More information Paul E. Black, D. Richard Kuhn, and Carl J. Williams, “Quantum Computing and Communication”, Advances in Computers, Marvin Zelkowitz, ed., vol 56, pp QCSim quantum simulator available at Paul Black44

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce More resources Complexity – Big O notation Summary of quantum algorithms –Known quantum algorithms offering speedup over the best known classical algorithms. It has links to pedagogical (noncomprehensive) surveys of quantum algorithms and an overview at a semipopular level. Paul Black45

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce 3 June 2016 Paul Black 46 Density Matrix

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 47 What is a Density Matrix? Sum of probability of pure states Diagonals are probabilities Off-diagonals are correlations Operations are “two-sided”:  ’  i ’  i ’   U  i  U  i  †  U  i  i  U †  U  U †   i p i  i  i    ab  ba                 2

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 48 Density Matrix Equivalent to a Vector within the Body of a 3-dimensional Bloch Sphere

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce 3 June 2016 Paul Black 49 QCSIM

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 50 Simulation Taxonomy Detail –Classical –Dirac ket (pure states) –Density matrix (mixed states) Time –Discrete –Continuous State –Discrete (n-level) –Continuous (finite) –Infinite Time DiscreteContinuous Mixed State Pure State Classical QCSim Detail

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 51 Simulation Taxonomy (cont.) Values –Concrete (e.g., ) –Symbolic (e.g., ) Simulation –Randomized (Monte Carlo or quantum trajectories) –Branching (one run; explore all choices) –Complete state (one run)

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 52 How Should We Represent States? Direct Simulator –Concrete input state; noise operator Must compute error model operators XeXe.707  00 .707  10 

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 53 QCSim 4481 lines of C++, plus 205k of tests & demos State is density matrix Simulates up to 13 qubits Operations –Hadamard, X (bit flip), CNOT, Toffoli (CCNOT) –Controlled Z (Phase), H –Measure (collapse to classical binary) –Trace Over (remove from state) –Initialize and print density matrix –Probabilistic XYZ –Generalized Amplitude Damping –BSW Depolarizing CPhase

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 54 Input: subset of QHDL Reference qubits by name Initialize state –ket notation –normalized Gates and commands Example variable qubit0, anc: qubit; =.25|00> +.75i|11>; cnot(qubit0, anc); hadamard(anc); print_state();

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 55 Computation is via Superoperators Typically written as two-sided operations QCSim uses the equivalent superoperator Zeroes and identities are optimized out

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 56 CNOT Standard QCSim code // swap appropriate rows for (int row = 0; row size(); row++) { if ((mask & row) == mask) { int otherrow = row ^ target; for (int col = 0; col size(); col++) { temp = mat->get_state(row, col); mat->set_state(row, col, mat->get_state(otherrow, col)); mat->set_state(otherrow, col, temp); } // swap appropriate columns...    

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 57 QCSim Results (BB84 NoEve) current state: EqBases, Error Alice and Bob select different bases 50% of the time. The other half of the time, Alice and Bob select the same basis. An error never occurs because Bob’s info qubit is always copied directly from Alice.

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 58 QCSim Results for BB84 current state: BasesEq, Error Alice and Bob choose a different basis 50% of the time, so it is ignored When they choose the same basis, Eve’s measurement creates an error on 1 of every 4 photons (.125/.5 = ¼) QCSim validates the 25% error rate We simulate the circuit and display the “Equal Bases” qubit and the “Error” qubit. BasesEq=0, Error=0 BasesEq=1, Error=0 BasesEq=1, Error=1

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 59 Teleportation

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Two More “Gates” Measure – convert to a classical bit Pauli Z or phase change gate Paul Black60 Z

National Institute of Standards and Technology Technology Administration, U.S. Department of Commerce Paul Black 61 Copy a state to another particle Input is a state and zeros Z H H