I use different qiskit backends to run my code. Since the maximum number of shots is $2^{13}$, sometimes I need to send the same code several times with a "different ticket". I am wondering if there is an equivalent way to run in the background, similar to the command nohup, to run qiskit code so that it runs all the instances one would like (or waiting in the queue as they are sent!)


1 Answer 1


All the jobs are sent in a non-blocking way. You can send all your jobs with job = backend.run and recover their results in a fully different session.

In order to fully recover your Job object from a backend, you need the job id (given you are running Qiskit 0.24 or later. See @jyu00's comment)

You can save your job ids like this:

jobs = []
for circuit in circuits:
  job = backend.run

Later, when the job is done, you can recover each Job object like this:

provider = IBMQ.load_account()
job = provider.get_backend(backend_name).retrieve_job(job_id)
  • 2
    $\begingroup$ You actually don't need the the backend name anymore. You can just do provider.backend.retrieve_job(job_id) (requires Qiskit 0.24). This syntax can also be used to retrieve jobs from retired backends. $\endgroup$
    – jyu00
    May 6, 2021 at 12:15
  • $\begingroup$ Great hint! Updating the answer to reflect that. $\endgroup$
    – luciano
    May 6, 2021 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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