Skip to content

bloqade.device.ExpectationDeviceMixin

← Module overview

classExpectationDeviceMixinsource

bloqade.device.ExpectationDeviceMixin

Bases: AbstractDevice[ExpectTaskType]

class ExpectationDeviceMixin

methodexpectsource

bloqade.device.ExpectationDeviceMixin.expect

Signature
def expect(kernel: ir.Method[Params, RetType], observable: ir.Method[[RetType], ObsType], args: tuple[Any, ...] = (), kwargs: dict[str, Any] | None = None, *, shots: int = 1) -> ObsType

Returns the expectation value of the given observable after running the task.

Parameters

NameTypeDefaultDescription
kernelir.Method[Params, RetType]required
observableir.Method[[RetType], ObsType]required
argstuple[Any, ...]()
kwargsdict[str, Any] | NoneNone
shotsint1

Returns

ObsType

source