ExecutorInterface#

Module: iqm.station_control.interface.executor_interface

class ExecutorInterface#

Bases: Serializable, Generic[T_JobDefinition, T_JobTracker]

Interface for managing quantum job execution and results retrieval.

Implementations are responsible for protocol-specific communication with execution backends, such as remote services, local processes, or hardware simulators.

Methods

cancel_job

Cancel a job that has been submitted for execution.

close

Release any resources this executor owns, e.g. in-process background threads.

delete_job

Delete a job that has been submitted for execution.

get_artifact_measurement_counts

Get the measurement counts of a circuit batch execution job.

get_artifact_measurements

Get the measurement results of a circuit batch execution job.

get_artifact_sweep_results

Get the results of an N-dimensional sweep job.

get_channel_properties

Get control channel properties, including hardware limitations and supported instructions.

get_chip_design_record

Get the chip design record for the QPU.

get_dut_label

Get the QPU chip label.

get_experiment_configuration

Get the default experiment configuration for the backend.

get_job

Get status information about an existing job.

get_job_payload

Get the job payload, i.e. the definition used to create the job.

get_or_create_software_version_set

Get software version set ID from the database, or create one if it doesn't exist.

get_settings

Default settings tree of the quantum computer.

get_static_quantum_architecture

Get the simplified QPU topology.

submit_job

Submit a job definition for execution.

close()#

Release any resources this executor owns, e.g. in-process background threads.

Intended to be called by callers managing this executor’s lifecycle when it is about to be replaced or discarded, so it can shut down cleanly before a new executor takes over.

The default implementation is a no-op, appropriate for executors that only talk to a remote service and own no local resources. Executors that do own local resources (e.g. an in-process station engine) should override this.

Return type:

None

abstractmethod get_experiment_configuration()#

Get the default experiment configuration for the backend.

Returns:

Default experiment configuration.

Return type:

dict[str, Any]

abstractmethod get_or_create_software_version_set(software_version_set)#

Get software version set ID from the database, or create one if it doesn’t exist.

Parameters:

software_version_set (dict[str, str])

Return type:

int

abstractmethod get_dut_label()#

Get the QPU chip label.

Return type:

str

abstractmethod get_chip_design_record()#

Get the chip design record for the QPU.

Return type:

dict[str, Any]

abstractmethod get_static_quantum_architecture()#

Get the simplified QPU topology.

Use get_chip_design_record() for more detailed QPU topology information.

Return type:

StaticQuantumArchitecture

abstractmethod get_channel_properties()#

Get control channel properties, including hardware limitations and supported instructions.

Return type:

dict[str, ChannelProperties]

abstractmethod get_settings()#

Default settings tree of the quantum computer.

Contains the available settings of the control instruments, and their default values.

Return type:

SettingNode

abstractmethod submit_job(job_definition, *, use_timeslot=False, _iteration_id=None)#

Submit a job definition for execution.

Parameters:
  • job_definition (T_JobDefinition) – The content of the job to be created (e.g. and experiment run, or a batch of quantum circuits).

  • use_timeslot (bool) – Iff True, submit the job to the priority timeslot queue; otherwise, submit it to the shared FIFO queue.

  • _iteration_id (str | UUID | None) – Iff not None, submit the job into the FIFO queue of an iteration (which must exist, and belong to you). The job will run inside that iteration, and is billed as a part of it. Mutually exclusive with use_timeslot=True.

Returns:

A JobTracker instance wrapping the submitted job, providing methods to track progress and retrieve results.

Return type:

T_JobTracker

abstractmethod get_job(job_id)#

Get status information about an existing job.

Allows for managing jobs submitted in previous sessions or by other clients.

Parameters:

job_id (str | UUID) – The ID of the job to query.

Returns:

Current status and metadata of the job.

Return type:

JobData

abstractmethod get_job_payload(job_id, job_type)#

Get the job payload, i.e. the definition used to create the job.

Parameters:
  • job_id (str | UUID) – ID of the job to query.

  • job_type (Literal['run', 'circuit'])

Returns:

Job payload.

Return type:

T_JobDefinition

abstractmethod get_artifact_sweep_results(job_id)#

Get the results of an N-dimensional sweep job.

Raises an error if the results are not available.

Parameters:

job_id (str | UUID) – ID of the job to query.

Returns:

Results of the sweep job.

Return type:

dict[str, list[ndarray]]

abstractmethod get_artifact_measurements(job_id)#

Get the measurement results of a circuit batch execution job.

Raises an error if the results are not available.

Parameters:

job_id (str | UUID) – ID of the job to query.

Returns:

For each circuit in the batch, the measurement results.

Return type:

list[dict[str, list[list[int]]]]

abstractmethod get_artifact_measurement_counts(job_id)#

Get the measurement counts of a circuit batch execution job.

Raises an error if the results are not available.

Parameters:

job_id (str | UUID) – ID of the job to query.

Returns:

For each circuit in the batch, the measurement counts.

Return type:

list[CircuitMeasurementCounts]

abstractmethod cancel_job(job_id)#

Cancel a job that has been submitted for execution.

A canceled job will remain in the execution record, but it will not proceed further. If the job is currently being executed, it is interrupted. If the job has already reached a terminal state (completed or failed), it will remain in that state.

Parameters:

job_id (str | UUID) – ID of the job to be canceled.

Return type:

None

abstractmethod delete_job(job_id)#

Delete a job that has been submitted for execution.

Works like cancel_job(), but also removes the job from the IQM Server database.

Warning

There is no way to recover a deleted job.

Parameters:

job_id (str | UUID) – ID of the job to be deleted.

Return type:

None

Inheritance

Inheritance diagram of iqm.station_control.interface.executor_interface.ExecutorInterface