quantum computing comp308 lecture notes based on: introduction to quantum computing cleve/cs497-f07...

68
Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing http://www.cs.uwaterloo.ca/~cleve/CS497-F07 Richard Cleve, Institute for Quantum Computing, University of Waterloo Introduction to Quantum Computing and Quantum Information Theory Dan C. Marinescu and Gabriela M. Marinescu Computer Science Department , University of Central Florida

Post on 19-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Quantum computing

COMP308 Lecture notes based on:

Introduction to Quantum Computing http://www.cs.uwaterloo.ca/~cleve/CS497-F07Richard Cleve, Institute for Quantum Computing, University of Waterloo

Introduction to Quantum Computing and Quantum Information TheoryDan C. Marinescu and Gabriela M. MarinescuComputer Science Department , University of Central Florida

Page 2: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

2

Moore’s Law

• Measuring a state (e.g. position) disturbs it• Quantum systems sometimes seem to behave as if

they are in several states at once• Different evolutions can interfere with each other

Following trend … atomic scale in 15-20 years

Quantum mechanical effects occur at this scale:

1975 1980 1985 1990 1995 2000 2005104

105

106

107

108

109number of transistors

year

Page 3: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

3

Quantum mechanical effectsAdditional nuisances to overcome?

or

New types of behavior to make use of?

[Shor ’94]: polynomial-time algorithm for factoring integers on a quantum computer

This could be used to break most of the existing public-key cryptosystems, including RSA, and elliptic curve crypto

[Bennett, Brassard ’84]: provably secure codes with short keys

Page 4: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

4

Also with quantum information:• Faster algorithms for combinatorial search problems• Fast algorithms for simulating quantum mechanics • Communication savings in distributed systems• More efficient notions of “proof systems”

Quantum information theory is a generalization of the classical information theory that we all know—which is based on probability theory

classical information

theory

quantum information

theory

Page 5: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

What is a quantum computer?

A quantum computer is a machine that performs calculations based on the laws of quantum mechanics, which is the behavior of particles at the sub-atomic level.

Page 6: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Introduction

“I think I can safely say that nobody understands quantum mechanics” - Feynman

1982 - Feynman proposed the idea of creating machines based on the laws of quantum mechanics instead of the laws of classical physics.

1985 - David Deutsch developed the quantum turing machine, showing that quantum circuits are universal.

1994 - Peter Shor came up with a quantum algorithm to factor very large numbers in polynomial time.

1997 - Lov Grover develops a quantum search algorithm with O(√N) complexity

Page 7: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Representation of Data - Qubits

A bit of data is represented by a single atom that is in one of two states denoted by |0> and |1>. A single bit of this form is known as a qubit

A physical implementation of a qubit could use the two energy levels of an atom. An excited state representing |1> and a ground state representing |0>.

Excited State

Ground State

Nucleus

Light pulse of frequency for time interval t

Electron

State |0> State |1>

Page 8: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Representation of Data - Superposition

A single qubit can be forced into a superposition of the two states denoted by the addition of the state vectors:

|> = |0> + |1>

Where and are complex numbers and | | + | | = 1

1 2

1 2 1 22 2

A qubit in superposition is in both of the states |1> and |0 at the same time

Page 9: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Representation of Data - Superposition

Light pulse of frequency for time

interval t/2

State |0> State |0> + |1>

Consider a 3 bit qubit register. An equally weighted superposition of all possible states would be denoted by:

|> = |000> + |001> + . . . + |111>1

√8

1

√8

1

√8

Page 10: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

One qubit

• Mathematical abstraction• Vector in a two dimensional complex vector space

(Hilbert space)• Dirac’s notation

ket column vector bra row vector

bra dual vector (transpose and complexconjugate)

|

Page 11: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

11

A bit versus a qubit

• A bit– Can be in two distinct states, 0 and 1– A measurement does not affect the state

• A qubit – can be in state or in state or in any other state

that is a linear combination of the basis state– When we measure the qubit we find it

• in state with probability • in state with probability

0| 1|10 10

0|1|

20 ||

21 ||

10 10

1|||| 21

20

are complex numbers|,| 10

Page 12: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

The Boch sphere representation of one qubit

• A qubit in a superposition state is represented as a vector connecting the center of the Bloch sphere with a point on its periphery.

• The two probability amplitudes can be expressed using Euler angles.

b

| 0 >

| 1 >

z

x

y

ψ|

r

Page 13: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

13

0

1

0

1

(a) One bit (b) One qubit

