Quantum Computing, Quantum, Quantum Physics, Shors Algorithm, Qiskit.
range(n//2): qc.swap(qubit, n-qubit-1) for j in range(n): for m in range(j): qc.cp(-np.pi/float(2**(j-m)), m, j) qc.h(j) qc.name = "QFT†" return qc With these building blocks we can easily construct the circuit for Shor’s algorithm: # Create QuantumCircuit with N_COUNT counting qubits # plus 4