Abstract 1 Introduction 2 Technical Overview References

Multidimensional Quantum Walks, Recursion, and Quantum Divide & Conquer

Stacey Jeffery ORCID QuSoft, CWI, Amsterdam, The Netherlands
University of Amsterdam, The Netherlands
Galina Pass QuSoft, Amsterdam, The Netherlands
University of Amsterdam, The Netherlands
Abstract

We introduce an object called a subspace graph that formalizes the technique of multidimensional quantum walks. Composing subspace graphs allows one to seamlessly combine quantum and classical reasoning, keeping a classical structure in mind, while abstracting quantum parts into subgraphs with simple boundaries as needed. As an example, we show how to combine a switching network with arbitrary quantum subroutines, to compute a composed function. As another application, we give a time-efficient implementation of quantum Divide & Conquer when the sub-problems are combined via a Boolean formula. We use this to quadratically speed up Savitch’s algorithm for directed st-connectivity.

Keywords and phrases:
Quantum Divide & Conquer, Time-Efficient, Subspace Graphs, Quantum Walks, Switching Networks, Directed st-Connectivity
Funding:
Stacey Jeffery: Supported by ERC STG grant 101040624-ASC-Q, NWO Klein project number OCENW.Klein.061. SJ is a CIFAR Fellow in the Quantum Information Science Program.
Galina Pass: Supported by the National Agenda for Quantum Technologies (NAQT), as part of the Quantum Delta NL programme.
Copyright and License:
[Uncaptioned image] © Stacey Jeffery and Galina Pass; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Quantum computation theory
; Theory of computation Design and analysis of algorithms
Related Version:
Full Version: https://arxiv.org/abs/2401.08355
Editors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim Thắng

1 Introduction

There are a number of graphical ways of reasoning about how the steps or subroutines of a classical algorithm fit together. For example, it is natural to think of a (randomized) classical algorithm as a (randomized) decision tree (or branching program), where different paths are chosen depending on the input, as well as random choices made by the algorithm. A deterministic algorithm gives rise to a computation path, a randomized algorithm to a computation tree. The edges of a path or tree, representing steps of computation, might be implemented by some subroutine that is also realized by a path (or tree) – we can abstract the subroutine’s details by viewing it as an edge, or zoom in and see those details, as convenient. More generally, we often think of a classical randomized algorithm as a random walk on a (possibly directed) graph, where there may be multiple parallel paths from point a to point b, with the cost of getting from a to b being derived from the expected length of these paths.

This picture appears to break down for quantum algorithms, at least in the standard circuit model. A quantum circuit can be thought of as a path, with edges representing its steps, but it is unclear how to augment this reasoning with subroutines. Consider calling subroutines with varying time complexities {Ti}i in superposition. Even if the subroutines are all classical deterministic, in the standard quantum circuit model, we tend to incur a cost of maxiTi if we call a superposition of subroutines, since we must wait for the slowest subroutine to finish before we can apply the next step of the computation. This problem was addressed in [13], where the technique of multidimensional quantum walks [15] was used to show how to get an average in place of a max in several settings where a quantum algorithm calls subroutines in superposition: a general setting, as well as the setting of quantum walks. The intuition behind [13] is that a quantum walk does keep the classical intuition of parallel paths representing a superposition of possible computations, and any quantum algorithm can be viewed as some sort of a quantum walk on a simple underlying graph (something like a path), but with some additional structure associated with it.

Multidimensional quantum walks, which we study more formally in this paper as an object than has been done previously, are valuable as a way of combining quantum and classical reasoning. A quantum algorithm can be abstracted as a graph with perhaps complicated internal structure, but a simple boundary with an “in” and an “out” terminal (called “s” and “t”), that can be seamlessly hooked into other graph-like structures, perhaps representing simple classical reasoning, such as a quantum random walk, or perhaps with their own complicated very quantum parts.

Subspace Graphs

While [15] and [13] use similar techniques, it is not formally defined what a multidimensional quantum walk is. We formally define an object called a subspace graph (Definition 2) that abstracts the structures in [15] and [13]. A subspace graph is simply a graph with some subspaces associated with each edge and vertex, where the structure of the graph constrains how the spaces can overlap. Defining what we mean, precisely, by a multidimensional quantum walk (i.e. subspace graph) is the first step to developing a general theory of recursive constructions of subspace graphs.

The recursive structure of subspace graphs is useful for composing quantum algorithms, but as a design tool, it is also convenient to be able to view a subspace graph in varying levels of abstraction. We can “zoom out” and view a complicated process as just a special “edge”, or zoom in on that edge and understand its structure as an involved graph with additional structure.

We cannot hope to be able to understand all quantum algorithms using purely classical ideas – quantum computing is not classical computing. But perhaps the next best thing is a way to seamlessly combine classical and quantum ideas, extending the classical intuition to its limits, and then employing quantum reasoning when needed, but with the possibility of abstracting out from it when needed as well, using a fully quantum form of abstraction.

In this work, we consider one specific kind of composition of subspace graphs called switch composition – another type is implicit in [13] – but we would like to emphasize the potential for more general types of recursion, which we leave for future work.

Time-Efficient Quantum Divide & Conquer

A particular type of recursive algorithm is divide & conquer, in which a problem is broken into multiple smaller sub-problems, whose solutions, obtained by recursive calls, are combined into a solution for the original problem. As a motivating example, consider the recursively defined nand-tree function. Let fk,d:{0,1}dk{0,1} be defined f0,d(x)=x, and for k1,

fk,d(x)=NAND(fk1,d(x(1)),,fk1,d(x(d))):=1fk1,d(x(1))fk1,d(x(d)),

