!pip install qiskit qiskit-aer

!pip install qiskit
!pip install pylatexenc

from qiskit import *
from qiskit.tools.monitor import job_monitor
from qiskit.tools.visualization import plot_state_qsphere
from qiskit.visualization import plot_histogram, plot_bloch_multivector, array_to_latex


# create a circuit
circuit = QuantumCircuit(1,1)

# Apply Gate
circuit.h(0)

# apply measurement
circuit.measure(0,0)

# draw circuit
circuit.draw(output = 'mpl', initial_state = True)


# select a simulator
simulator = Aer.get_backend('aer_simulator')

# assemble our circuit
qobj = assemble(circuit)

# run on simulator
job = simulator.run(qobj)

# monitoring the process
job_monitor(job)

# get results from job
result = job.result()

# colllect histogram data
count = result.get_counts()

plot_histogram(count)

# import library from QC
from qiskit import IBMQ

# Save API Token
IBMQ.save_account('737fd5837bd6099f57e56b04978b745c124a13757839bf80b239192c46a5e46d516b297fecf9524320e12303ec1b0392ea164895bcfef7e43cd5413f1f0dd179')

# Load account
IBMQ.load_account()

# Select provider
provider = IBMQ.get_provider