Lean, informalized

Nielsen & Chuang · Chapter 5, The quantum Fourier transform and its applications · p. 227

Exercise 5.12 - The operator of order finding permutes the basis states of a register and is unitary

Multiplication modulo NN by a number coprime to it is unitary.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

A register has dd basis states |0⟩,|1⟩,…,|d−1⟩|0\rangle, |1\rangle, \dots, |d-1\rangle, labelled by the numbers 00 to d−1d-1. Fix natural numbers xx and NN with N≤dN \le d and xx coprime to NN. Multiplication by xx modulo NN shuffles the labels 0,…,N−10, \dots, N-1 among themselves, and the labels from NN to d−1d-1 stay where they are. The operator UU of order finding is the matrix of this shuffle, and the exercise is to show that UU is unitary.

The Multiplication Map

For natural numbers xx and N≤dN \le d, the multiplication map fxf_x is the map of the labels {0,1,…,d−1}\{0, 1, \dots, d-1\} to themselves that multiplies a label below NN by xx modulo NN and fixes every other label: fx(y)={xymod⁡N,0≤y<N,y,N≤y≤d−1.f_x(y) = \begin{cases} xy \bmod N, & 0 \le y < N, \\ y, & N \le y \le d-1. \end{cases}(1)✦

For xx coprime to NN, the permutation πx\pi_x of the labels {0,…,d−1}\{0, \dots, d-1\} is fxf_x taken as a bijection, with each label written above its image: πx=(01⋯N−1N⋯d−10xmod⁡N⋯(N−1)xmod⁡NN⋯d−1).\pi_x = \begin{pmatrix} 0 & 1 & \cdots & N-1 & N & \cdots & d-1 \\ 0 & x \bmod N & \cdots & (N-1)x \bmod N & N & \cdots & d-1 \end{pmatrix}.(2)✦

The Operator

For xx coprime to NN and N≤dN \le d, the operator UU of order finding is the permutation matrix of πx\pi_x, the d×dd \times d complex matrix with entries Uyz={1,z=πx(y),0,otherwise,y,z=0,1,…,d−1.U_{yz} = \begin{cases} 1, & z = \pi_x(y), \\ 0, & \text{otherwise}, \end{cases} \qquad y, z = 0, 1, \dots, d-1.(3)✦

The Claim

Theorem 1. Let xx, NN and dd be natural numbers with xx coprime to NN and N≤dN \le d. Then the operator UU of (3) is unitary: with II the identity on the register, U†U=UU†=I.U^\dagger U = U U^\dagger = I.(4)✦

What Is Checked

The claim is stated over the operator UU of (3), the permutation matrix of πx\pi_x, which is built from the multiplication map fxf_x of (1). About these constructions the library proves that fxf_x is one to one whenever xx is coprime to NN, the fact that makes πx\pi_x in (2) a permutation of the dd labels.