from qiskit import QuantumCircuit,BasicAer,transpile
from qiskit.extensions import *
from qiskit.quantum_info.operators import Operator, Pauli
from qiskit.visualization import *
from math import *
import numpy as np
backend=BasicAer.get_backend('unitary_simulator')

qc=QuantumCircuit(1)
qc.h(0)
qc.x(0)
qc.h(0)
qc.draw()

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

Operator(ZGate()).data

qc=QuantumCircuit(1)
qc.h(0)
qc.z(0)
qc.h(0)
qc.draw()

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

Operator(XGate()).data

qc=QuantumCircuit(1)
qc.h(0)
qc.z(0)

qc.draw(output="mpl")

#visualize_transition(qc)

array_to_latex(Operator(XGate()).data)

array_to_latex(Operator(YGate()).data)

array_to_latex(Operator(ZGate()).data)

array_to_latex(Operator(SGate()).data)

array_to_latex(Operator(SdgGate()).data)

array_to_latex(Operator(TGate()).data)

array_to_latex(Operator(TdgGate()).data)

