triqs.operators.operators.Operator
- class triqs.operators.operators.Operator
Bases:
objectGeneric many-body operator.
A generic many-body operator \(\hat{O}\) is defined as a linear combination of monomials \(\hat{m}_i\) such that
\[\hat{O} = \sum_{i} a_i \hat{m}_i \; ,\]where \(a_i\) are real or complex coefficients.
Under the hood, we simply store all individual terms in a map/dictionary with the monomials as keys and the coefficients as values.
Operator-operator and operator-scalar arithmetic is supported such that many-body operators form an algebra over the field of real/complex numbers with an extra addition operation between operators and scalars.
Dispatched C++ constructor(s).
[1] () [2] (x: float | complex) [3] (x: float | complex, monomial: [CanonicalOpsT])
[1] Default constructor creates a zero many-body operator, i.e. with no terms.
[2] Construct a many-body operator \(\hat{O} = a \hat{I}\).
[3] Construct a many-body operator \(\hat{O} = a \hat{m}\).
- Parameters:
- xfloat | complex
Coefficient \(a\) of the identity operator \(\hat{I}\).
- monomial[CanonicalOpsT]
Monomial \(\hat{m}\).
Attributes
Get a copy of the operator \(\hat{O}\) with the real parts of all monomial coefficients set to zero.
Get a copy of the operator \(\hat{O}\) with the imaginary parts of all monomial coefficients set to zero.
Methods
Get the map/dictionary of monomials and their coefficients.
Check if the current operator \(\hat{O}\) is close to zero.
Check if the current operator \(\hat{O}\) is exactly zero.
Create a many-body operator that represents a single canonical operator \(\hat{c}_{\alpha}\) or
Create a minimal fundamental operator set with all single particle state indices \(\alpha_i\) that