Superposition states

Basis (logical) state 1

Basis (logical) state 0

0

1

Possible states of one qubit beforethe measurement

The state of the qubit afterthe measurement

p1

p0

Qubit measurement

Page 14: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Two qubits

• Represented as vectors in a 2-dimensional Hilbert space with four basis vectors

• When we measure a pair of qubits we decide that the system it is in one of four states

• with probabilities

11,10,01,00

11,10,01,00

211

210

201

200 ||,||,||,||

11 10 01 0011 10 01 00

1 | | | | | | | |2

112

102

012

00

Page 15: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

15

Measuring two qubits

• Before a measurement the state of the system consisting of two qubits is uncertain (it is given by the previous equation and the corresponding probabilities).

• After the measurement the state is certain, it is 00, 01, 10, or 11 like in the case of a classical two bit

system.

Page 16: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

16

Measuring two qubits (cont’d)

• What if we observe only the first qubit, what conclusions can we draw?

• We expect that the system to be left in an uncertain sate, because we did not measure the second qubit that can still be in a continuum of states. The first qubit can be – 0 with probability – 1 with probability

201

200 ||||

211

210 ||||

Page 17: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

17

Bell state

1/sqrt(2) |0> + 1/sqrt(2) |1>Measurement of a qubit in that state gives 50% of time logic 0, 50% of time logic.Can also be denoted as |+>

Page 18: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

18

Entanglement

• Entanglement is an elegant, almost exact translation of the German term Verschrankung used by Schrodinger who was the first to recognize this quantum effect.

• An entangled pair is a single quantum system in a superposition of equally possible states. The entangled state contains no information about the individual particles, only that they are in opposite states.

• The important property of an entangled pair is that the measurement of one particle influences the state of the other particle. Einstein called that “Spooky action at a distance".

Page 19: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Due to the nature of quantum physics, the destruction of information in a gate will cause heat to be evolved which can destroy the superposition of qubits.

Operations on Qubits - Reversible Logic

A B C

0 0 0

0 1 0

1 0 0

1 1 1

Input Output

A

BC

In these 3 cases, information is being destroyed

Ex.

The AND Gate

This type of gate cannot be used. We must use Quantum Gates.

Page 20: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Quantum Gates

Quantum Gates are similar to classical gates, but do not have a degenerate output. i.e. their original input state can be derived from their output state, uniquely. They must be reversible. This means that a deterministic computation can be performed on a quantum computer only if it is reversible. Luckily, it has been shown that any deterministic computation can be made reversible.(Charles Bennet, 1973)

Page 21: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

21

One-qubit gate

10 10

G

2221

1211

gg

ggG

1

0

2221

1211

1

0

gg

gg

10 '1

'0

Page 22: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

22

One qubit gates

• I identity gate; leaves a qubit unchanged.• X or NOT gate transposes the components

of an input qubit.• Y gate.• Z gate flips the sign of a qubit.• H the Hadamard gate.

Page 23: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Quantum Gates - Hadamard

Simplest gate involves one qubit and is called a Hadamard Gate (also known as a square-root of NOT gate.) Used to put qubits into superposition.

H

State |0>

State |0> + |1>

H

State |1>

Note: Two Hadamard gates used in succession can be used as a NOT gate

Page 24: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Quantum Gates - Controlled NOT

A gate which operates on two qubits is called a Controlled-NOT (CN) Gate. If the bit on the control line is 1, invert the bit on the target line.

A - Target

B - Control

A B A’ B’

0 0 0 0

0 1 1 1

1 0 1 0

1 1 0 1

Input Output

Note: The CN gate has a similar behavior to the XOR gate with some extra information to make it reversible.

A’

B’

Page 25: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Example Operation - Multiplication By 2

Carry Bit

Carry Bit

Ones Bit

Carry Bit

Ones Bit

0 0 0 0

0 1 1 0

Input Output

Ones Bit

We can build a reversible logic circuit to calculate multiplication by 2 using CN gates arranged in the following manner:

0

H

Page 26: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Quantum Gates - Controlled Controlled NOT (CCN)

A - Target

B - Control 1

C - Control 2

A B C A’ B’ C’

0 0 0 0 0 0

0 0 1 0 0 1

0 1 0 0 1 0

0 1 1 1 1 1

1 0 0 1 0 0

1 0 1 1 0 1

1 1 0 1 1 0

1 1 1 0 1 1

Input Output

A’

B’

C’

