TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::operators::many_body_operator_generic< T >

#include <triqs/operators/many_body_operator.hpp>

Detailed Description

template<typename T>
class triqs::operators::many_body_operator_generic< T >

Generic 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.

Template Parameters
TValue type of the coefficients.

Definition at line 230 of file many_body_operator.hpp.

Public Types

using const_iterator = utility::dressed_iterator<typename monomials_map_t::const_iterator, _cdress>
 Constant iterator type yielding (monomial, coefficient) pairs.
using monomials_map_t = std::map<monomial_t, T>
 Container type for monomials and their coefficients.
using scalar_t = T
 Value type of the coefficients (either real, complex or real_or_complex).

Public Member Functions

 many_body_operator_generic ()=default
 Default constructor creates a zero many-body operator, i.e. with no terms.
template<typename S>
 many_body_operator_generic (many_body_operator_generic< S > const &p)
 Construct a many-body operator from another many-body operator with a different coefficient type.
 many_body_operator_generic (scalar_t const &x)
 Construct a many-body operator \( \hat{O} = a \hat{I} \).
 many_body_operator_generic (scalar_t const &x, monomial_t monomial)
 Construct a many-body operator \( \hat{O} = a \hat{m} \).
const_iterator begin () const noexcept
 Get a const iterator to the beginning of the map that contains the monomials and their coefficients.
const_iterator cbegin () const noexcept
 Get a const iterator to the beginning of the map that contains the monomials and their coefficients.
const_iterator cend () const noexcept
 Get a const iterator past the end of the map that contains the monomials and their coefficients.
void deserialize (auto &ar)
 Deserialize the many-body operator from a generic archive.
const_iterator end () const noexcept
 Get a const iterator past the end of the map that contains the monomials and their coefficients.
monomials_map_t const & get_monomials () const
 Get the map/dictionary of monomials and their coefficients.
many_body_operator_generic imag () const
 Get a copy of the operator \( \hat{O} \) with the real parts of all monomial coefficients set to zero.
bool is_almost_zero (double precision=1e-10) const
 Check if the current operator \( \hat{O} \) is close to zero.
bool is_zero () const
 Check if the current operator \( \hat{O} \) is exactly zero.
hilbert_space::fundamental_operator_set make_fundamental_operator_set () const
 Create a minimal fundamental operator set with all single particle state indices \( \alpha_i \) that appear in the monomials of this operator.
many_body_operator_genericoperator*= (many_body_operator_generic const &op)
 Multiplication assignment operator to multiply the current many-body operator \( \hat{O} \) by another many-body operator \( \hat{P} \).
many_body_operator_genericoperator*= (scalar_t a)
 Multiplication assignment operator to multiply the current many-body operator \( \hat{O} \) by a scalar \( a \).
many_body_operator_genericoperator+= (many_body_operator_generic const &op)
 Addition assignment operator to add the many-body operator \( \hat{P} \) to the current many-body operator \( \hat{O} \).
many_body_operator_genericoperator+= (scalar_t a)
 Addition assignment operator to add a scalar \( a \) to the current many-body operator \( \hat{O} \).
many_body_operator_generic operator- () const
 Unary minus operator to negate the current many-body operator \( \hat{O} \).
many_body_operator_genericoperator-= (many_body_operator_generic const &op)
 Subtraction assignment operator to subtract the many-body operator \( \hat{P} \) from the current many-body operator \( \hat{O} \).
many_body_operator_genericoperator-= (scalar_t a)
 Subtraction assignment operator to subtract a scalar \( a \) from the current many-body operator \( \hat{O} \).
many_body_operator_genericoperator/= (scalar_t a)
 Division assignment operator to divide the current many-body operator \( \hat{O} \) by a scalar \( a \).
template<typename S>
many_body_operator_genericoperator= (many_body_operator_generic< S > const &p)
 Assignment operator from a many-body operator with a different coefficient type.
bool operator== (many_body_operator_generic const &op) const
 Equality operator to compare two many-body operators.
many_body_operator_generic real () const
 Get a copy of the operator \( \hat{O} \) with the imaginary parts of all monomial coefficients set to zero.
void serialize (auto &ar) const
 Serialize the many-body operator to a generic archive.

