Searching using Quantum Rules

15
Searching using Quantum Rules

description

Searching using Quantum Rules

Transcript of Searching using Quantum Rules

Page 1: Searching using Quantum Rules

Searching using Quantum Rules

Page 2: Searching using Quantum Rules

Classical

Our Two Worlds

Σ vi = 1 , 0<=vi<=1

T is stochastic (non-neg, col sums 1)

|v|2 = v†v = Σ |vi|2 = 1

T is Unitary T†T = I

QuantumMeasurement

System State is captured by a

Probability Distribution

System State is captured by an

Amplitude Distribution

Page 3: Searching using Quantum Rules

What does this mean for computation?

Page 4: Searching using Quantum Rules

Simple Search

• Given n items, A[1..n]

• Exactly one satisfies f()=1 – all others have f()=0

• Find the unique object for which f()=1

• How many f() calls are needed?

Page 5: Searching using Quantum Rules

Classical Algorithm

x Random item in 1..n

Repeat– – If f(x)=1

• Stay at x

– Else• Choose another (never previously picked) value for x,

each possible value equi-probably

K times

Page 6: Searching using Quantum Rules

Classical Algorithm: Analysis

si : State (i.e., value of x) in iteration i

s1 : [ …… ]

s2 : []

s3 : []

The state for which f()=1

K needs to be np before this prob

exceeds p

Page 7: Searching using Quantum Rules

Grover’s Quantum Algorithmx Random item in 1..n

Repeat

– If f(x)=1 • then stay at x with amplitude -1• else stay at x with amplitude 1

– Choose – this x with amplitude a– another value for x, each possible value with equal

amplitude, say b

K times

Page 8: Searching using Quantum Rules

Unitariness Constraints

12 0

Diagonals A, non-diagonals B

Page 9: Searching using Quantum Rules

Unitariness Constraints

[ (−1 ) 𝑓 (1) ⋯ 0⋮ ⋱ ⋮0 ⋯ (−1 ) 𝑓 (𝑛)]

Diagonal Matrix, so clearly Unitary

Page 10: Searching using Quantum Rules

Algorithm Analysis

([2−𝑛𝑛

2𝑛  

2𝑛  

2𝑛  

2−𝑛𝑛

2𝑛  

2𝑛  

2𝑛  

2−𝑛𝑛

⋱ ⋱] [ (−1 ) 𝑓 (1) ⋯ 0

⋮ ⋱ ⋮0 ⋯ (−1 ) 𝑓 (𝑛)]) [

1

√𝑛1

√𝑛1√𝑛

]k

Page 11: Searching using Quantum Rules

State Progression

si : State at the end of iteration i

s0 : [ …… ]

s1 : for destination item

[ - ] = - for other items

[ + ] = -

For n=4, one iteration suffices! With certainity!!

Page 12: Searching using Quantum Rules

State Progression in General

si : [ …… ]

si+1 : for destination item

- for other items

- + = -

What progress have we made?

The state for which f()=1

Page 13: Searching using Quantum Rules

Progress per Iteration [ …… ] . […… - ]

[]( + - = + ] = = 1 - = 1 -

State vector is rotated by roughly

radians towards destination

Dot Product

Page 14: Searching using Quantum Rules

GeometryInitial State

Vector[ …… ]

Destination State Vector[0 0……1]

Intermediate State Vectors, each rotated

by

K = floor or ceiling of ,

whichever leaves a smaller angle

Page 15: Searching using Quantum Rules

Wrapping Up

• After floor/ceiling <= iterations,

– state vector [a a a a b] satisfies b < – so b > = (1 - ) = (1 - )

• Probability of getting the correct answer is at least 1 -