c3.qiskit.c3_job
¶
Module Contents¶
- class c3.qiskit.c3_job.C3Job(backend, job_id, result)[source]¶
Bases:
qiskit.providers.JobV1
C3Job class
- Parameters
Job (JobV1) – Inherits JobV1 from qiskit.providers
- result() qiskit.result.Result [source]¶
Return the result of the job
- Returns
Result of the job simulation
- Return type
qiskit.Result
- status() qiskit.providers.jobstatus.JobStatus [source]¶
Return job status
- Returns
Status of the job
- Return type
qiskit.providers.JobStatus
- job_id() str ¶
Return a unique id identifying the job.
- backend() qiskit.providers.backend.Backend ¶
Return the backend where this job was executed.
- done() bool ¶
Return whether the job has successfully run.
- running() bool ¶
Return whether the job is actively running.
- cancelled() bool ¶
Return whether the job has been cancelled.
- in_final_state() bool ¶
Return whether the job is in a final job state such as
DONE
orERROR
.
- wait_for_final_state(timeout: Optional[float] = None, wait: float = 5, callback: Optional[Callable] = None) None ¶
Poll the job status until it progresses to a final state such as
DONE
orERROR
.- Parameters
timeout – Seconds to wait for the job. If
None
, wait indefinitely.wait – Seconds between queries.
callback –
Callback function invoked after each query. The following positional arguments are provided to the callback function:
job_id: Job ID
job_status: Status of the job from the last query
job: This BaseJob instance
Note: different subclass might provide different arguments to the callback function.
- Raises
JobTimeoutError – If the job does not reach a final state before the specified timeout.
- abstract cancel()¶
Attempt to cancel the job.