In a quantum computer, amplitude amplification can be used to obtain a quadratic speedup over several classical algorithms.

Algorithm

The derivation presented here roughly follows the one given in .[3] Assume we have an N-dimensional Hilbert spaceH{\displaystyle {\mathcal {H}}} representing the state space of our quantum system, spanned by the orthonormal computational basis states B:={|k⟩}k=0N−1{\displaystyle B:=\{|k\rangle \}_{k=0}^{N-1}}. Furthermore assume we have a Hermitianprojection operatorP:H→H{\displaystyle P:{\mathcal {H}}\to {\mathcal {H}}}. Alternatively, P{\displaystyle P} may be given in terms of a Boolean oracle function χ:Z→{0,1}{\displaystyle \chi :\mathbb {Z} \to \{0,1\}} and an orthonormal operational basis Bop:={|ωk⟩}k=0N−1{\displaystyle B_{\text{op}}:=\{|\omega _{k}\rangle \}_{k=0}^{N-1}}, in which case

P{\displaystyle P} can be used to partition H{\displaystyle {\mathcal {H}}} into a direct sum of two mutually orthogonal subspaces, the good subspace H1{\displaystyle {\mathcal {H}}_{1}} and the bad subspace H0{\displaystyle {\mathcal {H}}_{0}}:

rotating the state between the good and bad subspaces. After n{\displaystyle n} iterations the probability of finding the system in a good state is sin2⁡((2n+1)θ){\displaystyle \sin ^{2}((2n+1)\theta )\,\!}.
The probability is maximized if we choose

Up until this point each iteration increases the amplitude of the good states, hence the name of the technique.

Applications

Assume we have an unsorted database with N elements, and an oracle function χ{\displaystyle \chi } which can recognize the good entries we are searching for, and Bop=B{\displaystyle B_{\text{op}}=B} for simplicity.

If there are G{\displaystyle G}good entries in the database in total, then we can find them by initializing the quantum computer into a uniform superposition

of all the database elements, and running the above algorithm. In this case the overlap of the initial state with the good subspace is equal to the square root of the frequency of the good entries in the database, sin⁡(θ)=|P|ψ⟩|=G/N{\displaystyle \sin(\theta )=|P|\psi \rangle |={\sqrt {G/N}}}. If sin⁡(θ)≪1{\displaystyle \sin(\theta )\ll 1}, we can approximate the number of required iterations as

Measuring the state will now give one of the good entries with a high probability. Since each application of SP{\displaystyle S_{P}} requires a single oracle query (assuming that the oracle is implemented as a quantum gate), we can find a good entry with just O(N){\displaystyle O({\sqrt {N}})} oracle queries, thus obtaining a quadratic speedup over the best possible classical algorithm.

If we set G{\displaystyle G} to one, the above scenario essentially reduces to the original Grover search.