Static Public Member Functions

static std::string hdf5_format ()
 HDF5 format tag of the many-body operator.
static many_body_operator_generic make_canonical (bool is_dag, indices_t indices)
 Create a many-body operator that represents a single canonical operator \( \hat{c}_{\alpha} \) or \( \hat{c}_{\alpha}^{\dagger} \).

Friends

many_body_operator_generic dagger (many_body_operator_generic const &op)
 Compute the Hermitian conjugate (dagger) of the many-body operator \( \hat{O} \).
void h5_read (h5::group g, std::string const &name, many_body_operator &op, hilbert_space::fundamental_operator_set &fops)
 Read a triqs::operators::many_body_operator together with a triqs::hilbert_space::fundamental_operator_set from HDF5.
void h5_read (h5::group g, std::string const &name, many_body_operator_generic &op)
 Read a triqs::operators::many_body_operator_generic from HDF5.
void h5_write (h5::group g, std::string const &name, many_body_operator const &op, hilbert_space::fundamental_operator_set const &fops)
 Write a triqs::operators::many_body_operator together with a triqs::hilbert_space::fundamental_operator_set to HDF5.
void h5_write (h5::group g, std::string const &name, many_body_operator_generic const &op)
 Write a triqs::operators::many_body_operator_generic to HDF5.
many_body_operator_generic operator* (many_body_operator_generic lhs, many_body_operator_generic const &rhs)
 Product of two many-body operators \( \hat{O} \) and \( \hat{P} \) (Fock-space operator product).
many_body_operator_generic operator* (many_body_operator_generic op, scalar_t a)
 Multiply a many-body operator \( \hat{O} \) by a scalar \( a \) on the right.
many_body_operator_generic operator* (scalar_t a, many_body_operator_generic op)
 Multiply a many-body operator \( \hat{O} \) by a scalar \( a \) on the left.
many_body_operator_generic operator+ (many_body_operator_generic lhs, many_body_operator_generic const &rhs)
 Sum of two many-body operators \( \hat{O} \) and \( \hat{P} \).
many_body_operator_generic operator+ (many_body_operator_generic op, scalar_t a)
 Add a scalar \( a \) to a many-body operator \( \hat{O} \).
many_body_operator_generic operator+ (scalar_t a, many_body_operator_generic op)
 Add a many-body operator \( \hat{O} \) to a scalar \( a \).
many_body_operator_generic operator- (many_body_operator_generic lhs, many_body_operator_generic const &rhs)
 Difference of two many-body operators \( \hat{O} \) and \( \hat{P} \).
many_body_operator_generic operator- (many_body_operator_generic op, scalar_t a)
 Subtract a scalar \( a \) from a many-body operator \( \hat{O} \).
many_body_operator_generic operator- (scalar_t a, many_body_operator_generic const &op)
 Subtract a many-body operator \( \hat{O} \) from a scalar \( a \).
many_body_operator_generic operator/ (many_body_operator_generic op, scalar_t a)
 Divide a many-body operator \( \hat{O} \) by a scalar \( a \).
std::ostream & operator<< (std::ostream &os, many_body_operator_generic const &op)
 Write a triqs::operators::many_body_operator_generic to a std::ostream.
template<typename F>
many_body_operator_generic transform (many_body_operator_generic const &op, F &&f)
 Transform the coefficients of an operator \( \hat{O} \) using a callable object.

Constructor & Destructor Documentation

◆ many_body_operator_generic() [1/3]

template<typename T>
template<typename S>
triqs::operators::many_body_operator_generic< T >::many_body_operator_generic ( many_body_operator_generic< S > const & p)
inline

Construct a many-body operator from another many-body operator with a different coefficient type.

Calls operator=() to assign all terms of the other operator to the new operator. The scalar type scalar_t must be constructible from S.

Template Parameters
SScalar type of the source operator.
Parameters
pSource many-body operator.

Definition at line 250 of file many_body_operator.hpp.

◆ many_body_operator_generic() [2/3]

template<typename T>
triqs::operators::many_body_operator_generic< T >::many_body_operator_generic ( scalar_t const & x)
inlineexplicit

Construct a many-body operator \( \hat{O} = a \hat{I} \).

