symop.devices.models.detectors.number_detector¶
Number-resolving measurement device model.
This module defines NumberDetector, a semantic measurement
device that performs projective number measurements on selected modes.
The device constructs a semantic measurement specification describing a number-resolving measurement over the input port. The resulting semantic actions are later evaluated by backend-specific measurement kernels.
Notes
The detector supports three types of measurement queries:
observation: returns outcome probabilities,
detection: samples an outcome and optionally applies a state update,
postselection: conditions the state on a chosen outcome.
The measurement is defined via
ProjectiveNumberMeasurementSpec and operates on the
selected input paths.
Classes
|
Semantic number-measurement device. |
- class NumberDetector(destructive: bool = True) None¶
Bases:
MeasurementDeviceBaseSemantic number-measurement device.
This device performs projective number measurements on modes associated with its input port.
- Parameters:
destructive (
bool) – Whether the measurement should discard the measured subsystem after a selective update (for detection and postselection).
- _abc_impl = <_abc._abc_data object>¶
- _build_spec(*, ports: Mapping[str, Path]) ProjectiveNumberMeasurementSpec¶
Construct the number-measurement specification.
- property kind: DeviceKind¶
Return the device kind identifier.
- plan_detect(*, state: State, ports: Mapping[str, Path], selection: object | None = None, ctx: ApplyContext | None = None) DetectAction¶
Plan a detection query.
- Parameters:
- Returns:
Semantic action requesting a sampled measurement outcome.
- Return type:
DetectAction
- plan_observe(*, state: State, ports: Mapping[str, Path], selection: object | None = None, ctx: ApplyContext | None = None) ObserveAction¶
Plan an observation query.
- Parameters:
- Returns:
Semantic action requesting outcome probabilities.
- Return type:
ObserveAction
- plan_postselect(*, state: State, outcome: MeasurementOutcome, ports: Mapping[str, Path], selection: object | None = None, ctx: ApplyContext | None = None) PostselectAction¶
Plan a postselection query.
- Parameters:
- Returns:
Semantic action conditioning the state on the selected outcome.
- Return type:
PostselectAction