symop.ccr.algebra.density.apply_left

Left-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 left:

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

For each term, the product \(W L_k\) is expanded and normal-ordered using commutation relations via expand_word_times_monomial(). Each expansion contribution updates the term’s left monomial and coefficient, while keeping the right monomial unchanged.

Functions

apply_left(terms, word)

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

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

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

For each density term t, this function expands the product word * t.left into a linear combination of normally-ordered monomials via expand_word_times_monomial().

Each expanded ket-term kt contributes a density term with:

  • coeff = t.coeff * kt.coeff

  • left  = kt.monomial

  • right = t.right (unchanged)

All contributions from all input terms are concatenated and then merged 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 left of each term’s left monomial.

Returns:

Output density polynomial terms after left application and combination.

Return type:

tuple[DensityTerm, …]

Notes

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