from qiskit import IBMQ, execute
from qiskit.providers.ibmq.managed import IBMQJobManager
from qiskit.providers.ibmq.job import job_monitor
from qiskit.circuit.random import random_circuit

IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend('simulator_statevector')

# list all jobs which have been executed from our provider in the past
for job in backend.jobs():
    print(job.job_id())
    job_monitor(job)


qc = random_circuit(num_qubits=5, depth=4, measure=True)
qc.draw(output='mpl')

job = execute(qc, backend, shots=4096, job_name="test_job_name", job_tags=["test", "job"])
job_monitor(job)

counts = job.result().get_counts(0)
counts