where each x(j){0,1}dk1, and x=(x(1),,x(d)). There is a natural way to break an instance x of fk,d into d sub-problems x(1),,x(d) of fk1,d, and combine the solutions by taking the NAND (negated AND) of the d sub-problem solutions. Grover’s algorithm computes this NAND in O(d) queries, so we might hope for a speedup by recursive calls to this quantum algorithm. Unfortunately, since we recurse to depth k, the constant in front of d is raised to the k-th power. This kills the quantum speedup completely when d is constant (for example, the most common setting of d=2), and that is not even touching on the fact that we would seem to need to amplify the success probability of the subroutine, turning those constants into log factors. On the other hand, it is known [20] that fk,d can be evaluated in O(dk) quantum queries, even though our attempt to use classical divide-&-conquer reasoning combined with the basic Grover speedup failed.

More recently, [9] showed how to employ divide-&-conquer reasoning in the study of quantum query complexity, in which one only counts the number of queries to the input. They obtained their query upper bounds by composing dual adversary solutions. The key to their results is that dual adversary solutions exhibit perfect composition: no error, no log factors, not even constant overhead. However, their result were not constructive, as dual adversary solutions do not fully specify algorithms, and in particular, the time complexity analysis of their results was unknown. In this work, we use the framework of subspace graphs to give a time-complexity version of some of the query complexity results obtained in [9]. In particular, we show (see Theorem 16):

Theorem 1 (Informal).

Let {f,n:D,n{0,1}},n be a family of functions. Let φ be a symmetric Boolean formula on a variables, and suppose f,n=φ(f/b,n,,f/b,n)faux,,n, for some b>1 and some auxiliary function faux,,n with quantum time complexity Taux(,n). Then the quantum time complexity of f,n is O~(T(,n)) for T(,n) satisfying:

T(,n)aT(/b,n)+Taux(,n).

Our framework also handles the case where f,n=φ(f/b,n,,f/b,n,faux,,n) for any formula φ on a+1 variables, but then some extra, somewhat complicated looking costs need to be accounted for, and there is also a scaling in the depth, although this is not an issue if the formula has been preprocessed to be balanced [8].

Comparing this with the analogous classical statement, which would have a instead of a, we get an up to quadratic speedup over a large class of classical divide-&-conquer algorithms. As an application, we show a quadratic speedup of Savitch’s divide-&-conquer algorithm for directed st-connectivity [22].

To achieve these results, it is essential that we compose subspace graphs, rather than algorithms. When we convert a subspace graph to a quantum algorithm, we get constant factors in the complexity, and these seem necessary without at least specifying what gateset we are working in. By first composing in the more abstract model of subspace graphs, and then only converting to a quantum algorithm at the end, we ensure these factors only come into the complexity once. This is similar to compositions done with other abstract models, such as span programs (of which dual adversary solutions are a special case) [19], and transducers [6].

Switching Networks

A switching network is a graph with Boolean variables associated with the edges that can switch the edges on or off. Originally used to model certain hardware systems, including automatic telephone exchanges, and industrial control equipment [23], a switching network has an associated function f that is 1 if and only if two special vertices, s and t, are connected by a path of “on” edges. Shannon [23, 24] showed that series-parallel switching networks are equivalent to Boolean formulas, and Lee [16] showed that switching networks can model branching programs. These theoretical results have given this model a place in classical complexity theory, where they can be used to study classical space complexity and circuit depth (see [18]).

Quantum algorithms for evaluating switching networks111Switching networks have never been directly referred to in prior work on quantum algorithms, as far as we are aware, but the “st-connectivity problems” referred to in [14] are, in fact, switching networks. given query access to the edge variables were given in [14], using a span program construction based heavily on [7]. Let s,t(G(x)) be the effective resistance in the subgraph of “on” edges whenever f(x)=1, and whenever f(x)=0, let FxE be the minimum weight st-cut-set consisting of only edges that are “off”. Then there is a quantum algorithm evaluating the switching network using

maxxf1(1)s,t(G(x))maxxf1(0)eFx𝗐e,

queries, with matching time complexity assuming we can implement a certain reflection related to the particular switching network in unit time. From this it follows that if we can query the variable associated with an edge e in time Te, we can evaluate the switching network in time

maxxf1(1)s,t(G(x))maxxf1(0)eFx𝗐e.maxeETe.

Here we improve this to:

maxxf1(1)s,t(G(x))maxxf1(0)eFx𝗐eTe2.

This is analogous to results of [13], which showed a similar statement, but for quantum walks rather than switching networks222Both our result, and the one for quantum walks in [13] include variable-time quantum search [2] as a special case.. Because switching networks perfectly model Boolean formulas, without the constant overhead we get when we convert to a quantum algorithm, they can be used as a building block for our divide-&-conquer results.

Application to DSTCON

Quantum algorithms for st-connectivity on undirected graphs, which are closely related to evaluating switching networks, are well studied [10, 7, 14, 12, 3], including quantum algorithms that achieve optimal time- and space-complexity simultaneously, in both the edge-list access model, and the adjacency matrix access model.333We do not make a distinction between various access models, because they can simulate one another in poly(n) time and log(n) space, so our result, which includes a 2O(logn) term, is the same in all models. In contrast, quantum algorithms for directed st-connectivity (dstcon) – the problem of deciding if there is a directed path from s to t in a directed graph – is less well understood. The algorithm of [10] also applies to directed graphs, deciding connectivity in O~(n) time and space444In the edge-list access model.. This algorithm has optimal time complexity, whereas its space complexity is far from optimal.

Directed st-connectivity, also called reachability, is a fundamental problem in classical space complexity. In particular, understanding if this problem can be solved in log(n) space by a quantum algorithm would resolve the relationship between quantum logspace complexity and 𝖭𝖫, as dstcon is 𝖭𝖫-complete.

The best known classical (deterministic) space complexity of dstcon is O(log2(n)), using Savitch’s algorithm. We apply quantum divide & conquer (Theorem 1) to give a quadratic speedup to Savitch’s algorithm, achieving 212log2(n)+O(log(n)) time, while still maintaining O(log2(n)) space (see Theorem 18).

Model of Computation

We work in the same model as [15], where we allow not only arbitrary quantum gates, but also assume subroutines are given via access to a unitary that applies the subroutine’s t-th gate controlled on the value t in some time register. This is possible, for example, with quantum random access gates.

Related Work

While writing this manuscript, we became aware of an independent work that also achieves time-efficient quantum divide & conquer [1] when either (1) φ is an OR (equivalently, an AND) or (2) φ is a minimum or maximum. OR is a Boolean formula, while minimum/maximum is not. In that sense, our results are incomparable. Ref. [1] applies their framework to problems that are distinct from ours. The framework of [1] also differs from our work in that they explicitly treat the complexity of computing sub-instances (the cost of the “create” step), whereas we assume sub-instances are computable in unit cost. In one of the applications of [1], this cost is not negligible, and is even the dominating cost, so our framework, as stated, would not handle this application. This is not an inherent limitation of our techniques – it would be possible to take this cost into account in our framework as well.

We also mention that Ref. [9] analyzes the quantum query complexity of divide & conquer where φ is an arbitrary Boolean formula, as well as in settings where the function combining the sub-problems is more general. While our techniques do apply to composing quantum algorithms for arbitrary functions (already studied in [13]), an issue is a poor scaling in the error of subroutines. If we start with a bounded-error quantum algorithm for some function, we need to amplify the success probability, as it will be called many times, incurring logarithmic factors. This becomes a serious problem if the function is called recursively to depth more than constant. We get around this in the case of Boolean formulas by using a switching network construction (from which a quantum algorithm could be derived) rather than a bounded-error quantum algorithm for evaluating the formula. Our techniques would thus also readily apply to functions for which there is an efficient quantum algorithm derived from a switching network.

2 Technical Overview

Here we give a technical overview of our results, with full details available in the full version of the paper.

2.1 Subspace Graphs

Multidimensional quantum walks were introduced as such in [15], although they generalize various quantum algorithms that have appeared previously, including [25, 21, 4, 5, 11]. We wish to consider very general kinds of composition of multidimensional quantum walks, and in order to be clear about the precise types of objects we are composing, we give a more formal definition than has appeared previously.

Definition 2 (Subspace Graph).

A subspace graph consists of a (undirected) graph G=(V,E), a boundary BV, and the following subspaces of a space H=HG:

Edge and Boundary Spaces

We assume H can be decomposed into a direct sum of spaces as follows: H=eEΞeuBΞu.

Edge and Boundary Subspaces

For each eEB, let Ξe𝒜 and Ξe be subspaces of Ξe. These need not be orthogonal, and they may each be {0}, all of Ξe, or something in between.

Vertex Spaces and Boundary Space

For each uV, let 𝒱ueE(u)Ξe be pairwise orthogonal spaces. Let 𝒱BuBΞu.

Then we define

𝒜G=eEBΞe𝒜 and G=uV𝒱u+𝒱B+eEBΞe.

To motivate this perhaps complicated-looking definition, we mention some concrete examples of subspace graphs that already exist in the quantum algorithms literature:

  1. 1.

    A discrete-time quantum walk in Szegedy’s framework [25], or the more general electric network framework [4] is a subspace graph.

  2. 2.

    The span programs for st-connectivity in [14], based on [7], are subspace graphs. These are actually precisely switching networks, which we will discuss more shortly (although the basis constructions for Boolean switching networks in this work are new).

  3. 3.

    In [13], certain subspaces are defined from any quantum algorithm, and these actually make up a subspace graph (see Section 2.2.3).

We will allow subspace graphs to implicitly depend on some input, and associate them with a computation. Specifically, if we fix some initial state |ψ0HG, then this, along with 𝒜G and G, define a phase estimation algorithm that decides if |ψ0𝒜G+G by doing phase estimation of (2Π𝒜GI)(2ΠGI), where Π𝒜G is the orthogonal projector onto 𝒜G, and similarly for G. With this in mind, we say a subspace graph that depends on some input x, computes a function f (with respect to |ψ0) if f(x)=0 if and only if |ψ0𝒜G+G. Let us give some intuition. The quantum algorithm corresponding to a subspace graph described above distinguishes between two cases:

Negative Case:

|ψ0𝒜G+G

Positive Case:

|ψ0 has a (large) component, called a positive witness in (𝒜G+G)=𝒜GG

Then we can see all the vectors in 𝒜G and G as linear constraints on the initial state – it must have a large component orthogonal to all of them in the positive case. 𝒜G and G are each decomposed into sums of subspaces, representing subsets of constraints. The graph structure of G restricts how the different sets of constraints are allowed to overlap – the constraints associated with vertex v only overlap constraints associated with edges that are incident to v. This graph structure can then be used to help analyse the algorithm. For example, a positive witness is related to a flow on G.

Though it is possible to consider more general states |ψ0, throughout this paper, we will assume G has a pair of special “terminal” vertices s and t, and let |ψ0=12(|s|t).

To implement the phase estimation algorithm, we need a pair of orthogonal bases for 𝒜G and G that are easily generated, in order to implement their respective reflections. We therefore always assume we have such a basis pair associated with G, which we call the working bases.

