qrisp.QuantumSession.__init__#

QuantumSession.__init__(backend=None)[source]#

Constructs a QuantumSession

Parameters:
backendBackendClient, optional

The backend on which to execute the circuits created by this QuantumSession. This choice can be overwritten by specifying a backend in the get_measurement method of QuantumVariable.

Returns:
None.

Examples

We create a QuantumSession with the Aer simulator as default backend and register a QuantumFloat in it:

>>> from qiskit_aer import AerSimulator
>>> aer_sim = AerSimulator()
>>> from qrisp.interface import QiskitBackend
>>> vrtl_aer_sim = QiskitBackend(aer_sim)
>>> from qrisp import QuantumSession, QuantumFloat
>>> qs = QuantumSession(vrtl_aer_sim)
>>> qf = QuantumFloat(4, qs = qs)