Custom backends =============== .. py:module:: ket.clib.libket.execution Ket runs programs through an *execution target*. Besides the built-in KBW simulators, a target can be any object that subclasses one of the base classes below (from ``ket.clib.libket.execution``) and is passed to :class:`~ket.base.Process`: .. code-block:: python from ket import Process from ket.npsim import NPSim p = Process(NPSim(num_qubits=4)) - :class:`BatchExecution` receives the whole circuit at once, when a result is first needed. Use it for QPUs and remote services (see :class:`~ket.ibm.IBMDevice` and :class:`~ket.amazon.AmazonBraket`). - :class:`LiveExecution` receives each gate as soon as it is applied, so measurement results are available right away (see :class:`~ket.npsim.NPSim`). - :class:`NativeGateSet` translates gates into the instruction set of a device (see :mod:`ket.gateset`). Override only the callbacks that the target supports: the others raise :class:`CallbackNotImplementedError`. .. autosummary:: :nosignatures: BatchExecution LiveExecution NativeGateSet CallbackNotImplementedError .. autoclass:: ket.clib.libket.execution.BatchExecution :members: .. autoclass:: ket.clib.libket.execution.LiveExecution :members: .. autoclass:: ket.clib.libket.execution.NativeGateSet :members: .. autoexception:: ket.clib.libket.execution.CallbackNotImplementedError :show-inheritance: