= Solution
Put $L=2^N$ and define $\theta=\arcsin\sqrt{M/L}$. The normalized good and bad <vectors> have disjoint <computational basis> supports, so they are <orthogonal>. Counting the terms in the uniform <quantum superposition> gives
$$
\boxed{|\phi\rangle=\sin\theta\,|\Psi_g\rangle+\cos\theta\,|\Psi_b\rangle,\qquad\sin\theta=\sqrt{M/2^N}.}
$$
Since $V_0=I-2|0^N\rangle\langle0^N|$, the <Hadamard transform> gives $-H^{\otimes N}V_0H^{\otimes N}=2|\phi\rangle\langle\phi|-I$, the <Grover diffusion operator>. On the ordered <orthonormal basis> $(|\Psi_g\rangle,|\Psi_b\rangle)$, the two <reflection operators> have <matrices>
$$
U_f=\begin{pmatrix}-1&0\\0&1\end{pmatrix},\qquad 2|\phi\rangle\langle\phi|-I=\begin{pmatrix}-\cos2\theta&\sin2\theta\\\sin2\theta&\cos2\theta\end{pmatrix}.
$$
Their product is
$$
\boxed{G=\begin{pmatrix}\cos2\theta&\sin2\theta\\-\sin2\theta&\cos2\theta\end{pmatrix}.}
$$
This is a plane <rotation> through angle $-2\theta$ in the displayed coordinate convention, with the invariant good-bad plane preserved by both operators. In particular its action sends $(\sin a,\cos a)$ to $(\sin(a+2\theta),\cos(a+2\theta))$. Induction therefore gives the <Grover rotation angle> formula
$$
G^n|\phi\rangle=\sin((2n+1)\theta)|\Psi_g\rangle+\cos((2n+1)\theta)|\Psi_b\rangle.
$$
Back to article page