Quantum Fourier Transform, Quantum Phase Estimation, Shors Algorithm, Quantum Computing, Qiskit.
circ.to_gate() U_multi.name = '7Mod15_[2^{}]'.format(k) cU_multi = U_multi.control() return cU_multi def shor_qpe(k): a = 7 #Step 1. Begin a while loop until a nontrivial guess is found N = 15 count = k while True: #Step 2a. Construct a QPE circuit with m phase count qubits # to guess the phase phi