Class DefaultTensorCanonicalizer

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class DefaultTensorCanonicalizer : public sequant::TensorCanonicalizer

Subclassed by sequant::TensorBlockCanonicalizer

Public Functions

DefaultTensorCanonicalizer() = default
template<typename IndexContainer>
inline DefaultTensorCanonicalizer(IndexContainer &&external_indices)

Warning

external_indices is assumed to be immutable during the lifetime of this object

Template Parameters:

IndexContainer – a Container of Index objects such that IndexContainer::value_type is convertible to Index (e.g. this can be std::vector or std::set , but not std::map)

Parameters:

external_indices – container of external Index objects

virtual ~DefaultTensorCanonicalizer() = default
virtual ExprPtr apply(AbstractTensor &t) const override

Implements TensorCanonicalizer::apply

Note

Canonicalizes t by sorting its bra (if t.symmetry()==Symmetry::nonsymm ) or its bra and ket (if t.symmetry()!=Symmetry::nonsymm ), with the external indices appearing “before” (smaller particle indices) than the internal indices

template<typename IndexComp, typename IndexPairComp>
inline ExprPtr apply(AbstractTensor &t, const IndexComp &idxcmp, const IndexPairComp &paircmp) const

Core of DefaultTensorCanonicalizer::apply, only does the canonicalization, i.e. no tagging/untagging

Protected Functions

void tag_indices(AbstractTensor &t) const