Batch mode can shorten processing time if all jobs can be provided at the outset. If you want to submit iterative jobs, use sessions instead. Using batch mode has these benefits:
- The jobs' classical computation, such as compilation, is run in parallel. Thus, running multiple jobs in a batch is significantly faster than running them serially.
- There is no delay between job, which can help avoid drift.
When batching, jobs are not guaranteed to run in the order they are submitted.
The following example shows how you can divide up a long list of circuits into multiple jobs and run them as a batch to take advantage of the parallel processing.
jobs = 
with Batch(backend) as batch:
estimator = Estimator(batch)
# calls within this context are part of the batch.
for obs_set in observable_sets:
For a full example, see the following tutorials: