october 1 & 3, 20071 introduction to quantum computing lecture 2 of 2 richard cleve david r....
TRANSCRIPT
October 1 & 3, 2007 1
Introduction to Quantum ComputingIntroduction to Quantum ComputingLecture 2 of 2Lecture 2 of 2
Richard Cleve David R. Cheriton School of Computer Science
Institute for Quantum ComputingUniversity of Waterloo
CS 497 Frontiers of Computer ScienceCS 497 Frontiers of Computer Science
2
Recap of previous lectureRecap of previous lecture
Quantum states on n qubits are
2n-dimensional unit vectors
00 01
10
The basic operations on them are:• unitary operations (rotations)• measurements, that project on
to the basis states
quantum states
quantum circuits
Quantum algorithms so far:
• f(0) f(1) [Deutsch]
• one-out-of-four search
3
one-out-of-one-out-of-NN search?search?
Natural question: what about search problems in spaces larger than four (and without uniqueness conditions)?
For spaces of size eight (say), the previous method breaks down—the state vectors will not be orthogonal
Later on, we’ll see how to search a space of size N with
O(N ) queries ...
4
Contents of lecture 2Contents of lecture 21. Preliminary remarks2. Quantum states3. Unitary operations & measurements4. Subsystem structure & quantum circuit diagrams5. Introductory remarks about quantum algorithms6. Deutsch’s parity algorithm7. One-out-of-four search algorithm8. Shor’s period finding algorithm9. Grover’s search algorithm10. Concluding remarks
5
Contents of lecture 2Contents of lecture 21. Preliminary remarks2. Quantum states3. Unitary operations & measurements4. Subsystem structure & quantum circuit diagrams5. Introductory remarks about quantum algorithms6. Deutsch’s parity algorithm7. One-out-of-four search algorithm8. Shor’s period finding algorithm9. Grover’s search algorithm10. Concluding remarks
6
Period-findingPeriod-finding
r
Classically this is very hard in the general case—essentially it is as hard as finding a collision, which costs 2O(n) queries
Yet Quantum algorithms can determine r very efficiently: with only O(1) queries to f
This is the basis of Shor’s factoring algorithm ...
x y
Given: f :{0,1}n → T such that f is (strictly) r-periodic, with
unknown period r
7
ApplicationApplication of period-finding algorithm of period-finding algorithm
Example: let a = 4 and m = 35 (note that gcd(4,35) = 1)
•41 mod 35 = 4•42 mod 35 = 16•43 mod 35 = 29•44 mod 35 = 11•45 mod 35 = 9•46 mod 35 = 1•47 mod 35 = 4•48 mod 35 = 16• :
Question: what is r in this case?
The sequence is cyclic because the set Zm* ={a {1,2,…, m 1} : gcd(x, m ) = 1} is a group under multiplication mod m
Answer: r = 6
Order-finding problem ( factoring)
Input: m (an n-bit integer) and a < m such that gcd(x, m ) = 1
Output: the minimum r > 0 such that ar = 1 (mod m )
8
Application of period-finding algorithmApplication of period-finding algorithm
No classical polynomial-time algorithm is known for this problem — in fact, the factoring problem reduces to it
Order-finding reduces to finding the period of the function f (x) = a
x mod m, which can be computed in polynomial time
A circuit computing the function f is substituted into the black-box:
Order-finding problem ( factoring)
Input: m (an n-bit integer) and a < m such that gcd(x, m ) = 1
Output: the minimum r > 0 such that ar = 1 (mod m )
Ua,m
HV
x1x2xn
f(x)000
x1x2xn
9
SketchSketch of period-finding algorithm of period-finding algorithmConstruct x |x, f (x) and then measure second register to get
the following state:
k r r r r r r r(k random)
|k + |k + r + |k + 2r + |k + 3r + … + |k + (s 1)r
Measuring this state yields just a uniformly random value
More is needed to extract r, a global property of f ...
10
Quantum Fourier transformQuantum Fourier transform
2113121
13963
12642
132
1
1
1
1
11111
1
)()()(
)(
)(
NNNN
N
N
N
ωωωω
ωωωω
ωωωω
ωωωω
NNF
It’s a unitary operation on n qubits
(an NN matrix, where N = 2n)
where = e2i/N
11
Period inversion propertyPeriod inversion propertyApplying the quantum Fourier transform to the state |k + |k + r + |k + 2r + |k + 3r + … + |k + (s 1)r
yields the state|0 + k |s + 2k |2s + 3k |3s + … + (r
1)k |(r 1)s
Note: there is no longer an offset k (it’s now part of the “phase”)
k r r r r r r r
= e2i / r
s s s s s s
Measure to get multiple of s, from which r can be deduced
s = r 1
12
Computing the QFTComputing the QFT
H
4
8 4
816 4
32 16 8 4
H
H
H
H
11
11
2
1
mπie /2000
0100
0010
0001
Hm
Quantum circuit for F32:
Gates:
For F2n costs O(n2) gates
rev
erse
ord
er
13
QuantumQuantum algorithmalgorithm forfor order-findingorder-finding
HHH
000001
HH 4
4 8H
after measuring these qubits, can calculate r using classical methods
Ua,M x,y = x,axy mod m (poly-size circuit)
Quantum Fourier transform
Number of gates for a constant success probability is: O(n2 log n loglog n)
Ua,m
HV
14
Two-dimensional periodicityTwo-dimensional periodicity
Given: f :{0,1}n {0,1}n → T with a two-dimensional repeating pattern
Goal: find a simple description of this periodic strucuture
Quantum algorithms can also solve this very efficiently, and this is the basis of Shor’s discrete logarithm algorithm [1994]
15
Hidden subgroup problemHidden subgroup problemLet G be a known group and H be an unknown subgroup of G
Let f : G → T have the property f (x) = f ( y) iff x y1 H
(i.e., x and y are in the same right coset of H )
Problem: given a method for computing f, determine H
Example: G = Sn , the symmetric group (permutations of {1,2,…, n})
… alas no efficient quantum has been found for this version of HSP, despite significant effort by many people
Interesting fact: a fast algorithm for this leads to a fast algorithm for the graph isomorphism problem
16
Contents of lecture 2Contents of lecture 21. Preliminary remarks2. Quantum states3. Unitary operations & measurements4. Subsystem structure & quantum circuit diagrams5. Introductory remarks about quantum algorithms6. Deutsch’s parity algorithm7. One-out-of-four search algorithm8. Shor’s period finding algorithm9. Grover’s search algorithm10. Concluding remarks
17
Prelude: factoring vs. NPPrelude: factoring vs. NP
3-CNF-SAT
factoring
P
NP
PSPACE
co-NP
Is factoring an NP-hard problem?
But factoring hasn’t been shown to be NP-hard
Moreover, there is “evidence” that it is not NP-hard:factoring NPco-NP
If so, then every problem in NP is solvable by a poly-time quantum algorithm!
If factoring is NP-hard then NP = co-NP
18
Quantum search problemQuantum search problem
Given: a black box computing f : {0,1}n {0,1}
Goal: find x {0,1}n such that f (x) = 1
Classically, using probabilistic procedures, order 2n queries are necessary to succeed — even with probability ¾ (say)
x1
xny
xn
x1
y f(x1,...,xn)
UfQuery:
[Grover ’96]
Grover’s quantum algorithm makes only O(2n) queries
19
Applications of quantum searchApplications of quantum search
nn xxxxxxxxxx,...,xf 515324311
The function f could be realized as a 3-CNF formula:
In fact, the search could be for a certificate for any problem in NP
The resulting quantum algorithms appear to be quadratically more efficient than the best classical algorithms known
20
Prelude to Grover’s algorithm:Prelude to Grover’s algorithm:
two reflections = a rotationtwo reflections = a rotation
1
2
1
2
Consider two lines with intersection angle :
reflection 1
reflection 2
Net effect: rotation by angle 2, regardless of starting vector
21
Grover’s algorithm IGrover’s algorithm I
D
x1
xny
xn
x1
y f(x1,...,xn)
UfUf x(0 1) = (1) f(x)
x(0
1)
HHHH
Basic operations used:
nnn
nnn
nnn
D
2212222
2222122
2222221
Query:
Diffusion:
Hadamard:
Costs only O(n) gates
22
Grover’s algorithm IIGrover’s algorithm II
1. construct state H 0...02. repeat k times:
apply D Uf to state
3. measure state, to get x{0,1}n, and check if f (x) =1
0
0
H Uf D
iteration 1
Uf D
iteration 2
Uf D
iteration 3
Uf D
iteration 4
23
Grover’s algorithm IIIGrover’s algorithm III
Algorithm: (D Uf )k H 0...0
target
target (assume unique)
H0...0 = x x 2
22
2
Since D Uf is a composition of two reflections, it is a rotation
by 2, where sin() 1/N We want (2k+1)(1/N) /2, so set k (/4)N
24
Contents of lecture 2Contents of lecture 21. Preliminary remarks2. Quantum states3. Unitary operations & measurements4. Subsystem structure & quantum circuit diagrams5. Introductory remarks about quantum algorithms6. Deutsch’s parity algorithm7. One-out-of-four search algorithm8. Shor’s period finding algorithm and factoring9. Grover’s search algorithm10. Concluding remarks
25
ConclusionConclusion
Quantum computing challenges this thesis
Extended Chruch-Turing Thesis: any polynomial-time algorithm can be simulated by a probabilistic polynomial-time Turing machine
Either:
• The Extended Chruch-Turing Thesis is false
• Quantum mechanics as we understand it is false
• There is a classical poly-time factoring algorithm
There are many curious properties of quantum information in the context of computation, communication, and cryptography
Waterloo has many people in the faculties of Mathematics, Science, and Engineering working in quantum computing (please see www.iqc.ca more information)
26
Some possible project topicsSome possible project topics1. Efficient “quantum proofs”: an example is the group non-
membership problem
2. Nonlocal effects: apparently paradoxical tricks that can be performed with entangled states
3. Quantum error-correcting codes: important for physical implementations of quantum information processing
4. Alternate models of quantum computation: an example is the measurement-based model
5. Quantum walks: the quantum analogues of random walks, and their algorithmic applications
6. Quantum cryptography: information-theoretical security in a public-key setting
27