Parameters
xCoefficient \( a \) of the identity operator \( \hat{I} \).

Definition at line 260 of file many_body_operator.hpp.

◆ many_body_operator_generic() [3/3]

template<typename T>
triqs::operators::many_body_operator_generic< T >::many_body_operator_generic ( scalar_t const & x,
monomial_t monomial )
inline

Construct a many-body operator \( \hat{O} = a \hat{m} \).

Parameters
xCoefficient \( a \) of the monomial.
monomialMonomial \( \hat{m} \).

Definition at line 271 of file many_body_operator.hpp.

Member Function Documentation

◆ deserialize()

template<typename T>
void triqs::operators::many_body_operator_generic< T >::deserialize ( auto & ar)
inline

Deserialize the many-body operator from a generic archive.

Parameters
arArchive to deserialize from.

Definition at line 719 of file many_body_operator.hpp.

◆ is_almost_zero()

template<typename T>
bool triqs::operators::many_body_operator_generic< T >::is_almost_zero ( double precision = 1e-10) const
inlinenodiscard

Check if the current operator \( \hat{O} \) is close to zero.

Parameters
precisionTolerance \( \epsilon \) for considering a coefficient to be zero.
Returns
True if \( |a_i| < \epsilon \) for all coefficients \( a_i \), false otherwise.

Definition at line 362 of file many_body_operator.hpp.

◆ is_zero()

template<typename T>
bool triqs::operators::many_body_operator_generic< T >::is_zero ( ) const
inlinenodiscard

Check if the current operator \( \hat{O} \) is exactly zero.

Returns
True if the operator has no terms, false otherwise.

Definition at line 374 of file many_body_operator.hpp.

◆ make_canonical()

template<typename T>
many_body_operator_generic triqs::operators::many_body_operator_generic< T >::make_canonical ( bool is_dag,
indices_t indices )
inlinestatic

Create a many-body operator that represents a single canonical operator \( \hat{c}_{\alpha} \) or \( \hat{c}_{\alpha}^{\dagger} \).

Parameters
is_dagBoolean flag indicating whether to create a creation (true) or annihilation (false) operator.
indicesSingle particle state index \( \alpha \).
Returns
Many-body operator \( \hat{O} = \hat{c}_{\alpha}^{\dagger} \) or \( \hat{O} = \hat{c}_{\alpha} \).

Definition at line 320 of file many_body_operator.hpp.

◆ make_fundamental_operator_set()

template<typename T>
hilbert_space::fundamental_operator_set triqs::operators::many_body_operator_generic< T >::make_fundamental_operator_set ( ) const
inlinenodiscard

Create a minimal fundamental operator set with all single particle state indices \( \alpha_i \) that appear in the monomials of this operator.

Returns
Fundamental operator set \( A = \{ \alpha_i \}_{i=0}^{N-1} \).

Definition at line 305 of file many_body_operator.hpp.

◆ operator*=() [1/2]

template<typename T>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator*= ( many_body_operator_generic< T > const & op)
inline

Multiplication assignment operator to multiply the current many-body operator \( \hat{O} \) by another many-body operator \( \hat{P} \).

Computes the product \( \hat{O} \times \hat{P} \) using the distributive property of operator multiplication.

All generated monomials are normalized, i.e. sorted according to the order defined by canonical_ops_t::operator<=>(), using fermionic anti-commutation relations and added to the resulting operator. If a monomial is already present in the resulting operator, their coefficients are added together.

All terms with vanishing coefficients are removed.

Parameters
opRight hand side many-body operator \( \hat{P} \).
Returns
Reference to this containing the result \( \hat{O} \times \hat{P} \).

Definition at line 580 of file many_body_operator.hpp.

◆ operator*=() [2/2]

template<typename T>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator*= ( scalar_t a)
inline

Multiplication assignment operator to multiply the current many-body operator \( \hat{O} \) by a scalar \( a \).

Multiplies all coefficients \( a_i \) of the operator \( \hat{O} \) by the given scalar \( a \). If \( a = 0 \), the operator is set to zero (i.e. all terms are removed).

Parameters
aScalar \( a \).
Returns
Reference to this containing the result \( \hat{O} \times a \).

