Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms...

53
Andris Ambainis University of Latvia

Transcript of Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms...

Page 1: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Andris Ambainis

University of Latvia

Page 2: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Probabilistic computation Probabilistic system with

finite state space.

Current state: probabilities pi to be in state i.

1

2 3

4

0.6

0.10.2

0.1∑ =

iip 1

Page 3: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Quantum computation Current state: amplitudes

αi to be in state i.1

2 3

4

0.4+0.3i

-0.7 0.4-0.1i

0.3

∑ =i

i 12α

For most purposes, real (but negative) amplitudes suffice.

Page 4: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Quantum computation Amplitude vector (α1, …, αM), .

Transitions:

before the transition

MMM

M

uu

uu

...

.........

...

1

111

transition matrix

=

M'

...

'1

α

α

after the transition

α...

1

∑ =i

i 12α

Page 5: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Allowed transitions

U – unitary:

If , then .

MMM

M

uu

uu

...

.........

...

1

111

=

M'

...

'1

α

α

α...

1

∑ =i

i 12α ∑ =

ii 1'

Equivalent to UU+=I.

Page 6: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Quantum state:

α1 |1⟩ + α2 |2⟩ + … + αM |M⟩

|α1|2

1prob. |α2|

2

2|αM|2

M…

Measurement

Page 7: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Quantum computing vs. natureQuantum computing Quantum physics

Unitary transformations U.

Transformation U performed in one step.

No intermediate states.

Physical evolution –continuous time.

Forces acting on a physical system – Hamiltonian H.

iHteU −=Evolution for time t:

Page 8: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Quantum algorithms up to 2005

Page 9: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Shor’s algorithm

Factoring: given N=pq, find p and q.

Best algorithm - 2O(n1/3), n – number of digits.

Quantum algorithm - O(n3) [Shor, 94].

Cryptosystems based on hardness of factoring/discrete log become insecure.

Page 10: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Grover's search

Find i such that xi=1.

Queries: ask i, get xi.

Classically, N queries required.

Quantum: O(√N) queries [Grover, 96].

Speeds up any search problem.

0 1 0 0...

x1 x2 xNx3

Page 11: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

NP-complete problems Does this graph have a

Hamiltonian cycle?

Hamiltonian cycles are:

Easy to verify;

Hard to find (too many possibilities).

Page 12: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Quantum algorithm

Let N – number of possible Hamiltonian cycles.

Black box = algorithm that verifies if the ith

candidate – Hamiltonian cycle.

Quantum algorithm with O(√N) steps.

0 1 0 0...

x1 x2 xNx3

Applicable to any search problem

Page 13: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Pell’s equation Given d, find the smallest solution (x, y) to x2-

dy2=1.

Probably harder than factoring and discrete logarithm.

Best classical algorithms:

for factoring;

