Template Class Operator

Inheritance Relationships

Base Type

Class Documentation

template<typename QuantumNumbers, Statistics S>
class Operator : public sequant::Operator<void, S>

mbpt::Operator = Tensor * NormalOperator

It is an abstract (index-free) representation of a many-body operator that tracks one or more quantum numbers (e.g., excitation level for single-reference MBPT, particle numbers in each subspace for multi-reference MBPT, etc.) and can be used for operator-level optimizations.

Template Parameters:

QuantumNumbers – a sequence of quantum numbers, must be default-initializable

Public Functions

Operator(std::function<std::wstring_view()> label_generator, std::function<ExprPtr()> tensor_form_generator, std::function<void(QuantumNumbers&)> qn_action)
virtual ~Operator()
QuantumNumbers operator()(const QuantumNumbers &qns = {}) const

evaluates the result of applying this operator to qns

Parameters:

qns – the quantum numbers of the state to which this operator is applied; if not provided, the default-constructed QuantumNumbers are used

Returns:

the quantum numbers after applying this operator to qns

template<typename I, typename = std::enable_if_t<std::is_integral_v<I>>>
inline QuantumNumbers operator()(std::initializer_list<I> qns) const

evaluates the result of applying this operator to initializer-list-encoded qns

Parameters:

qns – the quantum numbers of the state to which this operator is applied; if not provided, the default-constructed QuantumNumbers are used

Returns:

the quantum numbers after applying this operator to qns

virtual QuantumNumbers &apply_to(QuantumNumbers &qns) const

evaluates the result of applying this operator to qns

Parameters:

qns[inout] the quantum numbers of the state to which this operator is applied; on return contains the quantum numbers after applying this operator

Returns:

a reference to *this

virtual bool static_less_than(const Expr &that) const override

Note

that is guaranteed to be of same type as *this, hence can be statically cast

Note

base comparison compares Expr::hash_value() , specialize to each type as needed

Parameters:

that – an Expr object

Returns:

true if *this is less than that

virtual bool commutes_with_atom(const Expr &that) const override

Note

*this and that are guaranteed to be leaves, and neither is a c-number , hence honest checking is needed

Note

this returns true unless overridden in derived class

Parameters:

that – an Expr object

Returns:

true if *this multiplicatively commutes with that

virtual void adjoint() override

adjoint of an Operator is a reversed string of the adjoints of its ops

Public Members

bool is_adjoint_ = false

Protected Functions

Operator()