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

Tensor -- a mutable hash table representing a tensor

Description

The type `Tensor` is a mutable hash table with additional metadata to represent multi-dimensional arrays. Each tensor has an associated format (list of dimensions), a coefficient ring, and a set of index keys.

i1 : T = zeroTensor(QQ, {2,2});
i2 : T#{0,0} = 1;
i3 : T#{1,1} = 5;
i4 : format T

o4 = {2, 2}

o4 : List
i5 : coefficientRing T

o5 = QQ

o5 : Ring
i6 : indexset T

o6 = {{0, 0}, {0, 1}, {1, 0}, {1, 1}}

o6 : List

See also

Methods that use an object of class Tensor:

  • assemblePlayeriPolynomials(Ring,Tensor,ZZ) -- see assemblePlayeriPolynomials -- get all incentive constraint polynomials for a player
  • assemblePolynomial(Ring,Tensor,List) -- see assemblePolynomial -- compute incentive constraint polynomial for deviation
  • coefficientRing(Tensor) (missing documentation)
  • format(Tensor) (missing documentation)
  • indexset(Tensor) -- see indexset -- get the list of index tuples of a tensor
  • slice(Tensor,List,List) -- see slice -- extract a slice of a tensor

For the programmer

The object Tensor is a type, with ancestor classes MutableHashTable < HashTable < Thing.


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