qibo_client package#


qibo_client.config module#

This module implements some constants and custom exceptions

exception qibo_client.config.MalformedResponseError(message='Server response body does not contain all the expected keys')#

Bases: Exception

Exception raised when server responsed body does not contain expected keys

exception qibo_client.config.JobPostServerError(message='Server failed to post job to queue')#

Bases: Exception

Exception raised when server fails to post the job to the queue.

The client should handle such error to aknowledge that job submission was not successful without crashing.

qibo_client.qibo_client module#

The module implementing the TIIProvider class.

qibo_client.qibo_client.wait_for_response_to_get_request(url: str) Response#

Wait until the server completes the computation and return the response.


url (str) – the endpoint to make the request


the response of the get request

Return type:


qibo_client.qibo_client.check_response_has_keys(response: Response, keys: List[str])#

Check that the response body contains certain keys.

  • response (requests.models.Response) – the server response

  • keys (List[str]) – the keys to be checked in the response body


MalformedResponseError – if the server response does not contain all the expected keys.

class qibo_client.qibo_client.Client(url: str, token: str)#

Bases: object

Class to manage the interaction with the QRC cluster.


Check that client and server qibo package installed versions match.

Raise assertion error if the two versions are not the same.

run_circuit(circuit: Circuit, nshots: int = 1000, device: str = 'sim') ndarray | None#

Run circuit on the cluster.

  • circuit (Circuit) – the QASM representation of the circuit to run

  • nshots (int) – number of shots

  • device (str) – the device to run the circuit on. Default device is sim


the numpy array with the results of the computation. None if the job raised an error.

Return type:


qibo_client.tii module#

qibo_client.tii.TII(token: str) Client#

Instantiate a TII Client object.


token (str) – the authentication token associated to the webapp user


the client instance connected to the TII server

Return type:


Module contents#

The qibo_tii_provider package