To analyze a phase estimation algorithm, we need to exhibit positive and negative witnesses, which have a particular form in the case G has a property called canonical st-boundary (see Definition 8), as will always be the case in this paper. In particular, st-boundary implies that uBΞu=ΞsΞt has four degrees of freedom, which we denote |s,|,s,|t,|,t.

Definition 3 (Positive Witness for a Graph).

We say |w^ΞE is a positive witness for G if

|s|,s+|w^+|,t|t𝒜GG.

We let W^+(G) be an upper bound (over some implicit input) on the minimum |w^2 of any positive witness for G.

A negative witness for a phase estimation algorithm is a vector |w𝒜𝒜 such that |w:=|ψ0|w𝒜, which exists if and only if |ψ0𝒜G+G. For a subspace graph, a negative witness is defined as follows.

Definition 4 (Negative Witness for a Graph).

We say |w^𝒜𝒜G is a negative witness for G if |w^𝒜+|,s|,tG. We let W^(G) be an upper bound (over some implicit input) on the minimum |w^𝒜2 of any negative witness for G.

This leads to the following theorem associating a quantum algorithm to a subspace graph.

Theorem 5.

Let G be a subspace graph that computes f:{0,1}n{0,1}, with working bases that can be generated in time T. Then there exists a quantum algorithm that decides f in time complexity O(TW^+(G)W^(G)) and space O(logdimHG+log(W^+(G)W^(G))).

This justifies defining 𝒞^(G):=W^+(G)W^(G) as the complexity of a subspace graph.

Switches and Switching Networks

Next, we introduce switching networks. In the classical model of switching networks, a switching network is a graph with a literal (variable or negated variable) φ(e) associated with each edge e, and two terminals s,tV. A switching network computes a function f:{0,1}E{0,1} if for any x{0,1}E, f(x)=1 if and only if s and t are connected in G(x), the subgraph consisting only of edges e such that xe=1 if φ(e) is a positive literal, and xe=0 otherwise – that is, edges labelled by literals that are true when the variables are set according to x. Here, we let “switching network” refer to a special kind of subspace graph, but this subspace graph implements the switching network, in the sense that the algorithm referred to in Theorem 5 decides if s and t are connected in G(x).

We first define what it means for an edge to be a switch. For a vertex uV, we let E(u) denote the edges incident to u, which we divide into E(u) – edges “coming out of” u – and E(u) – edges “going into” u. As G is an undirected graph, these edge directions can be chosen arbitrarily.

Definition 6 (Switch Edge).

Fix a subspace graph G. We call an edge eE a switch (or switch edge) if there is some value φ(e){0,1} associated with that edge (implicitly depending on the input), such that

Ξe =span{|,e,|,e},
Ξe𝒜 =span{|,e(1)φ(e)|,e}andΞe=span{|,e+|,e},

and moreover, if eE(u)E(v), (that is, e=(u,v)), then 𝒱uΞe=span{|,e} and 𝒱vΞe=span{|,e}.

The idea behind a switch edge is that if φ(e)=0, Ξe𝒜+Ξe=Ξe, and so Ξe={0}. Recall that a positive witness is some |w^ such that |w:=|s|,s+|w^+|,t|t𝒜GG. If Ξe={0}, then |w can have no overlap with Ξe, so e is essentially blocked from use, so we say the edge is switched off. In switching networks, defined shortly, the positive witness is an st-flow, and it is restricted to edges in the subgraph G(x) of edges that are switched on. Even in subspace graphs that are not switching networks, we can often think of |w intuitively as a kind of flow.

We next define simple vertices, which are the type of vertices of switching networks, and also quantum walks.

Definition 7 (Simple Vertex).

Fix a subspace graph G with associated edge weights {𝗐e}eE. For uV, define

|ψ(u):=eE(u)𝗐e|,e+eE(u)𝗐e|,e.

A vertex uV is simple if for all eE(u), |,eΞe, for all eE(u), |,eΞe, and if uVB 𝒱u=span{|ψ(u)}; and if uB, either |,uΞu and 𝒱u=span{|,u+|ψ(u)} or |,uΞu and 𝒱u=span{|,u+|ψ(u)}.

Let us motivate this definition. In a random walk on a weighted graph, in order to take a step from a vertex uV to a neighbour, the random walker chooses an edge eE(u) to traverse, with probability 𝗐e/(eE(u)𝗐e). This is precisely the distribution obtained by measuring |ψ(u)/|ψ(u). The states |ψ(u) correspond to quantum walk states – alternating a reflection around these with a reflection around the states {|,e+|,e}eE implements a discrete-time quantum walk, as in [25, 17, 4].555In some previous works, it is assumed that the graph is bipartite, and then the walk is implemented by alternating reflections around the states |ψ(u) of the two parts of the bipartition. We are actually doing the same thing here, we have just ensured the graph is bipartite by inserting a vertex in the middle of each edge.

Another important notion is that of canonical st-boundary for which we require the boundary to consist only of two vertices s and t with additional requirements on their subspaces.

Definition 8 (Canonical st-boundary).

We say a subspace graph G has canonical st-boundary if B={s,t}, where:

  • Ξs=span{|s,|,s}, Ξs𝒜=span{|s+|,s} and Ξs={0}, where 𝒱s only overlaps |,s.

  • Ξt=span{|,t,|t}, Ξt𝒜=span{|,t+|t} and Ξt={0}, where 𝒱t only overlaps |,t.

  • |,s+|,tG.

Definition 9 (Switching Network).

