Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2013/iii/paper-58/1/b/solution

Use the quantum Fourier transform convention , where . Reindexing the shifted sum gives
Thus the cyclic shift operator has these eigenvectors, with eigenvalues . This is cyclic shift diagonalization by the quantum Fourier transform, and it implies with .
For , the binary encoding is , with the more significant qubit. The required diagonal phase is
so . The allowed-gate circuit is therefore
In execution order, apply the inverse QFT, then the two phase gates, then the forward QFT. There is no extra global phase. Reversing the Fourier sign convention would conjugate both phase gate parameters.

New to topics? Read the docs here!