Class AbstractTensor

Inheritance Relationships

Derived Types

Class Documentation

class AbstractTensor

This interface class defines a Tensor concept. Object t of a type that meets the concept must satisfy the following:

  • bra(t) , ket(t) , and braket(t) are valid expressions and evaluate to a range of Index objects;

  • bra_rank(t) and ket_rank(t) are valid expression and return sizes of the bra(t) and ket(t) ranges, respectively;

  • symmetry(t) is a valid expression and evaluates to a Symmetry object that describes the symmetry of bra/ket of a particle-symmetric t ;

  • braket_symmetry(t) is a valid expression and evaluates to a BraKetSymmetry object that describes the bra-ket symmetry of t ;

  • particle_symmetry(t) is a valid expression and evaluates to a ParticleSymmetry object that describes the symmetry of t with respect to permutations of particles;

  • color(t) is a valid expression and returns whether a nonnegative integer that identifies the type of a tensor; tensors with different colors can be reordered in a Product at will

  • is_cnumber(t) is a valid expression and returns whether t commutes with other tensor of same color (tensors of different colors are, for now, always assumed to commute)

  • label(t) is a valid expression and its return is convertible to a std::wstring;

  • to_latex(t) is a valid expression and its return is convertible to a std::wstring. To adapt an existing class intrusively derive it from AbstractTensor and implement all member functions. This allows to implememnt heterogeneous containers of objects that meet the Tensor concept.

Subclassed by sequant::NormalOperator< S >, sequant::Tensor

Public Types

using const_any_view_rand = ranges::any_view<const Index&, ranges::category::random_access>
using const_any_view_randsz = ranges::any_view<const Index&, ranges::category::random_access | ranges::category::sized>
using any_view_rand = ranges::any_view<Index&, ranges::category::random_access>
using any_view_randsz = ranges::any_view<Index&, ranges::category::random_access | ranges::category::sized>

Public Functions

virtual ~AbstractTensor() = default
inline virtual const_any_view_randsz _bra() const

view of a contiguous range of Index objects

inline virtual const_any_view_randsz _ket() const

view of a contiguous range of Index objects

inline virtual const_any_view_rand _braket() const

view of a not necessarily contiguous range of Index objects

inline virtual std::size_t _bra_rank() const
inline virtual std::size_t _ket_rank() const
inline virtual Symmetry _symmetry() const
inline virtual BraKetSymmetry _braket_symmetry() const
inline virtual ParticleSymmetry _particle_symmetry() const
inline virtual std::size_t _color() const
inline virtual bool _is_cnumber() const

Returns:

true if this is a c-number; if false,

inline virtual std::wstring_view _label() const
inline virtual std::wstring _to_latex() const
inline virtual bool operator<(const AbstractTensor &other) const
inline virtual bool _transform_indices(const container::map<Index, Index> &index_map)
inline virtual void _reset_tags()