A switching network is a subspace graph with canonical st-boundary in which all edges are switches (Definition 6), and all vertices are simple (Definition 7).

Two more important definitions for the composition results are those of composable bases and st-composable subspace graph (Definition 10). The first one specifies conditions on working bases so that they can be smoothly composed with each other. We leave the rigorous definition to the full version of the paper since it is quite technical.

Definition 10.

We say a subspace graph G is st-composable if:

  1. 1.

    G has canonical st-boundary (Definition 8);

  2. 2.

    G is equipped with composable working bases;

  3. 3.

    for each eEE¯, Ξe={0}, where E¯ is the set of edges that are switches.

An st-composable subspace graph is a generalization of a switching network to allow for more complicated structures, such as arbitrary quantum algorithms. The main technical contribution of this paper (the composition theorem in Section 2.3) is to generalize a natural way that switching networks compose, as graphs, to any st-composable subspace graph.

2.2 Examples

We first give two examples of switching networks – one for computing the OR of d bits (Section 2.2.1) and one for the AND of d bits (Section 2.2.2) – which are also important building blocks for our later results. At a high level, these are quite simple to understand. The switching network for OR is just d parallel edges from s to t (see Figure 1) – s and t are connected if at least one of the edges is present. The switching network for AND is just a path of length d from s to t (see Figure 2) – s and t are connected if all of the edges are present. One can build up a graph that represents any formula by compositions where an edge is replaced by a graph whose terminals s and t are identified with the endpoints of the replaced edge (see also Figure 4). Our main composition theorem (see Section 2.3) generalizes this type of composition to apply to any st-composable subspace graph.

2.2.1 Switching network for OR

A switching network that computes the OR of d Boolean variables consists of two vertices connected by d parallel switch edges. The idea is that there is no flow if all the edges are blocked, that is all the variables take value 0, an there is a flow otherwise. Therefore, a negative witness corresponds to a cut in the graph, and a positive witness corresponds to a flow.

Lemma 11.

For any d1, and positive weights {𝗐i}i[d], there is a switching network Gor,d that computes i=1dφ(ei) with dimHGor,d=2d+4 such that:

  1. 1.

    Gor,d has st-composable working bases that can be generated in O(logd) time, assuming the state proportional to i=1d𝗐i|i can be generated in time O(logd);

  2. 2.

    if φ(ei)=1 for some i[d], Gor,d has positive witness |w^=1𝗐i(|,i|,i); and

  3. 3.

    if φ(ei)=0 for all i[d], Gor,d has negative witness |w^𝒜=i=1d𝗐i(|,i|,i).

Figure 1: The graph Gor. The dashed lines represent dangling boundary “edges”.

We remark that if 𝗐i=1 for all i, then Lemma 11 implies W^+(Gor,d)=2 and W^(Gor,d)=2d, so by Theorem 5, there is a quantum algorithm for evaluating d-bit OR with time complexity O~(d), which is optimal. This is a good sanity check, but we will mostly be interested in this construction as a building block, rather than in its own right.

Let G=Gor,d be defined, as shown in Figure 1 by:

V={s,t} and E={ei:i[d]}

where each ei has endpoints s and t, so E(s)=E(s)=E and E(t)=E(t)=E. Since G is a switching network, it has boundary B=V={s,t}. We will let the graph be weighted, with weights 𝗐ei=𝗐i. The only reason to let these vary in i is for later when we replace an edge with a gadget by composition, but for the sake of intuition, the reader may wish to imagine 𝗐i=1 for all i. Since G is a switching network, every edge is a switch, which fixes the following spaces (we simplify notation by using i to label the edge ei):

i[d], Ξei=span{|,i,|,i},
Ξei𝒜=span{|,i(1)φ(ei)|,i}, and Ξei=span{|,i+|,i}.

Furthermore, as a switching network has canonical st-boundary, the following spaces are fixed:

Ξs=span{|s,|,s},Ξs𝒜=span{|s+|,s}, and Ξs={0}
Ξt=span{|,t,|t},Ξt𝒜=span{|,t+|t}, and Ξt={0}.

Finally, since all vertices are simple, the following spaces are fixed:

𝒱s=span{|,s+i=1d𝗐i|,i|ψ(s)} and 𝒱t=span{i=1d𝗐i|,i|ψ(t)+|,t}.

Then we have:

𝒜G=eEBΞe𝒜=span{|,i(1)φ(ei)|,i:i[d]}{|s+|,s,|t+|,t}and G=𝒱s𝒱t+eEΞe=𝒱s𝒱t+span{|,i+|,i:i[d]}. (1)

We prove the second and the third items of Lemma 11 in the full version of the paper. It remains to find working bases that can be generated efficiently. We show in the full version that there is an st-composable working basis for 𝒜G that can be generated in unit time and there is a st-composable working basis for G that can be generated in O(logd) time.

2.2.2 Switching network for AND

In this section, we describe a switching network that computes the AND of d Boolean variables. This switching network consists of two boundary vertices connected by a path of switch-edges of length d. If at least one edge is blocked, that is at least one of the variables takes value 0, then there is no flow, and there is a flow otherwise.

Lemma 12.

For any d1, and positive weights {𝗐i}id, there is a switching network Gand,d that computes i=1dφ(ei) with dimHGand,d=2d+4 such that:

  1. 1.

    Gand,d has st-composable working bases that can be generated in O(logd) time, assuming the state proportional to i=1d1𝗐i|i can be generated in time O(logd);

  2. 2.

    if φ(ei)=1 for all i[d], Gand,d has positive witness |w^=i=1d1𝗐i(|,i|,i); and

  3. 3.

    if φ(ei)=0 for some i[d], Gand,d has negative witness |w^𝒜=𝗐i(|,i|,i).

