Quantum Computing, Crypto, Quantum Physics, Cryptography, Education.
if a in [4, 11]: U.swap(1,3) U.swap(0,2) if a in [7,11,13]: for q in range(4): U.x(q) U = U.to_gate() U.name = f"{a}^{power} mod 15" c_U = U.control() return c_U # Define the inverse Quantum Fourier Transform circuit def qft_dagger(n): """n-qubit QFTdagger the first n qubits in circ""" qc =