Académique Documents
Professionnel Documents
Culture Documents
DOI: 10.1103/PhysRevA.97.022337
problem and we altogether avoid spectral theory, this paper that f (m) =√1, there is a quantum algorithm which returns
can be loosely viewed as a step towards demonstrating the m using O( T n log3 n log(1/δ)) queries to f and h for any
utility of effective resistance estimates in search problems. Our 0 < δ < 1. The algorithm requires O(1) auxiliary operations
estimation procedure is similar to those found in Refs. [8,9], per query and poly(n) space and fails with probability at most δ.
which also employ amplitude estimation to estimate effective In many problems, however, we are not given the promise
resistance; however, our application of amplitude estimation of a unique marked vertex. Unfortunately, as the number of
is arrived at somewhat differently and is not intended to marked vertices is increased, it becomes increasingly unlikely
estimate effective resistance to within low multiplicative error. that measuring the output state of phase estimation in the
(Achieving low multiplicative error is indeed possible with the computational basis returns any state other than the input
algorithms we present, but is not the focus of this paper.) root. Therefore, for trees with potentially more than one
The algorithm of Ambainis and Kokainis in Ref. [10] marked vertex, Montanaro finds marked vertices by applying
also improves upon Montanaro’s complexity bound in certain his existence algorithm in conjunction with a classical descent.
settings, but by estimating the tree size rather than the effec- The search algorithm begins by considering each child c of
tive resistance. The tree-size-estimation strategy sometimes the root vertex r in turn and determining whether at least
confers an advantage over estimating effective resistance, one marked vertex exists in the subtree T (c) rooted at c
particularly if the known upper bound on the tree size is too (using the existence routine). For a child c0 of r for which
large. Additionally, some of the analysis of our algorithm is the subtree T (c0 ) is found to contain at least one marked
quite similar to that for tree-size estimation; however, we apply vertex, the algorithm checks whether c0 is marked. If so, c0 is
amplitude estimation to the output of phase estimation whereas returned, and if not, the procedure is repeated on the children
Ambainis and Kokainis estimate the phase of the eigenvector of c0 . Once the algorithm finds a marked vertex, it returns the
closest to the eigenvalue-1 eigenvector. This suggests that an vertex, unmarks it, and restarts at the root, until all k vertices
algorithm that integrates the approach of Ref. [10] with ours are discovered. Assuming that the degree of every vertex in T
may achieve better scaling than either taken independently. is O(1), the following bounds are thus achieved.
Indeed, the results of Ref. [9] suggest that a tighter bound Theorem 3. For T , f , h, T , and n defined as in Theorem 1
should be possible, even in the case where the structure of the and any 0 < δ < 1, there is a quantum algorithm which returns
graph is unknown. √ that f (v) = 1 or none if no such v exists using
v such
O( T n3/2 log n log(1/δ)) queries to f and h. The algorithm
requires O(1) auxiliary operations per query and poly(n) space
A. Previous work
and fails with probability at most
√ δ. It can be repeated to find
In his approach to the decision problem, Montanaro spe- all k marked vertices using O(k T n3/2 log n log(k/δ)) queries
cializes Belovs’ algorithm for determining the existence of to f and h.
marked vertices in a graph [6,11] to rooted trees [1]. The Ambainis and Kokainis reduce the number of steps needed
algorithm applies phase estimation to the product of two for trees with multiple marked vertices by introducing a tree-
diffusion operators (defined in Sec. II D), using the root of size-estimation algorithm in Ref. [10]. The result is similar
the search tree as the input state. When taken to high enough to Theorem 3 with the upper bound T on the size of the tree
precision, if one or more vertices in the tree are marked, phase replaced by the number of vertices T actually visited by a
estimation returns the eigenvalue 1 with probability at least classical backtracking algorithm.
1/2. If none of the vertices are marked, the eigenvalue 1 is seen
with probability less than 1/4. A straightforward application
of a Chernoff bound then decides existence. B. Main results
Theorem 1. Let T be a tree with root r and vertex set In Ref. [1], Montanaro leaves open the question of whether
V (T ). Let T denote an upper bound on the number of vertices an algorithm similar to that of Theorem 2 can be used to obtain
|V (T )| and n an upper bound on the depth of T . Define a similar bound for trees with an arbitrary number of marked
the functions f : V (T ) → {0,1}, where for a vertex v ∈ T , vertices. We proceed to such a generalization in the present
f (v) = 1 if v is marked and f (v) = 0 otherwise, and the oracle work.
h such that h(v) returns the set of children of v. Then, for any We first establish the following theorem, which utilizes the
0 < δ < 1, there is a quantum algorithm which takes r as input effective resistance η between the root vertex of the input tree
and√determines whether {v ∈ V (T )|P (v) = true} = ∅ using T and the set of marked vertices in T (which we will refer to
O( T n log(1/δ)) queries to f and h. The algorithm requires as the effective resistance of T ). Note that for trees with many
O(1) auxiliary operations per query and poly(n) space and fails marked vertices, this effective resistance can be substantially
with probability at most δ. smaller than the resistance between r and a particular marked
In the case where one and only one marked vertex is vertex, but never less than 1/dr , where dr is the degree of the
promised to exist, Montanaro measures the output state of the root.
phase estimation procedure described above in the computa- Theorem 4. For T , f , h, T , and n defined as in
tional basis and then uses the measurement outcome as the Theorem 1 and any 0 < δ < 1, there is a quantum algo-
new input root. Within an expected O(log n) repetitions, this √ which determines whether {v ∈ V (T )|f (v) = 1} = ∅ in
rithm
routine returns a marked vertex. Thus, Montanaro proves the O( T η log(1/δ)) queries to f and h, where η is the effective
following theorem. resistance of T (not necessarily known beforehand). The
Theorem 2. Let T , f , h, T , and n be defined as in Theorem 1. algorithm requires O(1) auxiliary operations per query and
Given the promise that there exists exactly one m ∈ V (T ) such poly(n) space and fails with probability at most δ.
022337-2
IMPROVED QUANTUM BACKTRACKING ALGORITHMS … PHYSICAL REVIEW A 97, 022337 (2018)
We use Theorem 4 to bound the number of steps taken to find unmarking a marked vertex once it is found, thereby giving
a marked vertex. Letting T (v) denote the subtree of T rooted access to its next shallowest marked descendants (if any) in the
at v and η(v) the effective resistance between v and the set next run.
of marked vertices in T (v), we define the maximum effective
resistance ηmax as the largest finite η(v) over all subtrees T (v). B. Notation
The polylogarithmic factors in the theorem below depend on
η [=η(r)], which may be smaller than ηmax . We use the following notation to describe the input tree T :
Theorem 5. Let T , f , h, T , n, and η be defined as in Theorem T denotes an upper bound on the number of vertices in T , n
4. Let η(v) denote the effective resistance of the subtree rooted denotes an upper bound on the depth of T , d denotes an upper
at v and define bound on the degree of any vertex in T , v denotes the depth
of a vertex v ∈ V (T ) and dv denotes its degree [accordingly,
ηmax = sup η(v). (1) v n and dv d for all v ∈ V (T )], and k is the total number
v ∈ V (T ) of marked vertices in T . For any vertex v ∈ V (T ), we write
η(v) < ∞
T (v) to denote the subtree of T rooted at v. For two vertices v
Then, for any 0 < δ < 1, there is a quantum algorithm which and u where u is a vertex in T (v), we write P(v,u) to denote the
returns a v ∈ V(T ) such that f (v) = 1 or none if no such v (shortest) path in T connecting v to u. Further, c ← v indicates
exists using O( T ηmax log4 (kη) log(1/δ)) queries to f and h. that vertex c is a child of vertex v. A summation indexed by
The algorithm requires O(1) auxiliary operations per query c ← v is hence a sum over all of the children of vertex v.
and poly(n) space and fails with probability at most δ. Additionally, we adopt a few conventions for ease of presen-
If desired, the algorithm of the above theorem can be tation. First, where we expect no confusion, we abusively write
repeated k times to return √ all k marked vertices, resulting in u ∈ T (v) instead of u ∈ V (T (v)) and (u,w) ∈ T (v) instead of
an overall runtime of O(k T n log4 (kn) log(k/δ)). Although (u,w) ∈ E(T (v)). That is, we use a single identifying variable
this is a loose bound, based on the fact (proven in Sec. VI) to represent a vertex and a pair to represent an edge, dropping
that the effective resistance is upper bounded by the depth the explicit specification of the appropriate set. We also follow
of the tree, it already achieves an improvement over Theorem the convention that an empty sum evaluates to zero. Finally,
3. To tighten the bound, one would need to take into account we denote the set of all shallowest marked vertices in the input
the change in effective resistance that results from unmarking tree T by M. This is the subset of marked vertices that do not
marked vertices that have been found. This is an interesting have any marked ancestors. To be precise,
question in its own right, but beyond the scope of this paper.
M ≡ {m ∈ V (T ) : f (m) = 1,
In Sec. V, we explore an example problem in which the bound
can be tightened, Grover’s search, and show that in at least f (v) = 0 ∀v ∈ P(r,m) \ {m}}.
some cases our algorithm achieves optimal scaling.
We then define M(v) ≡ M ∩ V (T (v)) for any v ∈ T as the
set of shallowest marked vertices in the subtree T (v) rooted
II. PRELIMINARIES at v.
A. Setting
We consider a tree T of bounded degree, with vertex set C. Phase and amplitude estimation
V (T ) and edge set E(T ). We assume access to the following: Our algorithm, like that in Ref. [1], applies quantum phase
(i) the root vertex r of T , (ii) upper bounds on the depth and size estimation on a particular unitary operator, with input state |r.
of T , (iii) an upper bound d on the degree of each vertex in T , We recall the statement of phase estimation from Ref. [1].
(iv) an oracle h which, for each v ∈ V (T ), returns a tuple that Theorem 6 (phase estimation [1]). For every integer s
encodes the children of v, and (v) an oracle which efficiently 1 and every unitary operator U on m qubits, there exists a
evaluates a function f : V (T ) −→ {0,1}. We call a vertex uniformly generated quantum circuit C such that C acts on
v ∈ V (T ) marked if f (v) = 1 and not marked if f (v) = 0. m + s qubits and the following hold.
For simplicity, we will assume that f (r) = 0, i.e., that the root (a) C uses the controlled-U operator O(2s ) times and
vertex is never marked. This could always be ensured by first contains O(s 2 ) other gates.
checking whether the root is marked and if so, returning and (b) If U |ψ = |ψ, then C|ψ|0s = |ψ|0s .
unmarking it. (c) If U |ψ = e2iθ |ψ with θ ∈ (0,π ), then C|ψ|0s =
The purpose of our algorithm is to find the marked vertices |ψ|ω, where
in T . Each run of the algorithm returns one of the shallowest
marked vertices, i.e., a marked vertex that has no marked |
ω|0s |2 = sin2 (2s θ )/22s sin2 θ.
ancestors. In a standard CSP, such as the Boolean satisfiability (d) For any |φ = j λj |ψj ∈ (C2 )⊗m , where U |ψj =
problem, where marked vertices can be associated with sat- e2iθj |ψj ,
isfying solutions, it is typically the case that if a particular
vertex is marked, then so are all of its descendants. In such C|φ|0s = λj |ψj |ωj ,
contexts, therefore, only the set of these shallowest marked j
vertices is of interest. In the abstract, however, one can easily
imagine a setting where, despite a vertex being marked, a with j : θj |
ωj |0s |2 = O(1/2s ).
subset of its descendants are not. Our method is able to Amplitude estimation, which is also used in our procedure,
find all of the marked vertices in either scenario, simply by is based on phase estimation [12]. We state it a bit differently
022337-3
MICHAEL JARRET AND KIANNA WAN PHYSICAL REVIEW A 97, 022337 (2018)
below since we will not need to analyze the resulting quantum for O(log(n)) different choices of η, these operators can be
state. Rather, we are mostly interested in determining whether implemented efficiently given that RA (n) can be implemented
the squares of probability amplitudes are within a constant of efficiently (as is explicitly demonstrated in Ref. [1]). An
1/2, which is quite similar to distinguishing the state |0s from application of the operator RB RA (η) amounts to a step in the
the rest of the state space of the ancilla qubits. quantum walk.
Theorem 7 (amplitude estimation). For every integer s
1 and every unitary operator U on m qubits, there exists a
III. ALGORITHMS
uniformly generated quantum circuit C such that C acts on
m + s qubits and the following hold. In Ref. [1], Montanaro proposes an algorithm for trees in
(a) C uses the controlled-U operator O(2s ) times and which a unique marked vertex is promised to exist. Given such a
contains O(s 2 ) other gates. tree and its root vertex as the input state, phase estimation on the
(b) If U |ψbad = |ψbad , then C|ψbad |0s = |ψbad |0s . operator RB RA (η), defined as in Sec. II D except with η set to n,
Similarly, if U |ψgood = −|ψgood , then C|ψgood |0s = is used to approximately produce a superposition state over the
|ψgood |π/2. vertices on the path from the root to the unique marked vertex.
(c) If |ψ = sin θ |ψgood + cos θ |ψbad for θ ∈ (0,π
), then a With probability 1/2, measuring this superposition in the
measurement of the second register of C|ψ|0s = i |ψi |θi computational basis collapses it to some state corresponding
returns a state | θ such that for = k/2s and some to a nonroot vertex. This procedure is then repeated with the
integer 1 < k 2s , (i) Prob(| θ − θ | ) = 1 − O(1/2s ) resulting state as the input until a marked vertex is reached.
and (ii) Prob(|θ − θ | > 2||θ − θ | ) = O(1/2s ) for Conditioned on measuring away from the root, any nonroot
some constant θ ∈ [0,π ) and where the differences are vertex along the path is sampled with equal probability. As
taken mod π . a result, the number of steps to reach a marked vertex is
logarithmic in the depth n (in contrast to the polynomial
overhead that would be incurred by classical descent).
D. Diffusion operators
Our algorithm is essentially a generalization of this scheme
Our algorithm finds marked vertices in T using a quantum to trees containing an arbitrary number of marked vertices
walk on the Hilbert space spanned by V (T ), with initial (not necessarily known beforehand) and uses the same basic
state |r. This quantum walk is effected by a set of diffusion framework. Algorithm 2 creates a superposition state | with
operators, adapted from Refs. [1,6,10]. support only on vertices that either are marked or have marked
Let η = 2i /d be an input parameter to the algorithm, where descendants. Unlike in the restricted case of a single marked
i ∈ [log dn]. For each vertex v ∈ T , the corresponding vertex, naively running Montanaro’s algorithm with η = n on
diffusion operator Dv is defined as follows: If v ∈ M, then a tree with multiple marked vertices may, depending on the
Dv is the identity operator; if v ∈ M, then distribution of the marked vertices in the tree, result in a state
for which the probability |
|r|2 of measuring |r is too large.
Dv (η) ≡ I − 2|ψv (η)
ψv (η)|, It turns out that with η set to the effective resistance of the tree,
| can be prepared with fixed precision and |
|r|2 can be
where for v ∈ T , kept close to 1/2.
√ However, since the structure of the input tree and the
√ 1 |v + η c←v |c if v = r distribution of the marked vertices are not known, the effective
|ψv (η) ≡
1+dv η
(2)
√1 |v +
dv c←v |c if v = r. resistance η cannot be determined in advance. Algorithm 1
describes the method by which we obtain an estimate η such
Each diffusion operator Dv acts only on the subspace that |η − η| O(
η) for a fixed
. For a given upper bound
spanned by the vertex v and its children and can therefore d on the degree of the tree, we begin by assuming η ≈ 1/d and
be implemented with only local knowledge. Specifically, it then increment η until it hits η or its maximum possible value
requires access to only the oracles f and h: f is evaluated at of n. Provided that the algorithm does not exit early, which we
v to check whether v is marked and h gives the children of v. will show is exceptionally unlikely, the interpolation crosses
Our diffusion operators are identical to those in Ref. [1] an η “close enough” to η with certainty if such an η exists.
with the exception of Dr , which is defined with respect to the Since the last iteration of the loop effectively implements
parameter η instead of the maximum depth n. This parameter Montanaro’s existence algorithm from [1], if
is taken to
will be tuned in Algorithm 1 and, as will be shown in Sec. VI, be sufficiently small, the last iteration will produce ∞ if there
its “optimal” value is equal to the effective resistance of T . are no marked vertices. If we are interested in a more precise
Now let A be the set of vertices that are at even distances estimate of η, after Algorithm 1 returns some estimate η such
from the root (including the root itself) and let B be the set of that η/η ≈ 1, we can perform amplitude estimation to higher
vertices at odd distances from the root. We define the unitary precision but with initial guess η. Alternatively, we can replace
operators 2i in Algorithm 1 with S i , where S ∈ (1,2). Because it is
sufficient for our application to backtracking algorithms, we
RA (η) ≡ Dv (η), RB ≡ |r
r| + Dv (·) assume that a multiplicative step size of 2 produces the desired
v∈A v∈B level of precision.
Algorithm 1 is implemented in a loop in Algorithm 2, which
RA (η) is√
as direct sums of diffusion operators. Because just a uses effective resistance estimates to find a marked vertex as
rotation of RA (n) in the subspace span({|r, c←r |c/ dr }) follows. Starting at the root vertex r, we obtain an estimate
022337-4
IMPROVED QUANTUM BACKTRACKING ALGORITHMS … PHYSICAL REVIEW A 97, 022337 (2018)
Require: A vertex v ∈ T ; upper bounds n, T , and d on the depth, number of vertices, and degree of T , respectively; unitaries RA (·) and RB ; a
failure probability δ0 ; universal constants γ1 and γ2 .
1: i ← 0.
2: η ← min{2i /d,n}.
3: Let C(η)|v|0s = sin(βη )|v|0s + cos(βη )|ψbad be the output of phase estimation with unitary RB RA (η), input state |v, and s
ancilla qubits in the phase register.
4: Perform amplitude estimation on the second register γ1 log(1/δ0 ) times with |ψgood = |0s and precision γ2 . Let the output be the
= {β
multiset j }j .
5: j ∈
If more than half of the elements β satisfy |β
j − π/4| π/16, return η = η cot2 β where β is the most frequent element in .
6: If η = n, return ∞.
7: Increment i, go to step 2.
η using Estimate-Res(r). Given that η ∼ η, the output | of A. On the path to marked vertices
phase estimation on unitary RB RA (η) with input state |r is For each marked vertex m ∈ M, the state
expected to satisfy |
r|2 − 1/2|
with high probability.
√
By measuring | in the computational basis and setting the |φm = η|r + (−1)v |v
output as the new root, we progress down the tree towards v ∈ P(r,m)
a marked vertex. Appendix B demonstrates that the expected v = r
number of steps in this walk is O(log(kη)).
is an eigenvector of RB RA (η) with eigenvalue 1. This can be
seen from the fact that for a given η, |φm as defined above is
IV. ANALYSIS orthogonal to |ψv (η) for all v ∈ T [cf. Eq. (2)]. In addition,
|φm encodes the entire path P(r,m) from the root r to the
In this section, we analyze Algorithms 1 and 2. Section IV A marked vertex m.
defines a particular eigenstate | of the unitary RB RA (η) We introduce the state
that will be used to find marked vertices and Sec. IV B
describes how phase estimation can be applied to prepare | ≡ Cm |φm
such an eigenstate. In Sec. IV C, we evaluate the accuracy and m∈M
efficiency of the section in returning a useful value for the √
= η Cm |r + Cm (−1)v |v (3)
parameter η. We bound the expected runtime of Algorithm 2
m∈M m∈M v ∈ P(r,m)
in Sec. IV D. v = r
As will be made more evident in Sec. IV C, in the case of no
marked vertices, our algorithm reduces to an algorithm similar as a normalized superposition of these path eigenvectors with
to that of Theorem 1. Therefore, we assume in the following real coefficients (Cm )m∈M . Clearly, | has support only on
discussion that there exists at least one marked vertex in the the shallowest marked vertices in T and their ancestors.
search tree T . Accordingly, we define the solution tree T to be the largest
Algorithm 2. Find a marked vertex.
Require: The root vertex r of T ; upper bound on the number of vertices in T ; unitaries RA (·) and RB ; other inputs required for
Estimate-Res(r).
1: v ← r.
2: If f (v) = 1, return v.
3:
η ← Estimate-Res(v).
4: while
η = ∞ do
5: η)|v|0s =
Let√| = C( i αi |ψi |ωi be the output of phase estimation with unitary RB RA (
η), input state |r, and precision
O( 1/T η).
6: Measure the second register of | in the computational basis. Let the output be |ω.
7: If ω = 0s , continue.
8: Measure the first register of |. Let the output be |o.
9: v ← o.
10: If f (v) = 1, return v.
11:
η ← Estimate-Res(v).
12: return “no marked vertex.”
022337-5
MICHAEL JARRET AND KIANNA WAN PHYSICAL REVIEW A 97, 022337 (2018)
subtree of T in which all leaves are the shallowest marked Lemma 4 of Sec. VI demonstrates that κ satisfies Eqs. (7)–
vertices on their respective paths, i.e., (9) if and only if for every m0 ∈ M,
T ≡ P(r,m).
κm κm = 1. (10)
m∈M
m∈M v ∈ P(r,m0 ) m ∈M(v)
v = r
We use T(v) to indicate the subtree of T rooted at a vertex
v ∈ T. Letting This constitutes a system of |M| equations that determines
√ (κm )m∈M and therefore κ uniquely [cf. Eq. (7)]. An important
sin β ≡
r| = η Cm (4) implication of Eq. (10) is that κ is independent of the input
m∈M parameter η and depends only on the structure of T. In
particular, we will show in Theorem 10 of Sec. VI that κr2
and defining κ : V (T ) −→ R by
is an invariant of finite trees and that its value is bounded in
1 terms of the number of marked vertices, the degree of the root
κv ≡ κ(v) = Cm , (5) vertex, and the (maximum) depth of the tree as
cos β m∈M(v)
1 1 1
we rewrite Eq. (3) as ∈ max , ,n . (11)
κr2 k dr
| = sin β|r + cos β (−1)v κv |v. (6) As will be further discussed in Sec. IV C, we exploit this result
v∈T in designing Algorithm 1, which tunes the input parameter η
v = r so as to optimize the superposition state | for our intended
purpose. That is, if we are able to produce a state | such that
By construction, κ satisfies
r| is not too large, a state closer to the marked state can be
revealed by measuring | in the computational basis. Indeed,
κv if v ∈ M
κv = (7) it follows from Eqs. (4) and (5) that
c←v κv if v ∈ M, √
tan β = ηκr . (12)
with κv = 0 for v ∈ T (using the convention that an empty sum This implies that if there exists at least one marked vertex, then
is equal to zero), as well as normalization: there is a particular value of η, determined by the structure
of the search tree, for which the the probability |
r||2 of
κv2 = 1. (8) sampling |r is approximately 1/2. Section IV C shows that
v∈T when η is equal to the effective resistance η of the tree, the
v = r
probability of sampling the root vertex is 1/2.2 In the following
We further constrain κ as follows: For every vertex v ∈ T section, we demonstrate that the particular superposition of
and any marked vertices m0 ,m1 ∈ M(v), eigenvectors | defined here can be approximately produced
via phase estimation.
κu = κu . (9)
u∈P(v,m0 ) u∈P(v,m1 ) B. Complexity of preparing |
This section primarily follows Ref. [1], with relevant ad-
In other words, given any vertex v in the solution tree T, the
justments as they become necessary in the generalization to
weight in | on the path from v to a marked vertex in T(v)
trees with possibly more than one marked vertex.
is independent of the choice of marked vertex. One can easily
For a fixed value of η and given | as defined in the pre-
see that as a consequence of this condition, κm = 0 for at least
ceding section, let |⊥ denote the particular normalized state
some m ∈ M. If this were not the case, Eq. (7) would imply
orthogonal to | such that |r =
r|| +
r|⊥ |⊥ ,
κv = 0 for all v ∈ T , violating Eq. (8).
that is,
As will become clear, a set of coefficients satisfying
Eqs. (7)–(9) is guaranteed to exist and are unique (up to a global |⊥ ≡ cos β|r − sin β (−1)v κv |v. (13)
phase).1 [For consistency with Eq. (5), we choose them to all v∈T
be real.] In particular, the constraint imposed by Eq. (9), which v = r
will justified in the following analyses, allows us to determine
some interesting properties of the solution tree T. We state By direct calculation,
some of the results relevant to this section below, postponing
⊥ |φm = 0 (14)
their proofs until Sec. VI.
for all m ∈ M.
1 2
The reader familiar with the theory of electrical networks and flows In Sec. IV C, the relative amplitude in the root and nonroot states
may already see how Eq. (9) can naturally follow from considering a is characterized by cot2 β. We call η achieving cot2 β = 1 optimal in
voltage between the root and the set of marked leaves. We nonetheless that it assigns equal probability to sampling either a root or nonroot
avoid this theory, as it obfuscates some of the ideas used in our walk. state.
022337-6
IMPROVED QUANTUM BACKTRACKING ALGORITHMS … PHYSICAL REVIEW A 97, 022337 (2018)
|2 −
This bounds the total variation distance as supi ||
i| Thus, the relative error in our estimate of η can be reduced
2 − | = O(δ).
|
i|| | = O(δ) and guarantees that | arbitrarily, up to the error of phase estimation itself, by taking
amplitude estimation to greater precision.
C. Algorithm 1
1. Accuracy of approximation 2. Failure rate
We begin our analysis by showing that the support on |0s It remains to analyze the failure rate of Algorithm 1.
of the output state | of phase estimation [cf. Eq. (15)] is Consider step 5 of Algorithm 1. Let Xi ∈ {0,1} be a coin that
a reasonable estimate of the amplitude
r| = sin β. Letting returns 0 whenever |βi − π/4| π/16 and 1 otherwise. By
|2 denote the state of the second register of |, |
0s |2 | Sec. II C, Prob(Xi = 0 | |βη − π/4| π/8) cγ2 for some
is simply the inverse of normalization constant in Eq. (16). constant c. We apply the Chernoff-Hoeffding theorem [13]
Hence, recalling Eq. (19), we fix a precision δ and write with probability p = cγ2 and γ1 log(1/δ0 ) repetitions of the
022337-7
MICHAEL JARRET AND KIANNA WAN PHYSICAL REVIEW A 97, 022337 (2018)
022337-8
IMPROVED QUANTUM BACKTRACKING ALGORITHMS … PHYSICAL REVIEW A 97, 022337 (2018)
by using the estimates of η to deduce information about the The remainder of this section will develop the proof of this
structure of the tree. theorem. In Lemma 2, we demonstrate that for κ satisfying
the conditions of Theorem 8, κv0 and κv1 have the same sign
V. OPTIMALITY OF THE ALGORITHM: GROVER’S for all vertices v0 ,v1 ∈ T. Lemmas 3 and 4 are technical
SEARCH REVISITED lemmas which are used to prove Theorem 9, our first statement
about effective resistance. Theorem 10 completes the proof
In the case of unstructured search, the bound achieved in of Theorem 8 by bounding the effective resistance. For the
Sec. IV D converges to Grover’s search and is therefore optimal remainder of this section, we assume that κ satisfies the
in at least some regimes. To see this, we can consider a database hypotheses of Theorem 8, i.e., Eqs. (7)–(9).
where all N database states are connected to a root vertex. If Lemma 2. For all v0 ,v1 ∈ T, κv0 κv1 > 0.
k of the N states are marked, the effective resistance of this Proof. First, we claim that for every vertex v ∈ T and any
tree is simply η = 1/k √ and the expected steps to find a marked leaf m ∈ M(v),
element scales like O(√ T /k log4 k). Noting that T = N + 1,
the naive bound is O( N/k log4 k).
κm κu > 0.
The factor of log4 k can be removed by considering the
u∈P(v,m)
iterative approach outlined in Sec. IV D. That is, we begin by
setting k = 1 and double the value of k until a marked vertex This is trivially true if v is a leaf. Now assume this holds true
is returned. Since we take only one step (from the root vertex for every child c of a vertex v ∈ M. Then, for any two children
to one of the database states, which are all leaves in the tree) c0 and c1 of v and leaves m0 ∈ T(c0 ) and m1 ∈ T(c1 ),
and the logarithmic factors are merely there to ensure that our
state is sufficiently precise to complete the necessary number ⎛ ⎞⎛ ⎞
of steps, we only need the sampling procedure to succeed 0 < ⎝κm0 κu ⎠⎝κm1 κu ⎠
once per
√ marked vertex. Thus, this approach actually scales u∈P(c0 ,m0 ) u∈P(c1 ,m1 )
as O( N/k), with no logarithmic factors. ⎛ ⎞⎛ ⎞
VI. EFFECTIVE RESISTANCE OF TREES = κm0 κm1 ⎝ κu − κv ⎠ ⎝ κu − κv ⎠
AND THE PARAMETER η u∈P(v,m0 ) u∈P(v,m1 )
⎛ ⎞2
In this section, we prove a number of helpful lemmas
concerning the particular function defined by Eqs. (7)–(9) on = κm0 κm1 ⎝ κu − κv ⎠ ,
the solution tree T rooted at r, which we subsequently use to u∈P(v,m0 )
establish a connection to effective resistance in the following
theorem. These results also arise naturally by identifying the where in the last line we have used Eq. (9). Thus, κm0 κm1 > 0
harmonic function in the Rayleigh quotient of the operator for all m0 ,m1 ∈ M(v), from which it directly follows that
RB RA (η) with the minimum energy function of a relevant flow
network on T, where the set of leaves M are all identified κm0 κu = κm0 κm > 0,
with a single point. Nevertheless, we construct this section in u∈P(v,m0 ) u∈P(v,m0 ) m∈M(u)
a self-contained fashion.
Consistent with the definition of T in Sec. IV A, we denote since for u ∈ P(v,m0 ) ⊆ T(v), m ∈ M(u) implies that m ∈
the set of leaves in T by M and the set of leaves in the M(v).
subtree T(v) rooted at v ∈ T by M(v). (In the context of Therefore, the claim is true for all v ∈ T, including for r,
the previous sections, the leaves of T comprise the shallowest and so κm0 κm1 > 0 for all m0 ,m1 ∈ M. Then,
marked vertices. The results derived in this section, however,
are applicable to arbitrary trees T with root r and leaf set M.) ⎛ ⎞⎛ ⎞
Theorem 8. Let κ : V (T
) −→ R be such that the following
κv0 κv1 = ⎝ κm0 ⎠⎝ κm1 ⎠
hold: v ∈ T κv2 = 1, κv = c←v κc for all v ∈ M, and for any
m0 ∈M(v0 ) m1 ∈M(v1 )
v = r
v ∈ T, u∈P(v,m0 ) κu = u∈P(v,m1 ) κu for all leaves m0 ,m1 ∈ = κm0 κm1 > 0,
M(v), where κv ≡ κ(v). Then η : {T(v)}v∈T −→ R0 defined m0 ∈M(v0 ) m1 ∈M(v1 )
by
2 as desired.
w∈T (v) κw
η(v) ≡ η(T (v)) = −1 Without loss of generality, we henceforth assume that
κv2 κv > 0 for all v ∈ T.
Lemma 3. For every v ∈ T and any m ∈ M(v),
is an invariant of the set of subtrees {T(v)}v∈T and
η(v) equals
the effective resistance between v and M(v) [through T(v)]
for each v ∈ T. Furthermore, if T(v) is of maximum degree d κv κu = κu2 .
and maximum depth n and has at most k leaves, then u∈P(v,m) u∈T(v)
1 1 Proof. This is trivially true if v ∈ M, and assuming
η(v) ∈ max , ,n .
k d that this holds for every child c of v ∈ M, we have for
022337-9
MICHAEL JARRET AND KIANNA WAN PHYSICAL REVIEW A 97, 022337 (2018)
any m ∈ M(v) −1
κc2
⎛ ⎞ =
c←v u∈T (c) κu2
⎜ ⎟ −1
⎜ ⎟
κv κu = κv ⎜ κv + κu ⎟ 1
⎝ ⎠ = ,
u∈P(v,m) u ∈ P(v,m) η(c) + 1
u = v c←v
= κv2 + κc κu where the second and fifth lines follow from Lemma 3 and
c←v u∈P(c,m)
the third and fourth lines use the direct consequence
of Eq. (9)
that for children c of v and leaves m ∈ M(c), u∈P(c,m) κu is
= κv2 + κu2 = κu2 , independent of c.
c←v u∈T(c) u∈T(v) Therefore, for every v ∈ T, η(v) is unique and well defined.
Furthermore, since we have
where the second line follows from Eq. (7), the third from
1 1
Eq. (9), and the fourth from the induction hypothesis. = ,
Lemma 4. For any m ∈ M, η(v) c←v η(c) + 1
κr κu = 1. η(v) satisfies the recurrence relation for the effective resistance
u ∈ P(r,m) of a circuit with source v and sinks M(v), where each edge
u = r has resistance 1.
Corollary 1. For any child c of v,
Proof. This follows directly from Lemma 3 and
Eq. (8). η(c) + 1 κv
Belovs’ original result relates the commute time of a classi- = .
η(v) κc
cal random walk with the problem of determining connectivity
via a quantum walk. In particular, the commute time can Proof. This follows from the definition of η(v) in Sec. VI
be characterized in terms of the effective resistance of the [cf. Eq. (20)] and the proof is omitted.
corresponding graph, provided that the graph’s structure is Since {η(v)}v∈T is uniquely determined, Corollary 1 guaran-
known a priori [6]. In light of this, the following theorem, tees that, up to a global factor, κ is unique and well defined. The
which is essentially a statement about the effective resistance global factor is fixed by the normalization condition [Eq. (8)].
of trees, should not be too surprising. The fact that η = η(r) is the effective resistance of the tree
Theorem 9. For every vertex v ∈ T, T makes the following theorem fairly intuitive.
Theorem 10. Let n denote the depth of the tree T, k ≡ |M|
2
u∈T(v) κu the number of leaves, and dr the degree of the root vertex r.
η(v) ≡ −1 (20) Then
κv2
1 1
is a unique map for all {T(v)}v∈T . η ∈ max , ,n .
Proof. We begin by noting that for a leaf m ∈ M, k dr
2 First, we note that
u∈T(m) κu
η(m) = −1=0 1 2 1 2 1
κm2 η= κu − 1 = 2 κu = 2 ,
2
κr κr κr
u∈T u∈T
is clearly unique for the trivial graph T (m). Now assume u = r
that for every child c of v ∈ M, η(c) = u∈T(c) κu2 /κc2 − 1
is uniquely defined for T(c). Then by definition. We use the Cauchy-Schwarz inequality to obtain
the upper and lower bounds. By Lemma 4, for any m ∈ M,
2
u∈T(v) κu ⎛ ⎞2
η(v) = −1
κv2
⎜ ⎟
1 ⎜ ⎟
κ2 u∈T(c) κu
2
=⎜ κu ⎟
= v2 +
c←v
2 −1 2
κr ⎝ ⎠
κv u ∈ P(r,m)
c←v κ c u = r
⎛ ⎞⎛ ⎞
c←v κ c u∈P(c,m) κu
= 2 ⎜ ⎟⎜ ⎟
c←v κc ⎜ ⎟⎜ ⎟
⎜ 1⎟⎜ κu2 ⎟
⎝ ⎠⎝ ⎠
u∈P(c ,m ) κu u ∈ P(r,m) u ∈ P(r,m)
= 0 0 u = r u = r
c←v κc
−1
n κu2 = n.
κc2
= u ∈ T
c←v c
κ u∈P(c,m) κu u = r
022337-10
IMPROVED QUANTUM BACKTRACKING ALGORITHMS … PHYSICAL REVIEW A 97, 022337 (2018)
022337-11
MICHAEL JARRET AND KIANNA WAN PHYSICAL REVIEW A 97, 022337 (2018)
respectively impose
r|ξ =
r|⊥ and
m|ξ =
m|⊥ for where in the third line, we apply item (a) of Proposition 1 in
m ∈ B ∩ M. Moreover, for each vertex v ∈ B, the set of the first sum and item (b) in the second. In particular, if v0 is
√ √
vectors the ancestor of v of depth 1, we have αv0 = ηαr = η cos β
⎧ ⎫ by items (a) and (c) and the above relation can be rearranged
⎨ ⎬
ψ ⊥ ≡ −|v + dv |ci − to obtain
|cj ⎧1
⎩ v,ci
⎭
c ←v j
ci ←v ⎨ κr − u ∈ P(r,v) κu
⎪ if v ∈ A
u = r
αv = sin β 1 (A4)
forms a basis for the space span({|ψv⊥ :
ψv⊥ |ψv = 0}). Di- ⎩ κr − u ∈ P(r,v) κu + κv if v ∈ B
⎪
u = r
rect calculation yields, for each child ci ,
# for all v ∈ T \ {r}.
⊥
ψv,ci
ξ = −αv + dv αci − αcj Taking v to be a marked vertex m ∈ M, this gives us
cj ←v ⎧1
and [cf. Eq. (13)] ⎨ κr − u ∈ P(r,m) κu
⎪ if v ∈ A
# αm = sin β 1 u = r
⊥ ⊥
ψv,ci
= −dv κci sin β. ⎩ κr − u ∈ P(r,m) κu + κm if v ∈ B
⎪
u = r
For each v ∈ B, we thus obtain a system of dv − 1 linear
equations of the form 0 if v ∈ A
=
κm sin β if v ∈ B,
−αv + dv αci − αcj = −dv κci sin β,
cj ← v as required by Eq. (A2). This uses Lemma 4, which we note is
a consequence of the constraints on κ imposed by Eq. (9).
which has the unique solution [cf. Eq. (7)] Thus, |ξ = v∈T αv |v satisfies Eq. (A2) and is uniquely
αci = αv − (κv + κci ) sin β. determined.
It follows from Lemmas 2 and 4 that for all v ∈ T \ {r},
This is item (b).
One might observe that items (a)–(d) of Proposition 1 may
1
overconstrain the set of coefficients {αv }v∈T . Consider, for
κu − κv κu ,
instance, the path P(r,m) from the root r to some marked κr
u ∈ P(r,m) u ∈ P(r,m)
vertex m ∈ M. Items (c) and (d) fix boundary conditions at u = r u = r
r and at the marked vertex m, respectively, while items (a) √
and (b) constitute a recurrence relation that determines αv for so |αv | | sin β/κr | = η| cos β| by Eq. (A4) and Lemma 2.
each vertex v along P(r,m) as a function of αp(v) for its parent Therefore,
p(v) and the values assigned by κ. If we start with αr , given
|ξ 2 = αr2 + αv2 cos2 β + η cos2 β
by item (c), and recurse down the path using (a) and (b) to
v∈T v∈T
obtain αm , the result may be inconsistent with the constraint v = r v = r
on αm imposed by (d). However, for κ given by Eqs. (7)–(9),
there indeed exists a set of coefficients {αv }v∈T that satisfies = [1 + (T − 1)η] cos2 β 2(T − 1)η cos2 β,
the recurrence relation as well as both boundary conditions. We
where the last inequality follows from the fact that η
determine these coefficients explicitly in the following lemma.
1/kmax 1/(T − 1) for any nontrivial tree whose root vertex
Lemma 6. For any nontrivial input tree T and any parameter
is not marked.
η, if κ
satisfies Eqs. (7)–(9), then there exists a unique vector
Finally, the lemmas above imply the result of Lemma 1,
|ξ = v∈T αv |v for which Eq. (A2) holds. Moreover,
which is used in Sec. IV B to bound the complexity of the
|ξ = O( T η). (A3) phase estimation procedure used to prepare the state |.
Proof of Lemma 1. Let |ξ be the vector satisfying Eq. (A2).
Proof. First, consider any two vertices v0 ∈ B and v ∈ Then
T (v0 ). Summing over all edges (u,w) ∈ P(v0 ,v),
P |⊥ = P B |ξ |ξ = O( T η),
αv0 − αv = (αu − αw )
where the inequality follows from Sec. VII and the last equality
(u,w)∈P(v0 ,v)
is Eq. (A3).
= (αu − αw ) + (αu − αw )
(u,w) ∈ P(v0 ,v) (u,w) ∈ P(u,w) APPENDIX B: EXPECTED NUMBER OF STEPS
u∈A u∈B
TO REACH A MARKED VERTEX
= 0+ (κu + κw ) sin β We reproduce a theorem originally derived in Ref. [14],
(u,w) ∈ P(v0 ,v) (u,w) ∈ P(v0 ,v) altered slightly so as to make use of our existing theorems and
u∈A u∈B
notation.
κu if v ∈ A Theorem 11. Let (Xi ∈ T)ni=0 be a discrete-time Markov
chain on the state space V (T), the vertex set of the tree T rooted
u∈P(v0 ,v)
= sin β
u∈P(v0 ,v) κu − κv if v ∈ B,
at r with effective resistance η, and leaves M. Let X0 = r and
022337-12
IMPROVED QUANTUM BACKTRACKING ALGORITHMS … PHYSICAL REVIEW A 97, 022337 (2018)
Prob(Xi+1 = u|Xi = v) =
κu2
. κc κm
κc
η(c) + 1
κv2 η(v) = +log2 κc
κ
c←v v m∈M(c) c
κ κc [η(c) + 1] κm
Let E(v) denote the expected time to reach a leaf starting from κm
η(c) + 2
v ∈ M. Then log2 κc
κ κm
E(v) = 1 + Prob(Xi+1 = u|Xi = v)E(u) c←v m∈M(c) v
u ∈ T(v) κm
κv η(v) + κc
u = v = log2
c←v m∈M(c) v
κ κm
κu2
=1+ E(u) κm
η(v) + 1
c←v u∈T(c)
κv2 η(v) log2 κv ,
⎡ ⎤ m∈M(v) v
κ κm
1 ⎢ ⎢ 2 ⎥
⎥
where the fourth line follows from Corollary 1 and the final
=1+ ⎢ κ E(c) + κ 2
E(u) ⎥ line from Lemma 2 and Eq. (7). Restricting ourselves to the
c←v
κv2 η(v) ⎣ c
u
⎦ case of v = r and applying Jensen’s inequality, we find that
u ∈ T (c)
u = c
E(r) log2 (|M|) + log2 (η + 1),
κc2
=1+ {E(c) + η(c)[E(c) − 1]} as desired.
c←v
κv2 η(v)
[1] A. Montanaro, Quantum walk speedup of backtracking algo- [9] S. Jeffery and S. Kimmel, Quantum algorithms for graph
rithms, arXiv:1509.02374. connectivity and formula evaluation, arXiv:1704.00765.
[2] H. Krovi F. Magniez, M. Ozols, and J. Roland, Quantum walks [10] A. Ambainis and M. Kokainis, Quantum algorithm for tree
can find a marked element on any graph, Algorithmica 74, 851 size estimation, with applications to backtracking and 2-player
(2016). games, arXiv:1704.06774.
[3] F. Magniez, A. Nayak, J. Roland, and M. Santha, Search via [11] A. Belovs, A. M. Childs, S. Jeffery, R. Kothari, and F. Mag-
quantum walk, SIAM J. Comput. 40, 142 (2011). niez, Proceedings of the International Colloquium on Au-
[4] N. Shenvi, J. Kempe, and K. B. Whaley, Quantum random-walk tomata, Languages, and Programming (Springer, Berlin, 2013),
search algorithm, Phys. Rev. A 67, 052307 (2003). pp. 105–122.
[5] M. Szegedy, Proceedings of the 45th Annual IEEE Symposium [12] G. Brassard, P. Hoyer, M. Mosca, and A. Tapp, Quantum
on Foundations of Computer Science (IEEE, Piscataway, 2004), amplitude amplification and estimation, Contemp. Math. 305,
pp. 32–41. 53 (2002).
[6] A. Belovs, Quantum walks and electric networks, [13] W. Hoeffding, Probability inequalities for sums of bounded
arXiv:1302.3143. random variables, J. Am. Stat. Assoc. 58, 13 (1963).
[7] G. Wang, Efficient quantum algorithms for analyzing large [14] M. Jarret, Bound on queries to a tree with unusual probabilities—
sparse electrical networks, Quantum Inf. Comput. 17, 987 follow-up, MathOverflow, https://mathoverflow.net/q/280505.
(2017). [15] T. Lee, R. Mittal, B. W. Reichardt, R. Špalek, and M. Szegedy,
[8] T. Ito and S. Jeffery, in Proceedings of the 43rd International Col- Proceedings of the 2011 IEEE 52nd Symposium on Founda-
loquium on Automata, Languages, and Programming (ICALP, tions of Computer Science (FOCS) (IEEE, Piscataway, 2011),
2016), pp. 12:1-12:14, arXiv:1507.00432. pp. 344–353.
022337-13