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
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 a generic unitary-dilation channel to a density polynomial. |
Apply a unitary-dilation channel from explicit dilation data. |
Classes
|
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:
objectSpecification 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 matchesmodes.trace_out_modes (
tuple[ModeOp,...]) – Modes to trace out after the unitary action.check_unitary (
bool) – If True, validate unitarity ofU.atol (
float) – Tolerance for optional unitary validation.
Notes
The mode ordering is the same convention as used by
LinearModeMap: columnkofUgives the image of input modekin the ordered output basismodes.
- 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.Uondilation.modes, then tracing outdilation.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:
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 aUnitaryDilationobject 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 bymodes.trace_out_modes (
tuple[ModeOp,...]) – Modes to trace out after applying the unitary action.normalize_trace (
bool) – IfTrue, normalize the reduced output state to unit trace after tracing out the selected modes.eps (
float) – Threshold used by the trace-normalization routine whennormalize_traceis enabled.check_unitary (
bool) – IfTrue, validate thatUis unitary within the tolerance specified byatol.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
UnitaryDilationobject and wants to specify the dilation data directly at the call site.See also
apply_unitary_dilation_densitypolyApply a dilation channel from a preconstructed dilation object.
UnitaryDilationDataclass representing the dilation specification.