12 #ifndef HAMMER_MATH_MULTIDIM_LABELEDINDEXING
13 #define HAMMER_MATH_MULTIDIM_LABELEDINDEXING
19 namespace MultiDimensional {
22 template<
class BasicIndexing>
46 using BasicIndexing::dim;
IndexType dim(IndexLabel label) const
dimension of a specific component by label.
LabeledIndexing & operator=(const LabeledIndexing &)=default
~LabeledIndexing()=default
std::vector< IndexPair > IndexPairList
UniqueLabelsList sameIndices(const LabelsList &otherLabels) const
returns the set of indices of this tensor that can be contracted using dot with those of another give...
UniqueLabelsList spinIndices() const
returns only the labels corresponding to spin indices
bool isSameLabelShape(const LabelsList &otherLabels, const IndexList &otherIndices) const
LabelPairsSet oppositeIndices() const
returns the pairs of indices that can be traced over.
const LabelsList & labels() const
get the labels of all the indices at once
IndexPairList getSameLabelPairs(const LabelsList &otherLabels, const UniqueLabelsList &indices, bool sortedBySecond=true) const
returns the position of the indices in the two tensor (this and another) that can be contracted toget...
Forward declarations of types used in the tensor classes.
std::vector< IndexType > IndexList
IndexLabel
label identifiers of tensor indices they are used to determine which indices can be contracted togeth...
Tensor labeled indexer template methods definitions.
IndexType labelIndex(IndexLabel label) const
bool canAddAt(const LabelsList &otherLabels, const IndexList &otherIndices, IndexLabel coord, IndexType position) const
std::vector< IndexLabel > LabelsList
std::set< IndexLabel > UniqueLabelsList
IndexPairList getOppositeLabelPairs(const UniqueLabelsList &indices) const
returns the position of the indices that can be traced together, given a set of allowed index labels ...
std::set< LabelPair > LabelPairsSet
LabelsList flipListOfLabels(LabelsList labels)
LabelsList _labels
the labels of each tensor index