API documentation

class pytket.extensions.azure.backends.azure.AzureBackend(name, resource_id=None, location=None, connection_string=None, use_string=False)[source]

Interface to Azure Quantum.

classmethod available_devices(cls, **kwargs)[source]

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

Supported kwargs:

  • resource_id (str)

  • location (str)

  • connection_string (str)

  • use_string (bool) = False

If omitted these are read from config, unless the environment variable AZURE_QUANTUM_CONNECTION_STRING is set in which case it is used.

Return type:

list[BackendInfo]

Returns:

A list of BackendInfo objects describing available devices.

average_queue_time_s()[source]

Average queue time in seconds reported by the target.

Return type:

int

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=2, timeout=300)[source]
Parameters:
  • optimisation_level (int) – Allows values of 0, 1, 2 or 3, with higher values prompting more computationally heavy optimising compilation that can lead to reduced gate count in circuits.

  • timeout (int) – Only valid for optimisation level 3, gives a maximimum time for running a single thread of the pass pytket.passes.GreedyPauliSimp(). Increase for optimising larger circuits.

Return type:

BasePass

Returns:

Compilation pass for compiling circuits to Quantinuum devices

get_result(handle, **kwargs)[source]

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

Supported kwargs:

  • timeout (int): timeout in seconds

Return type:

BackendResult

Returns:

Results corresponding to handle.

is_available()[source]

Availability reported by the target.

Return type:

bool

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

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

Supported kwargs:

  • option_params: a dictionary with string keys and arbitrary values; key-value pairs in the dictionary are passed as input parameters to the backend. Their semantics are backend-dependent.

Return type:

list[ResultHandle]

Returns:

Handles to results for each input circuit, as an iterable in the same order as the circuits.

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.

class pytket.extensions.azure.backends.azure.DeviceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Different types of devices

class pytket.extensions.azure.backends.config.AzureConfig(resource_id, location, connection_string, use_string=False)[source]

Holds config parameters for pytket-azure.

classmethod from_extension_dict(ext_dict)[source]

Abstract method to build PytketExtConfig from dictionary serialized form.

Return type:

AzureConfig

pytket.extensions.azure.backends.config.set_azure_config(resource_id=None, location=None, connection_string=None, use_string=False)[source]

Save Azure confuguration.

Return type:

None