from qiskit import *
from qiskit.visualization import plot_bloch_multivector

# Create a quantum circuit with a single qubit
# The default initial state of qubit will be |0> or [1,0]
qc = QuantumCircuit(1)

#Apply the Pauli X-gate on the qubit
qc.x(0)

#Draw the circuit
# qc.draw()
qc.draw('mpl')

#Get the backend for the circuit (simulator or realtime system)
backend = Aer.get_backend('statevector_simulator')


#execute the circuit using the backend
out = execute(qc,backend).result().get_statevector()

#plot the result as a bloch sphere visualization
plot_bloch_multivector(out)

