2019-09-05Original-language archivelegacy assets may be incomplete
Query value of function
Uf:∣x,y⟩→∣x,y⊕f(x)⟩
f:{0,1}n→{0,1}
对应的矩阵为置换阵 2n×2n
Quantum Parallelism: UfH⊕n∣0n⟩=2n1∑x∣x,f(x)⟩
Store the query in phase: Of∣x⟩=(−1)f(x)∣x⟩
Uf∣x,−⟩=(−1)f(x)∣x⟩∣−⟩
Deutsch Algorithm
Question: Given a function f:{0,1}→{0,1}, decide whether f(0)=f(1)
∣0⟩→H→Of→H→M(∣0⟩,∣1⟩)
Deutsch-Joszsa Algorithm
Question: Given a function f:{0,1}n→{0,1}, it is either constant or balanced(∣f−1(0)∣=∣f−1(1)∣=2n−1).
∣0⟩⊗n→H⊗n→Of→H⊗n→M(∣0n⟩)
Quantum Teleportation
Archived figure unavailable in this copy of the notes: Quantum Teleportation.
Super-dense Coding
one qubit encode two bits (tight)
share EPR state
00:I,01:Z,10:X,11:iY
Bernstein-Vazirani Algorithm
For N=2n, given x∈{0,1}N, there is some unknown a∈{0,1}n such that xi=(i⋅a)mod2. The goal is to find a
Algorithm
Prepare the state: H∣0n⟩
Make a query Of: 2n1∑i∈{0,1}n(−1)xi∣i⟩=2n1∑i∈{0,1}n(−1)i⋅a∣i⟩=H⊗n∣a⟩
Apply H⊗n: ∣a⟩
Simon's Algorithm
Simon's Problem(Hidden Shift): N=2n,x−(x0,⋯,xN−1),xi={0,1}n, there is some unknown nonzero s∈{0,1}n such that xi=xj iff i=j or i=j⊕s. The goal is to find s
Algorithm
Prepare the state: H⊕n∣0n⟩∣0n⟩=2n1∑i∈{0,1}n∣i⟩∣0n⟩
Make a query: 2n1∑i∈{0,1}n∣i⟩∣xi⟩
Measure the second register.
Output xi w.p. 2n1.
Post-measurement state: 21(∣i⟩+∣i⊗s⟩)
Apply H⊗n
Measure the register.
Output a random element from {j:s⋅s=0(mod2)}
Repeat this procedure until we have obtained n−1 independent linear equations involving s
Gaussian elimination modulo 2
Lower bound
decision version
Given: N=2n,x=(x0,⋯,xN−1),xi∈{0,1}n
Promise: ∃s∈{0,1}n such that xi=xj iff i=j or i=j⊕s
Task: decide whether s=0n
Proof
Let Π be a T-query randomized algorithm that solve the problem w.p. ≥32
Let r be internal randomness of Pi (Πr is a determininistic algorithm)
Let μ be a distribution on the inputs
Px∼μ(Π(x) is correct)≥32⇒Px∼μ,r(Πr(x) is correct)≥32⇒∃ a deterministic T-query algorithm that solve the problem with probability ≥32 under μ (在一个概率分布下随机化为确定)
Find a "hard distribution" μ:
μ(s=0)=21:x is a uniform random permutation of {0,1}n
μ(s=0)=21:s is picked from a nonzero string at random. For each pair {i,i⊕s} in a lexicographic order, we pick xi at random without replacement
Let i1,⋯,iT be queries made by algorithm, P(i1,⋯,ik is bad) should ≤31
∏i(1−xi)≥1−∑ixi
T=Ω(2n)
Complexity
BPP: probabilistically polynomial-time computable by a classical computer
BQP: probabilistically polynomial-time computable by a classical computer
Theorem
P⊆NP⊆PSPACE
P⊆BPP⊆BQP⊆PSPACE
Phase estimation
Given a unitary gate U and an eigenvector ∣φ⟩ of U, U∣φ⟩=λ∣φ, estimate ∣φ⟩ (λ=eiϕ, estimate ϕ∈[0,2π))
Algorithm
Prepare the state: FN∣0n⟩∣φ⟩=2n1∑j=0N−1∣j⟩∣φ⟩,N=2n
Make a query: ∣j⟩∣φ⟩→∣j⟩Uj∣φ⟩
Apply FN−1 to first n qubits
Get ∣ϕ1ϕ2⋯ϕn⟩,ϕ=2π∗0.ϕ1ϕ2⋯ϕn
Shor's Factoring Algorithm
Factoring: Given a composite N, find an integer 1<p<N,p∣N
Period-Finding: Given f:N→ZN,f(a)=xamodN with the property for unknown r∈ZN,f(a)=f(b) iff a=b(modr)
Theorem (Shor): There exists a quantum algortihm solving Period-find algorithm using O(loglogN) evaluations of f and O(loglogN) quantum Fourier transforms.
time complextity of each evaluation
Algorithm
Find q=2l,N2<q≤2N2
Prepare the state: q1∑a=0q−1∣a⟩∣0q⟩
Make a query: q1∑a=0q−1∣a⟩∣f(a)⟩
Apply Fq
Condition the second register is f(s), the first register is m1∑j=0m−1∣jr+s⟩
c uniformly random in [1,r−1], with probability Ω(loglogr1),c coprime with r
Repeat algorithm O(loglogN) times
Case 2: r∣q
∣1−e2πiqrb1−e2πiqmrb∣=∣sin(πrb/q)sin(πmrb/q)∣
w.h.p, ∣qb−rc∣≤2q1
r=r′,r,r′<N then ∣rc−r′c′∣>N21
use continued fraction find the fraction with denominator ≤N that is closest to qb, which is rc
Reduction of Factoring to period-finding
Theorem: N is composite number L bits long and x is non-trival solution to equation x2=1(modN) in range 1≤x≤N. Then at least one of gcd(x−1,N) and gcd(x+1,N) is a non-trivial factor of n that can be computed using O(L3) operation
找模N下 1 的非平凡平方剩余
Lemma: p is an odd prime, 2d be the largest power of 2 dividing φ(pα), then Px∼U[Zpα∗](2d∣ord(xmodpα))=21
Theorem: Suppose N>0 is an odd composite, x∼U[ZN∗] and r=ord(xmodN), then P(2∣r∧x2r=−1(modN))≥1−2−m
Algorithm
if 2∣N, return 2
Determine whether N=ab for a≥1,b≥2
Randomly choose x in ZN, if gcd(x,N)>1 return gcd(x,N)
Use period-finding subroutine find the r=ord(xmodN)
if 2∣r,x2x=1(modN) then compute gcd(x2r−1) and gcd(x2r+1,N), return the non-trivial factor. Otherwise, the algorithm fails.
Hidden Subgroup Algorithm
Problem: Given a known group G and a map f:G→S where S is some finite set. Suppose f has the property that there exists a subgroup H≤G such that f is constant within each coset and distinct on different cosets.
Goal: find H
Discrete logarithm: find α,A=γα
Algorithm for Abelian HSP
Initiate: ∣0⟩∣0⟩ of dimensions ∣G∣ and ∣S∣
Prepare: G1∑g∈G∣g⟩∣0⟩
Query: g1∑g∈G∣g⟩∣f(g)⟩
Mesure the second registerm yielding f(s) for s∈G: H1∑h∈H∣s+h⟩
Apply QFT: H1∑h∈H∣χs+h⟩
Measure and output g
uniform random g satisfying χg∈H⊥={χk∣(∀h∈H)χk(h)=1}
output: g1,⋯,gt
Graph isomorphism
Algorithm for Abelian HSP
∣g⟩→∑ρ∈G^dim∣G∣ρ∣ρ⟩∑i,j=1dim(ρ)ρ(g)ij∣i,j⟩
Heisenberg group: poly(log∣G∣)
solvable groups: poly(log∣G∣)
nil-2 groups: poly(log∣G∣)
dihedral groups: 2O(log∣G∣)
Query complexity of HSP
The quantum query complexity of HSP on any group G is O(log2∣G∣)
Grover's Search Algorithm
Problem: N=2n, given an arbitrary x∈{0,1}N. The goal is to find i such that xi=1.
Measure the first register and check that the resulting i is a solution
∣G⟩=t1∑i:xi=1∣i⟩
∣B⟩=t1∑i:xi=0∣i⟩
Ox: 在 ∣B⟩ 上翻转
sinθ=Nt
∣U⟩=sinθ∣G⟩+cosθ∣B⟩
Gk∣U⟩=sin(2k+1)θ∣G⟩+cos(2k+1)θ∣B⟩
k′=4θπ−21=O(θ1)=O(tN),t 为 xi=1 的个数
If t is unknown
t≤N/2 then the eigenvalues are eiθ and ei(2π−θ)
Optimality of Grover's algorithm
Adversary Method
∣ψkx⟩=UkOxUk−1Ox⋯U1Ox∣ψ⟩
∣ψk⟩=UkU−1⋯U1∣ψ⟩
Dk=∑x∥∣ψkx⟩−∣ψk⟩∥2
Dk≤4k2
Dk≥cN
Polynomial method
Amplitude amplification
χ:Z→{0,1} be any Boolean function, suppose we have a quantum algorithm A that uses no intermediate measurements and finds a solution z∈χ−1(1) with probability p
Suppose we have an algorithm check whether z is a solution.
Algorithm
Initiate: ∣U⟩=A∣0⟩
Repeat k=O(p1)
Apply Ox
Apply
Application
TSP: O(n!)
Satisfiability: O(2npoly(n))
Random walk
Problem: Given a d-regular simple graph G=(V,E) with m marked vertices, find one of the marked vertex.
Stationary distribution: G(V,E) is d-regular connected non-bipartite simple graph, then for any v, Pkv will converge to a uniform distribution over all vertices
Spectral gap: δ=1−λ2
Problem: G=(V,E) with ϵN marked vertices where N=∣V∣
S: set up an initial state v
U: update the current vertex
C: check whether the given vertex is marked
expected cost: S+ϵ1(C+δ1U)
Quantum walk
Prepare: ∣U⟩=N1∑x∣x⟩∣px⟩
Repeat the following O(ϵ1) times
Reflect through ∣B⟩=N−∣M∣1∑x∈M∣x⟩∣px⟩
Reflect through ∣U⟩
Measure the first register and check the x is marked