2O(√N) for Pell’s equation.

)( 3/1

2 NO

Hallgren, 2001: Quantum algorithm for Pell’s equation.

Page 14: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Element distinctness [A, 2004]

Numbers x1, x2, ..., xN.

Determine if two of them are equal.

Classically: N queries.

Quantum: O(N2/3).

7 9 2 1...

x1 x2 xNx3

Page 15: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Formula evaluation

Page 16: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

AND-OR tree

AND

OR OR

x11x22 x33 x44

OR OR

x55 x66 x77 x88

AND

OR

Page 17: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Evaluating AND-OR trees Variables xi accessed by

queries to a black box: Input i;

Black box outputs xi.

Quantum case:

Evaluate T with the smallest number of queries.

OR

AND AND

x11 x22 x33 x44

∑∑ −→i

xi

ii iaia i)1(

Page 18: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Motivation Vertices = chess positions;

Leaves = final positions;

xi=1 if the 1st player wins;

At internal vertices, AND/OR evaluates whether the player who makes the move can win.

OR

x11 x22

How well can we play chess if we only know the position tree?

Page 19: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Results (up to 2007)

Full binary tree of depth d.

N=2d leaves.

Deterministic: Ω(N).

Randomized [SW,S]: Θ(N0.753…).

Quantum?

Easy q. lower bound: Ω(√N).

OR

AND AND

x11 x22 x33 x44

Page 20: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

New results [Farhi, Gutman, Goldstone, 2007]:O(√N) time

algorithm for evaluating full binary trees in Hamiltonian query model.

[A, Childs, Reichardt, Spalek, Zhang, 2007]: O(N1/2+o(1)) time algorithm for evaluating any formulas in the usual query model.

Page 21: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

0 1 1 0

Finite “tail” in one direction

Page 22: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

a-a-aa

Starting state:

∑ −=Ψj

jstart ja 2)1(

Hamiltonian H,

H – adjacency matrix

0 0

0 0

... ...

Page 23: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

What happens? If T=0, the state stays almost unchanged.

If T=1, the state “scatters” into the tree.

Run for O(√N) time, check if the state |Ψ⟩is close to the starting state |Ψstart⟩.

Page 24: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

When is the state unchanged?H – forces acting on the system.

(State |Ψ⟩ unchanged) ↔ H|Ψ⟩=0.

e-iHt |Ψ⟩ = |Ψ⟩ ⇔ H |Ψ⟩ = 0.

Page 25: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

H – adjacency matrix

a1 a2 a3

( )∑

=

edgejiji

i

ab

bH

),(

,

H|Ψ⟩ = 0 ↔ for each i: 0),(

=∑−edgeji

ja

∑=Ψi

i ia

Page 26: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

T = 0 example

…a-a-aa 0 0

0

-a -a0

0

0

0

0

OR

ANDAND

1

00

11

00

|Ψ⟩ remains unchanged by H.

Page 27: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

T=1 case

…a-a-aa 0 0

0

-a -a0

0

0

0

0

AND

OROR

11111

00

No |Ψ⟩ with H|Ψ⟩=0.

0

Cannot place non-zero value here

Page 28: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Summary [Farhi, Gutman, Goldstone, 2007] Hamiltonian

algorithm;

[A, Childs, et al., 2007] Discrete time algorithm.

O(√N) time for full binary tree;

O(√Nd) for any formula of depth d;

O(N1/2+o(1)) for any formula.

Improved to O(√N log N) by [Reichardt, 2010].

Page 29: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span programs [Karchmer, Wigderson, 1993]

Target vector v.

Input x1, ..., xN → vectors v1, ..., vM.

Output F(x1, ..., xN) = 1 if there ėxist vi1,vi2, ..., vik:

v=vi1+vi2+...+vik.

Page 30: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span program example

1

1

α1

β1

x1=1 x2=1 x3=1

1

0

Target

Page 31: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span program example

1

1

α1

β1

x1=1 x2=1 x3=1

1

0

Target

Output = 1.

x1=1, x2=1, x3=0

Page 32: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span program example

1

1

α1

β1

x1=1 x2=1 x3=1

1

0

Target

Output = 0.

x1=1, x2=0, x3=0

Page 33: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span program example

1

1

α1

β1

x1=1 x2=1 x3=1

1

0

Target

Output = “yes” if ≥2 of xi=1.

Page 34: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Composing span programs Span program S1 with target t1.

Span program S2 with target t2.

Span program S1∪S2 with target t1+t2.

Answers 1 if both S1 and S2 answer 1.

F1, F2 F1 AND F2

Page 35: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span programs [Reichardt, Špalek, 2008]

Span program with witness size TSpan program with witness size T

O(O(√√T) query quantum algorithmT) query quantum algorithm

Logic formula of size TLogic formula of size T

Far-reaching generalization of formula evaluation

Page 36: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Example MAJ(x1, x2, x3 , x4)=1 if at least 2 xi are equal to 1.

Formula size: 8.

Span program: 6.

Page 37: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Iterated thresholds

MAJ

x11 x22 x33 x44

MAJ

x55 x66 x77 x88

MAJ MAJ

... ...

MAJ

d levels – formula of size 8d, span program 6d.

O(√6d) quantum algorithm

Page 38: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span programs [Reichardt, 2009]

Span program with witness size TSpan program with witness size T

O(O(√√T) query quantum algorithmT) query quantum algorithm

Page 39: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Adversary bound [A, 2001, Hoyer, Lee, Špalek, 2007]

Boolean function f(x1, ..., xN);

Inputs x = (x1, ..., xN);

Matrix A: A[x, y]≠0 only if f(x) ≠ f(y)

Theorem Computing f requires

quantum queries

)(max

)(

iDA

A

•λλ

)(max

)(

ii DA

A

•λλ

Page 40: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span programs [Reichardt, 2009]

Optimal adversary boundOptimal adversary bound

Semidefinite program (SDP)Semidefinite program (SDP)

Dual SDPDual SDP

Optimal span programOptimal span program

Page 41: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Span programs [Reichardt, 2009]

Span program with witness size TSpan program with witness size T

O(O(√√T) query quantum algorithmT) query quantum algorithm

Page 42: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Summary Span programs = optimal quantum

algorithms.

Open problem: how to design good span programs?

Quantum algorithm for perfect matchings?

Page 43: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Solving systems of linear equations

Page 44: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

The problem

Given aij and bi, find xi.

Best classical algorithm: O(N2.37...).

NNNNNN

NN

NN

bxaxaxa

bxaxaxa

bxaxaxa

=+++

=+++=+++

...

...

...

...

2211

22222121

11212111

Page 45: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Obstacles to quantum algorithm

Obstacle 1: takes time O(N2) to read all aij.

NNNNNN

NN

NN

bxaxaxa

bxaxaxa

bxaxaxa

=+++

=+++=+++

...

...

...

...

2211

22222121

11212111

Solution: query access to aij.

Grover: search N items with O(√N) quantum queries.

Obstacle 2: takes time O(N) to output all xi.

Page 46: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Harrow, Hassidim, Lloyd, 2008

Output =

NNNNNN

NN

NN

bxaxaxa

bxaxaxa

bxaxaxa

=+++

=+++=+++

...

...

...

...

2211

22222121

11212111

∑=

N

ii

ix1

Measurement → i with probability xi2.

Estimating c1x1+c2x2+...+cNxN.

Seems to be difficult classically.

Page 47: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Harrow, Hassidim, Lloyd, 2008

Running time for producing : O(logc N), but with dependence on two other parameters.

Exponential speedup, if the other parameters are good.

∑=

N

ii

ix1

NNNNNN

NN

NN

bxaxaxa

bxaxaxa

bxaxaxa

=+++

=+++=+++

...

...

...

...

2211

22222121

11212111

Page 48: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

The main ideas

∑=

N

ii ib

1∑

=

N

ii ix

1

Easy-to-prepare Solution

NNNNNN

NN

NN

bxaxaxa

bxaxaxa

bxaxaxa

=+++

=+++=+++

...

...

...

...

2211

22222121

11212111

Page 49: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

The main ideas

=

NNNN

N

N

aaa

aaa

aaa

A

...

............

...

...

21

22221

11211

=

Nx

x

x

x...

2

1

=

Nb

b

b

b...

2

1

bAx =

bAx 1−=

∑=

N

ii ib

1∑

=

N

ii ix

1

How do we apply A-1?

Page 50: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

The main ideas

bAx 1−=∑

=

N

ii ib

1∑

=

N

ii ix

1

We can build a physical system with Hamiltonian A.

Unitary eiA.

eiA → A-1 via eigenvalue estimation.

Page 51: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Running time1. Size of system N → O(logc N).

2. Time to implement A – O(1) for sparse matrices A, O(N) generally.

3. Condition number of A.

min

max

µµ=k µmax and µmin – biggest

and smallest eigenvalues of A

( )NOTime clog2κ−

Page 52: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Dependence on condition number Classical algorithms for sparse A: O(N√k).

[Harrow, Hassidim, Llyod, 2008]: O(k2 logc N).

[A, 2010]: O(k1+o(1) logc N), via improved version of eigenvalue estimation.

[HHL, 2008]: Ω(k1-o(1)), unless BQP=PSPACE.

Page 53: Andris Ambainis University of Latviahome.lu.lv/~df/tdays/ambainis-slides.pdf · Quantum algorithms up to 2005. Shor’s algorithm Factoring: given N=pq, find p and q. Best algorithm

Open problem What problems can we reduce to systems of linear

equations (with as the answer)?∑i

i ix

Examples:

Search;

Perfect matchings in a graph;

Graph bipartiteness.

Biggest issue: condition number.