import numpy as np
from qiskit import *

# Create a Quantum Circuit acting on a quantum register of three qubits
qc = QuantumCircuit(1)
qc.x(0)
qc.h(0) #set qubit to superposition
qc.z(0) #add Z gate to rotate out of phase by pi/2
#write the next lines to execute circuit and capture results

qc.draw('mpl')

# Import Aer
from qiskit import Aer

# Run the quantum circuit on a statevector simulator backend
backend = Aer.get_backend('statevector_simulator')

# Create a Quantum Program for execution
job = backend.run(qc)

result = job.result()

outputstate = result.get_statevector(qc, decimals=3)
print(outputstate)

from qiskit.visualization import plot_state_city
plot_state_city(outputstate)

from qiskit.visualization import plot_state_qsphere
%matplotlib inline

plot_state_qsphere(outputstate)