Is there a command to review queue length for an IonQ job?

39 Views Asked by At

When running jobs on IonQ I notice that there's a lot of variation in the running time. sometimes it's almost instant, sometimes hours. Is there a method to preview the job waiting time or queue before I submit a job, or review it while a job is waiting? In this case I'm using qiskit on the front end.

1

There are 1 best solutions below

0
davidryan On BEST ANSWER

It's common for cloud-accessible QPUs and other quantum hardware to have queues with somewhat unpredictable length. This is partly due to the downtimes involved in maintaining quantum devices in this current era of the technology, but there's also downtime due to partners or other priority users. And lastly, there's the natural peak times which might be hard to predict.

A pattern that is suggested by the documentation is to set up a block to poll for status, but "you can also just call qpu_job.result() and wait — it will block until the job is done".

from qiskit.providers.jobstatus import JobStatus
import time
# Check if job is done
while qpu_job.status() is not JobStatus.DONE:
    print("Job status is", qpu_job.status() )
    time.sleep(60)

# grab a coffee! This can take up to a few minutes.
# once we break out of that while loop, we know our job is finished
print("Job status is", qpu_job.status() )
print(qpu_job.get_counts()) # these counts are the “true” counts from the actual QPU Run
Job status is JobStatus.QUEUED
Job status is JobStatus.QUEUED
Job status is JobStatus.QUEUED
Job status is  JobStatus.DONE
{'00': 485, '01': 9, '0011': 530}