1
$\begingroup$

The Qiskit textbook shows the following circuit for implementing the phase $(\frac{s}{r})$ estimation stage of Shor's algorithm for factorizing 15: enter image description here
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}$?

$\endgroup$
2

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.