Quantum Computing, Crypto, Quantum Physics, Cryptography, Education.
multiplication by a mod 15""" # Check if a is valid if a not in [2,4,7,8,11,13]: raise ValueError("'a' must be 2,4,7,8,11 or 13") # Define the circuit for a single iteration U = QuantumCircuit(4) if a in [2,13]: U.swap(2,3) U.swap(1,2) U.swap(0,1) if a in [7,8]: U.swap(0,1) U.swap(1,2) U.swap(2,3)