I'm having a little trouble fully understanding the final steps of Shor's factoring algorithm.
Given an $N$ we want to factor, we choose a random $x$ which has order $r$.
The first step involves setting up the registers and applying the Hadamard operator. The second step a linear operator is applied. The third step the second register is measured (I believe this step can be performed later instead). The fourth step the discrete Fourier transform is applied to the first register. Then we measure the first register.
Here's where I'm a little hazy:
We get a measurement in the form $\mid j , x^k \textrm{mod} N \rangle $.
From this we can find the convergents of the fraction $ \frac{j}{2^q} $ , the convergents are possible values of the order $ r $. Here do we just try all the convergents $ < N $ and if we don't find $ r $ as one of the convergents do we just start again?
Also how does the probability for possible values $ j $ differ? They way I see it they should all have the same probability but Shor's paper says this isn't the case?
Just a little confused as some papers seem to say different things.
Thanks.