symop.polynomial.kernels.devices.filter

Polynomial density kernel for filter-like attenuation device.

This module implement a polynomial-density kernel that applies mode-dependent atenuation through a pure-loss dilation.

For each affected mode with transmissivity \(\eta\), the channel is realized by coupling the signal mode to a fresh vacuum environment mode through a beamsplitter dilation, followed by tracing out the environment.

Notes

The semantic planning stage is expected to provide the mapping

action.params["eta_by_mode"]

from input mode signatures to transmissivities.

Any output relabeling should be expressed through action.edits and is applied by the device after kernel execution. The kexnel itself should only perform the representation-specific transformation.

Functions

filter_poly_density(*, state, action, ctx)

Apply mode-dependent attenuation to a polynomial density state.

filter_poly_ket(*, state, action, ctx)

Apply mode-dependent attenuation to a polynomial ket state.

class _FilterKernelParams(eta_by_mode: Mapping[Any, float]) None

Bases: object

Parsed krenel parameters for attenuation-style filter devices.

Parameters:

eta_by_mode (Mapping[Any, float])

eta_by_mode
Type:

Mapping[Any, float]

eta_by_mode: Mapping[Any, float]
_make_env_mode_for_loss(*, ctx: ApplyContext, signal_mode: Any) Any

Create a fresh environment mode for a pure-loss dilation.

Parameters:
  • ctx (ApplyContext) – Apply context used to allocate a fresh environment path.

  • signal_mode (Any) – Signal mode to be attenuated.

Returns:

Environment mode matching the signal mode envelope on a fresh path.

Return type:

Any

_parse_filter_params(action: DeviceAction) _FilterKernelParams

Extract and validate kernel parameters from a device action.

Parameters:

action (DeviceAction) – Semantic device action produced during planning.

Returns:

Parsed attenuation parameters.

Return type:

_FilterKernelParams

Raises:

TypeError – If action.params or action.params["eta_by_mode"] does not have the expected mapping shape.

filter_poly_density(*, state: DensityPolyState, action: DeviceAction, ctx: ApplyContext) DensityPolyState

Apply mode-dependent attenuation to a polynomial density state.

Parameters:
  • state (DensityPolyState) – Input polynomial density state.

  • action (DeviceAction) – Semantic device action containing eta_by_mode in params.

  • ctx (ApplyContext) – Apply context used for fresh environment-path allocation.

Returns:

Output density state after applying all requested pure-loss channels.

Return type:

DensityPolyState

Notes

This kernel performs only the backend-specific channel application. Any label edits are expected to be applied later by the device runtime.

filter_poly_ket(*, state: KetPolyState, action: DeviceAction, ctx: ApplyContext) DensityPolyState

Apply mode-dependent attenuation to a polynomial ket state.

Parameters:
  • state (KetPolyState) – Input polynomial density state.

  • action (DeviceAction) – Semantic device action containing eta_by_mode in params.

  • ctx (ApplyContext) – Apply context used for fresh environment-path allocation.

Returns:

Output density state after applying all requested pure-loss channels.

Return type:

DensityPolyState

Notes

This is a thin wrapper, which expands a ket to dense representation