path detection: a quantum algorithmic primitive

57
Path Detection: A Quantum Algorithmic Primitive Shelby Kimmel Middlebury College Based on work with Stacey Jeffery: arXiv: 1704.00765 (Quantum vol 1 p 26) Michael Jarret, Stacey Jeffery, Alvaro Piedrafita, arXiv:1804.10591 (ESA 2018) Kai DeLorenzo, Teal Witter, arXiv:1904.05995 (TQC 2019)

Upload: khangminh22

Post on 20-Feb-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

Path Detection: A Quantum Algorithmic Primitive

Shelby KimmelMiddlebury College

Based on work with Stacey Jeffery: arXiv: 1704.00765 (Quantum vol 1 p 26)Michael Jarret, Stacey Jeffery, Alvaro Piedrafita, arXiv:1804.10591 (ESA 2018)Kai DeLorenzo, Teal Witter, arXiv:1904.05995 (TQC 2019)

Primitives!

โ€ข Quantum algorithmic primitives1. Widely applicable2. Can be used in a black box manner (with easily

analyzable behavior)

Primitives!

โ€ข Quantum algorithmic primitives1. Widely applicable2. Can be used in a black box manner (with easily

analyzable behavior)

โ€“ Ex: Searching unordered list of ๐‘› itemsโ€“ Classically, takes ฮฉ(๐‘›) timeโ€“ Quantumly, takes ๐‘‚( ๐‘›) time

Primitives!

โ€ข Quantum algorithmic primitives1. Widely applicable2. Can be used in a black box manner (with easily

analyzable behavior)

โ€“ Ex: Searching unordered list of ๐‘› itemsโ€“ Classically, takes ฮฉ(๐‘›) timeโ€“ Quantumly, takes ๐‘‚( ๐‘›) time

Good primitive: ๐’”๐’•-connectivity

Outline:

A. Introduction to st-connectivityB. st-connectivity makes a good algorithmic primitive

1. Widely applicable2. Easy to analyze

Outline:

A. Introduction to st-connectivityB. st-connectivity makes a good algorithmic primitive

1. Widely applicable2. Easy to analyze

Applications:โ€ข Read-once Boolean formulas (query optimal) [JK] โ€ข Total connectivity (query optimal) [JJKP]โ€ข Cycle detection (query optimal) [DKW]โ€ข Even length cycle detection [DKW]โ€ข Bipartiteness (query optimal) [DKW]โ€ข Directed st-connectivity (query optimal) (Beigi et al โ€˜19)โ€ข Directed smallest cycle (query optimal) (Beigi et al โ€˜19)

Outline:

Applications:โ€ข Topological sort (Beigi et al โ€˜19)โ€ข Connected components (Beigi et al โ€˜19)โ€ข Strongly connected components (Beigi et al โ€˜19)โ€ข k-cycle at vertex v (Beigi et al โ€˜19)โ€ข st-connectivity (Reichardt, Belovs โ€˜12)

๐‘ ๐‘ก-connectivity

๐‘ 

๐‘ก

๐’”๐’• โˆ’ ๐’„๐’๐’๐’๐’†๐’„๐’•๐’Š๐’—๐’Š๐’•๐’š:is there a path from ๐‘  to ๐‘ก?

๐‘ ๐‘ก-connectivity

๐‘ 

๐‘ก

๐’”๐’• โˆ’ ๐’„๐’๐’๐’๐’†๐’„๐’•๐’Š๐’—๐’Š๐’•๐’š:is there a path from ๐‘  to ๐‘ก?

Input to Algorithm

Bit String:

๐‘ฅ! ๐‘ฅ" ๐‘ฅ#โ€ฆ

Input to Algorithm

Bit String:

๐‘ฅ! ๐‘ฅ" ๐‘ฅ#101

โ€ฆ

Input to Algorithm

๐‘ฅ! ๐‘ฅ" ๐‘ฅ$

Skeleton Graph

Bit String:2

83 1

3

2

13

๐‘ 

๐‘ก

Input to Algorithm

2

1

3

2

13

๐‘ 

๐‘ก

๐‘ฅ! ๐‘ฅ" ๐‘ฅ$101

Skeleton Graph

Bit String:

83

