Amplitude amplification (source code)

= Amplitude amplification
{wiki}

= Amplitude amplification theorem
{synonym}

If a state has good amplitude $\sin\theta$, the product of the reflection in the bad axis and the reflection in the state line rotates its good-bad plane by $2\theta$. After $k$ iterations the good probability is
$$
\sin^2((2k+1)\theta),
$$
so $O(1/\sin\theta)$ iterations raise a small good amplitude close to one.