API documentation

class pytket.extensions.iqm.backends.iqm.IQMBackend(device, api_token=None, server_url=None)[source]

Interface to an IQM device or simulator.

circuit_status(handle)[source]

Return a CircuitStatus reporting the status of the circuit execution corresponding to the ResultHandle

Return type:

CircuitStatus

default_compilation_pass(optimisation_level=1)[source]

A suggested compilation pass that will will, if possible, produce an equivalent circuit suitable for running on this backend.

At a minimum it will ensure that compatible gates are used and that all two- qubit interactions are compatible with the backend’s qubit architecture. At higher optimisation levels, further optimisations may be applied.

This is a an abstract method which is implemented in the backend itself, and so is tailored to the backend’s requirements.

Parameters:

optimisation_level (int) –

The level of optimisation to perform during compilation.

  • Level 0 does the minimum required to solves the device constraints, without any optimisation.

  • Level 1 additionally performs some light optimisations.

  • Level 2 (the default) adds more computationally intensive optimisations that should give the best results from execution.

Return type:

BasePass

Returns:

Compilation pass guaranteeing required predicates.

get_metadata(handle, **kwargs)[source]

Return the metadata corresponding to the handle.

Use keyword arguments to specify parameters to be used in retrieving the metadata.

  • timeout: maximum time to wait for remote job to finish

Example usage:

n_shots = 100 backend.run_circuit(circuit, n_shots=n_shots, timeout=30) handle = backend.process_circuits([circuit], n_shots=n_shots)[0] result = backend.get_result(handle) metadata = backend.get_metadata(handle) print([qm.physical_name for qm in metadata.request.qubit_mapping])

Parameters:

handle (ResultHandle) – handle to results

Return type:

Metadata

Returns:

Metadata corresponding to handle

get_result(handle, **kwargs)[source]

See pytket.backends.backend.Backend.get_result(). Supported kwargs: timeout (default 900).

Return type:

BackendResult

process_circuits(circuits, n_shots=None, valid_check=True, **kwargs)[source]

See pytket.backends.backend.Backend.process_circuits().

Supported kwargs: :rtype: list[ResultHandle]

  • postprocess: apply end-of-circuit simplifications and classical postprocessing to improve fidelity of results (bool, default False)

  • simplify_initial: apply the pytket SimplifyInitial() pass to improve fidelity of results assuming all qubits initialized to zero (bool, default False)

rebase_pass()[source]

A single compilation pass that when run converts all gates in a Circuit to an OpType supported by the Backend (ignoring architecture constraints).

Return type:

BasePass

Returns:

Compilation pass that converts gates to primitives supported by Backend.

property backend_info: BackendInfo

Retrieve all Backend properties in a BackendInfo object, including device architecture, supported gate set, gate errors and other hardware-specific information.

Returns:

The BackendInfo describing this backend if it exists.

property required_predicates: list[Predicate]

The minimum set of predicates that a circuit must satisfy before it can be successfully run on this backend.

Returns:

Required predicates.

exception pytket.extensions.iqm.backends.iqm.IqmAuthenticationError[source]

Raised when there is no IQM access credentials available.

exception pytket.extensions.iqm.backends.iqm.IqmDeviceUnsupportedError(reason)[source]

Raised when we are unable to support a requested device.

class pytket.extensions.iqm.backends.config.IQMConfig(api_token)[source]

Holds config parameters for pytket-iqm.

classmethod from_extension_dict(ext_dict)[source]

Abstract method to build PytketExtConfig from dictionary serialized form.

Return type:

IQMConfig

pytket.extensions.iqm.backends.config.set_iqm_config(api_token=None)[source]

Set default value for IQM API token.

Return type:

None