This is Tensors.info, produced by Macaulay2, version 1.4

Tensors
*******

Authors
=======

  * Andrew Critch <critch@math.berkeley.edu>
  * Claudiu Raicu <claudiu@math.berkeley.edu>

Version
=======

This documentation describes version 0.1 of Tensors.

Source code
===========

The source code from which this documentation is derived is in the file
Tensors.m2.  The auxiliary files accompanying it are in the directory Tensors/.

Exports
=======

  * Types
      * IndexedTensor (missing documentation)
      * Tensor -- The class of all tensors
      * TensorModule -- The class of all tensor modules
  * Functions and commands
      * associativeCartesianProduct (missing documentation)
      * einsteinSum (missing documentation)
      * genericTensor (missing documentation)
      * indexedTensor (missing documentation)
      * indexedTensorProduct (missing documentation)
      * makeTensor -- Constructor for making tensors from
        their entries.
      * randomTensor (missing documentation)
      * tensorDims (missing documentation)
      * tensorModule -- Constructor for making modules
        whose elements are tensors
      * tensorModuleProduct (missing documentation)
  * Methods
      * - Tensor (missing documentation)
      * diff(Tensor,RingElement) (missing documentation)
      * dim(Symbol,IndexedTensor) (missing documentation)
      * dim(ZZ,Tensor) (missing documentation)
      * entries(IndexedTensor) (missing documentation)
      * IndexedTensor * IndexedTensor (missing documentation)
      * IndexedTensor @ List (missing documentation)
      * IndexedTensor @ Sequence (missing documentation)
      * IndexedTensor _ Sequence (missing documentation)
      * indexedTensor(Tensor,VisibleList) (missing documentation)
      * indices(IndexedTensor) (missing documentation)
      * module(Tensor) (missing documentation)
      * module(TensorModule) (missing documentation)
      * net(IndexedTensor) (missing documentation)
      * net(Tensor) (missing documentation)
      * net(TensorModule) (missing documentation)
      * Ring ** Tensor (missing documentation)
      * RingElement * Tensor (missing documentation)
      * sort(IndexedTensor) (missing documentation)
      * sum(IndexedVariable,IndexedTensor) (missing documentation)
      * sum(List,IndexedTensor) (missing documentation)
      * sum(Symbol,IndexedTensor) (missing documentation)
      * Tensor _ Sequence, see Tensor, -- The class of all
        tensors
      * 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)
      * tensor(IndexedTensor) (missing documentation)
      * tensor(TensorModule,Vector) (missing documentation)
      * tensor(TensorModule,VisibleList) (missing documentation)
      * TensorModule ** TensorModule, see TensorModule, --
        The class of all tensor modules
      * TensorModule ^ ZZ, see TensorModule, -- The class
        of all tensor modules
      * tensorModule(TensorModule), see tensorModule, --
        Constructor for making modules whose elements are tensors
      * TensorModule == TensorModule (missing documentation)
      * TensorModule @ List (missing documentation)
      * TensorModule _ Sequence (missing documentation)
      * vector(Tensor) (missing documentation)

associativeCartesianProduct
***************************

Ways to use associativeCartesianProduct :
=========================================

  * associativeCartesianProduct(VisibleList) (missing documentation)

einsteinSum
***********

Ways to use einsteinSum :
=========================

  * einsteinSum(VisibleList) (missing documentation)

genericTensor
*************

Ways to use genericTensor :
===========================

  * genericTensor(Ring,List) (missing documentation)
  * genericTensor(Ring,RingElement,List) (missing documentation)
  * genericTensor(Ring,ZZ,List) (missing documentation)

IndexedTensor
*************

Methods that use an indexed tensor :
====================================

  * dim(Symbol,IndexedTensor) (missing documentation)
  * entries(IndexedTensor) (missing documentation)
  * IndexedTensor * IndexedTensor (missing documentation)
  * IndexedTensor @ List (missing documentation)
  * IndexedTensor @ Sequence (missing documentation)
  * IndexedTensor _ Sequence (missing documentation)
  * indices(IndexedTensor) (missing documentation)
  * net(IndexedTensor) (missing documentation)
  * sort(IndexedTensor) (missing documentation)
  * sum(IndexedVariable,IndexedTensor) (missing documentation)
  * sum(List,IndexedTensor) (missing documentation)
  * sum(Symbol,IndexedTensor) (missing documentation)
  * tensor(IndexedTensor) (missing documentation)

