You're reading an old version of this documentation. If you want up-to-date information, please have a look at 11.0.

qiskit_iqm.iqm_backend.IQMBackend#

class qiskit_iqm.iqm_backend.IQMBackend(client, **kwargs)#

Bases: qiskit.providers.backend.BackendV2

Qiskit backend enabling the execution of quantum circuits on IQM quantum computers.

Parameters
  • client (IQMClient) – IQM client instance for submitting circuits for execution on an IQM server

  • **kwargs – optional arguments to be passed to the parent Qiskit Backend initializer

Initialize a BackendV2 based backend

Parameters
  • provider – An optional backwards reference to the Provider object that the backend is from

  • name – An optional name for the backend

  • description – An optional description of the backend

  • online_date – An optional datetime the backend was brought online

  • backend_version – An optional backend version string. This differs from the version attribute as version is for the abstract Backend abstract interface version of the object while backend_version is for versioning the backend itself.

  • fields – kwargs for the values to use to override the default options.

  • client (IQMClient) –

Raises

AttributeError – If a field is specified that’s outside the backend’s options

Attributes

max_circuits

The maximum number of circuits (or Pulse schedules) that can be run in a single job.

target

A qiskit.transpiler.Target object for the backend.

Methods

_default_options()

Return the default options

close_client()

Close IQMClient's session with the authentication server.

index_to_qubit_name(index)

Given an index in the backend register return the corresponding IQM-style qubit name ('QB1', 'QB2', etc.).

qubit_name_to_index(name)

Given an IQM-style qubit name ('QB1', 'QB2', etc.) return the corresponding index in the register.

retrieve_job(job_id)

Create and return an IQMJob instance associated with this backend with given job id.

run(run_input, **options)

Run on the backend.

serialize_circuit(circuit)

Serialize a quantum circuit into the IQM data transfer format.

property target: qiskit.transpiler.target.Target#

A qiskit.transpiler.Target object for the backend.

Return type

Target

property max_circuits: Optional[int]#

The maximum number of circuits (or Pulse schedules) that can be run in a single job.

If there is no limit this will return None

run(run_input, **options)#

Run on the backend.

This method returns a Job object that runs circuits. Depending on the backend this may be either an async or sync call. It is at the discretion of the provider to decide whether running should block until the execution is finished or not: the Job class can handle either situation.

Parameters
  • run_input (QuantumCircuit or Schedule or ScheduleBlock or list) – An individual or a list of ScheduleBlock, or Schedule objects to run on the backend.

  • options – Any kwarg options to pass to the backend for running the config. If a key is also present in the options attribute/object then the expectation is that the value specified will be used instead of what’s set in the options object.

Returns

The job object for the run

Return type

Job

retrieve_job(job_id)#

Create and return an IQMJob instance associated with this backend with given job id.

Parameters

job_id (str) –

Return type

qiskit_iqm.iqm_job.IQMJob

close_client()#

Close IQMClient’s session with the authentication server. Discard the client.

qubit_name_to_index(name)#

Given an IQM-style qubit name (‘QB1’, ‘QB2’, etc.) return the corresponding index in the register. Returns None is the given name does not belong to the backend.

Parameters

name (str) –

Return type

Optional[int]

index_to_qubit_name(index)#

Given an index in the backend register return the corresponding IQM-style qubit name (‘QB1’, ‘QB2’, etc.). Returns None if the given index does not correspond to any qubit in the backend.

Parameters

index (int) –

Return type

Optional[str]

serialize_circuit(circuit)#

Serialize a quantum circuit into the IQM data transfer format.

Qiskit uses one measurement instruction per qubit (i.e. there is no measurement grouping concept). While serializing we do not group any measurements together but rather associate a unique measurement key with each measurement instruction, so that the results can later be reconstructed correctly (see MeasurementKey documentation for more details).

Parameters

circuit (qiskit.circuit.quantumcircuit.QuantumCircuit) – quantum circuit to serialize

Returns

data transfer object representing the circuit

Raises

ValueError – circuit contains an unsupported instruction or is not transpiled in general

Return type

iqm_client.Circuit