# Creating quantum circuits
from qiskit import QuantumRegister, QuantumCircuit, ClassicalRegister
from qiskit.tools.visualization import circuit_drawer

qr =  QuantumRegister(5)
cr = ClassicalRegister(5)
qc = QuantumCircuit(qr, cr)

def swap_gate(q_swap, q1, q2):   
    q_swap.cx(q1, q2)
    q_swap.cx(q2,  q1)
    q_swap.cx(q1, q2)
    #q_swap.measure(qr2, cr2)
    #circuit_drawer(q_swap)
    
swap_gate(qc, qr[3], qr[4])
qc.measure(qr, cr)
circuit_drawer(qc)


