from qiskit import *
from math import pi
from qiskit.visualization import plot_bloch_multivector

qc = QuantumCircuit(1)
qc.u3(pi/4,pi/4,pi/4,0)
qc.draw(output='mpl')

# Let's see the result
backend = Aer.get_backend('statevector_simulator')
out = execute(qc,backend).result().get_statevector()
plot_bloch_multivector(out)

qc = QuantumCircuit(1)
qc.u2(pi/4,pi/4,0)
qc.draw(output='mpl')

# Let's see the result
backend = Aer.get_backend('statevector_simulator')
out = execute(qc,backend).result().get_statevector()
plot_bloch_multivector(out)

qc = QuantumCircuit(1)
qc.x(0)
qc.u1(pi/4,0)
qc.draw(output='mpl')

# Let's see the result
backend = Aer.get_backend('statevector_simulator')
out = execute(qc,backend).result().get_statevector()
print(out)
plot_bloch_multivector(out)

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

# Let's see the result
backend = Aer.get_backend('statevector_simulator')
out = execute(qc,backend).result().get_statevector()
plot_bloch_multivector(out)

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

# Let's see the result
backend = Aer.get_backend('statevector_simulator')
out = execute(qc,backend).result().get_statevector()
print(out)
plot_bloch_multivector(out)

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

# Let's see the result
backend = Aer.get_backend('statevector_simulator')
out = execute(qc,backend).result().get_statevector()
print(out)
plot_bloch_multivector(out)











