You are on page 1of 45

Introduction to Quantum Information Processing

CO481/CS467/PHYS467

Michele Mosca mmosca@uwaterloo.ca


CO481 CS467 PHYS467
AccessAbility Services
Volunteer Notetaker Required
Interested? Complete an online application using
your WATIAM:
https://york.accessiblelearning.com/UWaterloo/
More information:
Website: https://uwaterloo.ca/accessability-
services/opportunities/volunteer-notetaker
Email: notetaking@uwaterloo.ca
Phone: 519-888-4567, ext. 35082
The art of quantum algorithmics is to
choreograph constructive interference
on desirable outcomes and destructive
interference on undesirable outcomes.

3
Some basic tools

4
The Hadamard basis change

H1 1
0 → 0 + 1
2 2
H 1 1
1 → 0 − 1
2 2

1 1 H
0 − 1 → 1
2 2
5
The Hadamard transformation summary

H1 b 1
b ←→ 0 + ( −1) 1
2 2

6
The Hadamard transformation: circuit notation

1 b 1
b H 2
0 + ( −1)
2
1

7
The Hadamard transformation on several bits

1 x1 1
x1 H 2
0 + ( −1)
2
1

1 1
H
x2
x2 0 + ( −1) 1
2 2
1 1
H
x3
x3 0 + ( −1) 1
2 2

8
What is the amplitude of 010?
1 x1 1
x1 H 2
0 + ( −1)
2
1

1 1
H
x2
x2 0 + ( −1) 1
2 2
1 1
H
x3
x3 0 + ( −1) 1
2 2
What is the amplitude of y1y2y3?

1 x1 1
x1 H 2
0 + ( −1)
2
1

1 1
H
x2
x2 0 + ( −1) 1
2 2
1 1
H
x3
x3 0 + ( −1) 1
2 2
The Hadamard transformation: global view

H
1
x1 x2 x3 H ∑ ( −1) x⋅ y

8
y1 y2 y3
y∈{0 ,1}3

11
The Hadamard transformation: global view

H ⊗H ⊗H
1
x1 x2 x3  ∑ ( −1) x⋅ y

8
y1 y2 y3
y∈{0 ,1}3

12
The Hadamard transformation: global view

1
H ⊗ H ⊗ H x1 x2 x3 = ∑ (−1) x⋅ y

8
y1 y2 y3
y∈{0 ,1}3

13
The Hadamard transformation on several bits

1 x1 1
x1
2
0 + ( −1)
2
1 H
1 1 x2
0 + ( −1) x2
1 H
2 2
1 1 x3
2
0 + ( −1) x3

2
1 H
14
The Hadamard transformation: global view

H
1
∑ 3
( −1) x⋅ y

2
y1 y2 y3
H x1 x2 x3
y∈{0 ,1}

15
The Hadamard transformation: global view

1 H ⊗H ⊗H
∑ ( −1) x⋅ y

2
y1 y2 y3  x1 x2 x3
y∈{0 ,1}3

16
Looking at NOT and CNOT in Hadamard bases

Consider applying a NOT gate to the following states

NOT
0 + 1 
→ 0 + 1

→ −( 0 − 1
0 − 1  NOT
)
17
Now consider applying a controlled-NOT gate to the following states

0 ( 0 + 1 ) → 0 ( 0 + 1 )
CNOT

1 ( 0 + 1 ) → 1 ( 0 + 1 )
CNOT

0 ( 0 − 1 ) → 0 ( 0 − 1 )
CNOT

1 ( 0 − 1 ) → − 1 ( 0 − 1 )
CNOT
Now consider applying a controlled-NOT gate to the following states

(0 +1 )( 0 + 1 ) →( 0 + 1
CNOT
)( 0 +1)
(0 − 1 )( 0 + 1 ) →( 0 − 1 )( 0
CNOT
+1)
(0 + 1 )( 0 − 1 ) →( 0 − 1 )( 0
CNOT
−1)
(0 − 1 )( 0 − 1 ) →( 0 + 1 )( 0
CNOT
−1)

19
Computing functions into phases

Suppose we know how to compute a function

f : {0,1} → {0,1}
Uf
x c  x c ⊕ f (x )

x (0 − 1 )  ( −1) f ( x ) x (0 −1 )
Deutsch’s problem

Compute f (0) ⊕ f (1) using Uf only once

0 H H

0 −1 f
Deutsch algorithm

(−1) f ( 0 )
0 H H f (0) ⊕ f (1)
2
0 −1 f 0 −1
(−1) f ( 0 )
0 H H f (0) ⊕ f (1)
2
0 −1 f 0 −1
Aside: This was the first quantum algorithm
implemented (1997)
Garbage-free implementations of f(x)

Does the Deutsch algorithm work if when we implement

x 0  x f ( x)
we actually leave “junk” information in ancilla qubits?

x 0 0  x f ( x) junk ( x)
No!! We need a “clean” implementation of f(x).

25
Garbage-free implementations of f(x)

e.g. (reversing location of junk bit for convenience) if, for f(x)=x,
instead of (when computing f, and then applying H to the first qubit)

there is additional “junk”, say another copy of x, left in the extra bit.
Then (ignoring normalization factors) we’d get

We lose the interference that cancels out “0” and leaves “1”.
26
Deutsch-Jozsa problem

n
Suppose f : {0,1} → {0,1} with the promise that
f is either constant or “balanced”.

Decide if f is constant or balanced.

2
Equivalently, determine  ∑ (−1) f ( x)

 x 
 n 
 2 
 
