Template Class OpMakerΒΆ

Class DocumentationΒΆ

template<Statistics S>
class OpMakerΒΆ

makes a tensor-level many-body operator

A many-body operator has the following generic form: where are number of bra/ket indices of or, equivalently, the number of creators/annihilators of normal-ordered (w.r.t. the default vacuum) operator . Hence / are (quasi)particle creation/annihilation indices. For example, for fermionic operators relative to Fermi vacuum these are:

  • (pure) excitation: (active) unoccupied/occupied, respectively;

  • (pure) deexcitation: occupied/unoccupied, respectively; For generic operators (neither excitation nor deexcitation) complete basis indices are assumed by default.

    is the β€œnormalization” factor and depends on the vacuum used to define , and indices / .

Note

The choice of computational basis can be controlled by the default Context. See SeQuant/core/context.hpp and SeQuant/mbpt/context.hpp

Warning

Tensor will be antisymmetrized if get_default_context().spbasis() == SPBasis::spinorbital, else it will be particle-symmetric; the latter is only valid if # of bra and ket indices coincide.

Public Types

enum class UseDepIdxΒΆ

Values:

enumerator BraΒΆ

bra/cre indices depend on ket

enumerator KetΒΆ

ket/ann indices depend on bra

enumerator NoneΒΆ

use plain indices

Public Functions

template<typename IndexSpaceTypeRange1, typename IndexSpaceTypeRange2>
inline OpMaker(OpType op, const cre<IndexSpaceTypeRange1> &cre_list, const ann<IndexSpaceTypeRange2> &ann_list)ΒΆ
Parameters:
  • op – [in] the operator type

  • cre_list – [in] list of creator indices

  • ann_list – [in] list of annihilator indices

OpMaker(OpType op, ncre nc, nann na)ΒΆ
Parameters:
  • op – [in] the operator type

  • nc – [in] number of bra indices/creators

  • na – [in] number of ket indices/annihilators

OpMaker(OpType op, std::size_t rank)ΒΆ

creates a particle-conserving replacement operator

Parameters:
  • op – [in] the operator type

  • rank – [in] particle rank of the operator (# of creators = # of annihilators = rank )

OpMaker(OpType op, ncre nc, nann na, const cre<IndexSpace> &cre_space, const ann<IndexSpace> &ann_space)ΒΆ
Parameters:
  • op – [in] the operator type

  • nc – [in] number of bra indices/creators

  • na – [in] number of ket indices/annihilators

  • cre_space – [in] IndexSpace referred to be the creator

  • ann_space – [in] IndexSpace referred to be the annihilators

ExprPtr operator()(std::optional<UseDepIdx> dep_opt = {}, std::optional<Symmetry> opsymm_opt = {}) constΒΆ
Parameters:
  • dep_opt – [in] if given, controls whether bra (*dep_opt == UseDepIdx::Bra) / ket (*dep_opt == UseDepIdx::Ket) indices are dependent on the, respectively, ket/bra indices (i.e., use them as protoindices); if (*dep_opt == UseDepIdx::None) then plain indices are used; if dep_opt is not given then the default is determined by the MBPT context.

  • opsymm_opt – [in] if given, controls whether (anti)symmetric tensor is returned; if opsymm_opt is not given then the default is determined by the MBPT context.

Public Static Functions

template<typename TensorGenerator>
static inline ExprPtr make(const container::svector<IndexSpace> &creators, const container::svector<IndexSpace> &annihilators, TensorGenerator &&tensor_generator, UseDepIdx dep = UseDepIdx::None)ΒΆ
Template Parameters:

TensorGenerator – callable with signature TensorGenerator(range<Index>, range<Index>, Symmetry) that returns a Tensor with the respective bra/cre and ket/ann indices and of the given symmetry

Parameters:
  • creators – [in] creator indices

  • annihilators – [in] annihilator indices

  • tensor_generator – [in] the callable that generates the tensor

  • dep – [in] whether to use dependent indices

template<typename TensorGenerator>
static inline ExprPtr make(std::initializer_list<IndexSpace::Type> creators, std::initializer_list<IndexSpace::Type> annihilators, TensorGenerator &&tensor_generator, UseDepIdx csv = UseDepIdx::None)ΒΆ

Protected Functions

OpMaker(OpType op)ΒΆ
inline const auto ncreators() constΒΆ
inline const auto nannihilators() constΒΆ

Protected Attributes

OpType op_ΒΆ
container::svector<IndexSpace> cre_spaces_ΒΆ
container::svector<IndexSpace> ann_spaces_ΒΆ