symop.devices.models.beamsplitters¶
Beamsplitter device models.
This package contains semantic models of beamsplitter devices used in linear optical systems.
Beamsplitters are passive two-mode transformations that mix input modes according to a unitary transformation. At the semantic level, these models describe:
how input paths are paired,
how output paths are assigned,
and how device parameters (e.g., reflectivity, phase) are encoded.
The actual transformation of quantum states is performed by representation-specific kernels. The models defined here only construct semantic device actions and label edits required for execution.
Typical devices in this package include:
balanced and unbalanced beamsplitters,
parametrized two-mode couplers,
components used to build interferometers such as Mach–Zehnder setups.
Notes
These models are backend-agnostic and operate purely at the symbolic or semantic planning level.
- class BeamSplitter(theta: float, phi_t: float = 0.0, phi_r: float = 0.0) None¶
Bases:
DeviceBaseIdeal path beamsplitter device.
A beamsplitter acts on matched mode pairs drawn from two input paths. Planning records the participating input modes, output paths, and beamsplitter parameters for backend execution.
- Parameters:
Notes
Planning does not relabel existing modes. The actual two-mode rewrite, including construction of output-path modes, is delegated to the runtime kernel through
action.params["pairs"].- _abc_impl = <_abc._abc_data object>¶
- apply(state: State, *, ports: Mapping[str, Path], selection: object | None = None, runtime: DeviceRuntime | None = None, ctx: ApplyContext | None = None, out_kind: Literal['ket', 'density'] | None = None) State¶
Apply the device to a state through a runtime.
- property kind: DeviceKind¶
Return the device kind identifier.
- plan(*, state: State, ports: Mapping[str, Path], selection: object | None = None, ctx: ApplyContext | None = None) DeviceAction¶
Plan beamsplitter mixing on matched mode pairs.
- Parameters:
state (
State) – Input state whose mode labels are inspected.ports (
Mapping[str,Path]) – Mapping from device-port names to path labels. Must contain"in0","in1","out0", and"out1".selection (
object|None) – Optional selection object forwarded by the runtime. It is not used by this device.ctx (
ApplyContext|None) – Optional apply context forwarded by the runtime. It is not used by this device.
- Returns:
Planned action containing:
params["pairs"]: tuple of beamsplitter pair specificationsedits: always empty for this device
- Return type:
- Raises:
TypeError – If the state does not support path-based mode lookup.
ValueError – If both inputs are populated but contain incompatible numbers of modes.
Notes
The unitary itself is not applied here. This method only prepares semantic pairing and kernel parameters. If one side is missing, the backend kernel is expected to synthesize a matching vacuum partner.
Modules
Path beamsplitter device. |