API Reference¶
Here are reported the Qibo backends that support the execution of Quantum Circuits through different cloud service providers.
Qibo Cloud Backend¶
This backend supports qibo-based providers.
- class qibo_cloud_backends.qibo_client.QiboClientBackend(token: str | None = None, project: str | None = None, platform: str | None = None, verbosity: bool = False)[source]¶
Backend for the remote execution of Qibo circuits.
- Parameters:
token (str) – User authentication token. By default this is read from the ‘QIBO_CLIENT_TOKEN’ environment variable.
project (str) – The project to be billed for the service. Defaults to the personal project.
platform (str) – Name of the platform. Defaults to “sim”.
verbosity (str) – Enable verbose mode for the client. Default is False.
- execute_circuit(circuit, initial_state=None, nshots=1000, verbatim=False)[source]¶
Executes the passed circuit.
- Parameters:
circuit (qibo.models.Circuit) – The circuit to execute.
initial_state (ndarray) – The initial state of the circuit. Defaults to |00…0>.
nshots (int) – Total number of shots. Defaults to
1000
.verbatim (bool) – Whether to trigger the automatic transpilation (
verbatim=False
) or execute the circuit as is. Defaults toFalse
.
- Returns:
(qibo.result) The qibo result object containing the outcome of the circuit execution.
Qiskit Cloud Backend¶
This backend supports IBM as provider, namely the qibo circuits are loaded as qiskit circuits and the job is sent to the IBM servers.
Note
The qibo_cloud_backends.qiskit_client.QiskitClientBackend.execute_circuit()
does not take care of any transpilation and expects the passed circuit to be transpiled already.
Note
Circuits with no measurements are not supported yet. Remember to add measurements to your circuit!
- class qibo_cloud_backends.qiskit_client.QiskitClientBackend(token=None, platform=None)[source]¶
Backend for the remote execution of Qiskit circuits on the IBM servers.
- Parameters:
Braket Backend¶
This backend provides support for AWS Braket devices, ranging from the LocalSimulator to the devices available on Amazon Braket. Here, Qibo circuits are translated into Braket circuits and sent to the Braket device. There is an additional option to submit a Qibo circuit written in the device’s native gates and targeting specific qubits, fully avoiding any transpilation. This can be done by changing the default setting from verbatim_circuit=False to verbatim_circuit=True.
Note
If verbatim_circuit=True, the Qibo circuit only undergoes translation to a Braket circuit before execution on qibo_cloud_backends.braket_client.BraketClientBackend.execute_circuit()
. No transpilation will take place on the Braket device. A warning will be raised by the device if the qubits are out of range or if it detects non-native gates.
Note
Circuits with no measurements are not supported yet. Remember to add measurements to your circuit!
- class qibo_cloud_backends.braket_client.BraketClientBackend(device=None, verbatim_circuit=False, verbosity=False, token: str | None = None)[source]¶
- execute_circuit(circuit_qibo, nshots=1000, **kwargs)[source]¶
Executes a Qibo circuit on an AWS Braket device. The device defaults to the LocalSimulator().
- Parameters:
circuit (qibo.models.Circuit) – circuit to execute on the Braket device.
nshots (int) – Total number of shots.
- Returns:
The outcome of the circuit execution.
- Return type:
Measurement outcomes (qibo.measurement.MeasurementOutcomes)