Definition at line 430 of file many_body_operator.hpp.

◆ operator+=() [1/2]

template<typename T>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator+= ( many_body_operator_generic< T > const & op)
inline

Addition assignment operator to add the many-body operator \( \hat{P} \) to the current many-body operator \( \hat{O} \).

Adds all terms of \( \hat{P} \) to the current operator \( \hat{O} \). If a monomial is already present in \( \hat{O} \), their coefficients are added; otherwise a new term is created. All terms with vanishing coefficients are removed.

Parameters
opRight hand side many-body operator \( \hat{P} \).
Returns
Reference to this containing the result \( \hat{O} + \hat{P} \).

Definition at line 527 of file many_body_operator.hpp.

◆ operator+=() [2/2]

template<typename T>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator+= ( scalar_t a)
inline

Addition assignment operator to add a scalar \( a \) to the current many-body operator \( \hat{O} \).

If the term with the empty monomial \( \hat{m} = \hat{I} \) (the identity operator) is already present, the given scalar \( a \) is added to its coefficient. Otherwise, a new term \( a \hat{I} \) is created and added to \( \hat{O} \).

Parameters
aScalar \( a \).
Returns
Reference to this containing the result \( \hat{O} + a \).

Definition at line 396 of file many_body_operator.hpp.

◆ operator-()

template<typename T>
many_body_operator_generic triqs::operators::many_body_operator_generic< T >::operator- ( ) const
inline

Unary minus operator to negate the current many-body operator \( \hat{O} \).

Returns
Many-body operator \( -\hat{O} \) with the sign of all coefficients flipped.

Definition at line 380 of file many_body_operator.hpp.

◆ operator-=() [1/2]

template<typename T>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator-= ( many_body_operator_generic< T > const & op)
inline

Subtraction assignment operator to subtract the many-body operator \( \hat{P} \) from the current many-body operator \( \hat{O} \).

Subtracts all terms of \( \hat{P} \) from the current operator \( \hat{O} \). If a monomial is already present in \( \hat{O} \), their coefficients are subtracted. All terms with vanishing coefficients are removed.

Parameters
opRight hand side many-body operator \( \hat{P} \).
Returns
Reference to this containing the result \( \hat{O} - \hat{P} \).

Definition at line 551 of file many_body_operator.hpp.

◆ operator-=() [2/2]

template<typename T>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator-= ( scalar_t a)
inline

Subtraction assignment operator to subtract a scalar \( a \) from the current many-body operator \( \hat{O} \).

Equivalent to operator+=(-a).

Parameters
aScalar \( a \).
Returns
Reference to this containing the result \( \hat{O} - a \).

Definition at line 418 of file many_body_operator.hpp.

◆ operator/=()

template<typename T>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator/= ( scalar_t a)
inline

Division assignment operator to divide the current many-body operator \( \hat{O} \) by a scalar \( a \).

It calls operator*=() with \( 1 / a \).

Parameters
aScalar \( a \).
Returns
Reference to this containing the result \( \hat{O} / a \).

Definition at line 449 of file many_body_operator.hpp.

◆ operator=()

template<typename T>
template<typename S>
many_body_operator_generic & triqs::operators::many_body_operator_generic< T >::operator= ( many_body_operator_generic< S > const & p)
inline

Assignment operator from a many-body operator with a different coefficient type.

Clears the current operator and copies all monomials from the source, converting each coefficient to scalar_t. The scalar type scalar_t must be constructible from S.

Template Parameters
SScalar type of the source operator.
Parameters
pSource many-body operator.
Returns
Reference to this containing the result.

Definition at line 289 of file many_body_operator.hpp.

◆ operator==()

template<typename T>
bool triqs::operators::many_body_operator_generic< T >::operator== ( many_body_operator_generic< T > const & op) const
inline

Equality operator to compare two many-body operators.

Checks whether the difference \( \hat{O} - \hat{P} \) is exactly zero.

Parameters
opRight hand side many-body operator \( \hat{P} \).
Returns
True if \( \hat{O} = \hat{P} \), false otherwise.

Definition at line 629 of file many_body_operator.hpp.

◆ serialize()

template<typename T>
void triqs::operators::many_body_operator_generic< T >::serialize ( auto & ar) const
inline

