bloqade.device.ExpectationDeviceMixin
← Module overview
class
method
source
classExpectationDeviceMixin¶source
bloqade.device.ExpectationDeviceMixin
Bases: AbstractDevice[ExpectTaskType]
class ExpectationDeviceMixinmethodexpect¶source
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) -> ObsTypeReturns the expectation value of the given observable after running the task.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
kernel | ir.Method[Params, RetType] | required | |
observable | ir.Method[[RetType], ObsType] | required | |
args | tuple[Any, ...] | () | |
kwargs | dict[str, Any] | None | None | |
shots | int | 1 |
Returns
ObsType