Macaulay2 » Documentation
Packages » GameTheory :: indexset
next | previous | forward | backward | up | index | toc

indexset -- get the list of index tuples of a tensor

Description

Given a tensor $T$ of format $\{d_1, d_2, \dots, d_n\}$, this method returns a list of all index tuples $(i_1, i_2, \dots, i_n)$ such that $0 \leq i_j < d_j$ for each dimension $j$. Difference from enumerateTensorIndices is that indexset can only be used with a Tensor object. indexset retrieves precomputed indices stored as metadata in a Tensor.

i1 : T = zeroTensor(QQ, {2,3,4});
i2 : indexset T

o2 = {{0, 0, 0}, {0, 0, 1}, {0, 0, 2}, {0, 0, 3}, {0, 1, 0}, {0, 1, 1}, {0,
     ------------------------------------------------------------------------
     1, 2}, {0, 1, 3}, {0, 2, 0}, {0, 2, 1}, {0, 2, 2}, {0, 2, 3}, {1, 0, 0},
     ------------------------------------------------------------------------
     {1, 0, 1}, {1, 0, 2}, {1, 0, 3}, {1, 1, 0}, {1, 1, 1}, {1, 1, 2}, {1, 1,
     ------------------------------------------------------------------------
     3}, {1, 2, 0}, {1, 2, 1}, {1, 2, 2}, {1, 2, 3}}

o2 : List
i3 : T = zeroTensor(QQ, {2});
i4 : indexset T

o4 = {{0}, {1}}

o4 : List

See also

Ways to use indexset:

  • indexset(Tensor)

For the programmer

The object indexset is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.25.06+ds/M2/Macaulay2/packages/GameTheory.m2:1023:0.