Professional Documents
Culture Documents
CO481/CS467/PHYS467
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
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
f : {0,1} → {0,1}
Uf
x c x c ⊕ f (x )
x (0 − 1 ) ( −1) f ( x ) x (0 −1 )
Deutsch’s problem
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)
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”.
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
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
… 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 ?
(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
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
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
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