IQMJob#
Module: iqm.qrisp_iqm.backends.iqm_job
- class iqm.qrisp_iqm.backends.iqm_job.IQMJob(job: T_JobTracker, *, backend: iqm.qrisp_iqm.backends.backend.IQMBackend)#
Bases:
Job,Generic[T_JobTracker]ABC for wrapping IQM job trackers, shared by circuit-level and pulse-level jobs.
Implements routines that do not differ between the two submission paths: status polling, cancellation, and the high-level result-retrieval flow.
- Parameters:
job (T_JobTracker) – The IQM job tracker for an existing job. Used when retrieving a previously submitted job via
retrieve_job().backend (qrisp_IQMBackend) – The backend instance that created this job.
Notes
Jobs are normally created by
run_async()and should not be instantiated directly by the user.Attributes
The
IQMBackendthat created this job.Methods
Attempt to cancel the job on the IQM server.
Block until the job completes and return its measurement results.
Query and return the current job status.
- property backend: iqm.qrisp_iqm.backends.backend.IQMBackend#
The
IQMBackendthat created this job.
- result(timeout: float | None = None) JobResult#
Block until the job completes and return its measurement results.
Waits for the IQM job to reach a terminal state on the server, and then parses and returns the measurement counts, or raises an appropriate error.
- Parameters:
timeout (float | None) – Maximum number of seconds to wait for the job to finish.
Nonemeans use the default client timeout.- Returns:
The measurement results.
- Raises:
TimeoutError – If
timeoutis specified and the job does not finish in time.JobFailureError – If the job terminated with an error.
JobCancelledError – If the job was cancelled.
- Return type:
JobResult
- cancel() bool#
Attempt to cancel the job on the IQM server.
- Returns:
Trueiff cancellation was successful.- Return type:
- status() JobStatus#
Query and return the current job status.
This is a live query that fetches the latest status from the IQM server, which involves a network call.
- Returns:
The current status of the job.
- Return type:
JobStatus
Inheritance
