from qiskit import *
from math import pi
import numpy as np
from qiskit.visualization import plot_bloch_multivector,plot_state_qsphere
import matplotlib.pyplot as plt

q = QuantumRegister(2)

qc = QuantumCircuit(2)
qc.cx(0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))

qc = QuantumCircuit(2)
qc.cy(0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))

qc = QuantumCircuit(2)
qc.cz(0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))

qc = QuantumCircuit(2)
qc.ch(0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))

qc = QuantumCircuit(2)
qc.crz(pi/2,0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))

qc = QuantumCircuit(2)
qc.cu1(pi/2,0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))

qc = QuantumCircuit(2)
qc.cu3(pi/2, pi/2, pi/2, 0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))

qc = QuantumCircuit(2)
qc.swap(0,1)
qc.draw(output='mpl')

backend = Aer.get_backend('unitary_simulator')
job = execute(qc, backend)
result = job.result()
print(result.get_unitary(qc, decimals=3))