Class AbstractTensor

Inheritance Relationships

Derived Types

Class Documentation

class AbstractTensor

AbstractTensor is a tensor over general (i.e., not necessarily commutative) rings. A tensor with contravariant (ket, Dirac notation ) and covariant (bra) modes describes elements of a tensor product of vector spaces. Equivalently it represents a linear map between the tensor product of primal vector spaces to the tensor product of dual vector spaces. Tensor modes are 1-to-1 represented by unique indices, represented by Index objects.

It is also necessary to support modes that are “array-like” in that they do not refer to a vector space or its dual; such modes can represent ordinal indices (e.g. to treat a collection/sequence of tensors as a single tensor) Thus each tensor has zero or more auxiliary (aux) modes. The aux modes are invariant under the transformations of vector spaces and do not contribute to the tensor symmetries.

Tensors can have the following symmetries:

  • Tensors can be symmetric or nonsymmetric with respect to the transposition of corresponding (first, second, etc.) modes in bra/ket mode ranges. This symmetry is used to treat particle as indistinguishable or distinguishable in many-particle quantum mechanics context.

  • Tensors can be symmetric, antisymmetric, and nonsymmetric with respect to the transposition of modes within the bra or ket sets. This symmetry is used to model the distinguishable and indistinguishable (bosonic and fermionic) degrees of freedom in many-body quantum mechanics context. More complicated symmetries are not yet supported.

  • Tensors can be symmetric, conjugate, or nonsymmetric with respect to swap of bra with ket. This symmetry corresponds to time reversal in physical simulation.

Lastly, the supporting rings are not assumed to be scalars, hence tensor product supporting the concept of tensor is not necessarily commutative.

Note

This interface class defines a Tensor concept. All Tensor objects must fulfill the is_tensor trait (see below). To adapt an existing class intrusively derive it from AbstractTensor and implement all member functions. This allows to implement 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

accessor bra (covariant) indices

Returns:

view of a contiguous range of Index objects

inline virtual const_any_view_randsz _ket() const

accesses ket (contravariant) indices

Returns:

view of a contiguous range of Index objects

inline virtual const_any_view_randsz _aux() const

accesses aux (invariant) indices

Returns:

view of a contiguous range of Index objects

inline virtual const_any_view_rand _braket() const

accesses bra and ket indices view of a not necessarily contiguous range of Index objects

inline virtual const_any_view_rand _indices() const

accesses bra, ket, and aux indices

Returns:

view of a not necessarily contiguous range of Index objects

inline virtual std::size_t _bra_rank() const
Returns:

the number of bra indices

inline virtual std::size_t _ket_rank() const
Returns:

the number of ket indices

inline virtual std::size_t _aux_rank() const
Returns:

the number of aux indices

inline virtual Symmetry _symmetry() const
Returns:

the permutational symmetry of the vector space indices of the tensor

inline virtual BraKetSymmetry _braket_symmetry() const
Returns:

the symmetry of tensor under exchange of vectors space (bra) and its dual (ket)

inline virtual ParticleSymmetry _particle_symmetry() const
Returns:

the symmetry of tensor under exchange of bra and ket

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()