= Solution
Initialize the register in
$$
\boxed{|\phi_y\rangle=H^{\otimes N}|y\rangle=T_y|\phi\rangle.}
$$
This can be prepared by <Pauli X gates> on the one-bits of $y$, starting from $|0^N\rangle$, followed by <Hadamard gates> on all <qubits>. Alternatively, prepare the original uniform state and apply <Pauli Z gates> at those same bit positions. The conjugation calculation gives
$$
G_y^n|\phi_y\rangle=T_yG^n|\phi\rangle.
$$
The final diagonal sign operator changes no <computational basis> outcome <probabilities>. Thus the success <probability> and the iteration count in part (b) are unchanged. No final correction is needed when the objective is to measure a marked string.
Back to article page