For the known bit string , define the Pauli gate product . Its diagonal action is , where the binary inner product is taken modulo two. The Hadamard transform produces . Thus the required vectors for Grover search with a nonzero reflection label are
They remain orthonormal and . The new iterate is . Since commutes with the diagonal marked-state phase oracle and ,
Consequently its matrix on the signed basis is exactly the rotation matrix in part (a), proving the claimed equivalence of the two evolutions.
Prepare , query the oracle, and measure or discard the output register. For , the input register becomes the coset state
Apply , the quantum Fourier transform over . The two amplitudes interfere destructively unless the binary inner product satisfies
and every vector in this orthogonal subspace is sampled uniformly. Repeat until independent equations have been collected, then use Gaussian elimination over to find their one-dimensional null space; its nonzero vector is . This is Simon's algorithm. It uses oracle queries with high probability and polynomial classical work. When , the function is injective and the samples eventually span all of , which distinguishes that case with arbitrarily high probability.