iqm.qiskit_iqm.iqm_job.IQMJob#

class iqm.qiskit_iqm.iqm_job.IQMJob(backend: IQMBackend, job_id: str, **kwargs)#

Bases: JobV1

Implementation of Qiskit’s job interface to handle circuit execution on an IQM server.

Parameters:
  • backend (IQMBackend) – Backend instance initiating this job.

  • job_id (str) – String representation of the UUID generated by IQM server.

  • kwargs – Arguments to be passed to the initializer of the parent class.

Attributes

Methods

_format_iqm_results(iqm_result)

Convert the measurement results for a batch of circuits into the Qiskit format.

_format_measurement_results(...[, ...])

Convert the measurement results from a circuit into the Qiskit format.

cancel()

Attempt to cancel the job.

error_message()

Returns the error message if job has failed, otherwise returns None.

queue_position([refresh])

Return the position of the job in the server queue.

result(*[, timeout, cancel_after_timeout])

Retrieve results within defined timeout.

status()

Return the status of the job, among the values of JobStatus.

submit()

Submit the job to the backend for execution.

submit()#

Submit the job to the backend for execution.

cancel() bool#

Attempt to cancel the job.

Returns:

True if the job was cancelled successfully, False otherwise

Return type:

bool

result(*, timeout: float = 900, cancel_after_timeout: bool = False) Result#

Retrieve results within defined timeout.

Parameters:
  • timeout (float) – Time limit for client to get result, in seconds.

  • cancel_after_timeout (bool) – Whether client will try to cancel the job if timeout exceeded.

Returns:

Result if retrieved successfully.

Raises:
Return type:

Result

status() JobStatus#

Return the status of the job, among the values of JobStatus.

Return type:

JobStatus

queue_position(refresh: bool = False) int | None#

Return the position of the job in the server queue.

Note

The position is not yet implemented and this function will always return None. The refresh argument is ignored.

Parameters:

refresh (bool) – If True, re-query the server to get the latest value. Otherwise return the cached value.

Returns:

Position in the queue or None if position is unknown or not applicable.

Return type:

int | None

error_message() str | None#

Returns the error message if job has failed, otherwise returns None.

Return type:

str | None