Serialize the many-body operator to a generic archive.

Parameters
arArchive to serialize to.

Definition at line 713 of file many_body_operator.hpp.

◆ dagger

template<typename T>
many_body_operator_generic dagger ( many_body_operator_generic< T > const & op)
friend

Compute the Hermitian conjugate (dagger) of the many-body operator \( \hat{O} \).

Computes the Hermitian conjugate by reversing the order of the canonical operators in each monomial and flipping their dagger flag. The coefficients are complex conjugated.

Parameters
opMany-body operator \( \hat{O} \).
Returns
Many-body operator \( \hat{O}^{\dagger} \).

Definition at line 651 of file many_body_operator.hpp.

◆ h5_read [1/2]

template<typename T>
void h5_read ( h5::group g,
std::string const & name,
many_body_operator & op,
hilbert_space::fundamental_operator_set & fops )
friend

Read a triqs::operators::many_body_operator together with a triqs::hilbert_space::fundamental_operator_set from HDF5.

Parameters
gh5::group to be read from.
nameName of the subgroup.
opOperator to be read into.
fopsFundamental operator set associated with the operator.

Definition at line 139 of file many_body_operator.cpp.

◆ h5_read [2/2]

template<typename T>
void h5_read ( h5::group g,
std::string const & name,
many_body_operator_generic< T > & op )
friend

Read a triqs::operators::many_body_operator_generic from HDF5.

Parameters
gh5::group to be read from.
nameName of the subgroup.
opOperator to be read into.

Definition at line 767 of file many_body_operator.hpp.

◆ h5_write [1/2]

template<typename T>
void h5_write ( h5::group g,
std::string const & name,
many_body_operator const & op,
hilbert_space::fundamental_operator_set const & fops )
friend

Write a triqs::operators::many_body_operator together with a triqs::hilbert_space::fundamental_operator_set to HDF5.

Parameters
gh5::group to be written to.
nameName of the subgroup.
opOperator to be written.
fopsFundamental operator set associated with the operator.

Definition at line 94 of file many_body_operator.cpp.

◆ h5_write [2/2]

template<typename T>
void h5_write ( h5::group g,
std::string const & name,
many_body_operator_generic< T > const & op )
friend

Write a triqs::operators::many_body_operator_generic to HDF5.

A minimal fundamental operator set is constructed from the operator and used to label the canonical operators of each monomial.

Parameters
gh5::group to be written to.
nameName of the subgroup.
opOperator to be written.

Definition at line 745 of file many_body_operator.hpp.

◆ operator* [1/3]

template<typename T>
many_body_operator_generic operator* ( many_body_operator_generic< T > lhs,
many_body_operator_generic< T > const & rhs )
friend

Product of two many-body operators \( \hat{O} \) and \( \hat{P} \) (Fock-space operator product).

Parameters
lhsLeft hand side operator \( \hat{O} \).
rhsRight hand side operator \( \hat{P} \).
Returns
Many-body operator \( \hat{O} \times \hat{P} \).

Definition at line 619 of file many_body_operator.hpp.

◆ operator* [2/3]

template<typename T>
many_body_operator_generic operator* ( many_body_operator_generic< T > op,
scalar_t a )
friend

Multiply a many-body operator \( \hat{O} \) by a scalar \( a \) on the right.

Parameters
opOperator \( \hat{O} \).
aScalar \( a \).
Returns
Many-body operator \( \hat{O} \times a \).

Definition at line 496 of file many_body_operator.hpp.

◆ operator* [3/3]

template<typename T>
many_body_operator_generic operator* ( scalar_t a,
many_body_operator_generic< T > op )
friend

Multiply a many-body operator \( \hat{O} \) by a scalar \( a \) on the left.

Parameters
aScalar \( a \).
opOperator \( \hat{O} \).
Returns
Many-body operator \( a \times \hat{O} \).

Definition at line 505 of file many_body_operator.hpp.

◆ operator+ [1/3]

template<typename T>
many_body_operator_generic operator+ ( many_body_operator_generic< T > lhs,
many_body_operator_generic< T > const & rhs )
friend

Sum of two many-body operators \( \hat{O} \) and \( \hat{P} \).

