quantum computer algorithms: basics - squint.org · quantum computer algorithms: basics squint...

57
Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research Chair in Quantum Computation

Upload: lythien

Post on 27-Jun-2018

244 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Quantum Computer Algorithms: basics

SQUINT Summer School on Quantum Information Processing

June 2003

Michele MoscaCanada Research Chair in Quantum Computation

Page 2: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Overview

l A quantum computing model l Basis changesl Eigenvalue kick-backl Some simple algorithms

Page 3: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A QUANTUM COMPUTING MODEL

Page 4: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

“Classical” logic gates

l A gate is a function from m bits to n bits, for some fixed numbers m and n

ab a b

AND

a aNOT

Page 5: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

“Classical” circuits

l We “glue” gates together to make “circuits” (or “arrays of gates”) which compute Boolean functions

Page 6: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Universal sets of logic gatesl A set B of gates is universal if, for any

Boolean function F, there is a circuit composed of gates in B that computes F

l E.g. B = { NOT } is not universall E.g B = { AND } is not universall E.g. B = {NOT, AND, FANOUT } is universal

Page 7: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

examplel A circuit made from gates from set

},,{=A

Page 8: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Universal sets of logic gatesl If B is universal

l then

},,{=B

= C

C ≈ C

e.g.

Page 9: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Universal sets of logic gatesl We can exactly simulate the circuit with

gates from A with a circuit with gates from B

≈ C CC

C

Page 10: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Making irreversible gates reversible

0 ab a ba

bab

a b

l Note that irreversible gates are really just reversible gates where we hardwire some inputs and/or throw away some outputs

Page 11: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Making irreversible circuits reversible

0

0

abc

d

ab

cd

l Replace irreversible gates with their reversible counterparts

Page 12: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

New gates and notation

X0 1

X1 0

0 0

b b

1 1

b b

“X”-gate or NOT-gate

“controlled-NOT” gate

Page 13: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A Classical Computing Model

000

Acyclic circuits of reversible gates

000

Page 14: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Example physical realization

0 1NOT

(negligible coupling to the environment)

Page 15: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

More logic gates

01 1

1(negligible coupling to the environment)

Page 16: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A “classical” computation

000

01

1

Page 17: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Aside: Is this realistic?

l We do have a theory of classical linear error correction.

l But before we worry about stabilizing this system, let’s push forward its capabilities.

Page 18: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A quantum gate

1√NOT 0 +

√NOT 0 +12i

2i

21

21 1

0

Page 19: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A simple quantum circuit

√NOT0 √NOT 1i1

210

2i

+

Page 20: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Linear Algebra notation

01

√NOT0 √NOT 1i

221

21

2i

i

221

21

2i

i

i0 =

Page 21: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Notation

0000= = 0 0⊗ =

000 0⊗ =

01

01 = =

0001

=00

Page 22: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A quantum computation

0

00

0√NOT 0

0112

i +21

INOT ⊗10

2100

2+

i11

2100

2+

iCNOT

Page 23: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A quantum computation

00INOT ⊗

102100

2+

i11

2100

2+

iNOTc −

0001

Ii

i⊗

1

121

010

21

i

0100100000100001

100

21

i

Page 24: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

A Quantum Computing Model

0

Acyclic circuits of unitary gates (from a finite “universal set”) and von Neumann measurements in the “computational” basis

00

000

∑∈

=nx

x x}1,0{

a?

Page 25: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Universalityl A set B of quantum gates is “universal” if,

for any positive integer n, any unitary operator on n qubits and for any , there is a finite circuit in those gates that implements satisfying

0>eU~

( )nSUU 2∈

e<−UU~ ???

AA1

min=

=where

Page 26: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

In other wordsl A set B of quantum gates is “universal” if,

for any positive integer n, the gates of Bacting on n qubits span a dense subset of

.l Why not demand exact implementation of

all operators? Exact universality would require an infinite set of gates B and/or infinite sized circuits.

)2( nSU

Page 27: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Some universal setsl {C-NOT, all 1-qubit gates}l {C-NOT, H, P} l “most” 2-qubit gates are universal

Page 28: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

BASIS CHANGES

Page 29: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Distinguishing orthogonal states

Given a state

we can in principle determine which state we have by “performing a Von Neumann measurement with respect to the basis B”

{ }NB ???? ,,, 21 K=∈

ijji d?? =

Page 30: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Distinguishing orthogonal states

We can implement this measurement efficiently if we can efficiently implement the unitary transformation

jA j =?

j? A

j

tA j?

Page 31: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

In general

We can measure any state wrt the basis B in this way

∑j

j j?a A

j

tA j?

∑j

j ja with probability2

ja

Page 32: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard basis change

12

10

21

0 H + →

12

10

21

1 H − →

012

10

21 H →+

112

10

21 H →−

Page 33: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation: summary

12

1)1(0

21

b bH −+ →←

Page 34: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation: circuit notation

b 12

1)1(0

21 b−+H

Page 35: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation on several bits

1x 12

1)1(0

21

1x−+H

2x 12

1)1(0

21

2x−+H

3x 12

1)1(0

21

3x−+H

Page 36: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation: global view

321 xxx ∑∈

⋅−3}1,0{

32181

)1(y

yx yyy

H

H

H

Page 37: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation: global view

→ ⊗⊗ HHHxxx 321 ∑∈

⋅−3}1,0{

32181

)1(y

yx yyy

Page 38: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation: global view

∑∈

⋅−=⊗⊗3}1,0{

321321 81

)1(y

yx yyyxxxHHH

Page 39: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation on several bits

1x12

1)1(0

21

1x−+ H

2x12

1)1(0

21

2x−+ H

3x12

1)1(0

21

3x−+ H

Page 40: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation: global view

321 xxx∑∈

⋅−3}1,0{

32121

)1(y

yx yyy

H

H

H

Page 41: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

The Hadamard transformation: global view

321 xxxHHH → ⊗⊗∑∈

⋅−3}1,0{

32121

)1(y

yx yyy

Page 42: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Looking at NOT and CNOT in Hadamard bases

Consider applying a NOT (or “X”) gate to the following states

( )1010 X −− →−

1010 X + →+

HZHX =

=10

01Z

In other words:

Page 43: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

e.g.

Now consider applying a controlled-NOT gate to the following states

( ) ( )101101 CNOT −− →−

( ) ( )100100 CNOT + →+

( ) ( )101101 CNOT + →+

( ) ( )100100 CNOT − →−

Page 44: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

e.g.

Now consider applying a controlled-NOT gate to the following states

( )( ) ( )( )10101010 CNOT ++ →++

( )( ) ( )( )10101010 CNOT +− →+−

( )( ) ( )( )10101010 CNOT −− →−+

( )( ) ( )( )10101010 CNOT −+ →−−

Page 45: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Eigenvalue kick-back

Page 46: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Computing functions into the phase

Suppose we know how to compute a function

)( xfcxcx ⊕a

}1,0{}1,0{: →ffU

( ) ( )10)1(10 )( −−− xx xfa

Page 47: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Generalization:Eigenvalue “kick-back”

Suppose we know how to compute an operator

?? fieU =

( ) ( )?? f 1010 ieUc +=+−

?? 00 =− Uc

?? f 11 ieUc =−

Then the “controlled-U” gives us

Page 48: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

How do we implement c-U?

Replace every gate G in the circuit for with a c-G.For example,

=

Page 49: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

SOME SIMPLE ALGORITHMS

Page 50: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Deutsch’s problemCompute using only once )1()0( ff ⊕ fU

0 H

f

H

10 −

Page 51: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Deutsch algorithm

( )( )101)1(0)1(2

1 )1()0( −−+− ff

( )( )101)1(02)1( )1()0(

)0(

−−+−

= ⊕ fff

0 H

f

H )1()0(2)1( )0(

fff

⊕−

10 − 10 −

Page 52: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Deutsch-Jozsa problem

Suppose with the promise that f is either constant or “balanced”.

}1,0{}1,0{: →nf

Decide if f is constant or balanced.

2)(

2

)1(

−∑n

x

xfEquivalently, determine

Page 53: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Deutsch-Jozsa problem

yy

x

yxxf

∑∑

⋅+

3}1,0{3

)(

2

)1(

2

3

)(

2

)1(

−∑x

xf

Probability of measuring is

000i.e. we measure iff is constantf

000

0 H H

0 H H

0 H H

f10 − 10 −

Page 54: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Bernstein-Vazirani problem

Suppose is of the formfor some

}1,0{}1,0{: →nf

Given determine

xaxf ⋅=)( na }1,0{∈

)( xfcxcx ⊕afU

naaaa K21=

Page 55: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Bernstein-Vazirani problem

0 H H

0 H H

0 H H

1a

2a

3a

∑∈ 3}1,0{

32

1

x

x ∑∈

⋅−3}1,0{

32

)1(

x

xa

x

f10 − 10 −

Page 56: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

Another property of Hadamard transformation

Consider nZS 2≤

∑∈

+=+Ss

syS

Sy1

Let

Then∑

⊥∈⊥

⋅⊗ −

=+St

tyn t

SSyH

)1(

{ }SstsZttS n ∈∀=⋅∈=⊥ 0,: 2

Page 57: Quantum Computer Algorithms: basics - squint.org · Quantum Computer Algorithms: basics SQUINT Summer School on Quantum Information Processing June 2003 Michele Mosca Canada Research

e.g.Consider },0{ sS =

syySy ⊕+=+2

12

1Then

( )

−=

−+

−=

+

∑∑

⊥∈−

⋅⊕⋅

Stn

ty

tn

tsy

tn

ty

n

t

tt

SyH

12

)1(

2

)1(2

1

2

)1(2

1