Lean, informalized

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

Exercise 5.23 - Both Fourier sums over ℓ1,ℓ2\ell_1, \ell_2 in closed form, for the two signs of the phase

Inverting the Fourier transform of the discrete logarithm.

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

The quantum algorithm for the discrete logarithm works modulo a positive integer NN. It is given a unit aa of the integers modulo NN, of order rr, the least positive integer with ar=1mod⁡Na^r = 1 \bmod N, together with a power b=asmod⁡Nb = a^s \bmod N, and the unknown is the exponent ss. The algorithm evaluates the function of two exponents f(x1,x2)=asx1+x2mod⁡N=bx1ax2mod⁡Nf(x_1, x_2) = a^{s x_1 + x_2} \bmod N = b^{x_1} a^{x_2} \bmod N(1) and writes its values on a register of dimension NN.

The Fourier transform over both exponents takes the states |f(x1,x2)⟩|f(x_1, x_2)\rangle of that register to states |fˆ(ℓ1,ℓ2)⟩|\hat f(\ell_1, \ell_2)\rangle, labelled by integers ℓ1\ell_1 and ℓ2\ell_2 from 00 to r−1r - 1. The exercise runs the transform backwards: it sums the states |fˆ(ℓ1,ℓ2)⟩|\hat f(\ell_1, \ell_2)\rangle over both labels with the phases e±2πi(ℓ1x1+ℓ2x2)/re^{\pm 2\pi i (\ell_1 x_1 + \ell_2 x_2)/r} and asks which state of the register comes out. The library gives the answer for both signs of the exponent.

A Quantum System

A quantum system SS is a physical object whose state space is a finite dimensional complex Hilbert space.✦ A pure state |ψ⟩|\psi\rangle of a system SS is a unit vector in the state space of SS, determined physically up to a global phase.✦ The qudit with dd levels is the quantum system whose state space is ℂd\mathbb{C}^d itself, with its standard inner product, and for a level ii less than dd the computational basis state |i⟩|i\rangle of the qudit is the pure state whose vector has entry 11 at ii and 00 elsewhere.

The register of the exercise is the qudit with NN levels. Its basis states are labelled by residues: for a natural number kk, akmod⁡Na^k \bmod N is the natural number less than NN that represents the power aka^k, and |akmod⁡N⟩|a^k \bmod N\rangle is the basis state it labels.

The Fourier States

The value state |f(x1,x2)⟩|f(x_1, x_2)\rangle for natural numbers x1x_1 and x2x_2 is the basis state |asx1+x2mod⁡N⟩|a^{s x_1 + x_2} \bmod N\rangle of the qudit with NN levels.✦

For a label ℓ\ell less than rr, the eigenstate |uℓ⟩|u_\ell\rangle used in order finding, the algorithm that determines the order rr, is the pure state of the same qudit with NN levels |uℓ⟩=1r∑k=0r−1e−2πiℓk/r|akmod⁡N⟩.|u_\ell\rangle = \frac{1}{\sqrt r} \sum_{k=0}^{r-1} e^{-2\pi i \ell k/r}\, |a^k \bmod N\rangle .(2)✦

The Fourier state |fˆ(ℓ1,ℓ2)⟩|\hat f(\ell_1, \ell_2)\rangle, for labels ℓ1\ell_1 and ℓ2\ell_2 less than rr, is the vector of the state space of the qudit |fˆ(ℓ1,ℓ2)⟩={|uℓ2⟩if ℓ1=sℓ2mod⁡r,0otherwise.|\hat f(\ell_1, \ell_2)\rangle = \begin{cases} |u_{\ell_2}\rangle & \text{if } \ell_1 = s \ell_2 \bmod r, \\ 0 & \text{otherwise.} \end{cases}(3)✦

For natural numbers x1x_1 and x2x_2, the inverse Fourier sum |Φ+(x1,x2)⟩|\Phi_+(x_1, x_2)\rangle is the vector of the state space of the qudit with NN levels obtained by summing the Fourier states over both labels with phases: |Φ+(x1,x2)⟩=1r∑ℓ1=0r−1∑ℓ2=0r−1e2πi(ℓ1x1+ℓ2x2)/r|fˆ(ℓ1,ℓ2)⟩|\Phi_+(x_1, x_2)\rangle = \frac{1}{r} \sum_{\ell_1=0}^{r-1} \sum_{\ell_2=0}^{r-1} e^{2\pi i (\ell_1 x_1 + \ell_2 x_2)/r}\, |\hat f(\ell_1, \ell_2)\rangle(4)✦

For natural numbers x1x_1 and x2x_2, the forward Fourier sum |Φ−(x1,x2)⟩|\Phi_-(x_1, x_2)\rangle is the vector of the state space of the qudit with NN levels obtained by summing the Fourier states over both labels with the phases of the previous sum taken with the opposite sign: |Φ−(x1,x2)⟩=1r∑ℓ1=0r−1∑ℓ2=0r−1e−2πi(ℓ1x1+ℓ2x2)/r|fˆ(ℓ1,ℓ2)⟩.|\Phi_-(x_1, x_2)\rangle = \frac{1}{r} \sum_{\ell_1=0}^{r-1} \sum_{\ell_2=0}^{r-1} e^{-2\pi i (\ell_1 x_1 + \ell_2 x_2)/r}\, |\hat f(\ell_1, \ell_2)\rangle .(5)✦

The Claim

Theorem 1. Let NN be a positive integer, aa a unit of the integers modulo NN of order rr, and ss, x1x_1 and x2x_2 natural numbers. Then |Φ+(x1,x2)⟩=1r|f(x1,x2)⟩|\Phi_+(x_1, x_2)\rangle = \frac{1}{\sqrt r}\, |f(x_1, x_2)\rangle(6)✦ and |Φ−(x1,x2)⟩=1r|a(r−1)(sx1+x2)mod⁡N⟩.|\Phi_-(x_1, x_2)\rangle = \frac{1}{\sqrt r}\, |a^{(r-1)(s x_1 + x_2)} \bmod N\rangle .(7)✦

What Is Checked

The claim is stated over the eigenstates |uℓ⟩|u_\ell\rangle of order finding, which enter both sums through the Fourier states (3), and over the basis states |akmod⁡N⟩|a^k \bmod N\rangle of the qudit with NN levels in which both sides are written.

About these constructions the library proves that each |uℓ⟩|u_\ell\rangle is a pure state of the qudit.