As with the OR switching network, a corollary of this lemma is that there is a quantum algorithm for evaluating AND in optimal time O~(d).

Figure 2: The graph Gand. The dashed lines represent dangling boundary “edges”.

Let G=Gand,d be the graph in Figure 2, defined by

V={s=u0,u1,,ud=t} and E={ei=(ui1,ui):i[d]},

so E(s)=E(s)={e1}, E(t)=E(t)={ed}, and for all i[d1], E(ui)={ei} and E(ui)={ei+1}. Since G is a switching network, it has boundary B={s,t}. We will let the graph be weighted, with weights 𝗐ei=𝗐i. Since G is a switching network: every edge is a switch, which fixes Ξei, Ξei𝒜 and Ξei for all i[d]; G has canonical st-boundary, which fixes Ξs, Ξs𝒜, Ξs, Ξt, Ξt𝒜, and Ξt; and every vertex is simple, which fixes the spaces 𝒱ui for i{0,,d}. In particular, letting 𝗐0=𝗐d+1=1, s=0, t=d+1, and i[d] label ei, we must have:

i{0,,d}, 𝒱ui=span{𝗐i|,i+𝗐i+1|,i+1}.

This fully defines

𝒜G=eEBΞe𝒜 and G=i=0d𝒱ui+eEΞe.

We prove the second and the third items of Lemma 12 in the full version of the paper. It remains to find working bases that can be generated efficiently. We show in the full version that there is an st-composable working basis for 𝒜G that can be generated in unit time and there is a st-composable working basis for G that can be generated in O(logd) time.

2.2.3 Any Quantum Algorithm

Figure 3: The graph representing a quantum computation with 𝖳 steps. The top part should be thought of as computing a bit into the phase, and the bottom should be thought of as uncomputing. The dashed lines represent dangling boundary “edges”.

Ref. [13] deals with composing arbitrary quantum algorithms, implicitly using subspace graphs for the task. It is shown how to define certain subspaces from an arbitrary quantum algorithm, where the overlap between these various spaces gives rise to a graph as in Figure 3. In the full version of the paper, we show that these subspaces are precisely a subspace graph, so that the following follows from [13].

Lemma 13.

From any quantum algorithm computing some f:{0,1}n{0,1} in time T with S qubits, we can derive an st-composable subspace graph (Definition 10) G that computes f with dimHG=O(2ST), W^+(G)2T and W^(G)2T; with st-composable working bases that can be generated in time O(log(T)).

2.3 Composition

Subspace graphs lend themselves well to very general kinds of recursion. We can compose subspace graphs by identifying some of the vertices on their boundaries. In full generality, this may result in a subspace graph that is difficult to analyze. For example, if we replace two parallel edges with subspace graphs derived from quantum algorithms, “flow” along these edges may have complex phases that interfere on the other side. Our nice classical intuition of flows breaks down in the fully general case, which is not surprising, since quantum algorithms are not classical. However, an important question is in which special cases, and to what extent, we can compose subspace graphs and keep enough classical intuition to analyze them.

Figure 4: An example of replacing edges e1 and e2 in G with graphs Ge1 and Ge2 to obtain G. Boundary “edges” are represented by dashed lines. Switching networks already lend themselves to this type of recursion: we can replace an edge with a 2-terminal graph, and then the “edge” is traversable if and only if the terminals are connected. The difference with the more general recursion in Theorem 14 is that the subspace graphs used to replace edges (as well as other parts of G) might have more complicated structure than just their graph structure; for example, they might encode quantum algorithms like in Section 2.2.3.

One special case is implicit in [13], and here we present another special case, which we call switch composition. Switch composition generalizes a very simple kind of recursion that can be done in switching networks. Since an st-path (or more generally, flow) is allowed to use an edge if and only if φ(e)=1, we can replace it with a switching network Ge for some function fe, which will have an st-path from one endpoint to the other if and only if fe(x)=1. We can view this as removing e from the graph, and then adding its endpoints to the boundary, to then be identified with the boundary {se,te} of Ge. By applying this type of composition, the OR and AND switching networks in Section 2.2.1 and Section 2.2.2 can be combined to make switching networks for any Boolean formula [14].

Here we investigate how to compose subspace graphs with specific properties that generalize switching networks – st-composable subspace graphs (Definition 10) – into the switches of a graph G. Specifically, if E¯ is the set of edges of G that are switches, we will replace eE¯ with an st-composable graph Ge. We can assume without loss of generality that we replace every eE¯ with some Ge, since letting Ge be the graph consisting of a single edge from se to te is just like not replacing e.

Theorem 14.

Let G be an st-composable subspace graph with st-composable working bases that can be generated in time T. For each eE¯, the set of switches of G, let Ge be an st-composable subspace graph with st-composable working bases that can be generated in time at most T. Then there exists an st-composable subspace graph G with dimHGdimHG2|E¯|+eE¯dimHGe such that:

  • G has st-composable working bases that can be generated in time T+T+O(1).

  • If |w^ is a positive witness for G (Definition 3), and for each eE¯ such that ,e|w^0, |w^e is a positive witness for Ge, then

    |w^=eE¯,e|w^|w^e+ΠEE¯|w^

    is a positive witness for G.

  • If |w^𝒜 is a negative witness for G (Definition 4), and for each eE¯ such that ,e|w^𝒜0, |w^𝒜e is a negative witness for Ge, then

    |w^𝒜=eE¯,e|w^𝒜|w^𝒜e+ΠEE¯|w^𝒜

    is a negative witness for G.

