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 QASM simulator as default backend and register a QuantumFloat in it:

>>> from qiskit import Aer
>>> qasm_sim = Aer.get_backend("qasm_simulator")
>>> from qrisp.interface import QiskitBackend
>>> vrtl_qasm_sim = QiskitBackend(qasm_sim)
>>> from qrisp import QuantumSession, QuantumFloat
>>> qs = QuantumSession(vrtl_qasm_sim)
>>> qf = QuantumFloat(4, qs = qs)