<p>Turns out that there is a way to implement Grover's algorithm with fewer than $O(\sqrt{N}\log N)$ gates! That's why you were not able to find a reference claiming that $\Omega(\sqrt{N}\log N)$ gates are needed. At least in the case where there is one marked item it is possible to do better.</p>

<p>A recent preprint by <a href="http://arxiv.org/abs/1512.07550">Arunachalam and de Wolf</a> provides a new algorithm to solve the search problem with one marked item with query complexity $O(\sqrt{N})$ and only $O(\sqrt{N}\log(\log^* N))$ gates (from the gate set Toffoli + all one-qubit gates). </p>

<p>Note that the function $\log(\log^* N)$ grows so slowly that even if $N$ is the number of atoms in the universe, $\log(\log^* N)$ is at most 3.</p>

CC BY-SA 3.0
2015-12-29T02:39:37.467Z
2015-12-29T02:39:37.467Z
Robin Kothari
<p>The question is usually taken to be moot, for the following reason.  Grover's algorithm is a combinatorial search algorithm to find a solution to an arbitrary predicate.   While, yes, $\Theta(\log N)$ is the quantum gate complexity in each stage of the black-box algorithm, the predicate needs to be computed too.  The quantum gate complexity of that is $\Omega(\log N)$, because otherwise it wouldn't read the whole input and you could discard some of the input bits from the search.  On the other hand, an interesting predicate could take a lot more time than that.  Hence, the number of calls to the predicate is taken to be the standard coin, just as it is for the classical analogue of Grover's algorithm, namely random guessing.</p>

CC BY-SA 3.0
2015-05-17T04:21:25.303Z
2015-05-18T05:59:16.000Z
2015-05-18T05:59:16.000Z
Greg Kuperberg
<p>What is the time complexity (not query complexity) of Grover's algorithm?  It seems clear to me that it is $\Omega(\log(N) \sqrt{N})$ since there are $\Omega(\sqrt{N})$ iterations and each iteration requires use of the reflection operation which in turn takes time $\Omega(\log(N))$ using any standard set of universal gates.</p>

<p>The problem is, I can't find even a single reference which says the time complexity of Grover's algorithm is $\Omega(\log(N) \sqrt{N})$.  Wikipedia, and several other web pages, say $O(\sqrt{N})$ time complexity.  Grover's paper claims $O(\sqrt{N})$ "steps".</p>

<p>Am I missing something?  Perhaps people define the reflection operation to take unit time.  But that doesn't make sense to me because if we can play the game of allowing arbitrary unitaries to take unit time then there would be no difference between query complexity and time complexity.</p>

CC BY-SA 3.0
2013-03-29T22:26:20.077Z
I can't think of a reference that talks about the time complexity of Grover's algorithm, but what you wrote is true. In fact, over any finite gate set, the operations performed between queries in Grover's algorithm require at least $\Omega(\log N)$ gates, since each gate has finite width but we need to perform a gate that affects all $\log N$ qubits.
Robin Kothari
<reference-request><quantum-computing><time-complexity>
Runtime of Grover's algorithm
Dan Stahlke
# Runtime of Grover's algorithm

(Asked by: username_0 on 2013-03-29)

What is the time complexity (not query complexity) of Grover's algorithm? It seems clear to me that it is $\Omega(\log(N) \sqrt{N})$ since there are $\Omega(\sqrt{N})$ iterations and each iteration requires use of the reflection operation which in turn takes time $\Omega(\log(N))$ using any standard set of universal gates.

The problem is, I can't find even a single reference which says the time complexity of Grover's algorithm is $\Omega(\log(N) \sqrt{N})$. Wikipedia, and several other web pages, say $O(\sqrt{N})$ time complexity. Grover's paper claims $O(\sqrt{N})$ "steps".

Am I missing something? Perhaps people define the reflection operation to take unit time. But that doesn't make sense to me because if we can play the game of allowing arbitrary unitaries to take unit time then there would be no difference between query complexity and time complexity.

**Tags:** reference-request, quantum-computing, time-complexity
> **Comments:**
> **username_1**: I can't think of a reference that talks about the time complexity of Grover's algorithm, but what you wrote is true. In fact, over any finite gate set, the operations performed between queries in Grover's algorithm require at least $\Omega(\log N)$ gates, since each gate has finite width but we need to perform a gate that affects all $\log N$ qubits.  

---

## 2 answers

### Answer by username_2 on 2015-05-17. Score: 11 | Accepted answer

The question is usually taken to be moot, for the following reason. Grover's algorithm is a combinatorial search algorithm to find a solution to an arbitrary predicate. While, yes, $\Theta(\log N)$ is the quantum gate complexity in each stage of the black-box algorithm, the predicate needs to be computed too. The quantum gate complexity of that is $\Omega(\log N)$, because otherwise it wouldn't read the whole input and you could discard some of the input bits from the search. On the other hand, an interesting predicate could take a lot more time than that. Hence, the number of calls to the predicate is taken to be the standard coin, just as it is for the classical analogue of Grover's algorithm, namely random guessing.


---

### Answer by username_1 on 2015-12-29. Score: 8

Turns out that there is a way to implement Grover's algorithm with fewer than $O(\sqrt{N}\log N)$ gates! That's why you were not able to find a reference claiming that $\Omega(\sqrt{N}\log N)$ gates are needed. At least in the case where there is one marked item it is possible to do better.

A recent preprint by [Arunachalam and de Wolf](http://arxiv.org/abs/1512.07550) provides a new algorithm to solve the search problem with one marked item with query complexity $O(\sqrt{N})$ and only $O(\sqrt{N}\log(\log^\* N))$ gates (from the gate set Toffoli + all one-qubit gates).

Note that the function $\log(\log^\* N)$ grows so slowly that even if $N$ is the number of atoms in the universe, $\log(\log^\* N)$ is at most 3.


---

