_IQMServerClient#

Module: iqm.iqm_server_client.iqm_server_client

class iqm.iqm_server_client.iqm_server_client._IQMServerClient(iqm_server_url: str, *, quantum_computer: str | None = None, token: str | None = None, tokens_file: str | None = None, client_signature: str | None = None, enable_opentelemetry: bool = False, timeout: float = 120.0)#

Bases: object

Client implementation for IQM Server REST API.

Warning

_IQMServerClient is an unstable, private API. It may change without notice. Do not use it outside this package.

Parameters:
  • iqm_server_url (str) – Remote IQM Server URL to connect to.

  • quantum_computer (str | None) – ID or alias of the quantum computer to connect to, if the IQM Server instance controls more than one.

  • token (str | None) – Long-lived IQM token in plain text format.

  • tokens_file (str | None) – Path to a tokens file used for authentication.

  • client_signature (str | None) – String that is added to the User-Agent header of requests sent to the server.

  • enable_opentelemetry (bool) – Iff True, enable Jaeger/OpenTelemetry tracing.

  • timeout (float) – Timeout for the request in seconds.

Attributes

api_version

API version of the IQM Server API this client is using.

quantum_computer

Human-readable alias of the quantum computer this client connects to.

Methods

cancel_job

Cancel a job.

delete_job

Delete a job with the given ID.

get_about

Get information about IQM Server.

get_about_station

Get information about Station Control.

get_calibration_set

Get a calibration set from the database.

get_calibration_set_quality_metric_set

Get the latest quality metric set for the given calibration set ID.

get_channel_properties

Get the channel properties from the quantum computer.

get_chip_design_records

Get the chip design records of the quantum computer.

get_duts

Get the DUT(s) of the quantum computer.

get_dynamic_quantum_architecture

Get the dynamic quantum architecture for the given calibration set ID.

get_health

Get the status of the IQM Server.

get_job

Get the current status and metadata of the job.

get_job_artifact_measurement_counts

Get the "measurement_counts" artifact of the given circuit job.

get_job_artifact_measurements

Get the "measurements" artifact of the given circuit job.

get_job_artifact_sweep_results

Get N-dimensional sweep results from the database for the given sweep job.

get_settings

Default settings tree of the quantum computer, as defined in the configuration files.

get_static_quantum_architectures

Get the static quantum architecture(s) of the quantum computer.

get_submit_circuits_payload

Get the job payload, i.e. the contents of the run request sent to IQM Server.

get_submit_run_payload

Get the job payload, i.e. the contents of the run definition sent to IQM Server.

normalize_url

Validate the connection details, provide some backwards compatibility.

submit_circuits

Submit a batch of quantum circuits for execution.

submit_run

Submit an experiment run for execution.

submit_sweep

Submit an N-dimensional sweep for execution.

static normalize_url(iqm_server_url: str, quantum_computer: str | None) tuple[str, str | None, bool]#

Validate the connection details, provide some backwards compatibility.

Parameters:
  • iqm_server_url (str)

  • quantum_computer (str | None)

Return type:

tuple[str, str | None, bool]

property api_version: str#

API version of the IQM Server API this client is using.

property quantum_computer: str#

Human-readable alias of the quantum computer this client connects to.

get_health() dict[str, Any]#

Get the status of the IQM Server.

Return type:

dict[str, Any]

get_about() dict[str, Any]#

Get information about IQM Server.

Return type:

dict[str, Any]

get_about_station() dict[str, Any]#

Get information about Station Control.

Return type:

dict[str, Any]

get_settings() SettingNode#

Default settings tree of the quantum computer, as defined in the configuration files.

Return type:

SettingNode

get_chip_design_records() list[dict[str, Any]]#

Get the chip design records of the quantum computer.

Return type:

list[dict[str, Any]]

get_channel_properties() dict[str, ChannelProperties]#

Get the channel properties from the quantum computer.

Channel properties contain information about the hardware limitations, e.g. the sample rate, granularity and supported instructions for the various control channels.

Returns:

Mapping from channel name to AWGProperties or ReadoutProperties.

