Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2004/iii/paper-53/2/1/solution

Apply one Hadamard gate independently to each qubit. These gates act in parallel, so the quantum circuit implements with gates and depth one.
Figure 1.
Parallel Hadamard gates implementing the binary Fourier transform
. Details.
For a computational basis state, factorization gives
The exponent is the dot product over the finite field , because multiplying the separate signs adds their exponents modulo two. This is the Walsh-Hadamard transform, equivalently the quantum Fourier transform on the finite Abelian group .
In particular, the all-zero input becomes the uniform coherent superposition . It is a useful initial operation because an oracle can then act on all amplitudes in one call, and subsequent interference can reveal a global property. Measurement alone does not read all function values: the later interference step is what turns the preparation into an algorithmic advantage.

New to topics? Read the docs here!