quantum computer algorithms: basics - squint
TRANSCRIPT
Quantum Computer Algorithms: basics
SQUINT Summer School on Quantum Information Processing
June 2003
Michele MoscaCanada Research Chair in Quantum Computation
Overview
l A quantum computing model l Basis changesl Eigenvalue kick-backl Some simple algorithms
A QUANTUM COMPUTING MODEL
“Classical” logic gates
l A gate is a function from m bits to n bits, for some fixed numbers m and n
ab a b
AND
a aNOT
“Classical” circuits
l We “glue” gates together to make “circuits” (or “arrays of gates”) which compute Boolean functions
Universal sets of logic gatesl A set B of gates is universal if, for any
Boolean function F, there is a circuit composed of gates in B that computes F
l E.g. B = { NOT } is not universall E.g B = { AND } is not universall E.g. B = {NOT, AND, FANOUT } is universal
examplel A circuit made from gates from set
},,{=A
Universal sets of logic gatesl If B is universal
l then
},,{=B
≈
≈
= C
C ≈ C
e.g.
Universal sets of logic gatesl We can exactly simulate the circuit with
gates from A with a circuit with gates from B
≈ C CC
C
Making irreversible gates reversible
0 ab a ba
bab
a b
l Note that irreversible gates are really just reversible gates where we hardwire some inputs and/or throw away some outputs
≈
Making irreversible circuits reversible
0
0
abc
d
ab
cd
l Replace irreversible gates with their reversible counterparts
New gates and notation
X0 1
X1 0
0 0
b b
1 1
b b
“X”-gate or NOT-gate
“controlled-NOT” gate
A Classical Computing Model
000
Acyclic circuits of reversible gates
000
Example physical realization
0 1NOT
(negligible coupling to the environment)
More logic gates
01 1
1(negligible coupling to the environment)
A “classical” computation
000
01
1
Aside: Is this realistic?
l We do have a theory of classical linear error correction.
l But before we worry about stabilizing this system, let’s push forward its capabilities.
A quantum gate
1√NOT 0 +
√NOT 0 +12i
2i
21
21 1
0
A simple quantum circuit
√NOT0 √NOT 1i1
210
2i
+
Linear Algebra notation
01
√NOT0 √NOT 1i
221
21
2i
i
221
21
2i
i
i0 =
Notation
0000= = 0 0⊗ =
000 0⊗ =
01
⊗
01 = =
0001
=00
A quantum computation
0
00
0√NOT 0
0112
i +21
INOT ⊗10
2100
2+
i11
2100
2+
iCNOT
A quantum computation
00INOT ⊗
102100
2+
i11
2100
2+
iNOTc −
0001
Ii
i⊗
1
121
010
21
i
→
0100100000100001
100
21
i
A Quantum Computing Model
0
Acyclic circuits of unitary gates (from a finite “universal set”) and von Neumann measurements in the “computational” basis
00
000
∑∈
=nx
x x}1,0{
a?
Universalityl A set B of quantum gates is “universal” if,
for any positive integer n, any unitary operator on n qubits and for any , there is a finite circuit in those gates that implements satisfying
0>eU~
( )nSUU 2∈
e<−UU~ ???
AA1
min=
=where
In other wordsl A set B of quantum gates is “universal” if,
for any positive integer n, the gates of Bacting on n qubits span a dense subset of
.l Why not demand exact implementation of
all operators? Exact universality would require an infinite set of gates B and/or infinite sized circuits.
)2( nSU
Some universal setsl {C-NOT, all 1-qubit gates}l {C-NOT, H, P} l “most” 2-qubit gates are universal
BASIS CHANGES
Distinguishing orthogonal states
Given a state
we can in principle determine which state we have by “performing a Von Neumann measurement with respect to the basis B”
{ }NB ???? ,,, 21 K=∈
ijji d?? =
Distinguishing orthogonal states
We can implement this measurement efficiently if we can efficiently implement the unitary transformation
jA j =?
j? A
j
tA j?
In general
We can measure any state wrt the basis B in this way
∑j
j j?a A
j
tA j?
∑j
j ja with probability2
ja
The Hadamard basis change
12
10
21
0 H + →
12
10
21
1 H − →
012
10
21 H →+
112
10
21 H →−
The Hadamard transformation: summary
12
1)1(0
21
b bH −+ →←
The Hadamard transformation: circuit notation
b 12
1)1(0
21 b−+H
The Hadamard transformation on several bits
1x 12
1)1(0
21
1x−+H
2x 12
1)1(0
21
2x−+H
3x 12
1)1(0
21
3x−+H
The Hadamard transformation: global view
321 xxx ∑∈
⋅−3}1,0{
32181
)1(y
yx yyy
H
H
H
The Hadamard transformation: global view
→ ⊗⊗ HHHxxx 321 ∑∈
⋅−3}1,0{
32181
)1(y
yx yyy
The Hadamard transformation: global view
∑∈
⋅−=⊗⊗3}1,0{
321321 81
)1(y
yx yyyxxxHHH
The Hadamard transformation on several bits
1x12
1)1(0
21
1x−+ H
2x12
1)1(0
21
2x−+ H
3x12
1)1(0
21
3x−+ H
The Hadamard transformation: global view
321 xxx∑∈
⋅−3}1,0{
32121
)1(y
yx yyy
H
H
H
The Hadamard transformation: global view
321 xxxHHH → ⊗⊗∑∈
⋅−3}1,0{
32121
)1(y
yx yyy
Looking at NOT and CNOT in Hadamard bases
Consider applying a NOT (or “X”) gate to the following states
( )1010 X −− →−
1010 X + →+
HZHX =
−
=10
01Z
In other words:
e.g.
Now consider applying a controlled-NOT gate to the following states
( ) ( )101101 CNOT −− →−
( ) ( )100100 CNOT + →+
( ) ( )101101 CNOT + →+
( ) ( )100100 CNOT − →−
e.g.
Now consider applying a controlled-NOT gate to the following states
( )( ) ( )( )10101010 CNOT ++ →++
( )( ) ( )( )10101010 CNOT +− →+−
( )( ) ( )( )10101010 CNOT −− →−+
( )( ) ( )( )10101010 CNOT −+ →−−
Eigenvalue kick-back
Computing functions into the phase
Suppose we know how to compute a function
)( xfcxcx ⊕a
}1,0{}1,0{: →ffU
( ) ( )10)1(10 )( −−− xx xfa
Generalization:Eigenvalue “kick-back”
Suppose we know how to compute an operator
?? fieU =
( ) ( )?? f 1010 ieUc +=+−
?? 00 =− Uc
?? f 11 ieUc =−
Then the “controlled-U” gives us
How do we implement c-U?
Replace every gate G in the circuit for with a c-G.For example,
=
SOME SIMPLE ALGORITHMS
Deutsch’s problemCompute using only once )1()0( ff ⊕ fU
0 H
f
H
10 −
Deutsch algorithm
( )( )101)1(0)1(2
1 )1()0( −−+− ff
( )( )101)1(02)1( )1()0(
)0(
−−+−
= ⊕ fff
0 H
f
H )1()0(2)1( )0(
fff
⊕−
10 − 10 −
Deutsch-Jozsa problem
Suppose with the promise that f is either constant or “balanced”.
}1,0{}1,0{: →nf
Decide if f is constant or balanced.
2)(
2
)1(
−∑n
x
xfEquivalently, determine
Deutsch-Jozsa problem
yy
x
yxxf
∑∑
∈
⋅+
−
3}1,0{3
)(
2
)1(
2
3
)(
2
)1(
−∑x
xf
Probability of measuring is
000i.e. we measure iff is constantf
000
0 H H
0 H H
0 H H
f10 − 10 −
Bernstein-Vazirani problem
Suppose is of the formfor some
}1,0{}1,0{: →nf
Given determine
xaxf ⋅=)( na }1,0{∈
)( xfcxcx ⊕afU
naaaa K21=
Bernstein-Vazirani problem
0 H H
0 H H
0 H H
1a
2a
3a
∑∈ 3}1,0{
32
1
x
x ∑∈
⋅−3}1,0{
32
)1(
x
xa
x
f10 − 10 −
Another property of Hadamard transformation
Consider nZS 2≤
∑∈
+=+Ss
syS
Sy1
Let
Then∑
⊥∈⊥
⋅⊗ −
=+St
tyn t
SSyH
)1(
{ }SstsZttS n ∈∀=⋅∈=⊥ 0,: 2
e.g.Consider },0{ sS =
syySy ⊕+=+2
12
1Then
( )
−=
−+
−=
+
∑
∑∑
⊥∈−
⋅
⋅⊕⋅
⊗
Stn
ty
tn
tsy
tn
ty
n
t
tt
SyH
12
)1(
2
)1(2
1
2
)1(2
1