# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, transpile
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
from qiskit.quantum_info import Statevector
from qiskit_aer import AerSimulator

# qiskit-ibmq-provider has been deprecated.
# Please see the Migration Guides in https://ibm.biz/provider_migration_guide for more detail.
from qiskit_ibm_runtime import QiskitRuntimeService, Sampler, Estimator, Session, Options

# Loading your IBM Quantum account(s)
service = QiskitRuntimeService(channel="ibm_quantum")

# Invoke a primitive inside a session. For more details see https://qiskit.org/documentation/partners/qiskit_ibm_runtime/tutorials.html
# with Session(backend=service.backend("ibmq_qasm_simulator")):
#     result = Sampler().run(circuits).result()

import math #may be helpful

coords = [] # Put your code here in this format: [radius, theta, phi]

plot_bloch_vector(coords, coord_type='spherical')

qc = QuantumCircuit(1)
# Add your code here

sv = Statevector(qc)
plot_bloch_multivector(sv)

# You will already have defined 'qc' in the code cell above. Use that circuit for this exercise.

backend = # Choose your backend - this should be the Aer Simulator!
job = # Run your circuit through a job
result = # Get the result from the job
counts = # Get the counts dictionary from the result

plot_histogram(counts)

