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 call IBMBackend.run() to submit a list of circuits whose length exceeds the maximum allowed by the backend or by the max_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 like status() and result() to get the job status and result, respectively.

You can also retrieve a previously executed IBMCompositeJob using the job() and jobs() methods, like you would with traditional jobs.

IBMCompositeJob also allows you to re-run failed jobs, using the rerun_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 this IBMCompositeJob was returned by qiskit_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 by IBMCompositeJob start with ibm_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

IBMCompositeJob.client_version

Return version of the client used for this job.

IBMCompositeJob.version

Methods

IBMCompositeJob.backend()

Return the backend where this job was executed.

IBMCompositeJob.backend_options()

Return the backend configuration options used for this job.

IBMCompositeJob.block_for_submit()

Block until all sub-jobs are submitted.

IBMCompositeJob.cancel()

Attempt to cancel the job.

IBMCompositeJob.cancelled()

Return whether the job has been cancelled.

IBMCompositeJob.circuits()

Return the circuits or pulse schedules for this job.

IBMCompositeJob.creation_date()

Return job creation date, in local time.

IBMCompositeJob.done()

Return whether the job has successfully run.

IBMCompositeJob.error_message()

Provide details about the reason of failure.

IBMCompositeJob.from_jobs(job_id, jobs, ...)

Return an instance of this class.

IBMCompositeJob.header()

Return the user header specified for this job.

IBMCompositeJob.in_final_state()

Return whether the job is in a final job state such as DONE or ERROR.

IBMCompositeJob.job_id()

Return a unique id identifying the job.

IBMCompositeJob.name()

Return the name assigned to this job.

IBMCompositeJob.properties()

Return the backend properties for this job.

IBMCompositeJob.queue_info()

Return queue information for this job.

IBMCompositeJob.queue_position([refresh])

Return the position of the job in the server queue.

IBMCompositeJob.refresh()

Obtain the latest job information from the server.

IBMCompositeJob.report([detailed])

Return a report on current sub-job statuses.

IBMCompositeJob.rerun_failed()

Re-submit all failed sub-jobs.

IBMCompositeJob.result([timeout, wait, ...])

Return the result of the job.

IBMCompositeJob.running()

Return whether the job is actively running.

IBMCompositeJob.scheduling_mode()

Return the scheduling mode the job is in.

IBMCompositeJob.status()

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.

IBMCompositeJob.submit()

Unsupported method.

IBMCompositeJob.tags()

Return the tags assigned to this job.

IBMCompositeJob.time_per_step()

Return the date and time information on each step of the job processing.

IBMCompositeJob.update_name(name)

Update the name associated with this job.

IBMCompositeJob.update_tags(new_tags)

Update the tags associated with this job.

IBMCompositeJob.wait_for_final_state([...])

Wait until the job progresses to a final state such as DONE or ERROR.