This is a Quantum Computing algorithm that searches a database of items efficiently.

Given items encoded as n bit-strings. Given an oracle: a boolean function

This provides a quadratic improvement over the classical algorithm, a big improvement.

In fact this is the optimal solution for an unstructured search.

Note that you must know the number of solutions to know how many times to apply the process.

The optimal number of iterations is

Idea

Construct quantum function (unitary operator on n bits). Assumre is the only sequence for which returns 1.1

Note that we can’t observe this matrix directly, otherwise we’d already know the answer.

Then apply inversion about the mean:

The mean remainst unchanged by the operation :

Then we have the density matrix :

This gives us

Idea: Use Grover’s diffusion, this boosts the solution we care about around the mean, but doesn’t change the other solutions.

Footnotes

  1. The algorithm still works if there are multiple solutions. Otherwise quantum counting can be used in the case where there are multiple solutions.