IBMCompositeJob#
- class IBMCompositeJob(backend, api_client, job_id=None, creation_date=None, jobs=None, circuits_list=None, run_config=None, name=None, tags=None, client_version=None)[source]#
Representation of a set of jobs that execute on an IBM Quantum backend.
An
IBMCompositeJob
instance is returned when you callIBMBackend.run()
to submit a list of circuits whose length exceeds the maximum allowed by the backend or by themax_circuits_per_job
parameter.This
IBMCompositeJob
instance manages all the sub-jobs for you and can be used like a traditional job instance. For example, you can continue to use methods likestatus()
andresult()
to get the job status and result, respectively.You can also retrieve a previously executed
IBMCompositeJob
using thejob()
andjobs()
methods, like you would with traditional jobs.IBMCompositeJob
also allows you to re-run failed jobs, using thererun_failed()
method. This method will re-submit all failed or cancelled sub-jobs. Any circuits that failed to be submitted (e.g. due to server error) will only be re-submitted if the circuits are known. That is, if thisIBMCompositeJob
was returned byqiskit_ibm_provider.IBMBackend.run()
and not retrieved from the server.Some of the methods in this class are blocking, which means control may not be returned immediately.
result()
is an example of a blocking method, and control will return only after all sub-jobs finish.IBMCompositeJob
uses job tags to identify sub-jobs. It is therefore important to preserve these tags. All tags used internally byIBMCompositeJob
start withibm_composite_job_
.IBMCompositeJob constructor.
- Parameters:
backend (
IBMBackend
) – The backend instance used to run this job.api_client (
AccountClient
) – Object for connecting to the server.job_id (
Optional
[str
]) – Job ID.creation_date (
Optional
[datetime
]) – Job creation date.jobs (
Optional
[List
[IBMCircuitJob
]]) – A list of sub-jobs.circuits_list (
Optional
[List
[Union
[List
[QuantumCircuit
],List
[Schedule
]]]]) – Circuits for this job.run_config (
Optional
[Dict
]) – Runtime configuration for this job.name (
Optional
[str
]) – Job name.tags (
Optional
[List
[str
]]) – Job tags.client_version (
Optional
[Dict
]) – Client used for the job.
- Raises:
IBMJobInvalidStateError – If one or more subjobs is missing.
Attributes
Return version of the client used for this job.
Methods
Return the backend where this job was executed.
Return the backend configuration options used for this job.
Block until all sub-jobs are submitted.
Attempt to cancel the job.
Return whether the job has been cancelled.
Return the circuits or pulse schedules for this job.
Return job creation date, in local time.
Return whether the job has successfully run.
Provide details about the reason of failure.
IBMCompositeJob.from_jobs
(job_id, jobs, ...)Return an instance of this class.
Return the user header specified for this job.
Return whether the job is in a final job state such as
DONE
orERROR
.Return a unique id identifying the job.
Return the name assigned to this job.
Return the backend properties for this job.
Return queue information for this job.
IBMCompositeJob.queue_position
([refresh])Return the position of the job in the server queue.
Obtain the latest job information from the server.
IBMCompositeJob.report
([detailed])Return a report on current sub-job statuses.
Re-submit all failed sub-jobs.
IBMCompositeJob.result
([timeout, wait, ...])Return the result of the job.
Return whether the job is actively running.
Return the scheduling mode the job is in.
Query the server for the latest job status.
IBMCompositeJob.sub_job
(circuit_index)Retrieve the job used to submit the specified circuit.
IBMCompositeJob.sub_jobs
([block_for_submit])Return all submitted sub-jobs.
Unsupported method.
Return the tags assigned to this job.
Return the date and time information on each step of the job processing.
Update the name associated with this job.
IBMCompositeJob.update_tags
(new_tags)Update the tags associated with this job.
Wait until the job progresses to a final state such as
DONE
orERROR
.