searching using quantum rules
DESCRIPTION
Searching using Quantum RulesTRANSCRIPT
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
What does this mean for computation?
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?
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
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
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
Unitariness Constraints
12 0
Diagonals A, non-diagonals B
Unitariness Constraints
[ (−1 ) 𝑓 (1) ⋯ 0⋮ ⋱ ⋮0 ⋯ (−1 ) 𝑓 (𝑛)]
Diagonal Matrix, so clearly Unitary
Algorithm Analysis
([2−𝑛𝑛
2𝑛
2𝑛
2𝑛
2−𝑛𝑛
2𝑛
2𝑛
2𝑛
2−𝑛𝑛
⋱
⋱ ⋱] [ (−1 ) 𝑓 (1) ⋯ 0
⋮ ⋱ ⋮0 ⋯ (−1 ) 𝑓 (𝑛)]) [
1
√𝑛1
√𝑛1√𝑛
]k
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!!
State Progression in General
si : [ …… ]
si+1 : for destination item
- for other items
- + = -
What progress have we made?
The state for which f()=1
Progress per Iteration [ …… ] . […… - ]
[]( + - = + ] = = 1 - = 1 -
State vector is rotated by roughly
radians towards destination
Dot Product
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
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 -