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

Transcript of Quantum Computer Algorithms: basics - SQuInT

Page 1: Quantum Computer Algorithms: basics - SQuInT

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

Overview

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

Page 3: Quantum Computer Algorithms: basics - SQuInT

A QUANTUM COMPUTING MODEL

Page 4: Quantum Computer Algorithms: basics - SQuInT

“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

“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

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

examplel A circuit made from gates from set

},,{=A

Page 8: Quantum Computer Algorithms: basics - SQuInT

Universal sets of logic gatesl If B is universal

l then

},,{=B

= C

C ≈ C

e.g.

Page 9: Quantum Computer Algorithms: basics - SQuInT

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

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

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

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

A Classical Computing Model

000

Acyclic circuits of reversible gates

000

Page 14: Quantum Computer Algorithms: basics - SQuInT

Example physical realization

0 1NOT

(negligible coupling to the environment)

Page 15: Quantum Computer Algorithms: basics - SQuInT

More logic gates

01 1

1(negligible coupling to the environment)

Page 16: Quantum Computer Algorithms: basics - SQuInT

A “classical” computation

000

01

1

Page 17: Quantum Computer Algorithms: basics - SQuInT

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

A quantum gate

1√NOT 0 +

√NOT 0 +12i

2i

21

21 1

0

Page 19: Quantum Computer Algorithms: basics - SQuInT

A simple quantum circuit

√NOT0 √NOT 1i1

210

2i

+

Page 20: Quantum Computer Algorithms: basics - SQuInT

Linear Algebra notation

01

√NOT0 √NOT 1i

221

21

2i

i

221

21

2i

i

i0 =

Page 21: Quantum Computer Algorithms: basics - SQuInT

Notation

0000= = 0 0⊗ =

000 0⊗ =

01

01 = =

0001

=00

Page 22: Quantum Computer Algorithms: basics - SQuInT

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

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

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

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

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

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

BASIS CHANGES

Page 29: Quantum Computer Algorithms: basics - SQuInT

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

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

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

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

The Hadamard transformation: summary

12

1)1(0

21

b bH −+ →←

Page 34: Quantum Computer Algorithms: basics - SQuInT

The Hadamard transformation: circuit notation

b 12

1)1(0

21 b−+H

Page 35: Quantum Computer Algorithms: basics - SQuInT

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

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

The Hadamard transformation: global view

→ ⊗⊗ HHHxxx 321 ∑∈

⋅−3}1,0{

32181

)1(y

yx yyy

Page 38: Quantum Computer Algorithms: basics - SQuInT

The Hadamard transformation: global view

∑∈

⋅−=⊗⊗3}1,0{

321321 81

)1(y

yx yyyxxxHHH

Page 39: Quantum Computer Algorithms: basics - SQuInT

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

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

The Hadamard transformation: global view

321 xxxHHH → ⊗⊗∑∈

⋅−3}1,0{

32121

)1(y

yx yyy

Page 42: Quantum Computer Algorithms: basics - SQuInT

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

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

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

Eigenvalue kick-back

Page 46: Quantum Computer Algorithms: basics - SQuInT

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

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

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

SOME SIMPLE ALGORITHMS

Page 50: Quantum Computer Algorithms: basics - SQuInT

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

0 H

f

H

10 −

Page 51: Quantum Computer Algorithms: basics - SQuInT

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

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

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

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

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

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

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