# Useful additional packages 
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
from math import pi

from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.tools.visualization import circuit_drawer
from qiskit.quantum_info import state_fidelity
from qiskit import BasicAer

backend = BasicAer.get_backend('unitary_simulator')

q = QuantumRegister(1)

qc = QuantumCircuit(q)
qc.u3(pi/2,pi/2,pi/2,q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.u2(pi/2,pi/2,q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.u1(pi/2,q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.iden(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.x(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.y(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.z(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.h(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.s(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.sdg(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.t(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.tdg(q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.rx(pi/2,q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.ry(pi/2,q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

qc = QuantumCircuit(q)
qc.rz(pi/2,q)
qc.draw(output='mpl')

job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)

import qiskit.tools.jupyter
%qiskit_version_table
%qiskit_copyright

