Applying the transform twice gives
The root-of-unity filter makes the inner sum equal to exactly when and zero otherwise. Hence
Applying modular negation twice gives
Therefore is an involution. Every one of its eigenvalues satisfies , so its spectrum is contained in , as summarized by the square of the quantum Fourier transform.
Put and , with nonnegative integer so the register exists. The geometric sum satisfies
Consequently the matrix with entries has . This proves unitarity and
For a binary output string , expansion of the printed tensor product gives coefficient
Thus the printed product is exactly . It is a correct product decomposition of a Fourier phase state, but the printed recovery identity has inconsistent signs:
by the square of the quantum Fourier transform. To recover instead, use , replacing every product phase by its complex conjugate. Equivalently one may reverse the sign in the definition of . The discrepancy is visible for by taking concentrated at : the printed expression returns the basis vector at . The recovery display also uses as the summation variable on its right while its summand uses ; that dummy variable should be .
For factorization first check . Successive residues are
The first return is . Its half power is , which is neither nor modulo . Therefore
In Shor's algorithm prepare a uniform exponent register of size , conveniently , and reversibly compute into a second register. Measuring that second register, or tracing it out, leaves periodic exponent correlations of period . Conditional on one measured residue, the first register is a superposition over an arithmetic progression of exponents separated by . The quantum Fourier transform converts this periodic structure into peaks near . Continued fractions recover ; when is coprime to , its denominator is . Verify by modular exponentiation and repeat when the reduced denominator is insufficient. For this example is suitable, and useful peaks include those near and . Either transform sign gives the same period information, so the source's inverse-sign error does not invalidate the order-finding mechanism.
Put and , with nonnegative integer so the register exists. The geometric sum satisfies
Consequently the matrix with entries has . This proves unitarity and
For a binary output string , expansion of the printed tensor product gives coefficient
Thus the printed product is exactly . It is a correct product decomposition of a Fourier phase state, but the printed recovery identity has inconsistent signs:
by the square of the quantum Fourier transform. To recover instead, use , replacing every product phase by its complex conjugate. Equivalently one may reverse the sign in the definition of . The discrepancy is visible for by taking concentrated at : the printed expression returns the basis vector at . The recovery display also uses as the summation variable on its right while its summand uses ; that dummy variable should be .
For factorization first check . Successive residues are
The first return is . Its half power is , which is neither nor modulo . Therefore
In Shor's algorithm prepare a uniform exponent register of size , conveniently , and reversibly compute into a second register. Measuring that second register, or tracing it out, leaves periodic exponent correlations of period . Conditional on one measured residue, the first register is a superposition over an arithmetic progression of exponents separated by . The quantum Fourier transform converts this periodic structure into peaks near . Continued fractions recover ; when is coprime to , its denominator is . Verify by modular exponentiation and repeat when the reduced denominator is insufficient. For this example is suitable, and useful peaks include those near and . Either transform sign gives the same period information, so the source's inverse-sign error does not invalidate the order-finding mechanism.
The Part C inverse-transform display also prints as its summation index while the summand uses ; that sum must be over , as in the corrected inverse above.