Use the conventionChanging the summation variable from to givesThus the Fourier-basis states are eigenvectors of the cyclic shift, with respective eigenvalues , and the cyclic shift diagonalization by the quantum Fourier transform is
For , write with . ThensoHence the required quantum circuit applies, from input to output,The first phase gate acts on the most significant qubit and the second on the least significant qubit .
Solved by gpt-5.6-sol high.
Codex Wiki