Input to Algorithm

2

1

3

2

13

๐‘ 

๐‘ก

๐‘ฅ! ๐‘ฅ" ๐‘ฅ$100

Skeleton Graph

Bit String:

83

Input to Algorithm

2

1

3

2

13

๐‘ 

๐‘ก

๐‘ฅ! ๐‘ฅ" ๐‘ฅ$1

Skeleton Graph

Bit String:

โ€ข Bit string initially hidden, can query value of string at each bit.

83

Input to Algorithm

2

1

3

2

13

๐‘ 

๐‘ก

๐‘ฅ! ๐‘ฅ" ๐‘ฅ$1

Skeleton Graph

Bit String:

โ€ข Bit string initially hidden, can query value of string at each bit.

83

๐‘‚! ๐‘– ๐‘ = ๐‘– ๐‘ + ๐‘ฅ"

Algorithm

๐‘ฅ! ๐‘ฅ" ๐‘ฅ$

Skeleton Graph

๐‘‚%for Bit String:

2

83 1

3

2

13

๐‘ 

๐‘ก

Q. Algorithm to Solve

connectivityYes/No

Outline:

A. Introduction to st-connectivityB. st-connectivity makes a good algorithmic primitive

1. Widely applicable2. Easy to analyze

Cycle Detection

Is there a cycle?

Yes

Cycle Detection

Is there a cycle?

No

Cycle Detection

1

2 3

4

5

Is there a cycle?

Input to Cycle Detection: โ€ข Skeleton graphโ€ข Hidden bit string

๐‘ฅ!๐‘ฅ"๐‘ฅ$๐‘ฅ+๐‘ฅ,

๐‘ฅ- = 1 โ†”edge ๐‘– is present

Cycle Detection

Is there a cycle through edge 1?

1

2 3

4

5

Cycle Detection

There is a cycle through Edge 1 iff โ€ข Edge 1 is presentโ€ข Path between the

endpoints of Edge 1not using Edge 1

1

2 3

4

5

Is there a cycle through edge 1?

Cycle Detection

There is a cycle through Edge 1 iff โ€ข Edge 1 is presentโ€ข Path between the

endpoints of Edge 1not using Edge 1

1

2 3

4

5

Is there a cycle through edge 1?

1

2

3

4

5

๐‘ 

๐‘ก

Edge 1 is present

Path between the endpoints of Edge 1 not using Edge 1

Cycle Detection

Is there a cycle?

There is a cycle if there is a cycle through some edge

1

2 3

4

5

Cycle Detection

Is there a cycle?

There is a cycle if there is a cycle through some edge

1

2 3

4

5

1

2

3

4

5

๐‘ 

๐‘ก

12

3

4 5

2

3

4

5

1

1

2

3

4

51

2

3

5

4

Boolean Formulas

โ‹€

โ‹

โ‹€ โ‹€ โ‹€

โ‹ โ‹

๐‘ฅ#$

๐‘ฅ# ๐‘ฅ% ๐‘ฅ& ๐‘ฅ'๐‘ฅ( ๐‘ฅ) ๐‘ฅ* ๐‘ฅ+ ๐‘ฅ,

๐‘“(๐‘ฅ)

1

0 0 1 0

0 1 0 1 1

๐’”

๐’•๐‘ฅ!0

๐‘ฅ!

๐‘ฅ"

๐‘ฅ$

๐‘ฅ+

๐‘ฅ,

๐‘ฅ1

๐‘ฅ2๐‘ฅ3

๐‘ฅ4

Outline:

A. Introduction to st-connectivityB. st-connectivity makes a good algorithmic primitive

1. Widely applicable2. Easy to analyze

Algorithm Analysis:

Space Complexity: ๐‘‚ log(# ๐‘’๐‘‘๐‘”๐‘’๐‘  ๐‘–๐‘› ๐‘ ๐‘˜๐‘’๐‘™๐‘’๐‘ก๐‘œ๐‘› ๐‘”๐‘Ÿ๐‘Ž๐‘โ„Ž)

Algorithm Analysis:

Query Complexity:

โ€ข Bit string initially unknownโ€ข Minimum # of oracle uses to

determine w.h.p. on worst input

Algorithm Analysis:

Query Complexity:

โ€ข Bit string initially unknownโ€ข Minimum # of oracle uses to

determine w.h.p. on worst input

โ‰ˆTime Complexity

Algorithm Analysis:

Query Complexity:

๐‘‚ max!"##$!%$& '

๐‘…(,% ๐บ max#"% !"##$!%$& '

๐ถ(,% ๐บ

Effective resistance Effective capacitance

Algorithm Analysis:

Query Complexity:

๐‘‚ max!"##$!%$& '

๐‘…(,% ๐บ max#"% !"##$!%$& '

๐ถ(,% ๐บ

Effective resistance Effective capacitance[Belovs, Reichardt, โ€™12]

[Jarret, Jeffery, Kimmel, Piedrafita, โ€™18]

Effective Resistance

๐‘ 

๐‘ก

1 unit of flow

1 unit of flow

Effective Resistance

Valid flow:โ€ข 1 unit in at ๐‘ โ€ข 1 unit out at ๐‘กโ€ข At all other nodes, zero

net flow

๐‘ 

๐‘ก

1 unit of flow

1 unit of flow

1

1

๐‘“ 1 โˆ’ ๐‘“

0

Effective Resistance

Flow energy:

N56758

๐‘“๐‘™๐‘œ๐‘ค ๐‘œ๐‘› ๐‘’๐‘‘๐‘”๐‘’ "

๐‘ 

๐‘ก

1 unit of flow

1 unit of flow

1

1

๐‘“ 1 โˆ’ ๐‘“

0

Effective Resistance

Flow energy:

N56758

๐‘“๐‘™๐‘œ๐‘ค ๐‘œ๐‘› ๐‘’๐‘‘๐‘”๐‘’ "

Effective Resistance: ๐‘…8,:(๐บ)โ€ข Smallest energy of any valid

flow from ๐‘  to ๐‘ก on ๐บ.

๐‘ 

๐‘ก

1 unit of flow

1 unit of flow

1

1

๐‘“ 1 โˆ’ ๐‘“

0

Effective Resistance

๐‘ 

๐‘ก

1 unit of flow

1 unit of flow

1

1

1/2 1/2

0Flow energy:

N56758

๐‘“๐‘™๐‘œ๐‘ค ๐‘œ๐‘› ๐‘’๐‘‘๐‘”๐‘’ "

Effective Resistance: ๐‘…8,:(๐บ)โ€ข Smallest energy of any valid

flow from ๐‘  to ๐‘ก on ๐บ.

Algorithm Analysis:

Query Complexity:

๐‘‚ max!"##$!%$& '

๐‘…(,% ๐บ max#"% !"##$!%$& '

๐ถ(,% ๐บ

Effective resistance Effective capacitance

Effective Capacitance

Generalized cut:โ€ข 1 at ๐‘ โ€ข 0 at ๐‘กโ€ข Difference is 0 across edge

๐‘ 

๐‘ก

11 1

0๐‘ฃ

Effective Capacitance

๐‘ 

๐‘ก

11 1

0๐‘ฃ

Potential energy:

N56758 -#

8;5<5:=# 7>?@A

๐‘๐‘ข๐‘ก ๐‘‘๐‘–๐‘“๐‘“๐‘’๐‘Ÿ๐‘’๐‘›๐‘๐‘’ "

Effective Capacitance

Potential energy:

N56758 -#

8;5<5:=# 7>?@A

๐‘๐‘ข๐‘ก ๐‘‘๐‘–๐‘“๐‘“๐‘’๐‘Ÿ๐‘’๐‘›๐‘๐‘’ "

Effective Capacitance: ๐ถ8,:(๐บ)โ€ข Smallest potential energy of

any valid generalized cut between ๐‘  and ๐‘ก on ๐บ.

๐‘ 

๐‘ก

11 1

02/3

Algorithm Analysis:

Query Complexity:

๐‘‚ max!"##$!%$& '

๐‘…(,% ๐บ max#"% !"##$!%$& '

๐ถ(,% ๐บ

Effective resistance Effective capacitance

Example

1

2

3

4

5

๐‘ 

๐‘ก

12

3

4 5

2

3

4

51

12

3

4

51

2

3

5

4

Cycle Detection ๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

Example

Cycle Detection

1

2

3

4

5

๐‘ 

๐‘ก

12

3

4 5

2

3

4

51

12

3

4

51

2

3

5

4

๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

Example

Cycle Detection

1

2

3

4

5

๐‘ 

๐‘ก

12

3

4 5

2

3

4

51

12

3

4

51

2

3

5

4

๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

Length k cycleโ€ข k parallel paths of length kโ€ข 1/๐‘˜ flow on each pathโ€ข Effective resistance is 1

Example

Cycle Detection

1

2

3

4

5

๐‘ 

๐‘ก

12

3

4 5

2

3

4

51

12

3

4

51

2

3

5

4

๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

Multiple cycles Effective resistance is < 1

Example

Cycle Detection

1

2

3

4

5

๐‘ 

๐‘ก

12

3

4 5

2

3

4

51

12

3

4

51

2

3

5

4

๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

Example

Cycle Detection

1

2

3

4

5

๐‘ 

๐‘ก

12

3

4 5

2

3

4

51

12

3

4

51

2

3

5

4

๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

โ€ข ๐‘‚ ๐‘›% subgraphs corresponding to non-present edges: cut at top

โ€ข ๐‘‚ ๐‘› subgraphs corresponding to present edges, cut could have ๐‘‚(๐‘›%) edges in cut

Example

Cycle Detection ๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

๐ถ8,: ๐บ = ๐‘‚(๐‘›$)๐‘…8,: ๐บ = ๐‘‚(1)

Query complexity: ๐‘‚ ๐‘›$/"

(optimal โ€“ logarithmic improvement over previous algorithm)

Example

Cycle Detection ๐‘‚ maxB=##5B:56 C

๐‘…8,: ๐บ max#=: B=##5B:56 C

๐ถ8,: ๐บ

๐‘…8,: ๐บ = ๐‘๐‘–๐‘Ÿ๐‘๐‘ข๐‘–๐‘ก ๐‘Ÿ๐‘Ž๐‘›๐‘˜ E!

Circuit rank = min # of edges to cut to create a cycle free graph

โ€ข Quantum algorithm picks out critical topological parameterโ€ข If promised either large circuit rank or no cycle, then cycle

detection algorithm runs fasterโ€ข Proved by 2nd year undergrads

Estimation Algorithm:

Quantum query algorithm to estimate effective resistance or effective capacitance of ๐บ. (Jeffery, Ito โ€™15)

Estimation Algorithm:

Quantum query algorithm to estimate effective resistance or effective capacitance of ๐บ. (Jeffery, Ito โ€™15)

Because effective resistance depends directly on circuit rank, we now have a quantum algorithm to estimate circuit rank.

Ummโ€ฆAlgorithm?

Ummโ€ฆAlgorithm?

Theorem 14. Let U(P, x) = (2ฮ ker A โˆ’ I)(2ฮ H(x)โˆ’ I). Fix X โŠ† {0, 1}N and f : X โ†’ {0, 1}, and let P be a span

program on {0, 1}N that decides f . Let W+( f , P) = maxxโˆˆ f โˆ’1(1) w+(x, P) and Wโˆ’( f , P) = maxxโˆˆ f โˆ’1(0) wโˆ’(x, P).

Then there is a bounded error quantum algorithm that decides f by making O(!

W+( f , P)Wโˆ’( f , P)) calls to U(P, x),and elementary gates. In particular, this algorithm has quantum query complexity O(

!W+( f , P)Wโˆ’( f , P)).

Ref. [IJ16] defines the approximate positive and negative witness sizes, wฬƒ+(x, P) and wฬƒโˆ’(x, P). These aresimilar to the positive and negative witness sizes, but with the conditions |wโŸฉ โˆˆ H(x) and ฯ‰Aฮ H(x) = 0relaxed.

Definition 15 (Approximate Positive Witness). For any span program P on {0, 1}N and x โˆˆ {0, 1}N, we definethe positive error of x in P as:

e+(x) = e+(x, P) := min"###ฮ H(x)โŠฅ|wโŸฉ

###2

: A|wโŸฉ = ฯ„

$. (14)

We say |wโŸฉ is an approximate positive witness for x in P if###ฮ H(x)โŠฅ |wโŸฉ

###2= e+(x) and A|wโŸฉ = ฯ„. We define

the approximate positive witness size as

wฬƒ+(x) = wฬƒ+(x, P) := min"โˆฅ|wโŸฉโˆฅ2 : A|wโŸฉ = ฯ„,

###ฮ H(x)โŠฅ |wโŸฉ###

2= e+(x)

$. (15)

If x โˆˆ P1, then e+(x) = 0. In that case, an approximate positive witness for x is a positive witness, andwฬƒ+(x) = w+(x). For negative inputs, the positive error is larger than 0.

We can define a similar notion of approximate negative witnesses (see [IJ16]).

Theorem 16 ([IJ16]). Let U(P, x) = (2ฮ ker A โˆ’ I)(2ฮ H(x) โˆ’ I). Fix X โŠ† {0, 1}N and f : X โ†’ Rโ‰ฅ0. Let P be a

span program on {0, 1}N such that for all x โˆˆ X, f (x) = wโˆ’(x, P) and define %W+ = %W+(P) = maxxโˆˆX wฬƒ+(x, P).

Then there exists a quantum algorithm that estimates f to accuracy ฯต and that uses %O&

1ฯต3/2

'wโˆ’(x) %W+

(calls to

U(P, x) and elementary gates.

A span program for st-connectivity An important example of a span program is one for st-connectivity,first introduced in [KW93], and used in [BR12] to give a new quantum algorithm for st-connectivity. Westate this span program below, somewhat generalized to include weighted graphs, and to allow the inputto be specified as a subgraph of some parent graph G that is not necessarily the complete graph. We allowa string x โˆˆ {0, 1}N to specify a subgraph G(x) of G in a fairly general way, as described in Section 2.2.In particular, for i โˆˆ [N], let

โˆ’โ†’E i,1 โŠ† โˆ’โ†’

E (G) denote the set of (directed) edges associated with the literal xi,and

โˆ’โ†’E i,0 the set of edges associated with the literal xi. Note that if (u, v, โ„“) โˆˆ โˆ’โ†’

E i,b then we must also have(v, u, โ„“) โˆˆ โˆ’โ†’

E i,b, since G(x) is an undirected graph. We assume G has some implicit weighting function c.Then we refer to the following span program as PG:

โˆ€i โˆˆ [N], b โˆˆ {0, 1} : Hi,b = span{|eโŸฉ : e โˆˆ โˆ’โ†’E i,b}

U = span{|vโŸฉ : v โˆˆ V(G)}ฯ„ = |sโŸฉ โˆ’ |tโŸฉ

โˆ€e = (u, v, โ„“) โˆˆ โˆ’โ†’E (G) : A|u, v, โ„“โŸฉ =

'c(u, v, โ„“)(|uโŸฉ โˆ’ |vโŸฉ) (16)

One can check that if s and t are connected, then if |wโŸฉ represents a weighted st-path or linear combinationof weighted st-paths in G(x), then |wโŸฉ is a positive witness for x. Furthermore, this is the only possibilityfor a positive witness, so x is a positive input for PG if and only if G(x) is st-connected, and in particular,w+(x, PG) = 1

2 Rs,t(G(x)) [BR12]. Since the weights c(e) are positive, the set of positive inputs of PG areindependent of the choice of c, however, the witness sizes will depend on c.

10

Span Program

Span Program->Unitary U = (reflection about space that depends on skeleton graph)(reflection about a space that depends on input)

Do phase estimation on U to precision ๐‘‚ max!"##$!%$& '

๐‘…(,% ๐บ max#"% !"##$!%$& '

๐ถ(,% ๐บ

Open Questions and Current Directions

โ€ข How to choose edge weights? (Beigi et al โ€˜19)โ€ข Conditions when st-connectivity reduction optimal? โ€ข What is the classical time/query complexity of st-

connectivity in the black box model? Under the promise of small capacitance/resistance?

โ€ข Better estimation algorithm for st-connectivity effective resistance/capacitance

โ€ข Primitives/Pedagogical Problems?

Thank you!

Andrew Zhao

Teal Witter

Kai De Lorenzo

Stacey Jeffery

Michael Jarret

Alvaro Piedrafita