A gate which operates on three qubits is called a Controlled Controlled NOT (CCN) Gate. Iff the bits on both of the control lines is 1,then the target bit is inverted.

Page 27: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

A Universal Quantum Computer

The CCN gate has been shown to be a universal reversible logic gate as it can be used as a NAND gate.

A - Target

B - Control 1

C - Control 2

A B C A’ B’ C’

0 0 0 0 0 0

0 0 1 0 0 1

0 1 0 0 1 0

0 1 1 1 1 1

1 0 0 1 0 0

1 0 1 1 0 1

1 1 0 1 1 0

1 1 1 0 1 1

Input OutputA’

B’

C’

When our target input is 1, our target output is a result of a NAND of B and C.

Page 28: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

28

Classical and quantum systems

111

110

101

100

011

010

001

000

p

p

p

p

p

p

p

pProbabilistic states:

1x

xp

0 xpx,

111

110

101

100

011

010

001

000

α

α

α

α

α

α

α

αQuantum states:

12

xxα

Cαx x ,

x

x xαψ

Dirac notation: |000, |001, |010, …, |111 are basis vectors,

so

Page 29: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

29

Dirac bra/ket notation

d

2

1Ket: ψ always denotes a column vector, e.g.

Bracket: φψ denotes φψ, the inner product of φ and

ψ

Bra: ψ always denotes a row vector that is the conjugate transpose of ψ, e.g.

[ *1 *

2 *d ]

0

10

1

01Convention:

Page 30: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

30

Basic operations on qubits (I)

cossin

sincosRotation by :

(0) Initialize qubit to |0 or to |1

(1) Apply a unitary operation U (formally U†U = I )

Examples:

0

10

1

01Recall

conjugate transpose

01

10Xx

NOT (bit flip):Maps |0 |1

|1 |0

10

01Zz

Phase flip: Maps |0 |0 |1 |1

Page 31: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

31

Basic operations on qubits (II)

11

11

2

1HHadamard:

More examples of unitary operations: (unitary rotation)

1

1

2

1

2

1 100H

1

1

2

1

2

1 101H

0

1

Reflection about this line

H0

H1

Page 32: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

32

Basic operations on qubits (III)(3) Apply a “standard” measurement:

0 + 1

2

2

probwith1

probwith0

() There exist other quantum operations, but they can all be “simulated” by the aforementioned types

Example: measurement with respect to a different orthonormal basis {ψ0, ψ1}

||2

||2

0

1

ψ0

ψ1

… and the quantum state collapses to 0 or 1

Page 33: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

33

Distinguishing between two states

Question 1: can we distinguish between the two cases?

Let be in state or

Distinguishing procedure:

1. apply H2. measure

This works because H + = 0 and H − = 1

Question 2: can we distinguish between 0 and +?

Since they’re not orthogonal, they cannot be perfectly distinguished … but statistical difference is detectable

102

1 10

2

1

Page 34: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

34

Operations on n-qubit states

Unitary operations:

xx

xx xαxα U

… and the quantum state collapses

x

x xα

Measurements:

2

111

2

001

2

000

probwith111

probwith001

probwith000

α

α

α

(U†U = I )

111

001

000

α

α

α

Page 35: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

35

Entanglement

11'10'01'00'1'0'10 βββααβααβαβα

The state of the combined system their tensor product:

??

Suppose that two qubits are in states: 10 1'0'

11100100 21

21

21

21

Question: what are the states of the individual qubits for

1. ?

2. ?11002

12

1

10102

12

12

12

1 Answers: 1.

2. ... this is an entangled state

Page 36: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

36

Structure among subsystems

V

UW

qubits:

#2

#1

#4

#3

time

unitary operations measurements

Page 37: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

37

Quantum circuits

0

1

1

0

1

0

1

0

1

0

1

1

Computation is “feasible” if circuit-size scales polynomially

Page 38: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

38

One-qubit gate

10 10

G

2221

1211

gg

ggG

1

0

2221

1211

1

0

gg

gg

10 '1

'0

Page 39: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

39

One qubit gates

2221

1211

gg

ggG

2212

2111

gg

ggGT

*22

*12

*21

*11

gg

ggG

Igggggggg

ggggggggGG

22*2212

*1221

*2211

*12

22*2112

*1121

*2111

*11

Page 40: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

40

10

010 I

10

013 Z

0

02 i

iY

01

101 X

11

11

2

1H

10 10

10 01

10 01 ii

10 10

2

10

2

1010

Identity transformation, Pauli matrices, Hadamard

Page 41: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

41

