The Qiskit textbook shows the following circuit for implementing the phase $(\frac{s}{r})$ estimation stage of Shor's algorithm for factorizing 15:
My understanding is that the register of qubits 8-11 should be initialized to the state $|1\rangle$ which is the sum over $s \in \{0, .., r-1\}$ of the eigenstates$\frac{1}{\sqrt r}\sum_{k=0}^{r-1}e^{-\frac{2\pi i s k}{r}}|a^k \mod N\rangle$ of the modular multiplication operator $U|y\rangle = |ay \mod N \rangle$.
But the 4-qubit representation of $|1\rangle$ is $|0001\rangle$ and not $|1000\rangle$.
So, shouldn't we set $q_8$ (the lsb of the modular exponentiation circuits) to 1 instead of $q_{11}$?
$\begingroup$
$\endgroup$
2
-
1$\begingroup$ Thanks for spotting this problem. Can you please report this as an issue on the textbook repo so that we can correct it? Thank you. github.com/qiskit-community/qiskit-textbook/issues/… $\endgroup$– Junye HuangCommented Aug 3, 2022 at 9:22
-
$\begingroup$ It has already been reported: github.com/qiskit-community/qiskit-textbook/issues/1462 $\endgroup$– antonantalCommented Aug 3, 2022 at 10:28
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
I believe you're correct and this is an inconsistency in the textbook. Since they initialize the state backwards but also do the modular multiplication backwards (as you also pointed out), it seems like they are consistently inconsistent and so it doesn't affect the results, but should be fixed for consistency/clarity.