The Exercise
The discrete logarithm problem gives an element of order and a power , and asks for the exponent , with . The quantum algorithm for it ends by measuring two registers, which yields, for some integer , two real numbers and estimating and modulo one. The exercise is the classical step that follows, finding from , and by continued fractions.
Recovering the Exponent
For a rational number and a modulus , the numerator recovered from is the integer (1)✦ where is the numerator of a rational number in lowest terms.
The discrete logarithm recovered from rational numbers and , with modulus , is the residue modulo , between and , (2)✦ with the inverse of modulo .
The Claim
A real number with continued fraction expansion has, for each , an th convergent, the rational number .
Theorem 1. Let be a positive integer, an integer with , and an integer coprime to ; let and , both between and . Let and be real numbers with and . Then there are indices and with (3)✦
What Is Checked
The claim is stated over the numerator recovery of (1) and the recovered discrete logarithm of (2), evaluated at the exact fractions and , and over the convergents of the continued fractions of the two estimates.