Tensor products and ``outer’’ products

0000

0000

0000

0001

0001

0

0

0

1

0000

0

0

0

1

0

1

0

10|0|00

Page 42: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

42

CNOT a two qubit gate

• Two inputs– Control – Target

• The control qubit is transferred to the output as is.• The target qubit

– Unaltered if the control qubit is 0– Flipped if the control qubit is 1.

addition modulo 2+O

Target input

Control input

O+

Page 43: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

43

CNOT

CNOTV

0100

1000

0010

0001

CNOTG

CNOTCNOTCNOT VGW

Page 44: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

44

The two input qubits of a two qubit gates

10 10

10 10

11

01

10

00

1

0

1

0

CNOTV

Page 45: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

45

Two qubit gates

1011111001010000 CNOTG

0100

1000

0010

0001

CNOTG

Page 46: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

46

Two qubit gates

01

11

10

00

11

01

10

00

0100

1000

0010

0001

CNOTW

CNOTCNOTCNOT VGW

11100100 01111000 CNOTW

)10(1)10(0 011100 CNOTW

Page 47: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

47

Final comments on the CNOT gate

• CNOT preserves the control qubit (the first and the second component of the input vector are replicated in the output vector) and flips the target qubit (the third and fourth component of the input vector become the fourth and respectively the third component of the output vector).

• The CNOT gate is reversible. The control qubit is replicated at the output and knowing it we can reconstruct the target input qubit.

)10(1)010(0 011100 CNOTW

Page 48: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

48

Example of a one-qubit gate applied to a two-qubit system

1110

0100

uu

uuU

U

(do nothing)

The resulting 4x4 matrix is

1110

0100

1110

0100

00

00

00

00

uu

uu

uu

uu

UI00 0U0 01

0U1 10

1U0 11

1U1

Maps basis states as:

Question: what happens if U is applied to the first qubit?

Page 49: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

49

Controlled-U gates

1110

0100

00

00

0010

0001

uu

uu

U

00 00 01

01 10 1U0

11 1U1

Maps basis states as:

Resulting 4x4 matrix is

controlled-U =

1110

0100

uu

uuU

Page 50: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

50

Controlled-NOT (CNOT)

Note: “control” qubit may change on some input states!

X

a

b ab

a

0 + 1

0 − 10 − 1

0 − 1 H

H

H

H

Page 51: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

51

Multiplication problem

• “Grade school” algorithm takes O(n2) steps

• Best currently-known classical algorithm costs O(n log

n loglog n)

• Best currently-known quantum method: same

Input: two n-bit numbers (e.g. 101 and 111)

Output: their product (e.g. 100011)

Page 52: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

52

Factoring problem

• Trial division costs 2n/2

• Best currently-known classical algorithm costs O(2n⅓ log⅔

n

)• Hardness of factoring is the basis of the security of many

cryptosystems (e.g. RSA)

• Shor’s quantum algorithm costs n2 [ O(n2 log n loglog n) ]• Implementation would break RSA and other cryptosystems

Input: an n-bit number (e.g. 100011)

Output: their product (e.g. 101, 111)

Page 53: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Grover’s Search Algorithm

• Search in a database with N names.• Names are randomly entered.• Classically on average N/2 search is required.

O(N) operations is required.• Quantum computation requires O(sqrt(N))

operations

Page 54: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

54

How do quantum algorithms work?

This is not performing “exponentially many computations at polynomial cost”

But we can make some interesting tradeoffs:

instead of learning about any (x, f (x)) point, one can learn something about a global

property of f

Given a polynomial-time classical algorithm for f :{0,1}n → T, it is straightforward to

construct a quantum algorithm that creates the state:

x

xfxn

)(,2

1

The most straightforward way of extracting information from the state yields just

(x, f (x)) for a random x{0,1}n

Page 55: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

55

Deutsch’s problem

Let f : {0,1} → {0,1} f

There are four possibilities:

x f1(x)

0 1

0 0

x f2(x)

0 1

1 1

x f3(x)

0 1

0 1

x f4(x)

0 1

1 0

Goal: determine f(0) f(1)

Any classical method requires two queries

What about a quantum method?

Page 56: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

56

Reversible black box for f

Uf

a

b

a

b f(a)

falternate notation:

A classical algorithm: (still requires 2 queries) f f0

0

1

f(0) f(1)

2 queries + 1 auxiliary operation

Page 57: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

57

Quantum algorithm for Deutsch

H f

H

H

1

0 f(0) f(1)

1 query + 4 auxiliary operations

11

11

2

1H

How does this algorithm work?

Each of the three H operations can be seen as playing a different role ...

1

2 3

Page 58: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

58

Quantum algorithm (1) H f

H

H

1

0

1. Creates the state 0 – 1, which is an eigenvector of

1

2 3

NOT with eigenvalue –1

I with eigenvalue +1

This causes f to induce a phase shift of (–1) f(x) to x

f

0 – 1

x (–1) f(x)x

0 – 1

Page 59: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

59

Quantum algorithm (2) 2. Causes f to be queried in superposition (at 0 + 1)

f

0 – 1

0(–1) f(0)0 + (–1) f(1)1

0 – 1

H

x f1(x)

0 1

0 0

x f2(x)

0 1

1 1

x f3(x)

0 1

0 1

x f4(x)

0 1

1 0

(0 + 1) (0 – 1)

Page 60: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

60

Quantum algorithm (3) 3. Distinguishes between (0 + 1) and (0 – 1)

H

(0 + 1) 0

(0 – 1) 1

H

Page 61: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

61

Summary of Deutsch’s algorithm

H f

H

H

1

0 f(0) f(1)

1

2 3

constructs eigenvector so f-queries

induce phases: x (–1) f(x)x

produces superpositions of inputs to f : 0 + 1

extracts phase differences from

(–1) f(0)0 + (–1) f(1)1

Makes only one query, whereas two are needed classically

Page 62: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

62

One-out-of-four searchLet f : {0,1}2 → {0,1} have the property that there is exactly one x {0,1}2 for

which f (x) = 1

Four possibilities: x f00(x)

00011011

1 0 0 0

Goal: find x {0,1}2 for which f (x) = 1

x f01(x)

00011011

0 1 0 0

x f10(x)

00011011

0 0 1 0

x f11(x)

00011011

0 0 0 1

What is the minimum number of queries classically? ____

Quantumly? ____

Page 63: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

63

Quantum algorithm (I)

fx1

x2

yx2

x1

y f(x1,x2)

((–1) f(00)00 + (–1) f(01)01 + (–1) f(10)10 + (–1) f(11)11)(0 – 1)

Output state of query?

Black box for 1-4 search:

Start by creating phases in superposition of all inputs to f:

Input state to query?fH

H

H1

0

0(00 + 01 + 10 + 11)(0 – 1)

Page 64: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

64

Quantum algorithm (II)

Output state of the first two qubits in the four cases:

fH

H

H1

0

0

Case of f00?ψ01 = + 00 – 01 + 10 + 11

ψ10 = + 00 + 01 – 10 + 11

ψ11 = + 00 + 01 + 10 – 11

What noteworthy property do these states have? Orthogonal

U

ψ00 = – 00 + 01 + 10 + 11

Case of f01?Case of f10?Case of f11?

Apply the U that maps

ψ00, ψ01, ψ10, ψ11 to

00, 01, 10, 11 (resp.)

Page 65: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

What makes a quantum algorithm potentially faster thanany classical one?

• Quantum parallelism: by using superpositions of quantum states, the computer is executing the algorithm on all possible inputs at once

• Dimension of quantum Hilbert space: the “size” of the state space for the quantum system is exponentially larger than the corresponding classical system

• Entanglement capability: different subsystems (qubits) in a quantum computer become entangled, exhibiting nonclassical correlations

Page 66: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Quantum algorithms research

• Require more quantum algorithms in order to: solve problems more efficiently

• understand the power of quantum computation• make valid/realistic assumptions for information

security• Problems for quantum algorithms research:

– requires close collaboration between physicists and computer scientists

– highly non-intuitive nature of quantum physics– even classical algorithms research is difficult

Page 67: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Summary of quantum algorithms

• It may be possible to solve a problem on a quantum system much faster (i.e., using fewer steps) than on a classical computer• Factorization and searching are examples of problems where

quantum algorithms are known and are faster than any classical ones

• Implications for cryptography, information security• Study of quantum algorithms and quantum computation is

important in order to make assumptions about adversary’s algorithmic and computational capabilities

• Leading to an understanding of the computational power of quantum vs classical systems

Page 68: Quantum computing COMP308 Lecture notes based on: Introduction to Quantum Computing cleve/CS497-F07 Richard Cleve, Institute

Conclusion

In 2001, a 7 qubit machine was built and programmed to run Shor’s algorithm to successfully factor 15.

What algorithms will be discovered next?

Can quantum computers solve NP Complete problems in polynomial time?