next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Tensors (missing documentation) :: Tensor

Tensor -- The class of all tensors

Description

In Macaulay2, a tensor is stored as a vector which is a member of a tensor module.

i1 : R=QQ[a..h]

o1 = R

o1 : PolynomialRing
i2 : T=makeTensor({2,2,2},a..h)

     +------+------+
o2 = |{a, b}|{c, d}|
     +------+------+
     |{e, f}|{g, h}|
     +------+------+

      8
o2 : R {2x2x2}
i3 : class T

      8
o3 = R {2x2x2}

o3 : Free R-TensorModule of order 3, dimensions {2, 2, 2}
i4 : vector T

o4 = | a |
     | b |
     | c |
     | d |
     | e |
     | f |
     | g |
     | h |

      8
o4 : R

Tensor products of tensors have the appropriate dimensions.

i5 : X=makeTensor{{a,b},{c,d}}

     +-+-+
o5 = |a|b|
     +-+-+
     |c|d|
     +-+-+

      4
o5 : R {2x2}
i6 : Y=makeTensor{{1_R,2},{3,4}}

     +-+-+
o6 = |1|2|
     +-+-+
     |3|4|
     +-+-+

      4
o6 : R {2x2}
i7 : X**Y

     +-------------------+-------------------+
o7 = |{{a, 2a}, {3a, 4a}}|{{b, 2b}, {3b, 4b}}|
     +-------------------+-------------------+
     |{{c, 2c}, {3c, 4c}}|{{d, 2d}, {3d, 4d}}|
     +-------------------+-------------------+

      16
o7 : R  {2x2x2x2}

Tensors can be manipulated similarly to vectors.

i8 : U=makeTensor({2,2,2},{h,g,f,e,d,c,b,a})

     +------+------+
o8 = |{h, g}|{f, e}|
     +------+------+
     |{d, c}|{b, a}|
     +------+------+

      8
o8 : R {2x2x2}
i9 : T+2*U

     +----------------+----------------+
o9 = |{a + 2h, b + 2g}|{c + 2f, d + 2e}|
     +----------------+----------------+
     |{2d + e, 2c + f}|{2b + g, 2a + h}|
     +----------------+----------------+

      8
o9 : R {2x2x2}

Functions and methods returning a tensor :

  • randomTensor (missing documentation)

Methods that use a tensor :

  • - Tensor (missing documentation)
  • diff(Tensor,RingElement) (missing documentation)
  • dim(ZZ,Tensor) (missing documentation)
  • indexedTensor(Tensor,VisibleList) (missing documentation)
  • module(Tensor) (missing documentation)
  • net(Tensor) (missing documentation)
  • Ring ** Tensor (missing documentation)
  • RingElement * Tensor (missing documentation)
  • Tensor _ Sequence
  • Tensor * RingElement (missing documentation)
  • Tensor ** Tensor (missing documentation)
  • Tensor + Tensor (missing documentation)
  • Tensor - Tensor (missing documentation)
  • Tensor / Function (missing documentation)
  • Tensor @ List (missing documentation)
  • Tensor ^ ZZ (missing documentation)
  • Tensor _ IndexedVariable (missing documentation)
  • Tensor _ List (missing documentation)
  • Tensor _ Symbol (missing documentation)
  • vector(Tensor) (missing documentation)

For the programmer

The object Tensor is a type, with ancestor classes Vector < BasicList < Thing.