Controlled quantum search on structured databases

We present quantum algorithms to search for marked vertices in structured databases with low connectivity. Adopting a multi-stage search process, we achieve a success probability close to $100\%$ on Cayley trees with large branching factors. We find that the number of stages required is given by the height of the Cayley tree. At each stage, the jumping rate should be chosen as different values. The dominant term of the runtime in the search process is proportional to $N^{(2r-1)/2r}$ for the Cayley tree of height $r$ with $N$ vertices. We further find that one can control the number of stages by adjusting the weight of the edges in the graphs. The multi-stage search process can be merged into a single stage, and then an optimal runtime proportional to $\sqrt{N}$ is achieved, yielding a substantial speedup. The search process is quite robust under various kinds of small perturbations.

Introduction.-As one of the important applications of quantum computation, Grover's algorithm is designed for unstructured databases [1]. In unstructured databases, one can easily move from one vertex to any other vertices for finding the marked (or target) items. However, physical databases usually have structures that might prevent one from moving arbitrarily. Thus, the related spatial search algorithms, aimed to find the marked item, are not so easy to be realized.
Trees, one kind of the most important data structures in computer science, are very convenient for data manipulation due to their low connectivity. As a typical and important case, there have been a number of discussions about quantum algorithm related to trees [5,31,34,[40][41][42][43][44][45][46][47]. However, for trees the marked items are difficult to be found since they can be deeply hidden as the leaf vertices, and none of the reported schemes can achieve an optimal runtime. Moreover, the reported success probability of search on marked vertices is rather low, and prac-tically, decreases when the height of the tree increases. Is it possible to achieve a spatial search scheme with optimal search time and high success probability for trees, such as the Cayley trees, a typical balanced tree?
In this letter, we try to provide a solution. We present a multi-stage quantum search scheme on the Cayley trees, and find a success probability close to 100% which does not decrease when the height or branching factor of the tree increases. Surprisingly, we also find that proper variations of the edge weights can cause a merging of the stages in the search process, thus resulting in a substantial speedup for the search. With a suitable choice of the edge weights, we can achieve an optimal search time O( √ N ) for the Cayley trees while keeping the success probability close to 100%. Our study indicates that for physically structured databases with low connectivity, quantum search algorithm based on CTQW can still provide a quadratic speedup. Such a behavior of the quantum search independently on the database structure may illustrate certain intrinsic properties of quantum mechanics.
Multi-stage quantum search on Cayley trees-We consider a particle that performs a quantum walk on a graph with N vertices, with each vertex corresponding to a basis state in an N -dimensional Hilbert space. The quantum walk is governed by the Hamiltonian where γ is the jumping rate, L = A − D is the graph Laplacian, A is the adjacency matrix of graph (i.e., A ij is the weight of edge between vertices i and j), D is the diagonal matrix with D jj = deg(j) (i.e., the total weight of edges connected to vertex j), and |a is the state corresponding to the marked vertex a. For convenience, our Hamiltonian H and the time are chosen to be dimensionless. Since we have no prior information of the location of the marked vertex, the initial state of the particle is chosen as In order to study the evolution of the state, an invariant subspace of the Hamiltonian should be found by grouping the identically evolving vertices together. We focus on a Cayley tree with height r and branching factor M , which contains one vertex in the first (top) layer, M vertices in the second layer, · · · , and M r vertices in the (r + 1)-th (bottom) layer, thus the total number of (M r+1 − 1)/(M − 1) vertices (see Fig.1). In our work, we assume that the marked vertex is a leaf vertex.
We first discuss the case for a Cayley tree with height r = 2 and an arbitrary branching factor M . Figure 1 shows the case of M = 4. To study the evolution of the system, we first group the vertices with identical evolution by the same color, and then work out the invariant subspace. The invariant subspace is spanned by the following 6 basis states: |a = |a (the marked vertex state), |b = i∈e |i , and |f . A state initially in this subspace evolves only in the subspace, as the offdiagonal terms of the Hamiltonian between the invariant subspace and its orthogonal complement vanish. Therefore, the effective Hamiltonian in this subspace is The evolution of the particle's state is determined by a Schrödinger's equation with the solution |ψ(t) = e −iHt |s = e −iHt 5 i=0 |ψ i ψ i |s , where |ψ i is the i-th eigenstate of H. Figure 2 gives the squared overlaps of basis states with the eigenstates of H. From Fig.2, we know that when γ = 2, the first two eigenstates of H can be written as |ψ 0,1 ≈ (|b ± |s )/ √ 2, and therefore | b|ψ(t) | 2 = (1 − cos∆E 10 t)/2, where ∆E 10 = E 1 − E 0 . Hence, the probability amplitude will flow from |s to |b within a time π/∆E 10 . Similarly, when γ = 1, the state of the system oscillates between |b and |a . In order to make the probability amplitude be accumulated in the marked vertex a, a two-stage process is required and works as follows. In the first stage, the system is prepared in the initial state |s , and evolves according to the Hamiltonian with γ = 2 during a time π/∆E 10 . Then, in the second stage, the system evolves according to the Hamiltonian adjusted by changing the jumping rate γ = 2 to γ = 1 for a time π/∆E 20 . Finally, a simple projective measurement onto the basis states will reveal the state |a for the marked vertex a with a very high probability. Here, the special values of γ = 2, 1 are termed as critical jumping rates γ c approximately. It is worthy to note that when the value of γ deviates considerably from that of γ c , the basis states involved in Figure 2 become the eigenstates of H. Thus, the probability cannot be accumulated in the marked vertex a and the search scheme fails.
For the first stage with γ = 2, we find numerically that E 1 − E 0 = 4M −3/2 . Then, the time consumed in this stage is t = πM 3/2 /4, and the probability amplitude flows from |s to |b . For the second stage with γ = 1, we find E 2 − E 0 = 2M −1/2 . Then, the time consumed in this stage is t = πM 1/2 /2, and the probability amplitude flows from |b to |a . When M is large enough, e.g., M = 100, the success probability | a|ψ(t) | 2 for finding the marked vertex in the final projective measurement is larger than 99%. The effect of M on the success probability is shown in Appendix. A. The dominant term of the time consumed in the search process is t ∝ M 3/2 ∝ N 3/4 .
The general cases for the various Cayley trees-Now, we can explicitly write down the Hamiltonian in the invariant subspace for Cayley trees with any height r, and work out the related results for the cases with the height up to r = 6. That is, for a Cayley tree with height r, we find that the search process has r stages with different jumping rates γ = r, r − 1, · · · , 2, 1, and the time consumed in each stage is t ∝ M 1/2 , M 3/2 , · · · , M (2r−3)/2 , M (2r−1)/2 (i.e., t ∝ N 1/2r , N 3/2r , · · · , N (2r−3)/2r , N (2r−1)/2r ), respectively. The dominant term of the time consumed in the search process is t ∝ M (2r−1)/2 ∝ N (2r−1)/2r , which increases as the height increases.
An interesting observation is that the ground state of the Hamiltonian |ψ 0 changes dramatically when the value of the jumping rate γ in the Hamiltonian changes around the related critical jumping rates. The number of these dramatic changes corresponds to the number of searching stages. Furthermore, the probability amplitude flows from the out-most structure to the inner-most structure step by step, indicating that the hierarchical structure of the graphs may be the reason of a multi-stage quantum search. See Appendix. B for more demonstrations. We expect that these properties hold for other hierarchical graphs as well.
In a previous work for the Cayley tree with small branching factor, based on a single-stage search process, the success probability was found to be much less than 100%, and decreases as the height increases [34]. Such a result can be clearly understood from our Fig.2 since |a is dominated by states |ψ 0 and |ψ 2 , while |s is dominated by |ψ 0 and |ψ 1 . If the probability amplitude is kept to flow directly from |s to |a , one should make use of a small component of |ψ 1 in |a , which will lead to a small success probability. Obviously, this component becomes smaller when the number of vertices of the graph becomes larger (see Appendix. C). Nevertheless, our scheme with a multi-stage search process can yield a success probability close to 100% even for a large branching factor M . Moreover, the success probability in our scheme definitely does not decrease when the height r (or the branching factor M ) of the Cayley tree increases.
Merging of stages in quantum search-Our multi-stage quantum search on Cayley trees achieves a high success probability with a runtime t ∝ M (2r−1)/2 ∝ N (2r−1)/2r . Can we further improve the search scheme to achieve an optimal runtime ∝ N 1/2 while keeping the high success probability? A positive and even surprising answer is given below. By adjusting the edge weights we can merge our multi-stage search process into a single stage and achieve an optimal search speed with runtime ∝ N 1/2 via this merged single-stage process! Let us show an example firstly for a Cayley tree with height 2. The weight of edges between the first and second layer is set as ω, and the invariant subspace is the same as before. Then the effective Hamiltonian in the invariant subspace is written as From our numerical calculations, we observe that when the value of ω increases from O(M 1/4 ) to roughly O(M 3/4 ), the two stages in the search process are merged gradually, and then become a single stage for the value of ω > O(M 3/4 ). In the following, we present a detailed discussion on the case of ω = M . Figure 3 shows the squared overlaps of basis states with the eigenstates of H. When γ = 1 + 1/M , we find that E 1 − E 0 = 2.235M −1 , and the time consumed in the search process is t = πM/2.235 ∝ N 1/2 . Compared to the original two-stage search process, which gives a consumed time t ∝ M 3/2 ∝ N 3/4 , a substantial speedup is achieved on the weighted graph. We also find that the success probability is larger than 97% when M is large enough. It could be more close to 100% with a more delicate choice of the jumping rate γ. The influence of M on the success probability is shown in Appendix. D. Similar results for a Cayley tree with height 3 have been obtained (see Appendix. E). The runtime t ∝ N 5/6 in a multi-stage search is speeded up to an optimal runtime t ∝ N 1/2 in the single stage search with different controlled weights. Now, let us turn to discuss the case when the value of M is small while r is not small. Interestingly, by properly adjusting the weights of edges between different layers, we can still achieve the optimal search time for small branching factor (e.g. M = 2) and large height r. We set the edge weights to 1, ω, ω 2 , ω 3 , · · · , respectively, from bottom up as shown in Figure. 4.
As an example, we consider the case when r = 15, M = 2 and ω = 3. The squared overlaps of basis states with the eigenstates of H are given in Appendix. F. When γ = 1.5 and height varies, we have E 1 − E 0 = 1.764N −1/2 , and find that the time consumed in the search process is t = πN 1/2 /1.764. Thus, the optimal search time is still achieved! The success probability is found to be larger than 75%. The influence of total number of vertices N on the success probability is shown in Appendix. G. This example shows that our scheme with controlled edge weights can still provide an optimal search speed even when the branching factor is small. Compared to a recent scheme on this graph [31], which gives a runtime proportional to N , our scheme provides a substantial speedup.
Our results show that optimal quantum search can be achieved on intrinsically poorly connected graphs. A Cayley tree is intrinsically poorly connected since it becomes disconnected whichever edge is removed (the joined complete graphs [30] is not poorly connected in this sense). It has a low connectivity, irrespective of which measure one uses. According to the definition in [48], the average connectivity of the weighted Cayley tree of height 2 when ω = M is roughly 4/N . A discussion on different measures of connectivity can be found in Appendix. H.
We notice that a sufficient condition for optimal quantum search using CTQW was proposed in Ref. [32]. This condition is not satisfied by the Cayley trees with adjusted edge weights discussed here. However, an optimal quantum search with runtime O( √ N ) is achieved via our scheme. Therefore, it is not a necessary condition for the optimal quantum search. Cayley trees with weighted edges have far richer structure of the Hilbert space in which one can design useful quantum algorithms.
Conclusion and discussion-We have discussed quantum search of a marked vertex on Cayley trees with any height and any branching factor. Even though a Cayley tree has a low connectivity, our multi-stage quantum search scheme can achieve a success probability approaching 100% with a large branching factor M , and the success probability does not decrease even when the height or branching factor of the tree increases. The height of the Cayley tree directly gives the number of stages needed in the search process. Dominant term of the runtime in the search process is t ∝ M (2r−1)/2 ∝ N (2r−1)/2r for a Cayley tree of height r.
We have further found that different stages can be merged into a single stage by controlling the weight of edges between different levels of vertices in the graph. Thus, we can achieve a runtime t ∝ √ N with a substantial speedup. In other words, by using our search scheme with controllable weights, quantum search of a marked vertex on a Cayley tree with N vertices and a large branching factor can be achieved with a success probability close to 100% in an optimal runtime t ∝ √ N . Our scheme also works for Cayley trees when its branching factor is small while the height is large. In Appendix. I, we have shown these schemes are also quite robust under small deviations of the jumping rates or small perturbation of the graph structure. Finally, we expect similar results hold for other graphs with hierarchical structures.  Fig.5. From the figure, we see that the probability of success for our two-stage quantum search scheme is not affected by the branching factor M as long as M is large enough.

Appendix B: Evolution of probability distribution
For our two-stage quantum search scheme on a Cayley tree of height 2, the evolution of probability distribution in the search process is shown in Fig. 6. The dominant part of probability would flow from the out-most structure to the inner-most structure step by step in our scheme.

Appendix C: Small component of |ψ1 in |a
For quantum search on Cayley tree of height 2 with different values of branching factor M , the overlap | a|ψ 1 | 2 is shown as a function of the jumping rate γ in Fig.7. The value | a|ψ 1 | 2 gets smaller when M increases. This explains the decreasing of success probability for the scheme proposed in [34] when the branching factor M increases.  success as a function of the branching factor M is shown in Fig.8. We see that the success probability is close to 100% when M is large. The deviation from 100% might be caused by the deviation of γ we chose from the critical jumping rate. The merging of stages could also happen on the weighted Cayley tree of height 3. As shown in Figure  9, the weight between the first and second layer is set as ω 2 , the weight between the second and third layer is set as ω 1 . Numerical calculations show that when ω 2 is larger than roughly O(M   The weight of edges between the first and second layer is ω2, and the weight of edges between the second and third layer is ω1. from unity is determined by the spectrum of the Hamiltonian H as shown in Sec. F. More suitable weight of Cayley tree might support quantum search with success probability even closer to 100%.

Appendix H: connectivity
A Cayley tree has a low connectivity, irrespective of which measure one uses. There are several measures of connectivity [30,[48][49][50]. In Table I, we summarize the connectivity measures with different definitions for various Cayley trees, the first-order truncated M -simplex lattice and joined complete graphs for comparison. The average connectivity of the first-order truncated M -simplex lattice is roughly 1/ √ N and the average connectivity of joined complete graphs is roughly 1/2. Joined complete graphs were used as examples of poorly connected graphs to show connectivity is not a reliable indicator of faster quantum search in [30]. Here we provide a better example. Our scheme shows that optimal quantum search can still be achieved on Cayley trees that has an even lower connectivity. Cayley trees are intrinsically and much more poorly connected as they become disconnected whichever edge is removed. We have mentioned when γ is considerably away from γ c , the system state would essentially evolve only by a phase factor. Here we discuss the case when γ deviates from γ c by a small amount, and try to find how the deviation affects the quantum search. We find that a relatively small deviation of the jumping rate decreases the probability of success as we expect, however, it makes the quantum search faster! As discussed in [51], with potential barriers, the amplitude hopping from any vertex to other vertices is decreased by a factor ǫ, the Laplacian of the graph L becomes L ′ = L(1−ǫ). This is equivalent to the deviation of jumping rate γ since For Cayley tree of height 3, when we choose ω 1 = M , ω 2 = M 2 and γ = 1, we find that time consumed in the search process is t = πM . Since the number of vertices is N = M 3 + M 2 + M + 1, we have t ∝ N 1 3 , which is even faster than Grover's algorithm. Since the critical jumping rate is γ c = 1 + 1 M , it seems faster quantum search is achieved when γ deviates from γ c . However, we also find the success probability is 20% for M = 100, 9% for M = 500, and 6.5% for M = 1000. (In previous discussion, success probability is independent of M , as long as M is larger enough.) We would like to point out that when γ = γ c , the energy gap ∆E between the two related eigenstates is the smallest. Since t ∝ ∆E −1 , when energy gap becomes larger, time consumed in the search process will decrease together with a decrease of the success probability. But we find that the expected average time consumed for the search to succeed differs by only a constant factor for a small deviation of γ. Take Cayley tree of height 3 as an example, when M , numerically we find that time consumed is t ∝ M , success probability is p ∝ M − 1 2 , and p/t ∝ M − 3 2 . When 2 . The expected average time consumed is < t success >= pt+2p(1−p)t+3p(1−p) 2 t+· · · = t/p. Thus the expected average time consumed for the two search process differ by only a constant factor for Cayley trees of height 3. We have checked that similar results are also obtained for Cayley trees of other height. It is not clear how large the deviation can be without ruining the quantum search. When γ is far from γ c , whether the expected average time consumed still differs by only a constant factor is an open question.

Small perturbation on graph structure
We perform perturbation on the structure of the graph, and discuss how the modification affects the two-stage quantum search when M is large enough. We obtain the following results.
(1) As shown in Figure 12, the perturbation connects group of bottom vertices labeled with d directly to the top of the tree. No large influence on the two-stage search is observed. The quantum search is quite robust with respect to this kind of perturbation.
(2) As shown in Figure 13, we change the number of   2 ), the two-stage search succeeds with success probability larger than 99%. Quite robust!
(3) As shown in Figure 14, we change the weight of one edge between two vertices in groups |b and |e or the weight of one edge between two vertices in groups c and g to ω. When ω is not too large, i.e., ω = o(M 3 ), no influence on the two-stage search is observed. Quite robust! (4) Introducing Gaussian noise to every edge of a Cayley tree of height 2, the influence of noise on the success probability is shown in Figure 15. When standard deviation σ is smaller than 10 −2 , the success probability is not strongly affected. Dotted edges have weight ω (5) Introducing Gaussian noise to every edge of a weighted Cayley tree of height 2, the influence of noise on the success probability is shown in Figure 16. When standard deviation σ is smaller than 10 −2 , the influence of noise is very weak. Therefore, our quantum search schemes, the multistage scheme as well as the single-stage scheme with adjustable weights, are quite robust under small perturbation of the graph structure.

Large modification on graph structure
Now we consider large modifications on graph structure.
(1) As shown in Figure 17, we change the number of , the success probability of the twostage search process is larger than 99%. However, time consumed in each stages would change by a constant.
(2) As shown in Figure 18, nearly half of the groups in the bottom layer are directly connected to the top of the tree. The search process fails in such a modified graph.
(3) For Cayley tree of height 2, when each edge is assigned the weight ω = 1 or ω = 2 with equal probability, the search process is not successful.
A large modification on graph structure could affect our quantum search considerably.