symop.ccr.algebra.density.apply_right

Right-application of operator words to density polynomials.

A density polynomial is a finite linear combination of terms

\[\rho \sim \sum_k c_k\, L_k\, R_k,\]

where each term stores a complex coefficient c_k and two normally-ordered monomials (left=L_k, right=R_k).

This module provides the symbolic action of an operator word \(W = \hat o_1 \hat o_2 \cdots \hat o_L\) on the right:

\[\rho \mapsto \rho\, W.\]

Operationally, right-action is implemented using the identity

\[R_k\, W \;\equiv\; \left(W^\dagger R_k^\dagger\right)^\dagger,\]

which, at the level of symbolic normal ordering, can be computed by expanding the left action of the reversed daggered word on the right monomial.

Concretely we form

\[W_{\mathrm{dag}} = \hat o_L^\dagger \cdots \hat o_2^\dagger \hat o_1^\dagger\]

and expand \(W_{\mathrm{dag}} \cdot R_k\) via the normal-ordering engine.

Functions

apply_right(terms, word)

Apply an operator word on the right of a density polynomial.

apply_right(terms: tuple[DensityTerm, ...], word: Iterable[LadderOp]) tuple[DensityTerm, ...]

Apply an operator word on the right of a density polynomial.

For each density term t, this function computes the symbolic right action by expanding the left action of the reversed, daggered word on the right monomial:

  • form dag_word = reversed(word) with each operator daggered

  • expand dag_word * t.right via expand_word_times_monomial()

Each expanded ket-term kt contributes an output density term with:

  • coeff = t.coeff * kt.coeff

  • left  = t.left (unchanged)

  • right = kt.monomial

All contributions are concatenated and then canonicalized using combine_like_terms_density().

Parameters:
  • terms (tuple[DensityTerm, ...]) – Input density polynomial terms.

  • word (Iterable[LadderOp]) – Iterable of ladder operators forming the operator product applied on the right.

Returns:

Output density polynomial terms after right application and combination.

Return type:

tuple[DensityTerm, …]

Notes

This is purely symbolic. Normal ordering is performed using commutation relations inside expand_word_times_monomial.