1 Introduction
Quantum walks are quantum counterparts of classical random walks [1]. Similarly to classical random walks, there are two types of quantum walks: discretetime quantum walks (DTQW), introduced by Aharonov et al. [2], and continuoustime quantum walks (CTQW), introduced by Farhi et al. [3]. For the discretetime version, the step of the quantum walk is usually given by two operators – coin and shift – which are applied repeatedly. The coin operator acts on the internal state of the walker and rearranges the amplitudes of going to adjacent vertices. The shift operator moves the walker between the adjacent vertices.
Quantum walks have been useful for designing algorithms for a variety of search problems [4]. To solve a search problem using quantum walks, we introduce the notion of marked elements (vertices), corresponding to elements of the search space that we want to find. We perform a quantum walk on the search space with one transition rule at the unmarked vertices, and another transition rule at the marked vertices. If this process is set up properly, it leads to a quantum state in which the marked vertices have higher probability to be found than the unmarked ones. This method of search using quantum walks was first introduced in [5] and has been used many times since then.
In contrary to classical random walks, the behavior of the quantum walk can drastically change if the search space contains more than one marked element. In 2008 Ambainis and Rivosh [6] have studied DTQW on twodimensional grid and showed that if the diagonal of the grid is fully marked then the probability of finding a marked element does not grow over time. Later, in 2015 Wong and Ambainis [7] have analysed DTQW on the simplex of complete graphs and showed that if one of the complete graphs is fully marked then there is no speedup over classical exhaustive search. In both cases the configuration consists of marked vertices. The same year Nahimovs and Rivosh [8, 9] have studied DTQW on twodimensional grid for various placements of multiple marked vertices and demonstrated configurations of a constant number of marked vertices (naming them exceptional configurations) for which the walk have no speedup over classical exhaustive search. Later, Nahimovs and Santos [10] have extended the results to general graphs.
The reason why some configuration are exceptional is that for such configurations the initial state of the algorithm is close to a 1eigenvector of a step of the walk algorithm. Therefore, the probability of finding a marked vertex stays close to the initial probability and does not grow over time. Nahimovs, Khadiev and Santos
[11] analysed the search for a set of connected marked vertices forming an exceptional configuration and proved the upper bound on the probability of finding a marked vertex. The proved bound, however, depends on a parameter – a sum of squares of amplitudes of edges between the marked vertices inside the stationary state – which was left unestimated.In this paper we continue the analysis and prove the upper bound in explicit form, which depends properties of the graph and the configuration of marked vertices. In particular we showed, that if is the set of edges in the graph, is the set of marked vertices and is the maximum number of unmarked neighbours over , then the success probability satisfies
(1) 
Additionally, we analyse several examples of sets of marked vertices and show tightness of our results in the worst case scenario (but not in general). We believe that the proved results as well as used techniques might be of independent interest.
2 Preliminaries
2.1 Quantum walks
Let be an simple, undirected graph. We denote and . Let be a neighbourhood of a vertex , that is a set of vertices is adjacent to.
We define a location register with basis states for and a direction or coin register, which for a vertex has basis states for .
The state of the quantum walk is given by:
A step of the quantum walk is performed by first applying , where is a unitary transformation on the coin register. The usual choice of transformation on the coin register is Grover’s diffusion transformation .
Then, the shift transformation is applied:
which for each pair of connected vertices swaps an amplitude of vertex pointing to with an amplitude of vertex pointing to .
The quantum walk starts in the equal superposition over all pairs vertexdirection:
It can be easily verified that the state stays unchanged, regardless of the number of steps.
To use the quantum walk as a tool for search, we introduce the notion of marked vertices. We perform the quantum walk with one set of transformations at the unmarked vertices, and another set of transformations at the marked vertices. Usually the separation between marked and unmarked vertices is given by the query transformation , which flips the sign at a marked vertex, irrespective of the coin state, i.e. iff is marked. In this case a step of the walk is given by the transformation .
The running time of the walk and the probability of finding a marked vertex in general case depends on both the structure of the graph and the configuration, i.e. the number and the placement, of marked vertices.
2.2 Stationary states
We call a state stationary if it is not changed by a step of the algorithm. Below we summarize known facts on stationary states.
Theorem 1 ([10]).
Consider a state with the following properties: all amplitudes of the unmarked vertices are equal; the sum of the amplitudes of any marked vertex is 0; the amplitudes of two adjacent vertices pointing to each other are equal. Then is a stationary state of the evolution operator .
Furthermore, the state that maximize the overlap between stationary state and the initial state can be chosen of the above form.
Theorem 2 ([12]).
There exists a stationary state of the form as in Theorem 1 that maximizes the overlap between it and the initial state over all possible stationary states.
Note that since the amplitudes of adjacent vertices pointing to each other should be equal it is enough to set values on edges instead of arcs .
We say that a graph is bipartite if there exists a nonempty such that . We call a bipartite set.
Theorem 3 ([12]).
A bipartite marked connected component has a stationary state if and only if the sums of degrees of each bipartite set are equal. A nonbipartite marked connected component always have a stationary state.
Note that instead of comparing the sums of degrees of each bipartite set, one can count the number of outgoing edges, i.e. edges connecting marked and nonmarked vertices – this comes from the fact that the numbers of internal edges for bipartite sets must be equal. Let us denotes the number of all outgoing edges . We use notation or simply , if the graph is clear from the context, as a replacement of .
Theorem 4 ([11]).
Consider a graph with a connected component of marked vertices . Let be such that there exists a stationary state of the form
(2) 
Then the probability of finding any element from at time satisfies
(3) 
While , and depend on and only, there exist multiple assignments of and, therefore,
is not uniquely defined. In the next section, which is the main result of the paper, we will focus on estimating the sum.
Note that a simple lower bound on maximum probability is probability of the initial state, which is
(4) 
3 Summary of the results
It turns out that the sum in Eq. (3) may have large impact. In this section we give the summary of results on estimating the sum for various types of graphs. The technical details can be found in appendix.
We call a sequence a cycle if and , and there is no vertex repetition. We say graph is a tree if there is no cycle, and a unicyclic graph if there is precisely one cycle.
Let be the number of marked vertices and let be the number of unmarked neighbors connected to , i.e.
(5) 
Let . Note that , as otherwise the marked component is at the same the connected component of , and by this the success probability equals for all . Note that we are only interested on a value of on , thus, for simplicity we will use notation for the original sum.
Our results are of two kinds, as we have considered general and constant . In the first scenario, we can show that for trees we have where is the diameter of the tree. Note that needs to satisfy requirement given in Theorem 3 in order to have a stationary states, however no other requirements are needed. For graphs with a cycle we show upperbound . The upperbound does not depend whether the graph is bipartite or not, however for bipartite graph requirement given in Theorem 3 needs to be satisfied. The proofs of these facts can be found in Appendices B and C. Since we can conclude these results with following theorem.
Theorem 5.
Consider a graph with a connected component of marked vertices . Let the be defined as in (5). Let be such that there exists a stationary state. Then the probability of finding any element from at time satisfies
(6) 
Proof.
We would like to emphasize several interesting additional remarks. The proofs of the theorem were always constructive. Furthermore, it turned out that for trees and unicyclic nonbipartite graphs the function is unique and for unicyclic bipartite graphs it lies on a hyperline in space. These properties are particularly helpful, as the optimal is needed to show the tightness of the bound derived in the theorem above. In particular there exists tree for which optimal satisfies , see Theorem 12. This shows, that we cannot improve in general the result of the previous theorem, unless we provide some upperbound of different form than the one given in Theorem 4.
However we can improve the theorem provided is a constant function. In this case we can show that for graphs with a cycle we have , where is the length of any cycle of the graph. In particular the is small if the marked component is Hamiltonian.
Theorem 6.
Consider a graph . Let be a connected component of marked vertices with cycle of length . Let the be defined as in Eq. (5). Let be such that there exists a stationary state. Then the probability of finding any element from at time satisfies
(8) 
Proof.
Again we could provide some lowerbounds on the theorem: there exists graphs for which the optimal satisfies independently whether graph is bipartite or not, see Theorems 20 and 23 in Appendix D.
Finally we would like to emphasize two remarks based on Theorem 5. First, for every boundeddegree graphs the success probability of finding any vertex from constant size component is . Second, success probability of finding any vertex from constant size component in regular graphs is .
References
 [1] R. Portugal, Quantum walks and search algorithms. Springer, New York, 2013.
 [2] Y. Aharonov, L. Davidovich, and N. Zagury, “Quantum random walks,” Physical Review A, vol. 48, no. 2, pp. 1687–1690, 1993.

