c12_callisto_clients.pytket.extensions.callisto.backends package

Submodules

c12_callisto_clients.pytket.extensions.callisto.backends.callisto module

Pytket Backend for C12 Callisto quantum emulator

class c12_callisto_clients.pytket.extensions.callisto.backends.callisto.CallistoBackend(backend_name: str, token: str, verbose: bool = False)

Bases: Backend

A pytket Backing wrapper class for the C12 emulator

property backend_info: BackendInfo | None

Getter for obtaining the information about a backend. If the backend is not set, it calls private _get_info method to retrieve the information.

Returns:

BackendInfo or None

circuit_status(handle: ResultHandle) CircuitStatus

Method to get the status of the running job if it takes too much time to execute.

Parameters:

handle – job handle

Returns:

CircuitStatus

default_compilation_pass(optimisation_level: int = 1) BasePass

Abstract method from the Backend class. A suggested compilation pass that will, if possible, produce an equivalent circuit suitable for running on this backend.

Parameters:

optimisation_level

Returns:

static get_available_devices(token: str)

Get all available backends for the device

static get_circuit_status(status: str) StatusEnum

Method to transform C12’s job statuses to the TKET’s StatusEnum values.

Parameters:

status – status of the job

Returns:

corresponding StatusEnum value

Raises:

CallistoRunningException

get_error_message(handle: ResultHandle) str | None

Method to get an error message if the job has failed its execution.

Parameters:

handle – job handle

Returns:

error message or None

get_result(handle: ResultHandle, **kwargs: int | float | str | None) BackendResult

Get the results of the job with a given handle.

static job_id(handle: ResultHandle) str

Returns a job id from the handle. Object to store multidimensional identifiers for a circuit sent to a backend for execution.

Parameters:

handle – ResultHandle of a job

Returns:

UUID of the job

process_circuit(circuit: Circuit, n_shots: int | None = None, valid_check: bool = True, **kwargs: int | float | str | None) ResultHandle

Run a single circuit.

process_circuits(circuits: Sequence[Circuit], n_shots: int | Sequence[int] | None = None, valid_check: bool = True, **kwargs: int | float | str | None) List[ResultHandle]

Method that is called to run the circuit on the backend. It accepts a list of the instances of the Circuit class and a corresponding list of shots.

Internally it calls process_circuit method.

Parameters:
  • circuits – circuits to be run on the backend

  • n_shots – number of shots for each circuit (it can be different)

  • valid_check – if we are verifying the predicates

  • kwargs – additional arguments

Returns:

ResultHandle list

rebase_pass() BasePass

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

property required_predicates: List[Predicate]

Predicates represent the requirements that the circuit needs to satisfy to be able to be run on one backend. This is a property of the class (inherited from the parent, Backend class). It is a list of the instances of the classes whose parent class is a Predicate class.

Returns:

list of the predicates

exception c12_callisto_clients.pytket.extensions.callisto.backends.callisto.CallistoRunningException

Bases: Exception

Callisto Exception

Module contents