symop.ccr.algebra.op¶
Operator-polynomial algebra over ladder operators.
This package implements finite linear combinations of operator “words” built from bosonic ladder operators bound to logical modes.
An operator term has the form
where each \(o_k\) is a ladder operator (annihilation or creation) and \(c \in \mathbb{C}\).
An operator polynomial is a finite sum
with words \(W_k\) given by ordered products of ladder operators.
The modules in this package provide:
term construction from raw words,
word concatenation (multiplication),
combination of like terms via signatures,
concrete implementations of
OpTermandOpPoly.
This layer represents the free *-algebra generated by ladder operators.
Commutation relations and mode overlaps are encoded at the level of
individual LadderOp instances.
- class OpPoly(terms: tuple[OpTerm, ...] = ()) None¶
Bases:
objectFinite linear combination of
OpTermobjects.Notes
Multiplication does not automatically merge like terms; call
combine_like_terms()to normalize.- static a(mode: ModeOp) OpPoly¶
Return the annihilation operator for
mode.- Parameters:
mode (ModeOp)
- Return type:
- static adag(mode: ModeOp) OpPoly¶
Return the creation operator for
mode.- Parameters:
mode (ModeOp)
- Return type:
- combine_like_terms(*, approx: bool = False, decimals: int = 12, ignore_global_phase: bool = False) OpPoly¶
Combine operator terms with identical signatures.
Terms are bucketed either by their exact signatures or, when
approx=True, by approximate signatures obtained viaOpTermProto.approx_signature().When approximate matching is enabled, the parameters
decimalsandignore_global_phaseare forwarded to the underlying signature computation of the ladder operators.- Parameters:
approx (
bool) – IfTrue, use approximate signatures for bucketing. Otherwise, exact signatures are used.decimals (
int) – Number of decimal places used when rounding floating-point quantities in approximate signatures.ignore_global_phase (
bool) – IfTrue, component signatures may ignore global phase factors when constructing approximate signatures.
- Returns:
A new polynomial with coefficients of identical words summed and zero-sum buckets removed.
- Return type:
Notes
This operation performs purely signature-based merging. It does not reorder words or apply commutation relations.
See also
- static from_words(words: Iterable[Iterable[LadderOp]], coeffs: Iterable[complex] | None = None) OpPoly¶
Construct an operator polynomial from words and coefficients.
- static n(mode: ModeOp) OpPoly¶
Return the number operator \(a^\dagger a\) for
mode.- Parameters:
mode (ModeOp)
- Return type:
- normalize(*, approx: bool = False, decimals: int = 12, ignore_global_phase: bool = False) OpPoly¶
Return a normalized operator polynomial.
This is a convenience alias for
combine_like_terms(). It produces a polynomial in which identical operator words have been merged and zero-coefficient terms removed.- Parameters:
- Returns:
Normalized operator polynomial.
- Return type:
- static p(mode: ModeOp) OpPoly¶
Return the quadrature \(p = (i a^\dagger - i a)/\sqrt{2}\).
- Parameters:
mode (ModeOp)
- Return type:
- static q(mode: ModeOp) OpPoly¶
Return the quadrature \(q = (a + a^\dagger)/\sqrt{2}\).
- Parameters:
mode (ModeOp)
- Return type:
Modules
Combination of like operator terms. |
|
Construct operator terms from ladder-operator words. |
|
Multiplication of operator-term tuples. |
|
Operator polynomials. |