symop.ccr.algebra.ket.multiply¶
Symbolic multiplication of CCR ket expansions.
This module provides a purely symbolic product for ket expansions represented as finite sums of ket terms.
Given
their product is defined as the algebraic product of the underlying operator expressions,
where each concatenated word \(M_i N_j\) is expanded into normal order via
the CCR using symop.ccr.ket.from_word.ket_from_word().
The resulting terms are then canonicalized by merging identical monomials.
Functions
|
Multiply two symbolic ket expansions. |
- ket_multiply(a: tuple[KetTerm, ...], b: tuple[KetTerm, ...], *, eps: float = 1e-12, approx: bool = False, decimals: int = 12, ignore_global_phase: bool = False) tuple[KetTerm, ...]¶
Multiply two symbolic ket expansions.
The inputs represent formal sums of normally ordered monomials:
\[\lvert a \rangle \;\sim\; \sum_i c_i\, M_i, \qquad \lvert b \rangle \;\sim\; \sum_j d_j\, N_j.\]The product is computed by expanding each concatenated word \(M_i N_j\) into normal order using
ket_from_word()and accumulating the resulting terms:\[M_i N_j \;=\; \sum_k e_{ijk}\, P_{ijk} \quad\Rightarrow\quad \lvert a \rangle \lvert b \rangle \;\sim\; \sum_{i,j,k} (c_i d_j e_{ijk})\, P_{ijk}.\]- Parameters:
a (
tuple[KetTerm,...]) – Left factor as a tuple of ket terms.b (
tuple[KetTerm,...]) – Right factor as a tuple of ket terms.eps (
float) – Threshold used to skip negligible input terms and to discard negligible combined terms during canonicalization.approx (
bool) – IfTrue, canonicalization merges terms using approximate monomial signatures.decimals (
int) – Forwarded to approximate signature selection whenapprox=True.ignore_global_phase (
bool) – Forwarded to approximate signature selection whenapprox=True.
- Returns:
Canonicalized product expansion.
- Return type:
Notes
This routine is symbolic. It does not apply the result to a vacuum state.