For the programmer
==================

The object IndexedTensor (missing documentation) is a type (Macaulay2Doc),
with ancestor classes HashTable (Macaulay2Doc),
< Thing (Macaulay2Doc).

indexedTensor
*************

Ways to use indexedTensor :
===========================

  * indexedTensor(Tensor,VisibleList) (missing documentation)

indexedTensorProduct
********************

Ways to use indexedTensorProduct :
==================================

  * indexedTensorProduct(List) (missing documentation)

makeTensor -- Constructor for making tensors from their entries.
****************************************************************

Synopsis
========

  * Usage:makeTensor(rect)makeTensor(dims,ents)makeTensor(dims,func)
  * Inputs:
      * rect, a list (Macaulay2Doc), a rectangular nested list of
        entries of the tensor.
      * dims, a visible list (Macaulay2Doc), dimensions of
        the tensor
      * ents, a visible list (Macaulay2Doc), entries of the
        tensor
      * func, a function (Macaulay2Doc), specifying each entry
        of the tensor as a function of its position key (a sequence)

Description
===========

A tensor can be built like a matrix, by entering a rectangular nested list of
its entries,

+--------------------------------------------+
|i1 : makeTensor{{{1,2},{3,4}},{{5,6},{7,8}}}|
|                                            |
|     +------+------+                        |
|o1 = |{1, 2}|{3, 4}|                        |
|     +------+------+                        |
|     |{5, 6}|{7, 8}|                        |
|     +------+------+                        |
|                                            |
|       8                                    |
|o1 : ZZ {2x2x2}                             |
+--------------------------------------------+

or by entering its dimensions followed by a non-nested visible list of entries

+---------------------------------------------+
|i2 : makeTensor({2,2,2},{1,2,3,4,5,6,7,8})   |
|                                             |
|     +------+------+                         |
|o2 = |{1, 2}|{3, 4}|                         |
|     +------+------+                         |
|     |{5, 6}|{7, 8}|                         |
|     +------+------+                         |
|                                             |
|       8                                     |
|o2 : ZZ {2x2x2}                              |
+---------------------------------------------+
|i3 : makeTensor({3,3,3},1..27)               |
|                                             |
|     +------------+------------+------------+|
|o3 = |{1 , 2 , 3 }|{4 , 5 , 6 }|{7 , 8 , 9 }||
|     +------------+------------+------------+|
|     |{10, 11, 12}|{13, 14, 15}|{16, 17, 18}||
|     +------------+------------+------------+|
|     |{19, 20, 21}|{22, 23, 24}|{25, 26, 27}||
|     +------------+------------+------------+|
|                                             |
|       27                                    |
|o3 : ZZ  {3x3x3}                             |
+---------------------------------------------+

or by entering its dimenions followed by a function which gives the entries of
tensor as a function of their position keys,

+-----------------------------------------------------------------+
|i4 : R=QQ[x,y,z]                                                 |
|                                                                 |
|o4 = R                                                           |
|                                                                 |
|o4 : PolynomialRing                                              |
+-----------------------------------------------------------------+
|i5 : T=makeTensor({3,3,3},(i,j,k)->x^i*y^j*z^k)                  |
|                                                                 |
|     +---------------+--------------------+---------------------+|
|     |           2   |                2   |  2     2      2 2   ||
|o5 = |{1 , z  , z   }|{y  , y*z  , y*z   }|{y   , y z  , y z   }||
|     +---------------+--------------------+---------------------+|
|     |             2 |                  2 |    2     2      2 2 ||
|     |{x , x*z, x*z }|{x*y, x*y*z, x*y*z }|{x*y , x*y z, x*y z }||
|     +---------------+--------------------+---------------------+|
|     |  2   2    2 2 |  2    2      2   2 |  2 2   2 2    2 2 2 ||
|     |{x , x z, x z }|{x y, x y*z, x y*z }|{x y , x y z, x y z }||
|     +---------------+--------------------+---------------------+|
|                                                                 |
|      27                                                         |
|o5 : R  {3x3x3}                                                  |
+-----------------------------------------------------------------+
|i6 : T_(1,2,2)==x^1*y^2*z^2                                      |
|                                                                 |
|o6 = true                                                        |
+-----------------------------------------------------------------+

Caveat
======

The constructor tensor (Macaulay2Doc), is used to return tensors
from tensor-related types defined in the Tensors package.

Ways to use makeTensor :
========================

  * makeTensor(List)
  * makeTensor(VisibleList,Function)
  * makeTensor(VisibleList,VisibleList)

randomTensor
************

Ways to use randomTensor :
==========================

  * randomTensor(Ring,List) (missing documentation)
  * randomTensor(Ring,Thing,List) (missing documentation)

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 (Macaulay2Doc), with
ancestor classes Vector (Macaulay2Doc), < BasicList (Macaulay2Doc)
< Thing (Macaulay2Doc).

tensorDims
**********

TensorModule -- The class of all tensor modules
***********************************************

Description
===========

A tensor module is a module that is a tensor product of smaller modules, which
"remembers" that it is a tensor product.  Mathematically, one could define a
tensor module as a module M augmented with a list of other modules M_1...M_n
and a choice of isomorphism to M'=M_1**...**M_n. In Macaulay2, this isomoprhism
is implicit in that M and M' are == as modules, and the isomorphism is
accessible as inducedMap(M,M').

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x]                                                                 |
|                                                                             |
|o1 = R                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : M=R^3 ** R^3 ** R^4 -- doesn't remember it's a tensor product, but      |
|                                                                             |
|      36                                                                     |
|o2 = R                                                                       |
|                                                                             |
|o2 : R-module, free                                                          |
+-----------------------------------------------------------------------------+
|i3 : N=tensorModule(R,{3,3,4}) -- does.                                      |
|                                                                             |
|      36                                                                     |
|o3 = R  {3x3x4}                                                              |
|                                                                             |
|o3 : Free R-TensorModule of order 3, dimensions {3, 3, 4}                    |
+-----------------------------------------------------------------------------+
|i4 : (class M,class N)                                                       |
|                                                                             |
|o4 = (Module, TensorModule)                                                  |
|                                                                             |
|o4 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i5 : M==N -- they are equal as modules,                                      |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+
|i6 : M'===M -- but not as typed objects, and                                 |
|                                                                             |
|o6 = false                                                                   |
+-----------------------------------------------------------------------------+
|i7 : O=tensorModule(R,{4,3,4})                                               |
|                                                                             |
|      48                                                                     |
|o7 = R  {4x3x4}                                                              |
|                                                                             |
|o7 : Free R-TensorModule of order 3, dimensions {4, 3, 4}                    |
+-----------------------------------------------------------------------------+
|i8 : not M==O -- tensor modules with different factors are considered        |
|                                                                             |
|o8 = true                                                                    |
|-----------------------------------------------------------------------------|
|different                                                                    |
+-----------------------------------------------------------------------------+
|i9 : N.factors                                                               |
|                                                                             |
|       3   3   4                                                             |
|o9 = {R , R , R }                                                            |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+
|i10 : O.factors                                                              |
|                                                                             |
|        4   3   4                                                            |
|o10 = {R , R , R }                                                           |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+

Methods that use a tensor module :
==================================

  * module(TensorModule) (missing documentation)
  * net(TensorModule) (missing documentation)
  * tensor(TensorModule,Vector) (missing documentation)
  * tensor(TensorModule,VisibleList) (missing documentation)
  * TensorModule ** TensorModule
  * TensorModule ^ ZZ
  * tensorModule(TensorModule), see tensorModule, --
    Constructor for making modules whose elements are tensors
  * TensorModule == TensorModule (missing documentation)
  * TensorModule @ List (missing documentation)
  * TensorModule _ Sequence (missing documentation)

For the programmer
==================

The object TensorModule, is a type (Macaulay2Doc),
with ancestor classes Module (Macaulay2Doc),
< ImmutableType (Macaulay2Doc) < HashTable (Macaulay2Doc)
< Thing (Macaulay2Doc).

tensorModule -- Constructor for making modules whose elements are tensors
*************************************************************************

