symop.polynomial.channels.primitives.unitary_dilation

Generic unitary-dilation channels for symbolic density polynomials.

This module provides a reusable density-channel primitive based on a unitary dilation followed by partial trace. It is intended as the generic CPTP construction layer on top of passive linear mode rewrites.

A channel is applied as

\[\Phi(\rho) = \mathrm{Tr}_{E}\!\left[ U\, \rho\, U^\dagger \right],\]

where U acts on an ordered tuple of modes and a chosen subset of those modes is traced out afterward.

Notes

This implementation is especially convenient when some of the modes in the dilation are fresh environment modes that are implicitly treated as vacuum by the polynomial rewrite semantics. This is the same pattern used by the pure-loss channel implementation.

Functions

apply_unitary_dilation_densitypoly(rho, *, ...)

Apply a generic unitary-dilation channel to a density polynomial.

apply_unitary_dilation_densitypoly_direct(...)

Apply a unitary-dilation channel from explicit dilation data.

Classes

UnitaryDilation(modes, U, trace_out_modes[, ...])

Specification of a unitary dilation on an ordered tuple of modes.

class UnitaryDilation(modes: tuple[ModeOp, ...], U: ndarray, trace_out_modes: tuple[ModeOp, ...], check_unitary: bool = False, atol: float = 1e-10) None

Bases: object

Specification of a unitary dilation on an ordered tuple of modes.

Parameters:
  • modes (tuple[ModeOp, ...]) – Ordered modes on which the dilation unitary acts.

  • U (ndarray) – Square matrix whose ordering matches modes.

  • trace_out_modes (tuple[ModeOp, ...]) – Modes to trace out after the unitary action.

  • check_unitary (bool) – If True, validate unitarity of U.

  • atol (float) – Tolerance for optional unitary validation.

Notes

The mode ordering is the same convention as used by LinearModeMap: column k of U gives the image of input mode k in the ordered output basis modes.

U: ndarray
atol: float = 1e-10
check_unitary: bool = False
modes: tuple[ModeOp, ...]
trace_out_modes: tuple[ModeOp, ...]
apply_unitary_dilation_densitypoly(rho: DensityPoly, *, dilation: UnitaryDilation, normalize_trace: bool = False, eps: float = 1e-14) DensityPoly

Apply a generic unitary-dilation channel to a density polynomial.

The channel is implemented by first applying the passive linear mode transformation associated with dilation.U on dilation.modes, then tracing out dilation.trace_out_modes:

\[\Phi(\rho) = \mathrm{Tr}_{T}\!\left[ U\, \rho\, U^\dagger \right],\]

where \(T\) is the subsystem spanned by the traced modes.

Parameters:
  • rho (DensityPoly) – Input symbolic density polynomial.

  • dilation (UnitaryDilation) – Dilation specification.

  • normalize_trace (bool) – If True, trace-normalize the reduced output density.

  • eps (float) – Threshold used by trace normalization if enabled.

Returns:

Reduced density polynomial after the unitary action and partial trace.

Return type:

DensityPoly

Notes

This helper is the generic building block for channels such as pure loss, thermal-loss variants with suitable ancilla handling, and other ancilla-assisted linear bosonic channels.

In the common “fresh environment mode” pattern, the traced modes are newly introduced ancilla modes not otherwise present in the retained system.

apply_unitary_dilation_densitypoly_direct(rho: DensityPoly, *, modes: tuple[ModeOp, ...], U: ndarray, trace_out_modes: tuple[ModeOp, ...], normalize_trace: bool = False, eps: float = 1e-14, check_unitary: bool = False, atol: float = 1e-10) DensityPoly

Apply a unitary-dilation channel from explicit dilation data.

This is a convenience wrapper around apply_unitary_dilation_densitypoly. It constructs a UnitaryDilation object from the supplied modes, unitary matrix, and traced modes, and then applies the resulting channel.

The induced channel is

\[\Phi(\rho) = \operatorname{Tr}_{T}\!\left[ U \rho U^\dagger \right],\]

where the ordering of the matrix \(U\) matches the ordering of modes.

Parameters:
  • rho (DensityPoly) – Input symbolic density polynomial.

  • modes (tuple[ModeOp, ...]) – Ordered tuple of modes on which the dilation unitary acts.

  • U (ndarray) – Square matrix representing the passive linear transformation in the ordered basis given by modes.

  • trace_out_modes (tuple[ModeOp, ...]) – Modes to trace out after applying the unitary action.

  • normalize_trace (bool) – If True, normalize the reduced output state to unit trace after tracing out the selected modes.

  • eps (float) – Threshold used by the trace-normalization routine when normalize_trace is enabled.

  • check_unitary (bool) – If True, validate that U is unitary within the tolerance specified by atol.

  • atol (float) – Absolute tolerance used when validating unitarity.

Returns:

Reduced symbolic density polynomial obtained after the unitary action and partial trace.

Return type:

DensityPolyProtocol

Notes

This function is useful when the caller does not need to reuse a UnitaryDilation object and wants to specify the dilation data directly at the call site.

See also

apply_unitary_dilation_densitypoly

Apply a dilation channel from a preconstructed dilation object.

UnitaryDilation

Dataclass representing the dilation specification.