Informally, we obtain G from G by, for each eE¯, removing the edge e, and identifying its endpoints with the vertices s=se and t=te of the graph Ge. This is illustrated in Figure 4. The subspaces associated with G are mostly inherited from G and Ge, except for those on the glued boundaries. There, intuitively, we replace |,e with the edges incident to s=se in Ge, and |,e with the edges incident to t=te in Ge.

Note that the witnesses in the composed subspace graph have a very logical form. We obtain a positive witness |w^ by taking a positive witness for G, and replacing the edge |,e+|,e with a positive witness, and similarly for negative witnesses.

Next, we apply the composition construction of Theorem 14 to compose the switching networks for AND and OR in Section 2.2.2 and Section 2.2.1 with other st-composable subspace graphs computing some functions fσ to get a subspace graph computing the composed function φ(fσ)σΣ when φ is a Boolean formula on {0,1}Σ. This is the function obtained by computing the value of each variable xσ of the formula φ as fσ of some input. Subspace graphs for φ can be obtained simply by composing the switching networks for OR and AND (see [14]). Our composition theorem, Theorem 14, generalizes this simple switching network composition.

A formula is a rooted tree, where each internal node represents an AND or an OR gate, and each leaf represents a literal. We let Σ¯Σ denote the set of internal nodes, and for each σΣ¯Σ, dσ is the number of children of σ.

A family of formulas is balanced if there is a constant c such that for every internal node σ, if its subtree has N leaves, then the sub-tree of each of its dσ children has at most cN/dσ leaves.

Lemma 15.

Let φ be a balanced formula on {0,1}Σ. Let {fσ}σΣ be Boolean functions, and for each σΣ, let Gσ be an st-composable subspace graph (Definition 10) computing fσ, with working bases that can be generated in time at most T, and logdimHGσS.

For each σΣ, let 𝖢σ be a known upper bound on 𝒞^(Gσ). Then there is an st-composable subspace graph G computing φ(fσ)σΣ with logdimHG=S+O(log|Σ|) and

𝒞^(G)2σΣ𝖢σ2,

as long as for each σΣ¯Σ, a superposition proportional to i[dσ]𝖢σ,i±|i can be generated in O(logdσ) complexity, for certain values 𝖢σ,i± related to the bounds {𝖢σ}σΣ. Furthermore, the working bases of G can be generated in time T+O(log|Σ|).

2.4 Quantum Divide & Conquer

In this section, we state our time-efficient quantum divide & conquer results. The following is a time-efficient version of Strategy 1 in [9], restricted to symmetric formulas.

Theorem 16.

Fix a function family f,n:D,n{0,1}. Fix unit-time-computable functions λ1,λ2:, and a formula φ on {0,1}a+1 such that φ=φ(z1,,za)za+1 for some symmetric formula φ. Suppose {𝒫aux,,n},n is a family of quantum algorithms such that:

  • 𝒫aux,,n decides some faux,,n:D,n{0,1} with time and space complexities Taux(,n) and Saux(,n);

  • if 0, f,n(x)=faux,,n(x);

  • if >0, f,n(x)=φ(fi)i[a+1] where each fi for i[a] is such that fi(x)=fλ1(),λ2(n)(xi) for some unit-time-computable instance xi of fλ1(),λ2(n), and fa+1=faux,,n.

Then there is a bounded-error quantum algorithm that decides f,n with time complexity O~(T(,n)), and space complexity O(Saux(,n)+logT(,n)), where for all >0:

T(,n):=aT(λ1(),λ2(n))2+4Taux(,n)2aT(λ1(),λ2(n))+2Taux(,n)

and for 0, T(,n)=2Taux(,n).

To prove Theorem 16, we make a subspace graph that computes f,n=φ(fi)i using Lemma 15, which allows us to combine subspace graphs for fλ1(),λ2(n) – built up inductively – and faux,,n – built by turning the quantum algorithm 𝒫aux,,n into a subspace graph using Lemma 13. Note that Lemma 15 applies to any balanced formula φ, but in the special case we consider in Theorem 16, the values 𝖢σ,i± referred to in Lemma 15 are well behaved.

2.5 Application to DSTCON

In this section we consider the directed st-connectivity problem.

Problem 17 (dstcon).

Given access to a directed graph G=(V,E) via the oracle 𝒪G, and two vertices s,tV, decide whether there is a directed path from s to t in G.

There is a classical recursive algorithm for dstcon that operates in the low-space regime due to Savitch [22] that decides dstcon in time O((2n)logn=2log2+O(logn)) and space O(log2n). The algorithm recursively calls a subroutine that decides a function f,n(G,u,v), which is 1 if and only if there is a path of length at most from u to v in G. We can express f,n recursively, in terms of a symmetric formula φ in a=2n variables:

f,n(G,u,v)=wV(f/2,n(G,u,w)f/2,n(G,w,v))φ.

We show a quantum speedup for Savitch’s algorithm via application of Theorem 16, which gives us the recursion

T(,n)=2nT(/2,n)+O(1)

from which we get:

T(n,n)=2nlogn+O(logn)=212log2(n)+O(logn),

which is the complexity of computing fn,n(G,s,t)=dstcon(G). This yields the following.

Theorem 18.

Let G=(V,E) be a directed graph, |V|=n. Then there exists a recursive quantum algorithm that decides dstcon on G with bounded error in time O~((2n)logn)=212log2n+O(logn) and space O(log2n).

