Solution (source code)

= Solution

Apply parts (b)(ii) and (b)(iii), keeping the oracle's minus sign:
$$
\begin{aligned}
WV_f|e_0\rangle
&=\frac1{\sqrt N}\left[\frac{2(S_0-S_1)}N|J\rangle-|A_0\rangle+|A_1\rangle\right]\\
&=\frac1{\sqrt N}\bigl[|J\rangle-|A_0\rangle+|A_1\rangle\bigr]\\
&=\boxed{\frac2{\sqrt N}|A_1\rangle=\frac2{\sqrt N}\sum_{f(x)=1}|x\rangle.}
\end{aligned}
$$
The middle equality uses part (a), and the last uses $|J\rangle=|A_0\rangle+|A_1\rangle$. The final squared <norm> is $4S_1/N=1$, providing a <normalization> check.

The sign convention matters: here $W=2|e_0\rangle\langle e_0|-I$ fixes $|e_0\rangle$ and negates its <orthogonal> complement. Its action on amplitudes is <inversion about the mean>. The negative of this reflection would change the final <vector> by an overall <global phase>, but mixing those conventions midway would give incorrect intermediate signs.<A fast quantum mechanical algorithm for database search by Lov Grover>[Section 4, diffusion transform and equation (4.0), inversion-about-average interpretation]{ref}