[3]
E. Farhi and S. Gutmann, “Quantum computation and decision trees,”
Physical Review A, vol. 58, pp. 915–928, 1998.  [4] D. Reitzner, D. Nagaj, and V. Buzek, “Quantum walks,” in Acta Physica Slovaca 61, vol. 6, pp. 603–725, 2011. arxiv.org/abs/1207.7283.
 [5] N. Shenvi, J. Kempe, and K. B. Whaley, “A quantum random walk search algorithm,” Physical Review A, vol. 67, no. 052307, 2003.
 [6] A. Ambainis and A. Rivosh, “Quantum walks with multiple or moving marked locations,” in Proceedings of SOFSEM, pp. 485–496, 2008.
 [7] T. G. Wong and A. Ambainis, “Quantum search with multiple walk steps per oracle query,” Phys. Rev. A, vol. 92, Aug 2015.
 [8] N. Nahimovs and A. Rivosh, “Quantum walks on twodimensional grids with multiple marked locations,” in Proceedings of SOFSEM 2016, vol. 9587, pp. 381–391, 2016. arXiv:quantph/150703788.
 [9] N. Nahimovs and A. Rivosh, “Exceptional configurations of quantum walks with Grover’s coin,” in Proceedings of MEMICS, pp. 79–92, 2015.
 [10] N. Nahimovs and R. Santos, “Adjacent vertices can be hard to find by quantum walks,” in Proceedings of SOFSEM 2017, vol. 10139, pp. 256–267, 2017.
 [11] K. Khadiev, N. Nahimovs, and R. A. M. Santos, “On the probability of finding marked connected components using quantum walks,” Lobachevskii Journal of Mathematics, vol. 39, pp. 1016–1023, Sep 2018.
 [12] K. Prūsis, J. Vihrovs, and T. G. Wong, “Stationary states in quantum walk search,” Phys. Rev. A, vol. 94, 2016.
