Qiskit
This is Qiskit's
code for Shor’s Algorithm. In this example, we factorize with counting qubits. Remember that we need roughly qubits for obtaining a good accuracy, where is the number of bits needed to represent . Also, notice the implementation of that allows us to reconstruct the period of the function by transferring the phase information into our qubits for measurement. You can find further details at the Qiskit Textbook
here. The code below uses exponentially many gates to apply the operations. The polynomial-gates implementation is given in the references section of Qiskit
on the link provided earlier.
Get hands-on with 1400+ tech skills courses.