Return type:

dict[str, ChannelProperties]

get_duts() list[DutData]#

Get the DUT(s) of the quantum computer.

Return type:

list[DutData]

get_static_quantum_architectures() list[StaticQuantumArchitecture]#

Get the static quantum architecture(s) of the quantum computer.

Return type:

list[StaticQuantumArchitecture]

get_calibration_set(calibration_set_id: str | UUID | Literal['default']) ObservationSetWithObservations#

Get a calibration set from the database.

Parameters:

calibration_set_id (str | UUID | Literal['default'])

Return type:

ObservationSetWithObservations

get_dynamic_quantum_architecture(calibration_set_id: str | UUID | Literal['default']) DynamicQuantumArchitecture#

Get the dynamic quantum architecture for the given calibration set ID.

Returns:

Dynamic quantum architecture of the quantum computer for the given calibration set ID.

Parameters:

calibration_set_id (str | UUID | Literal['default'])

Return type:

DynamicQuantumArchitecture

get_calibration_set_quality_metric_set(calibration_set_id: str | UUID | Literal['default']) ObservationSetWithObservations#

Get the latest quality metric set for the given calibration set ID.

Parameters:

calibration_set_id (str | UUID | Literal['default'])

Return type:

ObservationSetWithObservations

submit_sweep(sweep_definition: SweepDefinition, *, use_timeslot: bool = False) JobData#

Submit an N-dimensional sweep for execution.

Parameters:
  • sweep_definition (SweepDefinition) – The content of the sweep to be created.

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

Returns:

sweep job data, including the job ID that can be used to track it.

Return type:

Upon successful submission

submit_run(run_definition: RunDefinition, *, use_timeslot: bool = False) JobData#

Submit an experiment run for execution.

Parameters:
  • run_definition (RunDefinition) – The content of the run to be created.

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

Returns:

run job data, including the job ID that can be used to track it.

Return type:

Upon successful submission

submit_circuits(run_request: PostJobsRequest, *, use_timeslot: bool = False) JobData#

Submit a batch of quantum circuits for execution.

Parameters:
  • run_request (PostJobsRequest) – Circuit execution request.

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

Returns:

circuit job data, including the job ID that can be used to track it.

Return type:

Upon successful submission

get_job(job_id: str | UUID) JobData#

Get the current status and metadata of the job.

Parameters:

job_id (str | UUID)

Return type:

JobData

cancel_job(job_id: str | UUID) None#

Cancel a job.

A canceled job will remain in the server database, but it will not be executed. If the job is currently being executed, it is interrupted. If the job was already executed (or failed), it will remain in its current terminal state.

Parameters:

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

Return type:

None

delete_job(job_id: str | UUID) None#

Delete a job with the given ID.

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

Parameters:

job_id (str | UUID)

Return type:

None

get_submit_run_payload(job_id: str | UUID) RunDefinition#

Get the job payload, i.e. the contents of the run definition sent to IQM Server.

Parameters:

job_id (str | UUID)

Return type:

RunDefinition

get_submit_circuits_payload(job_id: str | UUID) PostJobsRequest#

Get the job payload, i.e. the contents of the run request sent to IQM Server.

Parameters:

job_id (str | UUID)

Return type:

PostJobsRequest

get_job_artifact_sweep_results(job_id: str | UUID) dict[str, list[ndarray]]#

Get N-dimensional sweep results from the database for the given sweep job.

Parameters:

job_id (str | UUID)

Return type:

dict[str, list[ndarray]]

get_job_artifact_measurements(job_id: str | UUID) list[dict[str, list[list[int]]]]#

Get the “measurements” artifact of the given circuit job.

Parameters:

job_id (str | UUID)

Return type:

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

get_job_artifact_measurement_counts(job_id: str | UUID) list[CircuitMeasurementCounts]#

Get the “measurement_counts” artifact of the given circuit job.

Parameters:

job_id (str | UUID)

Return type:

list[CircuitMeasurementCounts]

Inheritance

Inheritance diagram of iqm.iqm_server_client.iqm_server_client._IQMServerClient