The Exercise
Shor’s algorithm factors a composite number through order finding. For coprime to , the order of modulo is the least positive integer with . Finding is the one step that needs a quantum computer, and the procedure around it is classical:
If is even, return the factor .
If is a perfect power, for natural numbers and with , return .
Choose at random with . If the greatest common divisor exceeds , return it.
Find the order of modulo with the quantum subroutine.
If is even and , return , a factor of other than and . Otherwise the run fails.
The exercise runs the procedure on with , which is coprime to . It asks whether gets past steps one and two, and then for the order of modulo and the factor that step five returns.
The Claim
The library states the run as six facts about the numbers and .
Theorem 1. Let be the order of modulo . Then (1)✦ (2)✦ (3)✦ (4)✦ (5)✦ and (6)✦
Statements (1) and (2) take past steps one and two of the procedure.
What Is Checked
The theorem is stated over the integers modulo , the residues added and multiplied modulo , in which is the residue : the order in (3) is the order of the residue , and (4) and (5) compare residues. The other three statements concern natural numbers; in (6), is the integer .