This post is about my paper Quantum walks can find a marked element on any graph with Hari Krovi, Frédéric Magniez, and Jérémie Roland. We wrote it in 2010, but after spotting a subtle mistake in the original version, we have recently substantially revised it. It went from 15 to 50 pages after we added much more details and background material, as well as corrected some small bugs and addressed one major bug.

**Problem statement**

Imagine a huge graph with many vertices, some of which are marked. You are able to move around this graph and query one vertex at a time to figure out if it is marked or not. Your goal is to find any of the marked vertices.

Given an instance of such problem, a typical way to solve it is by setting up a random walk on the graph. You can imagine some probabilistic procedure that systematically moves from one vertex to another and looks for a marked one.

More formally, you would define a stochastic matrix whose entry describes the probability to move from vertex to . Starting from some randomly chosen initial vertex, your goal is to end up in one of the marked vertices in the set .

**Our result**

We show that any classical algorithm that is based on such random walk can be turned into a quantum walk algorithm that finds a marked vertex quadratically faster. To state this more formally, let us define the hitting time of a random walk:

**Definition.** The *hitting time* of with respect to a set of marked vertices is the expected number of steps the walk takes to find a marked vertex, starting from a random unmarked vertex chosen from a distribution which is proportional to the stationary distribution of . Let us denote this quantity by .

Our main result is as follows:

**Theorem.** Quantum walk can find a marked vertex in steps.

As you can see, this is a very general result—no matter how cleverly the transition probabilities for the random walk are chosen, we can always cook up a related quantum walk that beats the classical walk quadraticaly!

Note that this is much more general than what is achieved by Grover’s algorithm. Grover’s algorithm corresponds to the special case, where the underlying graph is complete and the random walk moves from any vertex to any other with equal probability.

**It’s weaker than before…**

You may have noticed a little “+” that appeared next to in the statement of the theorem. Indeed, this has to do with the subtle mistake we spotted in our earlier proof. It turns out that if (i.e., there is a unique marked vertex) then

and we indeed achieve a quadratic quantum speedup. Unfortunately, when it can happen that

and thus we don’t get a fully quadratic speedup. Hence our result is weaker than what we claimed previously. On the other hand, the new version is *more correct*!

**Proof idea**

Our algorithm is based on Szegedy’s method for turning random walks into quantum walks. It constructs two unitary matrices, each corresponding to a reflection with respect to a certain subspace. These subspaces are defined by

- the standard basis vectors corresponding to marked vertices,
- the unit vectors obtained by taking entry-wise square roots of the rows of .

Together these two reflections define one step of the quantum walk.

Our contribution consists in modifying the original walk before we quantize it. We define a *semi-absorbing* walk that leaves a marked vertex with probability even when one is found. This might seem like a bad idea, but one can check that at least classically it does not make things worse by too much. In fact, the limit of corresponds to the classical algorithm that never leaves a marked vertex once it is found.

**Glitch in the previous proof**

Our proof makes extensive use of a certain quantity which we associate to and call *interpolated hitting time*. Then , the *extended hitting time* that appears in the above theorem, is defined as the limit

When , taking this limit is straightforward and one can easily see that it gives , the regular hitting time.

It is tempting to guess that the same happens also when . Indeed, it is far from obvious why in this case the answer *does not* come out the same way as in the case. This is exactly what was overlooked in the earlier version of our paper. Computing the limit properly when is much harder (the expression contains inverse of some matrix that is singular at ). This is done in detail in the final appendix of our paper.

**Open problems**

Here are some open questions:

- Why is it that our algorithm has a harder time to find a needle in a haystack when there are several needles rather than just one?
- What is the operational interpretation of the interpolated hitting time ?
- Can quadratic speedup for finding be achieved also when there are multiple marked vertices?
- How can we efficiently prepare the initial state on which the walk is applied?

One might get some insight in the first two questions by observing that our algorithm actually solves a slightly harder problem than just finding a marked vertex—it samples the marked vertices according to a specific distribution (proportional to for some ). When there is only one marked vertex, finding it is the same as sampling it. However, for multiple marked vertices this is equivalence does not hold and in general it should be harder to sample.