Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2024/iii/paper-324/1/c/iv/solution

Choose and prepare . The circuit from part (iii) returns
so a quantum measurement in the computational basis of the first register reveals the discrete logarithm exactly. More generally, any that is invertible modulo returns , from which follows by multiplication by the modular inverse of .

New to topics? Read the docs here!