1
$\begingroup$

I was preparing for the exam and I was confused about how to get job and backend status using qiskit, do we use Job_monitor for both of them?

$\endgroup$

1 Answer 1

2
$\begingroup$

We use Job_monitor to get the status of a job (IBMQJob instance)

To get the status of an IBMQ backend, we use IBMQBackend.status() which returns a BackendStatus instance:

from qiskit import IBMQ

if IBMQ.active_account() is None:
    IBMQ.load_account()

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

print('Status:')
print('  Operational: ', backend.status().operational)
print('  Pending jobs:', backend.status().pending_jobs)
print('  Status message:', backend.status().status_msg)

Result of this code snippet should be some thing like:

Status:
  Operational:  True
  Pending jobs: 108
  Status message: active
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.