I am trying to run an optimization problem on IBMQ. Running the same code on QASM simulator works fine. However, changing only the backend name to IBMQX takes long time. I am aware of the queues although, there is no way to track the status of my job. I have followed the same code structure given on qiskit-aqua partition example tutorial. Any help would be really appreciated. Thanks.
3 Answers
Here is tested code (also provided in one of the qiskit tutorials)
lapse = 0
interval = 60
while not job.done:
print('Status @ {} seconds'.format(interval * lapse))
print(job.status)
time.sleep(interval)
lapse += 1
print(job.status)
where interval is giving in seconds (if your job requires longer waiting and execution, I would suggest to increase it). This will provide you information about your queue placement.
There is currently no way to check the status of a job in Qiskit Aqua:
https://github.com/Qiskit/qiskit-aqua/issues/545
However, it looks like it is a feature that is coming.
Depending on what is your definition of "long time" the answer might be different:
- If it is of the order of minutes, then you can't do anything and you just have to wait for your turn in the queue.
- If it is several days, then there might be a problem (or a very very long queue).
Anyway, you can track the status of your job, even if this status does not include its position within the queue. Here is a (non-tested) example:
# Setup everything for Qiskit.
# Create your quantum program
job = qiskit.execute(my_circuits, the_backend)
# Ask for the status
print(job.status()) # will return one of the values listed here:
# https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/backends/jobstatus.py