0 H H
0 H H
0 H H
0 −1 f 0 −1
0 H H
0 H H
0 H H
0 −1 f 0 −1
0 H H  ∑ (−1) f ( x ) + x⋅ y 
 x 
∑ 3 y
0 H H
3
y∈{0 ,1}  2 
 
0 H H
0 −1 f 0 −1
2
 ∑ (−1) f ( x ) 
 x 
 
Probability of measuring 000 is  23 
 
i.e. we measure 000 iff f is constant
Simon’s problem

Let f : {0,1}n → {0,1}n have the property that there exists an s ∈ {0,1}n
such that f (x) = f (y) iff x⊕y = s or x = y

Example:
x f (x)
000 011
001 101
010 000
What is s is this case? s= 101
011 010
100 101
101 011
110 010
111 000
Classical algorithm for Simon’s problem

Search for a collision, an x ≠ y such that f (x) = f (y)

1. Choose x1, x2 ,..., xk ∈ {0,1}n uniformly randomly (independently)

2. For all i ≠ j, if f (xi) = f (xj) then output xi⊕xj and halt

A hard case is where s is chosen randomly from {0,1}n– {0n} and then
the “table” for f is filled out randomly subject to the structure implied by s

Question: How big does k have to be for the probability of a collision


to be a constant, such as ¾?

Answer: order 2n/2


Classical lower bound

Theorem: any classical algorithm solving Simon’s problem must


make Ω(2n/2) queries

Note: the performance analysis of the previous algorithm does not


imply the theorem

… how can we know that there isn’t a different algorithm that performs
better?
Quantum algorithm for Simon’s problem

|x1〉 |x1〉
Queries:
|x2〉 |x2〉
|xn〉 |xn〉
Uf
|y1〉
|y2〉 | y ⊕ f (x)〉
|yn〉
|0〉 H
Proposed start of quantum
algorithm: query all values of f |0〉 H
in superposition
|0〉 H
Uf ?

What is the output state of this |0〉


circuit? |0〉
|0〉
Answer: the output state is
∑x f ( x)
x∈{0 ,1}n
Answer: the output state is
∑x f ( x)
x∈{0 ,1}n
x f (x)
Let T ⊆ {0,1}n
be such that one element from each
matched pair is in T (assume s ≠ 00...0) 000 011
001 101
Example: could take T = {000, 001, 011, 111} 010 000
011 010
Then the output state can be written as:
100 101
∑x
x∈T
f ( x) + x ⊕ s f ( x ⊕ s ) 101 011
110 010
= ∑( x + x ⊕ s ) f ( x) 111 000
x∈T
Measuring the second register yields |x〉 + |x ⊕ s〉 in the first register,
for a random x ∈ T

How can we use this to learn about s?

Try applying H ⊗n to the state, yielding:

∑ (n−1) y + ∑ (−1)( x⊕s)• y y


x• y
y∈{0 ,1} n
y∈{0 ,1}

= ∑ (−1) x• y 1+ (−1) s • y  y


n y∈{0 ,1}
 

(1/2)n–1 if s ∙ y = 0
Measuring this state yields y with prob. 0 if s ∙ y ≠ 0
|0〉 H H
Executing this algorithm k = n+O(1) times yields
random y1, y2 ,..., yk ∈ {0,1}n such that s ∙ y1 = s ∙ y2 |0〉 H H
= ... = s∙ yn = 0 |0〉 H H
Uf
How does this help? |0〉
This is a system of k linear equations: |0〉
|0〉
 y11 y12  y1n   s1  0
y
 21 y22  y2 n   s2  0
 = 
         
    
 yk 1 yk 2  ykn   sn  0

With high probability, there is a unique non-zero solution that is s


(which can be efficiently found by linear algebra)
• Any classical algorithm has to query the black box Ω(2n/2 ) times,
even to succeed with probability ¾.

• There is a quantum algorithm that queries the black box only


n+O(1) times, performs only O(n 3 ) auxiliary operations (for the
Hadamards, measurements, and linear algebra), and succeeds with
probability ¾.
Another property of Hadamard transformation

n
Consider S ≤ Z2

{ n
S = t : t ∈ Z 2 , s ⋅ t = 0 ∀s ∈ S

}
1
Let y+S =∑ y+s
s∈S S

( −1) y⋅t
Then
H ⊗n y + S = ∑ t
t∈S ⊥ S⊥
40
Generalized Simon’s problem

Suppose f : {0,1}n → X has the property that

f ( x) = f ( y ) iff x+S = y+S

n
For some “hidden subgroup” S ≤ Z2

Uf
Given x 0  x f ( x) find
S

41
Simon’s algorithm

0 H H t1
0 H H t2

t ∈S
0 H H t3
0 1
Pr ( t ) = ⊥
f S
0
S 1  
∑  ∑ (−1) y⋅t t  f ( y )
∑ 3 2 n
y + S f ( y) S⊥ y + S∈
Z 2
3

S
 t∈S ⊥ 
Z 42
y + S∈ 2
S
Abelian Hidden subgroup problem

Suppose f :G → X has the property that

f ( x) = f ( y ) iff x+S = y+S


for some “hidden subgroup” S ≤G
Uf
Given x 0  x f ( x) find S

43
Hidden subgroup problem

0
0 F F −1 t ∈S⊥

0
1
Pr ( t ) = ⊥
0 S
f
0
1
∑ S ⊥
y + S f ( y) 1
S⊥
 
∑G  ∑⊥α y ,t t  f ( y)
 t∈S 
y + S∈G y + S∈
S 44
S
Reading
Chapter 6

45

You might also like