Write , and . The easy starting state is uniform over all -bit labels, so its good fraction is , not . For distinct primes one has . If both primes are odd, and , giving . If one prime is two, the other is an odd prime ; since has bits, , and .
The uniform coprime state for a semiprime can now be prepared by one exact Grover rotation. SetPrepareUse the good subspace spanned by with and . Its squared overlap with is exactly . The Euclidean algorithm supplies a reversible computation of the membership predicate, including the range check; condition a sign flip on membership and the extra qubit being one, then uncompute the workspace. This implements .
The starting-state reflection uses the inverse of its known preparation and a reflection on the all-zero state. Applying once invokes exact amplitude amplification at , and givesThe extra qubit factors off, and the arithmetic workspace is returned to zero. Although the stated range includes , that label is not coprime to itself, so the predicate is equivalent and avoids admitting labels outside the intended range.
The supplied determine in polynomial time; no factoring procedure is needed. Binary arithmetic, range comparison, the reversible greatest common divisor, the two starting-state reflections and the controlled sign flip all have polynomial-size circuits. Thus the construction takes polynomial time in in the ideal model allowing the specified one-qubit state preparation. Exactness uses the rotation with known amplitudes ; with a fixed finite approximate gate library one obtains arbitrary accuracy with precision overhead, rather than an automatic promise of exact state preparation. In the ideal model the preparation succeeds with certainty, without rejection sampling. If desired, the extra can be reset by a Pauli X gate.
Articles by others on the same topic
There are currently no matching articles.