next | previous | forward | backward | up | top | index | toc | Macaulay2 website
TensorComplexes :: toOrdinal

toOrdinal -- turns the label of a basis element of a labeled module into a corresponding ordinal

Synopsis

Description

This function allows one to move from the labels of the basis elements of a labeled free module of rank $r$ to the the integers $\{0,1, \dots, r-1\}$. More specifically, if $F$ is a labeled free module where we have labeled the basis with the list $L$, then this function an element $l\in L$ to the ordinal $j$ such that $l$ is the $j$'th element of $L$.

i1 : S=ZZ/101[x_{0,0,0}..x_{2,1,1}];
i2 : C=symmetricPower(2,labeledModule(S^3))

      6
o2 = S

o2 : free S-module with labeled basis
i3 : basisList C

o3 = {{0, 0}, {0, 1}, {1, 1}, {0, 2}, {1, 2}, {2, 2}}

o3 : List
i4 : toOrdinal({0,0},C)

o4 = 0
i5 : toOrdinal({1,2},C)

o5 = 4

See also

Ways to use toOrdinal :

For the programmer

The object toOrdinal is a method function.