Synopsis
========

  * Usage:tensorModule(R,dims)tensorModule(M)tensorModule(M,dims)tensorModule(N
    )
  * Inputs:
      * R, a ring (Macaulay2Doc),
      * dims, a list (Macaulay2Doc), specifying dimensions for the
        tensors in the module
      * M, a module (Macaulay2Doc), a free module or quotient
        module.
      * N, a tensor module,
  * Consequences:
      * Returns a module whose elements are interpreted and displayed as
        tensors, which "remembers" if it is a tensor product of smaller
        modules.
      * {\tt tensorModule(R,dims)}

Description
===========

+---------------------------------------------------------+
|i1 : R=QQ[x,y]                                           |
|                                                         |
|o1 = R                                                   |
|                                                         |
|o1 : PolynomialRing                                      |
+---------------------------------------------------------+
|i2 : M=tensorModule(R,{4,3,2})                           |
|                                                         |
|      24                                                 |
|o2 = R  {4x3x2}                                          |
|                                                         |
|o2 : Free R-TensorModule of order 3, dimensions {4, 3, 2}|
+---------------------------------------------------------+
|i3 : M_(2,0,1) -- same as M_13                           |
|                                                         |
|     +------+------+------+                              |
|o3 = |{0, 0}|{0, 0}|{0, 0}|                              |
|     +------+------+------+                              |
|     |{0, 0}|{0, 0}|{0, 0}|                              |
|     +------+------+------+                              |
|     |{0, 1}|{0, 0}|{0, 0}|                              |
|     +------+------+------+                              |
|     |{0, 0}|{0, 0}|{0, 0}|                              |
|     +------+------+------+                              |
|                                                         |
|      24                                                 |
|o3 : R  {4x3x2}                                          |
+---------------------------------------------------------+
|i4 : M.factors                                           |
|                                                         |
|       4   3   2                                         |
|o4 = {R , R , R }                                        |
|                                                         |
|o4 : List                                                |
+---------------------------------------------------------+
|i5 : M.dimensions                                        |
|                                                         |
|o5 = {4, 3, 2}                                           |
|                                                         |
|o5 : List                                                |
+---------------------------------------------------------+

+-----------------------------------------------------------------+
|i6 : I = ideal(x*y)                                              |
|                                                                 |
|o6 = ideal(x*y)                                                  |
|                                                                 |
|o6 : Ideal of R                                                  |
+-----------------------------------------------------------------+
|i7 : M=R^4/I                                                     |
|                                                                 |
|o7 = cokernel | xy 0  0  0  |                                    |
|              | 0  xy 0  0  |                                    |
|              | 0  0  xy 0  |                                    |
|              | 0  0  0  xy |                                    |
|                                                                 |
|                            4                                    |
|o7 : R-module, quotient of R                                     |
+-----------------------------------------------------------------+
|i8 : N=tensorModule(M,{2,2})                                     |
|                                                                 |
|o8 = cokernel | xy 0  0  0  |                                    |
|              | 0  xy 0  0  |                                    |
|              | 0  0  xy 0  |                                    |
|              | 0  0  0  xy |                                    |
|                                                                 |
|                                                                4|
|o8 : R-TensorModule of order 2, dimensions {2, 2}, quotient of R |
+-----------------------------------------------------------------+
|i9 : N_(0,0)                                                     |
|                                                                 |
|     +-+-+                                                       |
|o9 = |1|0|                                                       |
|     +-+-+                                                       |
|     |0|0|                                                       |
|     +-+-+                                                       |
|                                                                 |
|o9 : cokernel | xy 0  0  0  |                                    |
|              | 0  xy 0  0  |                                    |
|              | 0  0  xy 0  |                                    |
|              | 0  0  0  xy |                                    |
+-----------------------------------------------------------------+
|i10 : oo*x*y==0_N                                                |
|                                                                 |
|o10 = true                                                       |
+-----------------------------------------------------------------+

Ways to use tensorModule :
==========================

  * tensorModule(Module)
  * tensorModule(Module,List)
  * tensorModule(Ring,List)
  * tensorModule(TensorModule)

tensorModuleProduct
*******************

Ways to use tensorModuleProduct :
=================================

  * tensorModuleProduct(List) (missing documentation)
  * tensorModuleProduct(Sequence) (missing documentation)