path detection: a quantum algorithmic primitive
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
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
1
2 3
4
5
Is there a cycle?
Input to Cycle Detection: โข Skeleton graphโข Hidden bit string
๐ฅ!๐ฅ"๐ฅ$๐ฅ+๐ฅ,
๐ฅ- = 1 โedge ๐ is present
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
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
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?
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?