symop.polynomial.channels.primitives.linear_mode_unitary¶
Linear mode-map rewrites for CCR polynomial representations.
This module defines passive linear transformations on a finite ordered set of modes and provides helpers for applying such transformations to symbolic CCR polynomial objects.
The linear map acts in the Heisenberg picture by rewriting ladder operators according to a unitary mode mixing matrix. The same substitution machinery is then reused to transform ket, density, and operator polynomials.
Notes
The ordered tuple modes defines the basis in which the matrix
representation is interpreted. Column k of the matrix gives the
image of input mode k expressed in the ordered output basis.
Functions
|
Apply a passive linear mode map to a density polynomial. |
|
Apply a passive linear mode map to a ket polynomial. |
|
Apply a passive linear mode map to an operator polynomial. |
|
Construct the bra-side substitution induced by a linear mode map. |
|
Construct the ladder-operator substitution induced by a linear mode map. |
Classes
|
Represent a passive linear transformation on an ordered mode basis. |
- class LinearModeMap(modes: tuple[ModeOp, ...], U: ndarray, check_unitary: bool = False, atol: float = 1e-10) None¶
Bases:
objectRepresent a passive linear transformation on an ordered mode basis.
The ordered tuple
modesdefines both the input and output basis used to interpret the matrixU. The convention is that columnkofUgives the image of input modekin the ordered output basis.In the Heisenberg picture, the ladder operators transform as
\[a_k^\dagger \;\mapsto\; \sum_j U_{j k}\, a_j^\dagger,\]and
\[a_k \;\mapsto\; \sum_j \overline{U_{j k}}\, a_j.\]- Parameters:
modes (
tuple[ModeOp,...]) – Ordered mode basis used for the matrix representation.U (
ndarray) – Square matrix representing the passive linear transformation in the ordered basis given bymodes.check_unitary (
bool) – IfTrue, validate thatUis unitary within the tolerance specified byatol.atol (
float) – Absolute tolerance used for optional unitary validation.
Notes
This class stores only the linear transformation data and does not itself apply the rewrite. Use
make_substitutionor one of theapply_to_*helpers to act on symbolic polynomial objects.
- _apply_ketpoly_to_vacuum(poly: KetPoly) KetPoly¶
Project a rewritten ket polynomial onto the vacuum reference sector.
After operator substitution and normal ordering, terms containing annihilation operators acting on the vacuum are discarded. Only creator-only monomials and the identity term are retained.
- apply_to_densitypoly(rho: DensityPoly, *, lmap: LinearModeMap) DensityPoly¶
Apply a passive linear mode map to a density polynomial.
The density polynomial is rewritten by substituting ladder operators on both the left and right monomials according to the Heisenberg action of
lmap.- Parameters:
rho (
DensityPoly) – Input density polynomial.lmap (
LinearModeMap) – Passive linear mode transformation to apply.
- Returns:
Rewritten density polynomial after the linear mode transformation.
- Return type:
DensityPolyProtocol
Notes
This function applies the same substitution map to both sides of the density polynomial, with annihilation operators transformed using the conjugated matrix elements as required by the Heisenberg convention.
- apply_to_ketpoly(poly: KetPoly, *, lmap: LinearModeMap) KetPoly¶
Apply a passive linear mode map to a ket polynomial.
The transformation is implemented by rewriting all ladder operators in the polynomial according to the Heisenberg action of
lmapand then discarding terms incompatible with the vacuum reference state.- Parameters:
poly (
KetPoly) – Input ket polynomial.lmap (
LinearModeMap) – Passive linear mode transformation to apply.
- Returns:
Rewritten ket polynomial after vacuum-compatible projection.
- Return type:
Notes
The final projection step keeps only creator-only monomials and the identity term, corresponding to the usual vacuum-based ket polynomial semantics.
- apply_to_oppoly(op: OpPoly, *, lmap: LinearModeMap) OpPoly¶
Apply a passive linear mode map to an operator polynomial.
Each ladder operator in the operator polynomial is rewritten according to the Heisenberg action of
lmap.- Parameters:
op (
OpPoly) – Input operator polynomial.lmap (
LinearModeMap) – Passive linear mode transformation to apply.
- Returns:
Rewritten operator polynomial after the linear mode transformation.
- Return type:
OpPolyProtocol
- make_right_substitution(lmap: LinearModeMap) Callable[[LadderOp], list[tuple[complex, LadderOp]]]¶
Construct the bra-side substitution induced by a linear mode map.
This is the substitution used on the right monomial of a density term, corresponding to the adjoint-side action needed for
rho -> U rho U^dagger.
For creation operators, the coefficients are conjugated relative to the ket-side map. For annihilation operators, the unconjugated coefficients are used.
- Parameters:
lmap (LinearModeMap)
- Return type:
- make_substitution(lmap: LinearModeMap) Callable[[LadderOp], list[tuple[complex, LadderOp]]]¶
Construct the ladder-operator substitution induced by a linear mode map.
The returned substitution function rewrites ladder operators according to the Heisenberg action of
lmap. If an operator acts on a mode not present inlmap.modes, it is left unchanged.For creation operators, the substitution is
\[a_k^\dagger \;\mapsto\; \sum_j U_{j k}\, a_j^\dagger.\]For annihilation operators, the substitution is
\[a_k \;\mapsto\; \sum_j \overline{U_{j k}}\, a_j.\]- Parameters:
lmap (
LinearModeMap) – Linear mode transformation specification.- Returns:
Substitution function mapping a ladder operator to a list of
(coefficient, operator)pairs.- Return type:
callable
Notes
The substitution acts only on operators whose mode signatures are present in
lmap.modes. Other operators pass through unchanged.