Quantum Computing, Crypto, Quantum Physics, Cryptography, Education.
QuantumCircuit(n) # Swap qubits to reverse the order of the bitstring for qubit in range(n//2): qc.swap(qubit, n-qubit-1) # Apply the controlled phase shift gates 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 # Define the quantum phase