Skip to main content
. 2019 Aug 15;21(8):800. doi: 10.3390/e21080800
Algorithm 8: Shor [17]
  Proceed with the following steps to find a candidate for the quotient s/r where s is randomand r is the period of ax mod N.
  1. Prepare a 2n-qubit query register in the state 0 and an n-qubit answer register in the

    state 1.

  2. Apply the quantum Fourier transform to the query register.

  3. Apply the specific unitary Ua,Nxy=xy×axmodN.

  4. Apply the inverse quantum Fourier transform to the query register.

  5. Measure the query register to retrieve a candidate for s/r.

  Return that candidate for s/r.