qrunch.quantum.backends.iqm_resonance.iqm_resonance_backend

Module with implementation of IQM’s backend for running quantum circuits.

Classes

IqmJob

Job class for handling job on IQM.

IqmResonanceBackend

Class for handling IQM's quantum devices.

IqmResonanceDevices

Available IQM devices.

class IqmJob

Bases: BackendJob

Job class for handling job on IQM.

__init__(backend: IqmResonanceBackend, job_id: UUID, mappings: list[dict[int, int]], shots: int, error_log: str) None

Initialize an IQM job.

Parameters:
  • backend (IqmResonanceBackend) – Backend used for the job.

  • job_id (UUID) – id of the job.

  • mappings (list[dict[int, int]]) – list of the mappings of each circuit.

  • shots (int) – number of shots.

  • error_log (str) – Message to log in case of errors.

Return type:

None

property backend: Backend

Backend used for the job.

cancel() None

Cancel the job.

Return type:

None

property job_id: str

ID of the job.

result() BackendResult

Get the results of the job.

Return type:

BackendResult

status() BackendJobStatus

Return the collective status of all tasks in the job.

Return type:

BackendJobStatus

wait_for_final_state(timeout: float | None = None) None

Wait until the job status is in a final state, i.e., DONE, CANCELLED, or FAILED.

Parameters:

timeout (float | None) – Seconds to wait for the job. If None, wait forever.

Raises:

TimeoutError – If the job does not reach a final state before the specified timeout.

Return type:

None

class IqmResonanceBackend

Bases: Backend

Class for handling IQM’s quantum devices.

__init__(token: str, device: IqmResonanceDevices = IqmResonanceDevices.GARNET, *, is_timeslot: bool = False, compiler: Compiler | None = None, layout_synthesizer: LayoutSynthesizer | None = None, iqm_options: CircuitCompilationOptions | None = None) None

Initialize an IQM backend.

The backend can be used to launch quantum circuits to quantum devices on IQM’s cloud.

Parameters:
  • token (str) – Token used to access IQM’s cloud.

  • device (IqmResonanceDevices) – Device to run circuit on.

  • is_timeslot (bool) – If True, the device is a timeslot device.

  • compiler (Compiler | None) – Compiler for changing into universal gates. the compiler must implement the to_universal_gates method.

  • layout_synthesizer (LayoutSynthesizer | None) – Layout synthesizer to use if the device is not all-to-all connected.

  • iqm_options (CircuitCompilationOptions | None) – Options to be passed to the IQM backend when running the circuits.

Return type:

None

property client: IQMClient

IQM Client.

get_device_data() DeviceData

Get the device data for the IQM backend.

Return type:

DeviceData

property name: str

Name of the backend.

run(circuits: Circuit | Sequence[Circuit], shots: int | None) IqmJob

Run circuit on the backend.

Parameters:
  • circuits (Circuit | Sequence[Circuit]) – circuits to run on backend

  • shots (int | None) – number of shots. Must be a positive integer

Return type:

IqmJob

supports_shots_equals_none() bool

Return whether the backend supports shots = None.

IQM Backend does not support shots = None.

Return type:

bool

class IqmResonanceDevices

Bases: Enum

Available IQM devices.

EMERALD = 'emerald'
EMERALD_MOCK = 'emerald:mock'
GARNET = 'garnet'
GARNET_MOCK = 'garnet:mock'
SIRIUS = 'sirius'
SIRIUS_MOCK = 'sirius:mock'