Appendix A Preliminaries and the optimization problem description
a.1 Graph theory preliminaries
Let be an simple, undirected graph. We denote and . We use notation as a replacement of . We say that the graph is bipartite if there exists a nonempty such that . We call a bipartite set. We define to be the set of edges incident to , and to be the set of adjacent vertices. Furthermore, we define a degree of the vertex . We call a sequence
(10) 
where a path, if each vertex appears exactly one, allowing . If we call the path a cycle. For such path is the length of the path. Let be the diameter in a graph, i.e. the maximum distance between any pair of vertices in . Let be the largest degree in a graph. We call vertex a leaf iff its degree is one.
We call graph a subgraph of iff and . Furthermore, a subgraph is an spanning subgraph iff . Note that is a (spanning) subgraph of as well. We call subgraph a component (or an induced subgraph) of iff for each we have .
We say is a tree if it does not contain any cycles. Forest is a disjoint union of trees. Connected graph is a tree iff it has precisely edges. We say is unicyclic if it contains precisely one cycle. Every connected graph is unicyclic iff it has precisely edges. One can prove the following theorem.
Lemma 7.
Let be a connected undirected graph with a subgraph being a cycle. Then there exists connected, unicyclic, spanning subgraph such that .
Proof.
The proof is constructive. Let us start with . If contains precisely edges, then it matches the requirements of the theorem. If not, it means it has another cycle . Let be an edge that is in but not in , Then we construct new graph . Removing the edge from any cycle does not break connectivity, and still we have , but with having one edge less. We repeat the procedure as long as we have graph with precisely edges. By construction we have and that is connected spanning subgraph of . ∎
We call a rooted tree iff is a tree and . For such graph, for each vertex there exists a unique path . The length of the path is denoted by . We call the height of the tree the length of maximal path from its root, i.e.
(11) 
For each there exists an edge which is the first edge of the path , that is the edge which connects the vertex to its parent . Let be a collection of vertices is a parent of. Let be a collection of edges pointing to vertices in . Note that for the root we have and .
For any rooted tree we can define a natural partial order called treeorder. We have iff the path passes through . We denote a set of all descendants of . Note, that we assume is its own descendant. We call a linear extension of the partial order iff the is linear and for each we have . Note that the root is the unique minimum for both treeorder and its linear extension. Furthermore, the maximal elements of the treeorder (and, thus, the maximum of its linear extension) are leafs.
a.2 The optimization problem
Let be an undirected connected graph and let . We need to construct a function such that is minimized and for each we have
(12) 
Furthermore we denote .
In the original problem would be the component of marked vertices, and would be the number of edges from vertex to unmarked vertices. Hence, we will often assume that . Furthermore, in the case of being a bipartite graph with bipartite sets and we need to add another condition on
(13) 
This comes directly from Theorem 3.
Appendix B Success probability for trees
The notation used in this section is described in Sec. A.
Lemma 8.
Let be a tree with height . Then
(14) 
Proof.
Note that for tree has height 0, thus the statement is true. We will show the statement by proving inductively for all in linear extension of tree order
(15) 
where is the longest path from to its descendant. Note that for we have the original statement. The equation above is true for being a leaf. For other nodes we have
(16) 
∎
We start with a lemma which will be used in almost all proofs.
Lemma 9.
Let be a rooted undirected tree and . Then there is a unique function satisfying Eq. (12) for all vertices except the root. Furthermore it satisfies
(17)  
(18) 
Proof.
Let be vertices enumerated according to some linear extension of the treeorder of . We will assign the values of and prove Eqs. (17) and (18) inductively with the given order of vertices. Note that uniqueness comes directly from the construction.
Suppose is a leaf. According to condition Eq. (12), we have
(19) 
Note that in this case Eq. (17) and (18) are trivially fulfilled as .
Suppose is not a leaf. Then, according to the order , for all edges value of is specified. According to Eq. (12) we have
(20) 
From this we have
(21) 
Let us start with proving Eq. (17) for :
(22) 
where the second inequality comes from the induction assumption on Eq. (18), and the last equality results from the fact that we enumerated all descendants of except . Suppose is not the root. We have
(23) 
∎
Now let us show the upperbound on the success probability for tree graph.
Proposition 10.
Proof.
Theorem 11.
Proof.
We will now prove that the bound is tight in the worst case scenario, but not in the general case.
Theorem 12.
Proof.
Let
be odd and
be even. We consider the following graph. Let be vertices forming a path in the given order, and let and for be vertices connected to and respectively, as in Fig. 1. Let be a constant function. Since graph is a tree, by the Theorem 11 the function is unique and thus optimal.The function satisfying Eq. (12) takes the form
(27) 
Thus, we have
(28) 
Note that , hence . If we choose , then the graph satisfies the theorem statement. ∎
Theorem 13.
Appendix C Success probability for general function
The notation used in this section is described in Sec. A.
c.1 Nonbipartite graphs
Proposition 14.
Let be a simple, undirected, connected graph with cycle of odd length and . Then there exists function satisfying Eq. (12) such that
(31) 
Proof.
Let be an cycle of of length , with vertices with respectively where . Let be a connected, unicyclic spanning subgraph of containing . We set for all .
Now let as consider graph . Such constructed graph is a forest which consists of trees such that each tree contains precisely one vertex from cycle . Each tree can be considered as an ordered tree with root , and by Lemma 9 we can define uniquely for each tree such that
(32)  
(33) 
Now let us consider the missing part of the domain of , which is . Based on Eq. (12) we have that the values must satisfy
(34) 
Since there is odd number of variables, there exists unique solution of the form
(35) 
Note that since we have
(36) 
we have as well
(37) 
Finally using all of the equations above we have
(38) 
where we used , , and equations given before. ∎
Theorem 15.
Let be a simple, undirected, connected graph with cycle of odd length and . Then there is function satisfying Eq. (12) such that .
Proof.
Comes directly from Theorem 14 and from . ∎
c.1.1 Bipartite graphs
Proposition 16.
Proof.
The proofs goes similarly to proof of Theorem 14, up to system of linear equations. In this case we have even number of equations there is either no solutions, or infinite number of solutions. Provided satisfies Eq. (13) it turned one that the solution is parametrized by single free variable and takes the form
(40) 
where is free parameter. Let . Then
(41) 
Remark 17.
Proof.
Comes directly from Theorem 16 and from . ∎
Note that the solution is not unique anymore, as it depends on single parameter even if it contains only one cycle. Furthermore, note that in the proof we searched for unicyclic spanning subgraph, while we could search for spanning tree and use Theorem 11. Careful analysis would show the same bound , since diameter of any spanning tree is at most .
Appendix D Success probability for constant function
The notation used in this section is described in Sec. A.
d.1 Nonbipartite graphs
In case of being a constant function, we can slightly reduce obtained result.
Proposition 18.
Let be a simple, undirected, connected graph with cycle of odd length and constant function . Then there is function satisfying Eq. (12) such that
(43) 
Proof.
Whole construction of and other variables remains the same as in Theorem 14, however we can provide more explicit form of on edges from cycle. Note that according to the construction we have
(44) 
where . Thus we can do following
(45) 
Hence we have