References

  • [1] Jonathan Allcock, Jinge Bao, Aleksandrs Belovs, Troy Lee, and Miklos Santha. On the quantum time complexity of divide and conquer. arXiv:2311.16401, 2023.
  • [2] Andris Ambainis. Quantum search with variable times. Theory of Computing Systems, 47:786–807, 2010. arXiv:quant-ph/0609168 doi:10.1007/s00224-009-9219-1.
  • [3] Simon Apers, Stacey Jeffery, Galina Pass, and Michael Walter. (No) Quantum Space-Time Tradeoff for USTCON. In 31st Annual European Symposium on Algorithms (ESA 2023), pages 10:1–10:17, 2023. doi:10.4230/LIPIcs.ESA.2023.10.
  • [4] Aleksandrs Belovs. Quantum walks and electric networks. arXiv:1302.3143, 2013.
  • [5] Aleksandrs Belovs, Andrew M. Childs, Stacey Jeffery, Robin Kothari, and Frédéric Magniez. Time-efficient quantum walks for 3-distinctness. In Proceedings of the 40th International Colloquium on Automata, Languages, and Programming (ICALP), pages 105–122, 2013. doi:10.1007/978-3-642-39206-1_10.
  • [6] Aleksandrs Belovs, Stacey Jeffery, and Duyal Yolcu. Taming quantum time complexity. arXiv:2311.15873, 2023. doi:10.48550/arXiv.2311.15873.
  • [7] Aleksandrs Blovs and Ben W. Reichardt. Span programs and quantum algorithms for st-connectivity and claw detection. In Proceedings of the 20th Annual European Symposium on Algorithms (ESA), pages 193–204, 2012. doi:10.1007/978-3-642-33090-2_18.
  • [8] M. L. Bonet and S. R. Buss. Size-depth tradeoffs for boolean formulae. Information Processing Letters, 49:151–155, 1994. doi:10.1016/0020-0190(94)90093-0.
  • [9] Andrew M. Childs, Robin Kothari, Matt Kovacs-Deak, Aarthi Sundaram, and Daochen Wang. Quantum divide and conquer. arXiv:2210.06419, 2022.
  • [10] Christoph Dürr, Mark Heiligman, Peter Høyer, and Mehdi Mhalla. Quantum query complexity of some graph problems. SIAM Journal on Computing, 35(6):1310–1328, 2006. Earlier version in ICALP’04. arXiv:quant-ph/0401091 doi:10.1137/050644719.
  • [11] Tsuyoshi Ito and Stacey Jeffery. Approximate span programs. Algorithmica, 79:2158–2195, 2019. doi:10.1007/S00453-018-0527-1.
  • [12] Michael Jarret, Stacey Jeffery, Shelby Kimmel, and Alvaro Piedrafita. Quantum algorithms for connectivity and related problems. In Proceedings of the 26th Annual European Symposium on Algorithms (ESA), pages 49:1–49:13, 2018. doi:10.4230/LIPIcs.ESA.2018.49.
  • [13] Stacey Jeffery. Quantum subroutine composition. arXiv:2209.14146, 2022.
  • [14] Stacey Jeffery and Shelby Kimmel. Quantum algorithms for graph connectivity and formula evaluation. Quantum, 1(26), 2017.
  • [15] Stacey Jeffery and Sebastian Zur. Multidimensional quantum walks and application to k-distinctness. In Proceedings of the 55th ACM Symposium on the Theory of Computing (STOC), pages 1125–1130, 2023. arXiv:2208.13492
  • [16] C. Y. Lee. Representation of switching functions by binary decision programs. Bell Systems Technical Journal, 38(4):985–999, 1959. doi:10.1002/j.1538-7305.1959.tb01585.x.
  • [17] Frédéric Magniez, Ashwin Nayak, Jérémie Roland, and Miklos Santha. Search via quantum walk. SIAM Journal on Computing, 40(1):142–164, 2011. Earlier version in STOC’07. arXiv:quant-ph/0608026 doi:10.1137/090745854.
  • [18] Aaron H. Potechin. Analyzing monotone space complexity via the switching network model. PhD thesis, Massachusetts Institute of Technology, 2015.
  • [19] Ben W. Reichardt. Span programs and quantum query complexity: The general adversary bound is nearly tight for every Boolean function. In Proceedings of the 50th IEEE Symposium on Foundations of Computer Science (FOCS), pages 544–551, 2009. arXiv:0904.2759 doi:10.1109/FOCS.2009.55.
  • [20] Ben W. Reichardt. Faster quantum algorithm for evaluating game trees. In Proceedings of the 22nd ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 546–559, 2011. doi:10.5555/2133036.2133079.
  • [21] Ben W. Reichardt and Robert Špalek. Span-program-based quantum algorithm for evaluating formulas. Theory of Computing, 8(13):291–319, 2012. doi:10.4086/toc.2012.v008a013.
  • [22] Walter J Savitch. Relationships between nondeterministic and deterministic tape complexities. Journal of computer and system sciences, 4(2):177–192, 1970. doi:10.1016/S0022-0000(70)80006-X.
  • [23] Claude E. Shannon. A symbolic analysis of relay and switching networks. Transactions of the American Institute of Electrical Engineers, 57(12):713–723, 1938. doi:10.1109/T-AIEE.1938.5057767.
  • [24] Claude E. Shannon. The synthesis of two-terminal switching circuits. Bell System Technical Journal, 28(1):59–98, 1949. doi:10.1002/j.1538-7305.1949.tb03624.x.
  • [25] Mario Szegedy. Quantum speed-up of Markov chain based algorithms. In Proceedings of the 45th IEEE Symposium on Foundations of Computer Science (FOCS), pages 32–41, 2004. arXiv:quant-ph/0401053 doi:10.1109/FOCS.2004.53.