I'm working through a problem set, and am stuck on the following problem:
a) What can go wrong in Shor’s algorithm if Q (the dimension of the Quantum Fourier Transform) is not taken to be sufficiently large? Illustrate with an example.
b) What can go wrong if the function, f, satisfies $f(p) = f(q)$ if the period $s$ divides $p − q$, but it’s not an “if and only if” (i.e., we could have $f(p) = f(q)$ even when $s$ doesn’t divide $p − q$)? Note that this does not actually happen for the function in Shor’s algorithm, but it could happen when attempting period finding on an arbitrary function. Illustrate with an example.
c) What can go wrong in Shor’s algorithm if the integer $N$ to be factored is even (that is, one of the prime factors, $p$ and $q$, is equal to 2)? Illustrate with an example.
d) Prove that there can be at most one rational $\frac{a}{b}$, with $a$ and $b$ positive integers, that’s at most $\epsilon$ away from a real number $x$ and that satisfies $b < \frac{1}{\sqrt{2\epsilon}}$. Explain how this relates to the choice, in Shor’s algorithm, to choose Q to be quadratically larger than the integer $N$ that we’re trying to factor.
I've been wrestling with it for a while, and my attempt so far is:
a) When $s$ (the period) does not divide $Q$, a sufficiently large $Q$ ensures that the rational approximation to $\frac{k Q}{s}$ where $k$ is an integer is sufficiently close to determine a unique $s$.
b) There might be more than one period $s$ associated with the function (something like an acoustic beat), so it would be much more difficult to solve for one period individually.
c) Completely lost....
d) I supposed that there existed two different rationals such that $\mid{\frac{a_1}{b_1} - \frac{a_2}{b_2}}\mid> 0$ and tried to force a contradiction using the constraints $\mid\frac{a_\mu}{b_\mu}-x\mid \leq \epsilon$ and $b_\mu < \frac{1}{\sqrt{2\epsilon}}$, but couldn't get it to come out. Either I am making a stupid mistake and/or missing something simple (?).
I am really struggling to gain intuition for Shor's algorithm and its specific steps, so I'm very unconfident when trying to address parts (a) - (c). I'm stumped by (c) especially; isn't Shor's algorithm robust in the sense that it does not matter if $N$ is even or odd? If anyone could point me in the right direction, it would be appreciated. Thanks!