Parameters
lhsLeft hand side operator \( \hat{O} \).
rhsRight hand side operator \( \hat{P} \).
Returns
Many-body operator \( \hat{O} + \hat{P} \).

Definition at line 601 of file many_body_operator.hpp.

◆ operator+ [2/3]

template<typename T>
many_body_operator_generic operator+ ( many_body_operator_generic< T > op,
scalar_t a )
friend

Add a scalar \( a \) to a many-body operator \( \hat{O} \).

Parameters
opOperator \( \hat{O} \).
aScalar \( a \).
Returns
Many-body operator \( \hat{O} + a \).

Definition at line 458 of file many_body_operator.hpp.

◆ operator+ [3/3]

template<typename T>
many_body_operator_generic operator+ ( scalar_t a,
many_body_operator_generic< T > op )
friend

Add a many-body operator \( \hat{O} \) to a scalar \( a \).

Parameters
aScalar \( a \).
opOperator \( \hat{O} \).
Returns
Many-body operator \( a + \hat{O} \).

Definition at line 467 of file many_body_operator.hpp.

◆ operator- [1/3]

template<typename T>
many_body_operator_generic operator- ( many_body_operator_generic< T > lhs,
many_body_operator_generic< T > const & rhs )
friend

Difference of two many-body operators \( \hat{O} \) and \( \hat{P} \).

Parameters
lhsLeft hand side operator \( \hat{O} \).
rhsRight hand side operator \( \hat{P} \).
Returns
Many-body operator \( \hat{O} - \hat{P} \).

Definition at line 610 of file many_body_operator.hpp.

◆ operator- [2/3]

template<typename T>
many_body_operator_generic operator- ( many_body_operator_generic< T > op,
scalar_t a )
friend

Subtract a scalar \( a \) from a many-body operator \( \hat{O} \).

Parameters
opOperator \( \hat{O} \).
aScalar \( a \).
Returns
Many-body operator \( \hat{O} - a \).

Definition at line 476 of file many_body_operator.hpp.

◆ operator- [3/3]

template<typename T>
many_body_operator_generic operator- ( scalar_t a,
many_body_operator_generic< T > const & op )
friend

Subtract a many-body operator \( \hat{O} \) from a scalar \( a \).

Equivalent to \( -\hat{O} + a \). See operator-() and operator+=(scalar_t).

Parameters
aScalar \( a \).
opMany-body operator \( \hat{O} \).
Returns
Many-body operator \( a - \hat{O} \).

Definition at line 487 of file many_body_operator.hpp.

◆ operator/

template<typename T>
many_body_operator_generic operator/ ( many_body_operator_generic< T > op,
scalar_t a )
friend

Divide a many-body operator \( \hat{O} \) by a scalar \( a \).

Parameters
opOperator \( \hat{O} \).
aScalar \( a \).
Returns
Many-body operator \( \hat{O} / a \).

Definition at line 514 of file many_body_operator.hpp.

◆ operator<<

template<typename T>
std::ostream & operator<< ( std::ostream & os,
many_body_operator_generic< T > const & op )
friend

Write a triqs::operators::many_body_operator_generic to a std::ostream.

Parameters
osstd::ostream object.
opOperator \( \hat{O} \) to be written.
Returns
Reference to std::ostream object.

Definition at line 696 of file many_body_operator.hpp.

◆ transform

template<typename T>
template<typename F>
many_body_operator_generic transform ( many_body_operator_generic< T > const & op,
F && f )
friend

Transform the coefficients of an operator \( \hat{O} \) using a callable object.

The callable object must take two arguments, a monomial \( \hat{m}_i \) and the corresponding coefficient \( a_i \), and return a new coefficient \( \tilde{a}_i \).

The callable is applied to each term of the operator and the returned coefficient \( \tilde{a}_i \) together with the monomial \( \hat{m}_i \) is inserted in the resulting operator. If the returned coefficient is zero, the term is omitted.

Template Parameters
FCallable type.
Parameters
opOperator \( \hat{O} \) to be transformed.
fCallable object.
Returns
Transformed many-body operator.

Definition at line 673 of file many_body_operator.hpp.


The documentation for this class was generated from the following file: