I'm currently working through the book "Quantum Machine Learning with Python Using Cirq from Google Research and IBM Qiskit" and im at shor's algorithm, more precise at the period finding. So in the picture there is an example of how the unitary/period finding is build with a=2 and N=15. My question is now, how would i do that with a different N. I'm trying to do that with N=21 but im not quite sure how many qubits i would need for that or how exactly this would work. Unitary calculation
I have two ideas for that.
- First would be to use |y⟩ = ∣ y1, y2 , y3 , y4, y5⟩ = |y⟩ = ∣16y1 + 8y2 + 4y3 + 2y4 + y5⟩
- Or my other idea would be: |y⟩ = ∣ y1, y2 , y3⟩ = |y⟩ = ∣16y1 + 4y2 + y3⟩
I also add this picture, for clarifying my question and what i want to achieve.
Quantum circuit implementation of operator U_2