qrmi.qiskit_iqm package#

Submodules#

qrmi.qiskit_iqm.iqm_provider module#

Qiskit backend provider for QRMI IQM backends.

class qrmi.qiskit_iqm.iqm_provider.IQMJobCustom(backend: QRMIBackend, job_id: UUID, circuits: iqm.station_control.interface.models.CircuitBatch, shots: int)[source]#

Bases: JobV1

Qiskit job backed by IQMClientProtocol instead of IQMClient/CircuitJob.

POLL_INTERVAL: float = 2.0#
cancel() → bool[source]#

Attempt to cancel the job.

result(*, timeout: float = 300.0, poll_interval: float = 2.0) → Result[source]#

Poll until the job finishes, then return the Qiskit Result.

status() → JobStatus[source]#

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

submit() → None[source]#

Submit the job to the backend for execution.

class qrmi.qiskit_iqm.iqm_provider.IQMProvider(**_args)[source]#

Bases: object

Provider for IQM backends.

IQMProvider connects to a quantum computer through an IQM Server. If the server requires user authentication, you can provide it either using environment variables, or as keyword arguments to IQMProvider. The user authentication kwargs are passed through to :class:~iqm.iqm_client.iqm_client.IQMClient as is, and are documented there.

Parameters:
  • url – URL of the IQM Server (e.g. “https://resonance.iqm.tech/”).

  • quantum_computer – ID or alias of the quantum computer to connect to, if the IQM Server instance controls more than one (e.g. “garnet”). None means connect to the default one.

get_backend(name: str | None = None, calibration_set_id: UUID | None = None, *, use_metrics: bool = False) → QRMIBackend[source]#

IQMBackend instance associated with this provider.

Parameters:
  • name – Optional name of a facade backend to request, see :class:IQMFacadeBackend.

  • calibration_set_id – ID of the calibration set to be used with the backend. Affects both the transpilation target and the circuit execution. If None, the server default calibration set will be used.

  • use_metrics – If True, the backend will provide calibration data and related quality metrics to the transpilation target to improve the transpilation. The default value is set to False until quality metrics become available on the Resonance API.

Returns:

Backend instance for connecting to a quantum computer.

class qrmi.qiskit_iqm.iqm_provider.QRMIBackend(*args: Any, **kwargs: Any)[source]#

Bases: IQMBackendBase

IQMBackend that uses IQMClientProtocol instead of IQMClient.

Parameters:
  • client – Object satisfying IQMClientProtocol. Its methods map 1-to-1 onto the REST API endpoints used by the original IQMBackend.

  • calibration_set_id – ID of the calibration set to use. None means the server default (queried on every run to detect calset changes).

  • use_metrics – If True, fetch calibration quality metrics from the server.

  • kwargs – Forwarded to IQMBackendBase.

create_run_request(run_input: QuantumCircuit | list[QuantumCircuit], shots: int = 1024, circuit_compilation_options: CircuitCompilationOptions | None = None, circuit_callback: Callable[[list[QuantumCircuit]], Any] | None = None, qubit_index_to_name: dict[int, str] | None = None, **unknown_options) → RunRequest[source]#

Build a RunRequest without submitting it.

Identical logic to the original IQMBackend.create_run_request().

property max_circuits: int | None#

max_circuits property

qrmi: QuantumResource#
run(run_input: QuantumCircuit | list[QuantumCircuit], *, use_timeslot: bool = False, **options) → IQMJobCustom[source]#

Transpile and submit circuits; return a job object.

serialize_circuit(circuit: QuantumCircuit, qubit_index_to_name: dict[int, str] | None = None) → iqm.pulse.Circuit[source]#

Public alias kept for API compatibility with IQMBackend.

Module contents#

QRMI python package for Qiskit IQM