This is TensorComplexes.info, produced by Macaulay2, version 1.25.05

TensorComplexes -- multilinear algebra for the construction of tensor complexes
*******************************************************************************

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

A $b_1\times \cdots\times  b_n$ tensor with coefficients in a ring S may be
thought of as a multilinear linear form on $X := Proj(Spec S \times \mathbb
P^{b_1-1}\times \cdots \times \mathbb P^{b_n-1})$. (If $S$ is graded, we may
replace $Spec S$ by $Proj S$.)

This package provides a family of definitions around the notion of
LabeledModule that makes it convenient to manipulate complicated multilinear
constructions with tensors. We implement one such construction, that of Tensor
Complexes, from the paper ``Tensor Complexes: Multilinear free resolutions
constructed from higher tensors'' of Berkesch, Erman, Kummini and Sam (BEKS),
which extends the construction of pure resolutions in the paper ``Betti numbers
of graded modules and cohomology of vector bundles'' of Eisenbud and Schreyer.
This itself is an instance of the technique of ``collapsing homogeneous vector
bundles'' developed by Kempf and described, for example, in the book
``Cohomology of vector bundles and syzygies'' of Weyman.

Tensor complexes specialize to several well-known constructions including: the
Eagon-Northcott and Buchsbaum-Rim complexes, and the others in this family
described by Eisenbud and Buchsbaum (see Eisenbud ``Commutative algebra with a
view towards algebraic geometry'', A2.6), and the hyperdeterminants of Weyman
and Zelevinsky.

A collection of $a$ tensors of type $b_1\times \dots \times b_n$ may be
regarded as a map $E := \mathcal O_X^a(-1,-1,\dots,-1) \to \mathcal O_X$ (with
$X$ as above). Equivalently, we may think of this as a single $a \times b_1
\times \cdots \times b_n$ tensor.

One important construction made from such a collection of tensors is the Koszul
complex $$ \mathbf K := \cdots \to \wedge^2 (\oplus_1^a O_X(-1,\dots, -1)) \to
\oplus_1^a O_X(-1,\dots, -1)\to  O_X  \to 0. $$ Let $\mathcal O_X(d, e_1,\dots
e_n)$ be the tensor product of the pull-backs to $X$ of the line bundles
$\mathcal O_{\mathbb P^n}(d)$ and  $\mathcal O_{\mathbb P^{b_i-1}}(-1)$. If we
twist the Koszul complex by $O_X(0, -w_1, \dots -w_n)$ and then push it forward
to $Spec S$ we get the tensor complex $F(\phi,w)$ of BEKS.

Each map $\partial_i$ in the tensor complex can be defined by a rather involved
construct in multilinear algebra. This package implements the construction of
$\partial_1$ in the range of cases described explicitly in BEKS (Sections 4 and
12). This range includes the hyperdeterminants of boundary format, the
construction of the first map of the pure resolutions of Eisenbud-Schreyer, and
the first map in most of the much larger family of generic pure resolutions of
BEKS.

Authors
=======

  * David Eisenbud (see http://www.msri.org/~de/ ) <de@msri.org>
  * Daniel Erman (see http://math.stanford.edu/~derman/ )
    <derman@math.stanford.edu>
  * Gregory G. Smith (see http://www.mast.queensu.ca/~ggsmith )
    <ggsmith@mast.queensu.ca>
  * Dumitru Stamate <dumitru.stamate@fmi.unibuc.ro>

Version
=======

This documentation describes version 1.0 of TensorComplexes.

Citation
========

If you have used this package in your research, please cite it as follows:

+-----------------------------------------------------------------------------+
|@misc{TensorComplexesSource,                                                 |
|  title = {{TensorComplexes: multilinear algebra with labeled bases. Version~|
|  author = {David Eisenbud and Daniel Erman and Gregory G. Smith and Dumitru |
|  howpublished = {A \emph{Macaulay2} package available at                    |
|    \url{https://github.com/Macaulay2/M2/tree/master/M2/Macaulay2/packages}} |
|}                                                                            |
|-----------------------------------------------------------------------------|
|1.0}},                                                                       |
|Stamate},                                                                    |
+-----------------------------------------------------------------------------+

Exports
=======

  * Types
      * LabeledModule -- the class of free modules with a
        labeled basis
      * LabeledModuleMap -- the class of maps between
        LabeledModules
  * Functions and commands
      * basisList -- gives the list used to label the basis
        elements of a labeled module
      * cauchyMap -- produces one surjection from the Cauchy
        decomposition of the exterior power of a tensor product
      * flattenedESTensor -- make a flattened tensor
        from elementary symmetric functions
      * flattenedGenericTensor -- Make a generic
        tensor of given format
      * fromOrdinal -- outputs the label of a basis element
        of a labeled module
      * hyperdeterminant -- computes the
        hyperdeterminant of a boundary format tensor
      * hyperdeterminantMatrix -- computes a
        matrix whose determinant equals the hyperdeterminant of a boundary
        format tensor
      * labeledModule -- makes a labeled module
      * minorsMap -- creates a map of labeled free modules
        whose image is the minors of a map of labeled free modules
      * multiSubsets -- produce all subsets of a given
        size, allowing repetitions
      * pureResES -- constructs the Eisenbud--Schreyer pure
        resolution of a given type
      * pureResES1 -- computes the first map of the
        Eisenbud--Schreyer pure resolution of a given type
      * pureResTC -- constructs the balanced tensor complex
        of a given type
      * pureResTC1 -- computes the first map of a balanced
        tensor complex with pure resolution of a given type
      * symmetricMultiplication -- creates the
        symmetric multiplication map
      * tensorComplex1 -- computes the first map of the
        tensor complex
      * tensorProduct -- tensor product of Modules and
        LabeledModules, Matrices, Maps and LabeledModuleMaps
      * toOrdinal -- turns the label of a basis element of a
        labeled module into a corresponding ordinal
      * traceMap -- produces the trace map from a ring to a
        free module tensored with its dual
      * underlyingModules -- gives the list of
        underlying modules of a labeled module
  * Methods
      * "basisList(LabeledModule)" -- see basisList, -- gives
        the list used to label the basis elements of a labeled module
      * "cauchyMap(ZZ,LabeledModule)" -- see cauchyMap, --
        produces one surjection from the Cauchy decomposition of the exterior
        power of a tensor product
      * cokernel(LabeledModuleMap) (missing documentation)
      * exteriorPower(ZZ,LabeledModule)
        -- Exterior power of a @TO
        LabeledModule@
      * flattenedESTensor(List,Ring) (missing documentation)
      * "flattenedGenericTensor(List,Ring)" -- see
        flattenedGenericTensor, -- Make a generic
        tensor of given format
      * "fromOrdinal(ZZ,LabeledModule)" -- see fromOrdinal,
        -- outputs the label of a basis element of a labeled module
      * "hyperdeterminant(LabeledModuleMap)" -- see hyperdeterminant,
        -- computes the hyperdeterminant of a boundary format
        tensor
      * "hyperdeterminantMatrix(LabeledModuleMap)" -- see
        hyperdeterminantMatrix, -- computes a matrix
        whose determinant equals the hyperdeterminant of a boundary format
        tensor
      * "labeledModule(Module)" -- see labeledModule, --
        makes a labeled module
      * "labeledModule(Ring)" -- see labeledModule, --
        makes a labeled module
      * LabeledModule ** LabeledModule (missing documentation)
      * LabeledModule == LabeledModule (missing documentation)
      * LabeledModuleMap * LabeledModuleMap (missing documentation)
      * LabeledModuleMap ** LabeledModuleMap (missing documentation)
      * map(LabeledModule,LabeledModule,Function)
        -- create a
        LabeledModuleMap by specifying a function that gives each entry
      * map(LabeledModule,LabeledModule,LabeledModuleMap)
        -- creates a
        new LabeledModuleMap from a given LabeledModuleMap
      * map(LabeledModule,LabeledModule,List)
        -- creates a
        LabeledModuleMap from a list
      * map(LabeledModule,LabeledModule,Matrix)
        -- creates a
        LabeledModuleMap from a matrix
      * map(LabeledModule,LabeledModule,ZZ)
        -- creates scalar
        multiplication by an integer as a LabeledModuleMap
      * matrix(LabeledModuleMap) (missing documentation)
      * "minorsMap(LabeledModuleMap,LabeledModule)" -- see minorsMap,
        -- creates a map of labeled free modules whose image is the
        minors of a map of labeled free modules
      * "minorsMap(Matrix,LabeledModule)" -- see minorsMap, --
        creates a map of labeled free modules whose image is the minors of a
        map of labeled free modules
      * module(LabeledModule) (missing documentation)
      * "multiSubsets(List,ZZ)" -- see multiSubsets, --
        produce all subsets of a given size, allowing repetitions
      * "multiSubsets(ZZ,ZZ)" -- see multiSubsets, --
        produce all subsets of a given size, allowing repetitions
      * net(LabeledModule) (missing documentation)
      * net(LabeledModuleMap) (missing documentation)
      * pureResES(List,Ring) (missing documentation)
      * pureResES1(List,Ring) (missing documentation)
      * pureResTC(List,Ring) (missing documentation)
      * pureResTC1(List,Ring) (missing documentation)
      * rank(LabeledModule) (missing documentation)
      * rank(LabeledModuleMap) (missing documentation)
      * ring(LabeledModule) (missing documentation)
      * ring(LabeledModuleMap) (missing documentation)
      * source(LabeledModuleMap) -- the
        source of a map of a labeled modules
      * "symmetricMultiplication(LabeledModule,ZZ,ZZ)" -- see
        symmetricMultiplication, -- creates the
        symmetric multiplication map
      * symmetricPower(ZZ,LabeledModule)
        -- Symmetric power of a @TO
        LabeledModule@
      * target(LabeledModuleMap) -- the
        target of a map of a labeled modules
      * tensor(LabeledModule,LabeledModule)
        -- creates the tensor
        product of two labeled modules, as a labeled module
      * tensor(LabeledModuleMap,LabeledModuleMap)
        -- creates the tensor
        product of two maps of labeled modules, as a map of labeled module
      * "tensorComplex1(LabeledModuleMap)" -- see tensorComplex1,
        -- computes the first map of the tensor complex
      * "tensorComplex1(LabeledModuleMap,List)" -- see tensorComplex1,
        -- computes the first map of the tensor complex
      * tensorProduct(List) (missing documentation)
      * tensorProduct(Sequence) (missing documentation)
      * "toOrdinal(Thing,LabeledModule)" -- see toOrdinal, --
        turns the label of a basis element of a labeled module into a
        corresponding ordinal
      * "traceMap(LabeledModule)" -- see traceMap, -- produces
        the trace map from a ring to a free module tensored with its dual
      * transpose(LabeledModuleMap) (missing documentation)
      * "underlyingModules(LabeledModule)" -- see underlyingModules,
        -- gives the list of underlying modules of a labeled
        module
  * Symbols
      * MonSize (missing documentation)

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

The object TensorComplexes, is a package (Macaulay2Doc),
defined in TensorComplexes.m2.

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:699:0.

basisList -- gives the list used to label the basis elements of a labeled module
********************************************************************************

  * Usage:
        basisList(F)
  * Inputs:
      * F, a free module with labeled basis,
  * Outputs:
      * a list (Macaulay2Doc),

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

One of the key features of a labeled module of rank $r$ is that the basis can
be labeled by any list of cardinality $r$. This is particularly convenient when
working with tensor products, symmetric powers, and exterior powers.  For
instance, if $A$ is a labeled module with basis labeled by $\{0,\dots, r-1\}$
then it is natural to think of $\wedge^2 A$ as a labeled module with a basis
labeled by elements of the lists $$ \{(i,j)| 0\leq i<j\leq r-1\}. $$ When you
use apply the functions tensorProduct,
symmetricPower (Macaulay2Doc), and exteriorPower (Macaulay2Doc),
to a labeled module, the output is a labeled
module with a natural basis list.

+---------------------------------------------------------------------+
|i1 : S=ZZ/101[x,y,z];                                                |
+---------------------------------------------------------------------+
|i2 : A=labeledModule(S^2);                                           |
|                                                                     |
|o2 : free S-module with labeled basis                                |
+---------------------------------------------------------------------+
|i3 : B=labeledModule(S^4);                                           |
|                                                                     |
|o3 : free S-module with labeled basis                                |
+---------------------------------------------------------------------+
|i4 : F=A**B                                                          |
|                                                                     |
|      8                                                              |
|o4 = S                                                               |
|                                                                     |
|o4 : free S-module with labeled basis                                |
+---------------------------------------------------------------------+
|i5 : basisList(F)                                                    |
|                                                                     |
|o5 = {{0, 0}, {0, 1}, {0, 2}, {0, 3}, {1, 0}, {1, 1}, {1, 2}, {1, 3}}|
|                                                                     |
|o5 : List                                                            |
+---------------------------------------------------------------------+
|i6 : G=exteriorPower(2,B)                                            |
|                                                                     |
|      6                                                              |
|o6 = S                                                               |
|                                                                     |
|o6 : free S-module with labeled basis                                |
+---------------------------------------------------------------------+
|i7 : basisList(G)                                                    |
|                                                                     |
|o7 = {{0, 1}, {0, 2}, {1, 2}, {0, 3}, {1, 3}, {2, 3}}                |
|                                                                     |
|o7 : List                                                            |
+---------------------------------------------------------------------+

Ways to use basisList:
======================

  * "basisList(LabeledModule)"

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

The object basisList, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1615:0.

cauchyMap -- produces one surjection from the Cauchy decomposition of the exterior power of a tensor product
************************************************************************************************************

  * Usage:
        cauchyMap(b,E)
  * Inputs:
      * b, an integer (Macaulay2Doc),
      * E, a free module with labeled basis, must be a
        tensor product
  * Outputs:
      * a map of labeled modules,

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

We begin with a module $E$ that was constructed as a tensor product $E=A\otimes
B$, where $A$ and $B$ are free modules. Cauchy decomposition provides a formula
for decomposing $\wedge^b E$ as $GL(A)\times GL(B)$ representations.  This
function constructs the surjection onto the $\wedge^b A\otimes S^b B$ factor:
$$ \wedge^b E \to \wedge^b A\otimes S^b B. $$

+-----------------------------------------------------------------------------+
|i1 : S=ZZ/101[x,y,z];                                                        |
+-----------------------------------------------------------------------------+
|i2 : A=labeledModule(S^3);                                                   |
|                                                                             |
|o2 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i3 : B=labeledModule(S^3);                                                   |
|                                                                             |
|o3 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i4 : E=tensorProduct(A,B)                                                    |
|                                                                             |
|      9                                                                      |
|o4 = S                                                                       |
|                                                                             |
|o4 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i5 : f=cauchyMap(2,E)                                                        |
|                                                                             |
|o5 = | 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 |
|                                                                             |
|             18       36                                                     |
|o5 : Matrix S   <--- S                                                       |
|-----------------------------------------------------------------------------|
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
|0 |                                                                          |
+-----------------------------------------------------------------------------+
|i6 : underlyingModules source f                                              |
|                                                                             |
|       9                                                                     |
|o6 = {S }                                                                    |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : underlyingModules target f                                              |
|                                                                             |
|       3   6                                                                 |
|o7 = {S , S }                                                                |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use cauchyMap:
======================

  * "cauchyMap(ZZ,LabeledModule)"

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

The object cauchyMap, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1780:0.

exteriorPower(ZZ,LabeledModule) -- Exterior power of a @TO LabeledModule@
*************************************************************************

  * Function: exteriorPower (Macaulay2Doc),
  * Usage:
        E = exteriorPower(i,M)
  * Inputs:
      * i, an integer (Macaulay2Doc),
      * M, a free module with labeled basis,
  * Optional inputs (Macaulay2Doc),:
      * Strategy (Macaulay2Doc),
        => ..., default value null,
  * Outputs:
      * a free module with labeled basis,

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

This produces the exterior power of a labeled module as a labeled module with
the natural basis list.  For instance if $M$ is a labeled module with basis
list $L$, then exteriorPower(2,M) is a labeled module with basis list
subsets(2,L) and with $M$ as an underlying module,

+-----------------------------------------------------------+
|i1 : S=ZZ/101[x,y,z];                                      |
+-----------------------------------------------------------+
|i2 : M=labeledModule(S^3);                                 |
|                                                           |
|o2 : free S-module with labeled basis                      |
+-----------------------------------------------------------+
|i3 : E=exteriorPower(2,M)                                  |
|                                                           |
|      3                                                    |
|o3 = S                                                     |
|                                                           |
|o3 : free S-module with labeled basis                      |
+-----------------------------------------------------------+
|i4 : basisList E                                           |
|                                                           |
|o4 = {{0, 1}, {0, 2}, {1, 2}}                              |
|                                                           |
|o4 : List                                                  |
+-----------------------------------------------------------+
|i5 : underlyingModules E                                   |
|                                                           |
|       3                                                   |
|o5 = {S }                                                  |
|                                                           |
|o5 : List                                                  |
+-----------------------------------------------------------+
|i6 : F=exteriorPower(2,E);                                 |
|                                                           |
|o6 : free S-module with labeled basis                      |
+-----------------------------------------------------------+
|i7 : basisList F                                           |
|                                                           |
|o7 = {{{0, 1}, {0, 2}}, {{0, 1}, {1, 2}}, {{0, 2}, {1, 2}}}|
|                                                           |
|o7 : List                                                  |
+-----------------------------------------------------------+

The first exterior power of a labeled module is not the identity in the
category of labeled modules.  For instance, if $M$ is a free labeled module
with basis list $\{0,1\}$ and with no underlying modules, then
$exteriorPower(1,M)$ is a labeled module with basis list $\{ \{0\}, \{1\},\}$
and with $M$ as an underlying module.

+--------------------------------------+
|i8 : S=ZZ/101[x,y,z];                 |
+--------------------------------------+
|i9 : M=labeledModule(S^2);            |
|                                      |
|o9 : free S-module with labeled basis |
+--------------------------------------+
|i10 : E=exteriorPower(1,M);           |
|                                      |
|o10 : free S-module with labeled basis|
+--------------------------------------+
|i11 : basisList M                     |
|                                      |
|o11 = {0, 1}                          |
|                                      |
|o11 : List                            |
+--------------------------------------+
|i12 : basisList E                     |
|                                      |
|o12 = {{0}, {1}}                      |
|                                      |
|o12 : List                            |
+--------------------------------------+
|i13 : underlyingModules M             |
|                                      |
|o13 = {}                              |
|                                      |
|o13 : List                            |
+--------------------------------------+
|i14 : underlyingModules E             |
|                                      |
|        2                             |
|o14 = {S }                            |
|                                      |
|o14 : List                            |
+--------------------------------------+

By convention, the zeroeth symmetric power of an $S$-module is the labeled
module $S^1$ with basis list $\{\{\}\}$ and with no underlying modules.

+--------------------------------------+
|i15 : S=ZZ/101[x,y,z];                |
+--------------------------------------+
|i16 : M=labeledModule(S^2);           |
|                                      |
|o16 : free S-module with labeled basis|
+--------------------------------------+
|i17 : E=exteriorPower(0,M)            |
|                                      |
|       1                              |
|o17 = S                               |
|                                      |
|o17 : free S-module with labeled basis|
+--------------------------------------+
|i18 : basisList E                     |
|                                      |
|o18 = {{}}                            |
|                                      |
|o18 : List                            |
+--------------------------------------+
|i19 : underlyingModules E             |
|                                      |
|o19 = {}                              |
|                                      |
|o19 : List                            |
+--------------------------------------+

Ways to use this method:
========================

  * exteriorPower(ZZ,LabeledModule)
    -- Exterior power of a @TO
    LabeledModule@
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1048:0.

flattenedESTensor -- make a flattened tensor from elementary symmetric functions
********************************************************************************

  * Usage:
        flattenedESTensor(L,kk)
  * Inputs:
      * L, a list (Macaulay2Doc), of positive ZZ
      * kk, a ring (Macaulay2Doc), Name of ground field (or ring)
  * Optional inputs (Macaulay2Doc),:
      * MonSize (missing documentation) => ..., default value 32,
  * Outputs:
      * f, a map of labeled modules,

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

Given a list $L = \{a, b_1,\dots, b_n\}$ of positive integers with $ a= sum_i
b_i, $ and a field (or ring of integers) kk, the script creates a ring $S =
kk[x_1,\dots,x_n]$ and a map $$ f: A \to B_1\otimes\cdots \otimes B_n $$ of
LabeledModule,s over $S$, where $A$ is a free
LabeledModule of rank $a$ and $B_i$ is a free LabeledModule of rank $b_i$. The
map $f$ is constructed from symmetric functions, and corresponds to collection
of linear forms on $P^{b_1-1}\times\cdots\timesß P^{b_n-1}$ as used in the
construction of pure resolutions in the paper ``Betti numbers of graded modules
and cohomology of vector bundles'' of Eisenbud and Schreyer.

The format of $F$ is the one required by tensorComplex1,
namely $f: A \to B_1\otimes \cdots \otimes B_n$, with $a = rank A, b_i = rank
B_i$.

There is an OPTION, MonSize => n (where n is 8,16, or 32). This sets the
MonomialSize (Macaulay2Doc), option when the base ring of
flattenedESTensor is created.

+-----------------------------------------------------------------------------+
|i1 : kk = ZZ/101                                                             |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : f = flattenedESTensor({5,2,1,2},kk)                                     |
|                                                                             |
|o2 = | x_0 x_1 x_2 0   0   |                                                 |
|     | 0   x_0 x_1 x_2 0   |                                                 |
|     | 0   x_0 x_1 x_2 0   |                                                 |
|     | 0   0   x_0 x_1 x_2 |                                                 |
|                                                                             |
|                        4                  5                                 |
|o2 : Matrix (kk[x ..x ])  <--- (kk[x ..x ])                                  |
|                 0   2              0   2                                    |
+-----------------------------------------------------------------------------+
|i3 : numgens ring f                                                          |
|                                                                             |
|o3 = 3                                                                       |
+-----------------------------------------------------------------------------+
|i4 : betti matrix f                                                          |
|                                                                             |
|            0 1                                                              |
|o4 = total: 4 5                                                              |
|        -1: . 5                                                              |
|         0: 4 .                                                              |
|                                                                             |
|o4 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i5 : S = ring f                                                              |
|                                                                             |
|o5 = S                                                                       |
|                                                                             |
|o5 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : g = tensorComplex1 f                                                    |
|                                                                             |
|o6 = | x_0^2 0     x_0x_1 0      x_1^2-x_0x_2 0            x_0x_2 0          |
|     | 0     x_0^2 x_0^2  x_0x_1 x_0x_1       x_1^2-x_0x_2 x_0x_1 x_0x_2     |
|     | 0     0     0      x_0^2  x_0^2        x_0x_1       0      x_0x_1     |
|     | 0     0     0      0      0            x_0^2        0      0          |
|                                                                             |
|             4       20                                                      |
|o6 : Matrix S  <--- S                                                        |
|-----------------------------------------------------------------------------|
|x_1x_2 0      x_2^2        0            0      0      0      0      0        |
|x_1^2  x_1x_2 x_1x_2       x_2^2        x_0x_2 0      x_1x_2 0      x_2^2    |
|x_0x_1 x_1^2  x_1^2-x_0x_2 x_1x_2       0      x_0x_2 x_0x_2 x_1x_2 x_1x_2   |
|0      x_0x_1 0            x_1^2-x_0x_2 0      0      0      x_0x_2 0        |
|-----------------------------------------------------------------------------|
|0      0     0     |                                                         |
|0      0     0     |                                                         |
|x_2^2  x_2^2 0     |                                                         |
|x_1x_2 0     x_2^2 |                                                         |
+-----------------------------------------------------------------------------+
|i7 : betti res coker g                                                       |
|                                                                             |
|            0  1  2 3                                                        |
|o7 = total: 4 20 20 4                                                        |
|         0: 4  .  . .                                                        |
|         1: . 20 20 .                                                        |
|         2: .  .  . 4                                                        |
|                                                                             |
|o7 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * flattenedGenericTensor -- Make a generic
    tensor of given format
  * tensorComplex1 -- computes the first map of the
    tensor complex

Ways to use flattenedESTensor:
==============================

  * flattenedESTensor(List,Ring) (missing documentation)

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

The object flattenedESTensor, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1336:0.

flattenedGenericTensor -- Make a generic tensor of given format
***************************************************************

  * Usage:
        flattenedGenericTensor(L,kk)
  * Inputs:
      * L, a list (Macaulay2Doc), of positive ZZ
      * kk, a ring (Macaulay2Doc), Name of ground field (or ring)
  * Outputs:
      * f, a map of labeled modules,

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

Given a list $L = \{a, b_1,\dots, b_n\}$ of positive integers with $ a= sum_i
b_i, $ and a field (or ring of integers) kk, the script creates a polynomial
ring $S$ over $kk$ with $a\times b_1\times\cdots\times b_n$ variables, and a
generic map $$ f: A \to B_1\otimes\cdots \otimes B_n $$ of LabeledModule,
s over $S$, where $A$ is a free LabeledModule of rank $a$ and
$B_i$ is a free LabeledModule of rank $b_i$. We think of $f$ as representing a
tensor of type $(a,b_1,\dots,b_n)$ made from the elementary symmetric
functions.

The format of $F$ is the one required by tensorComplex1,
namely $f: A \to B_1\otimes \cdots \otimes B_n$, with $a = rank A, b_i = rank
B_i$.

+-----------------------------------------------------------------------------+
|i1 : kk = ZZ/101                                                             |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : f = flattenedGenericTensor({5,2,1,2},kk)                                |
|                                                                             |
|o2 = | x_(0,0,0,0) x_(1,0,0,0) x_(2,0,0,0) x_(3,0,0,0) x_(4,0,0,0) |         |
|     | x_(0,0,0,1) x_(1,0,0,1) x_(2,0,0,1) x_(3,0,0,1) x_(4,0,0,1) |         |
|     | x_(0,1,0,0) x_(1,1,0,0) x_(2,1,0,0) x_(3,1,0,0) x_(4,1,0,0) |         |
|     | x_(0,1,0,1) x_(1,1,0,1) x_(2,1,0,1) x_(3,1,0,1) x_(4,1,0,1) |         |
|                                                                             |
|                                    4                              5         |
|o2 : Matrix (kk[x       ..x       ])  <--- (kk[x       ..x       ])          |
|                 0,0,0,0   4,1,0,1              0,0,0,0   4,1,0,1            |
+-----------------------------------------------------------------------------+
|i3 : numgens ring f                                                          |
|                                                                             |
|o3 = 20                                                                      |
+-----------------------------------------------------------------------------+
|i4 : betti matrix f                                                          |
|                                                                             |
|            0 1                                                              |
|o4 = total: 4 5                                                              |
|        -1: . 5                                                              |
|         0: 4 .                                                              |
|                                                                             |
|o4 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i5 : S = ring f                                                              |
|                                                                             |
|o5 = S                                                                       |
|                                                                             |
|o5 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : tensorComplex1 f                                                        |
|                                                                             |
|o6 = | -x_(0,1,0,0)x_(1,0,0,0)+x_(0,0,0,0)x_(1,1,0,0)                        |
|     | -x_(0,1,0,1)x_(1,0,0,0)-x_(0,1,0,0)x_(1,0,0,1)+x_(0,0,0,1)x_(1,1,0,0)+|
|     | -x_(0,1,0,1)x_(1,0,0,1)+x_(0,0,0,1)x_(1,1,0,1)                        |
|     | 0                                                                     |
|                                                                             |
|             4       20                                                      |
|o6 : Matrix S  <--- S                                                        |
|-----------------------------------------------------------------------------|
|                       0                                                     |
|x_(0,0,0,0)x_(1,1,0,1) -x_(0,1,0,0)x_(1,0,0,0)+x_(0,0,0,0)x_(1,1,0,0)        |
|                       -x_(0,1,0,1)x_(1,0,0,0)-x_(0,1,0,0)x_(1,0,0,1)+x_(0,0,|
|                       -x_(0,1,0,1)x_(1,0,0,1)+x_(0,0,0,1)x_(1,1,0,1)        |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|0,1)x_(1,1,0,0)+x_(0,0,0,0)x_(1,1,0,1)                                       |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(0,1,0,0)x_(2,0,0,0)+x_(0,0,0,0)x_(2,1,0,0)                               |
|-x_(0,1,0,1)x_(2,0,0,0)-x_(0,1,0,0)x_(2,0,0,1)+x_(0,0,0,1)x_(2,1,0,0)+x_(0,0,|
|-x_(0,1,0,1)x_(2,0,0,1)+x_(0,0,0,1)x_(2,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(2,1,0,1) -x_(0,1,0,0)x_(2,0,0,0)+x_(0,0,0,0)x_(2,1,0,0)               |
|                -x_(0,1,0,1)x_(2,0,0,0)-x_(0,1,0,0)x_(2,0,0,1)+x_(0,0,0,1)x_(|
|                -x_(0,1,0,1)x_(2,0,0,1)+x_(0,0,0,1)x_(2,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|2,1,0,0)+x_(0,0,0,0)x_(2,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(1,1,0,0)x_(2,0,0,0)+x_(1,0,0,0)x_(2,1,0,0)                               |
|-x_(1,1,0,1)x_(2,0,0,0)-x_(1,1,0,0)x_(2,0,0,1)+x_(1,0,0,1)x_(2,1,0,0)+x_(1,0,|
|-x_(1,1,0,1)x_(2,0,0,1)+x_(1,0,0,1)x_(2,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(2,1,0,1) -x_(1,1,0,0)x_(2,0,0,0)+x_(1,0,0,0)x_(2,1,0,0)               |
|                -x_(1,1,0,1)x_(2,0,0,0)-x_(1,1,0,0)x_(2,0,0,1)+x_(1,0,0,1)x_(|
|                -x_(1,1,0,1)x_(2,0,0,1)+x_(1,0,0,1)x_(2,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|2,1,0,0)+x_(1,0,0,0)x_(2,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(0,1,0,0)x_(3,0,0,0)+x_(0,0,0,0)x_(3,1,0,0)                               |
|-x_(0,1,0,1)x_(3,0,0,0)-x_(0,1,0,0)x_(3,0,0,1)+x_(0,0,0,1)x_(3,1,0,0)+x_(0,0,|
|-x_(0,1,0,1)x_(3,0,0,1)+x_(0,0,0,1)x_(3,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(3,1,0,1) -x_(0,1,0,0)x_(3,0,0,0)+x_(0,0,0,0)x_(3,1,0,0)               |
|                -x_(0,1,0,1)x_(3,0,0,0)-x_(0,1,0,0)x_(3,0,0,1)+x_(0,0,0,1)x_(|
|                -x_(0,1,0,1)x_(3,0,0,1)+x_(0,0,0,1)x_(3,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|3,1,0,0)+x_(0,0,0,0)x_(3,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(1,1,0,0)x_(3,0,0,0)+x_(1,0,0,0)x_(3,1,0,0)                               |
|-x_(1,1,0,1)x_(3,0,0,0)-x_(1,1,0,0)x_(3,0,0,1)+x_(1,0,0,1)x_(3,1,0,0)+x_(1,0,|
|-x_(1,1,0,1)x_(3,0,0,1)+x_(1,0,0,1)x_(3,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(3,1,0,1) -x_(1,1,0,0)x_(3,0,0,0)+x_(1,0,0,0)x_(3,1,0,0)               |
|                -x_(1,1,0,1)x_(3,0,0,0)-x_(1,1,0,0)x_(3,0,0,1)+x_(1,0,0,1)x_(|
|                -x_(1,1,0,1)x_(3,0,0,1)+x_(1,0,0,1)x_(3,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|3,1,0,0)+x_(1,0,0,0)x_(3,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(2,1,0,0)x_(3,0,0,0)+x_(2,0,0,0)x_(3,1,0,0)                               |
|-x_(2,1,0,1)x_(3,0,0,0)-x_(2,1,0,0)x_(3,0,0,1)+x_(2,0,0,1)x_(3,1,0,0)+x_(2,0,|
|-x_(2,1,0,1)x_(3,0,0,1)+x_(2,0,0,1)x_(3,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(3,1,0,1) -x_(2,1,0,0)x_(3,0,0,0)+x_(2,0,0,0)x_(3,1,0,0)               |
|                -x_(2,1,0,1)x_(3,0,0,0)-x_(2,1,0,0)x_(3,0,0,1)+x_(2,0,0,1)x_(|
|                -x_(2,1,0,1)x_(3,0,0,1)+x_(2,0,0,1)x_(3,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|3,1,0,0)+x_(2,0,0,0)x_(3,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(0,1,0,0)x_(4,0,0,0)+x_(0,0,0,0)x_(4,1,0,0)                               |
|-x_(0,1,0,1)x_(4,0,0,0)-x_(0,1,0,0)x_(4,0,0,1)+x_(0,0,0,1)x_(4,1,0,0)+x_(0,0,|
|-x_(0,1,0,1)x_(4,0,0,1)+x_(0,0,0,1)x_(4,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(4,1,0,1) -x_(0,1,0,0)x_(4,0,0,0)+x_(0,0,0,0)x_(4,1,0,0)               |
|                -x_(0,1,0,1)x_(4,0,0,0)-x_(0,1,0,0)x_(4,0,0,1)+x_(0,0,0,1)x_(|
|                -x_(0,1,0,1)x_(4,0,0,1)+x_(0,0,0,1)x_(4,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|4,1,0,0)+x_(0,0,0,0)x_(4,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(1,1,0,0)x_(4,0,0,0)+x_(1,0,0,0)x_(4,1,0,0)                               |
|-x_(1,1,0,1)x_(4,0,0,0)-x_(1,1,0,0)x_(4,0,0,1)+x_(1,0,0,1)x_(4,1,0,0)+x_(1,0,|
|-x_(1,1,0,1)x_(4,0,0,1)+x_(1,0,0,1)x_(4,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(4,1,0,1) -x_(1,1,0,0)x_(4,0,0,0)+x_(1,0,0,0)x_(4,1,0,0)               |
|                -x_(1,1,0,1)x_(4,0,0,0)-x_(1,1,0,0)x_(4,0,0,1)+x_(1,0,0,1)x_(|
|                -x_(1,1,0,1)x_(4,0,0,1)+x_(1,0,0,1)x_(4,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|4,1,0,0)+x_(1,0,0,0)x_(4,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(2,1,0,0)x_(4,0,0,0)+x_(2,0,0,0)x_(4,1,0,0)                               |
|-x_(2,1,0,1)x_(4,0,0,0)-x_(2,1,0,0)x_(4,0,0,1)+x_(2,0,0,1)x_(4,1,0,0)+x_(2,0,|
|-x_(2,1,0,1)x_(4,0,0,1)+x_(2,0,0,1)x_(4,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(4,1,0,1) -x_(2,1,0,0)x_(4,0,0,0)+x_(2,0,0,0)x_(4,1,0,0)               |
|                -x_(2,1,0,1)x_(4,0,0,0)-x_(2,1,0,0)x_(4,0,0,1)+x_(2,0,0,1)x_(|
|                -x_(2,1,0,1)x_(4,0,0,1)+x_(2,0,0,1)x_(4,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|4,1,0,0)+x_(2,0,0,0)x_(4,1,0,1)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(3,1,0,0)x_(4,0,0,0)+x_(3,0,0,0)x_(4,1,0,0)                               |
|-x_(3,1,0,1)x_(4,0,0,0)-x_(3,1,0,0)x_(4,0,0,1)+x_(3,0,0,1)x_(4,1,0,0)+x_(3,0,|
|-x_(3,1,0,1)x_(4,0,0,1)+x_(3,0,0,1)x_(4,1,0,1)                               |
|0                                                                            |
|-----------------------------------------------------------------------------|
|                0                                                            |
|0,0)x_(4,1,0,1) -x_(3,1,0,0)x_(4,0,0,0)+x_(3,0,0,0)x_(4,1,0,0)               |
|                -x_(3,1,0,1)x_(4,0,0,0)-x_(3,1,0,0)x_(4,0,0,1)+x_(3,0,0,1)x_(|
|                -x_(3,1,0,1)x_(4,0,0,1)+x_(3,0,0,1)x_(4,1,0,1)               |
|-----------------------------------------------------------------------------|
|                                |                                            |
|                                |                                            |
|4,1,0,0)+x_(3,0,0,0)x_(4,1,0,1) |                                            |
|                                |                                            |
+-----------------------------------------------------------------------------+

See also
========

  * flattenedESTensor -- make a flattened tensor from
    elementary symmetric functions
  * tensorComplex1 -- computes the first map of the
    tensor complex

Ways to use flattenedGenericTensor:
===================================

  * "flattenedGenericTensor(List,Ring)"

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

The object flattenedGenericTensor, is a
method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1281:0.

fromOrdinal -- outputs the label of a basis element of a labeled module
***********************************************************************

  * Usage:
        fromOrdinal(i,F)
  * Inputs:
      * i, an integer (Macaulay2Doc),
      * F, a free module with labeled basis,
  * Outputs:
      * a thing (Macaulay2Doc),

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

This function allows one to access the labels of the basis elements of a
labeled free module. For instance, if $F$ is a labeled free module of $r$, then
its basis is labeled by a list $L$. This function takes an integer $i$ between
$0$ and outputs the $i$'th element of $L$.

This function is particularly useful when defining maps between labeled free
modules.

+----------------------------------------------------------------------+
|i1 : S=ZZ/101[x_{0,0,0}..x_{2,1,1}];                                  |
+----------------------------------------------------------------------+
|i2 : A=labeledModule(S^3);                                            |
|                                                                      |
|o2 : free S-module with labeled basis                                 |
+----------------------------------------------------------------------+
|i3 : fromOrdinal(0,A)                                                 |
|                                                                      |
|o3 = 0                                                                |
+----------------------------------------------------------------------+
|i4 : B=labeledModule(S^2);                                            |
|                                                                      |
|o4 : free S-module with labeled basis                                 |
+----------------------------------------------------------------------+
|i5 : C=symmetricPower(2,B)                                            |
|                                                                      |
|      3                                                               |
|o5 = S                                                                |
|                                                                      |
|o5 : free S-module with labeled basis                                 |
+----------------------------------------------------------------------+
|i6 : fromOrdinal(0,C)                                                 |
|                                                                      |
|o6 = {0, 0}                                                           |
|                                                                      |
|o6 : List                                                             |
+----------------------------------------------------------------------+
|i7 : f=map(A,C,(i,j)->x_(flatten {fromOrdinal(j,A)}|fromOrdinal(i,C)))|
|                                                                      |
|o7 = | x_{0, 0, 0} x_{1, 0, 0} x_{2, 0, 0} |                          |
|     | x_{0, 0, 1} x_{1, 0, 1} x_{2, 0, 1} |                          |
|     | x_{0, 1, 1} x_{1, 1, 1} x_{2, 1, 1} |                          |
|                                                                      |
|             3       3                                                |
|o7 : Matrix S  <--- S                                                 |
+----------------------------------------------------------------------+

See also
========

  * basisList -- gives the list used to label the basis
    elements of a labeled module
  * toOrdinal -- turns the label of a basis element of a
    labeled module into a corresponding ordinal

Ways to use fromOrdinal:
========================

  * "fromOrdinal(ZZ,LabeledModule)"

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

The object fromOrdinal, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1653:0.

hyperdeterminant -- computes the hyperdeterminant of a boundary format tensor
*****************************************************************************

  * Usage:
        hyperdeterminant f
  * Inputs:
      * f, a map of labeled modules,
  * Outputs:
      * a ring element (Macaulay2Doc),

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

This constructs the hyperdeterminant of a tensor of boundary format, where we
say that a $a\times b_1\times \dots \times b_n$ has boundary format if $$
a-\sum_{i=1}^n (b_i-1)=1. $$ We construct the hyperdeterminant as the
determinant of a certain square matrix derived from $f$.  The hyperdeterminant
function outputs the hyperdeterminant itself, whereas the
hyperdeterminantMatrix, function outputs the matrix
used to compute the hyperdeterminant.  (For background on computing
hyperdeterminants, see Section 14.3 of the book ``Discriminants, resultants,
and multidimensional determinants '' by Gelfand-Kapranov-Zelevinsky.)

The following constructs the generic hyperdeterminant of format $3\times
2\times 2$, which is a polynomial of degree 6 consisting of 66 monomials.

+------------------------------------------------------------+
|i1 : f=flattenedGenericTensor({3,2,2},QQ);                  |
|                                                            |
|                                4                          3|
|o1 : Matrix (QQ[x     ..x     ])  <--- (QQ[x     ..x     ]) |
|                 0,0,0   2,1,1              0,0,0   2,1,1   |
+------------------------------------------------------------+
|i2 : S=ring f;                                              |
+------------------------------------------------------------+
|i3 : h=hyperdeterminant f;                                  |
+------------------------------------------------------------+
|i4 : degree h                                               |
|                                                            |
|o4 = {6}                                                    |
|                                                            |
|o4 : List                                                   |
+------------------------------------------------------------+
|i5 : #terms h                                               |
|                                                            |
|o5 = 66                                                     |
+------------------------------------------------------------+

Caveat
======

There is bug involving the graded structure of the output. Namely, the code
assumes that all entries of f have degree 1, and gives the wrong graded
structure if this is not the case. If ring f is not graded, then the code gives
an error.

See also
========

  * hyperdeterminantMatrix -- computes a matrix
    whose determinant equals the hyperdeterminant of a boundary format tensor

Ways to use hyperdeterminant:
=============================

  * "hyperdeterminant(LabeledModuleMap)"

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

The object hyperdeterminant, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:955:0.

hyperdeterminantMatrix -- computes a matrix whose determinant equals the hyperdeterminant of a boundary format tensor
*********************************************************************************************************************

  * Usage:
        hyperdeterminantMatrix f
  * Inputs:
      * f, a map of labeled modules,
  * Outputs:
      * a map of labeled modules,

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

This constructs a matrix whose determinant equals the hyperdeterminant of a
tensor of boundary format, where we say that a $a\times b_1\times \dots \times
b_n$ has boundary format if $$ a-\sum_{i=1}^n (b_i-1)=1. $$ The entries of the
output matrix correspond to entries of the input tensor.

+--------------------------------------------------------------------+
|i1 : f=flattenedGenericTensor({3,2,2},QQ);                          |
|                                                                    |
|                                4                          3        |
|o1 : Matrix (QQ[x     ..x     ])  <--- (QQ[x     ..x     ])         |
|                 0,0,0   2,1,1              0,0,0   2,1,1           |
+--------------------------------------------------------------------+
|i2 : S=ring f;                                                      |
+--------------------------------------------------------------------+
|i3 : M=hyperdeterminantMatrix f                                     |
|                                                                    |
|o3 = | x_(0,0,0) 0         x_(1,0,0) 0         x_(2,0,0) 0         ||
|     | x_(0,0,1) x_(0,0,0) x_(1,0,1) x_(1,0,0) x_(2,0,1) x_(2,0,0) ||
|     | 0         x_(0,0,1) 0         x_(1,0,1) 0         x_(2,0,1) ||
|     | x_(0,1,0) 0         x_(1,1,0) 0         x_(2,1,0) 0         ||
|     | x_(0,1,1) x_(0,1,0) x_(1,1,1) x_(1,1,0) x_(2,1,1) x_(2,1,0) ||
|     | 0         x_(0,1,1) 0         x_(1,1,1) 0         x_(2,1,1) ||
|                                                                    |
|             6      6                                               |
|o3 : Matrix S  <-- S                                                |
+--------------------------------------------------------------------+
|i4 : det(M)==hyperdeterminant f                                     |
|                                                                    |
|o4 = true                                                           |
+--------------------------------------------------------------------+

Caveat
======

There is bug involving the graded structure of the output. Namely, the code
assumes that all entries of f have degree 1, and gives the wrong graded
structure if this is not the case. If ring f is not graded, then the code gives
an error.

See also
========

  * hyperdeterminant -- computes the hyperdeterminant
    of a boundary format tensor

Ways to use hyperdeterminantMatrix:
===================================

  * "hyperdeterminantMatrix(LabeledModuleMap)"

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

The object hyperdeterminantMatrix, is a
method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:993:0.

LabeledModule -- the class of free modules with a labeled basis
***************************************************************

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

A labeled module $F$ is a free module together with two additional pieces of
data: a basisList, which corresponds to the basis of $F$, and
a list of underlyingModules, which were used in the
construction of $F$. The constructor labeledModule, can be
used to construct a labeled module from a free module. The call labeledModule
E, where $E$ is a free module, returns a labeled module with basisList,
$\{1,\dots, rank E\}$ and underlyingModules,
$\{E\}$.ß

For example if $A,B$ are of type LabeledModule, then F=tensorProduct(A,B)
constructs the LabeledModule $F=A\otimes B$ with basisList,
equal to the list of pairs $\{a,b\}$ where $a$ belongs to the basis list of $A$
and $b$ belongs to the basis list of $b$. The list of underlyingModules,
of $F$ is $\{A,B\}$.

Certain functors which are the identity in the category of modules are
non-trivial isomorphisms in the category of labeled modules.  For example, if F
is a labeled module with basis list \{0,1\} then tensorProduct F is a labeled
free module with basis list \{\{ 0\},\{ 1\}\} .  Similarly, one must be careful
when applying the functors exteriorPower (Macaulay2Doc),
and symmetricPower (Macaulay2Doc).  For a ring $S$, the
multiplicative unit for tensor product is the rank 1 free $S$-module whose
generator is labeled by \{\} . This is constructed by labeledModule S.

Functions and methods returning a free module with labeled basis:
=================================================================

  * labeledModule -- makes a labeled module
  * tensor(LabeledModule,LabeledModule)
    -- creates the tensor product of
    two labeled modules, as a labeled module

Methods that use a free module with labeled basis:
==================================================

  * "basisList(LabeledModule)" -- see basisList, -- gives the
    list used to label the basis elements of a labeled module
  * "cauchyMap(ZZ,LabeledModule)" -- see cauchyMap, --
    produces one surjection from the Cauchy decomposition of the exterior power
    of a tensor product
  * exteriorPower(ZZ,LabeledModule)
    -- Exterior power of a @TO
    LabeledModule@
  * "fromOrdinal(ZZ,LabeledModule)" -- see fromOrdinal, --
    outputs the label of a basis element of a labeled module
  * LabeledModule ** LabeledModule (missing documentation)
  * LabeledModule == LabeledModule (missing documentation)
  * map(LabeledModule,LabeledModule,Function)
    -- create a
    LabeledModuleMap by specifying a function that gives each entry
  * map(LabeledModule,LabeledModule,LabeledModuleMap)
    -- creates a new
    LabeledModuleMap from a given LabeledModuleMap
  * map(LabeledModule,LabeledModule,List)
    -- creates a
    LabeledModuleMap from a list
  * map(LabeledModule,LabeledModule,Matrix)
    -- creates a
    LabeledModuleMap from a matrix
  * map(LabeledModule,LabeledModule,ZZ)
    -- creates scalar
    multiplication by an integer as a LabeledModuleMap
  * "minorsMap(LabeledModuleMap,LabeledModule)" -- see minorsMap,
    -- creates a map of labeled free modules whose image is the
    minors of a map of labeled free modules
  * "minorsMap(Matrix,LabeledModule)" -- see minorsMap, --
    creates a map of labeled free modules whose image is the minors of a map of
    labeled free modules
  * module(LabeledModule) (missing documentation)
  * net(LabeledModule) (missing documentation)
  * rank(LabeledModule) (missing documentation)
  * ring(LabeledModule) (missing documentation)
  * "symmetricMultiplication(LabeledModule,ZZ,ZZ)" -- see
    symmetricMultiplication, -- creates the symmetric
    multiplication map
  * symmetricPower(ZZ,LabeledModule)
    -- Symmetric power of a @TO
    LabeledModule@
  * "toOrdinal(Thing,LabeledModule)" -- see toOrdinal, --
    turns the label of a basis element of a labeled module into a corresponding
    ordinal
  * "traceMap(LabeledModule)" -- see traceMap, -- produces the
    trace map from a ring to a free module tensored with its dual
  * "underlyingModules(LabeledModule)" -- see underlyingModules,
    -- gives the list of underlying modules of a labeled
    module

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

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

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:824:0.

labeledModule -- makes a labeled module
***************************************

  * Usage:
        labeledModule M
        labeledModule R
  * Inputs:
      * M, a module (Macaulay2Doc), which is free
      * R, a ring (Macaulay2Doc),
  * Outputs:
      * a free module with labeled basis,

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

This is the basic construction for a LabeledModule.
Given a free module $M$ of rank $r$, this constructs a labeled module with
basis labeled by $\{0,..,r-1\}$ and no underlying modules.

+-------------------------------------+
|i1 : S = ZZ/101[a,b,c];              |
+-------------------------------------+
|i2 : E = labeledModule S^3           |
|                                     |
|      3                              |
|o2 = S                               |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : basisList E                     |
|                                     |
|o3 = {0, 1, 2}                       |
|                                     |
|o3 : List                            |
+-------------------------------------+
|i4 : underlyingModules E             |
|                                     |
|o4 = {}                              |
|                                     |
|o4 : List                            |
+-------------------------------------+
|i5 : module E                        |
|                                     |
|      3                              |
|o5 = S                               |
|                                     |
|o5 : S-module, free                  |
+-------------------------------------+
|i6 : rank E                          |
|                                     |
|o6 = 3                               |
+-------------------------------------+

For technical reasons, it is often convenient to construct a rank $1$ free
module whose generator is labeled by the empty set. This is constructed by
labeledModule S.

+--------------------------------------+
|i7 : S = ZZ/101[a,b,c];               |
+--------------------------------------+
|i8 : F = labeledModule S              |
|                                      |
|      1                               |
|o8 = S                                |
|                                      |
|o8 : free S-module with labeled basis |
+--------------------------------------+
|i9 : basisList F                      |
|                                      |
|o9 = {{}}                             |
|                                      |
|o9 : List                             |
+--------------------------------------+
|i10 : underlyingModules F             |
|                                      |
|o10 = {}                              |
|                                      |
|o10 : List                            |
+--------------------------------------+
|i11 : module F                        |
|                                      |
|       1                              |
|o11 = S                               |
|                                      |
|o11 : S-module, free                  |
+--------------------------------------+
|i12 : E = labeledModule S^1           |
|                                      |
|       1                              |
|o12 = S                               |
|                                      |
|o12 : free S-module with labeled basis|
+--------------------------------------+
|i13 : basisList E                     |
|                                      |
|o13 = {0}                             |
|                                      |
|o13 : List                            |
+--------------------------------------+
|i14 : underlyingModules E             |
|                                      |
|o14 = {}                              |
|                                      |
|o14 : List                            |
+--------------------------------------+

Ways to use labeledModule:
==========================

  * "labeledModule(Module)"
  * "labeledModule(Ring)"

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

The object labeledModule, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:871:0.

LabeledModuleMap -- the class of maps between LabeledModules
************************************************************

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

A map between two labeled modules remembers the labeled module structure of the
source of target. Some, but not all methods available for maps have been
extended to this class.  In these cases, one should apply the method to the
underlying matrix.  See rank(LabeledModuleMap) (missing documentation).

Functions and methods returning a map of labeled modules:
=========================================================

  * cauchyMap -- produces one surjection from the Cauchy
    decomposition of the exterior power of a tensor product
  * flattenedESTensor(List,Ring) (missing documentation)
  * "flattenedGenericTensor(List,Ring)" -- see flattenedGenericTensor,
    -- Make a generic tensor of given format
  * LabeledModuleMap * LabeledModuleMap (missing documentation)
  * LabeledModuleMap ** LabeledModuleMap (missing documentation)
  * map(LabeledModule,LabeledModule,LabeledModuleMap)
    -- creates a new
    LabeledModuleMap from a given LabeledModuleMap
  * map(LabeledModule,LabeledModule,ZZ)
    -- creates scalar
    multiplication by an integer as a LabeledModuleMap
  * "minorsMap(LabeledModuleMap,LabeledModule)" -- see minorsMap,
    -- creates a map of labeled free modules whose image is the
    minors of a map of labeled free modules
  * "minorsMap(Matrix,LabeledModule)" -- see minorsMap, --
    creates a map of labeled free modules whose image is the minors of a map of
    labeled free modules
  * pureResES1(List,Ring) (missing documentation)
  * pureResTC1(List,Ring) (missing documentation)
  * symmetricMultiplication -- creates the
    symmetric multiplication map
  * tensor(LabeledModuleMap,LabeledModuleMap)
    -- creates the tensor
    product of two maps of labeled modules, as a map of labeled module
  * "tensorComplex1(LabeledModuleMap)" -- see tensorComplex1,
    -- computes the first map of the tensor complex
  * "tensorComplex1(LabeledModuleMap,List)" -- see tensorComplex1,
    -- computes the first map of the tensor complex
  * "traceMap(LabeledModule)" -- see traceMap, -- produces the
    trace map from a ring to a free module tensored with its dual
  * transpose(LabeledModuleMap) (missing documentation)

Methods that use a map of labeled modules:
==========================================

  * cokernel(LabeledModuleMap) (missing documentation)
  * "hyperdeterminant(LabeledModuleMap)" -- see hyperdeterminant,
    -- computes the hyperdeterminant of a boundary format
    tensor
  * "hyperdeterminantMatrix(LabeledModuleMap)" -- see
    hyperdeterminantMatrix, -- computes a matrix whose
    determinant equals the hyperdeterminant of a boundary format tensor
  * matrix(LabeledModuleMap) (missing documentation)
  * net(LabeledModuleMap) (missing documentation)
  * rank(LabeledModuleMap) (missing documentation)
  * ring(LabeledModuleMap) (missing documentation)
  * source(LabeledModuleMap) -- the source
    of a map of a labeled modules
  * target(LabeledModuleMap) -- the target
    of a map of a labeled modules

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

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

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1352:0.

map(LabeledModule,LabeledModule,Function) -- create a LabeledModuleMap by specifying a function that gives each entry
*********************************************************************************************************************

  * Function: map (Macaulay2Doc),
  * Usage:
        map(F,G,f)
  * Inputs:
      * F, a free module with labeled basis,
      * G, a free module with labeled basis,
      * f, a function (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), =>
        ..., default value null,
      * DegreeLift (Macaulay2Doc), => ...,
        default value null,
      * DegreeMap (Macaulay2Doc), => ...,
        default value null,
  * Outputs:
      * a map of labeled modules,

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

This function produces essentially the same output as
map(Module,Module,Function), except that the output map belongs to the class
LabeledModuleMap, and thus remembers the labeled module structure of the source
and target.

+-------------------------------------+
|i1 : S=QQ[x,y,z];                    |
+-------------------------------------+
|i2 : F=labeledModule(S^3)            |
|                                     |
|      3                              |
|o2 = S                               |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : f=map(F,F,(i,j)->(S_i)^j)       |
|                                     |
|o3 = | 1 x x2 |                      |
|     | 1 y y2 |                      |
|     | 1 z z2 |                      |
|                                     |
|             3       3               |
|o3 : Matrix S  <--- S                |
+-------------------------------------+

See also
========

  * map(Module,Module,Function) (Macaulay2Doc)
    -- create a matrix by
    specifying a function that gives each entry

Ways to use this method:
========================

  * map(LabeledModule,LabeledModule,Function)
    -- create a
    LabeledModuleMap by specifying a function that gives each entry
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1380:0.

map(LabeledModule,LabeledModule,LabeledModuleMap) -- creates a new LabeledModuleMap from a given LabeledModuleMap
*****************************************************************************************************************

  * Function: map (Macaulay2Doc),
  * Usage:
        map(F,G,f)
  * Inputs:
      * F, a free module with labeled basis,
      * G, a free module with labeled basis,
      * f, a map of labeled modules,
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), =>
        ..., default value null,
      * DegreeLift (Macaulay2Doc), => ...,
        default value null,
      * DegreeMap (Macaulay2Doc), => ...,
        default value null,
  * Outputs:
      * a map of labeled modules,

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

This function produces has the same output map(F,G,matrix f). This function is
most useful when the either source/target of $f$ is isomorphic to $F/G$ as a
module with basis, but not as a labeled module.

+-------------------------------------+
|i1 : S=QQ[x,y,z];                    |
+-------------------------------------+
|i2 : A=labeledModule(S^2)            |
|                                     |
|      2                              |
|o2 = S                               |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : F=(A**A)**A                     |
|                                     |
|      8                              |
|o3 = S                               |
|                                     |
|o3 : free S-module with labeled basis|
+-------------------------------------+
|i4 : G=A**(A**A)                     |
|                                     |
|      8                              |
|o4 = S                               |
|                                     |
|o4 : free S-module with labeled basis|
+-------------------------------------+
|i5 : f=map(F,G,id_(F))               |
|                                     |
|o5 = | 1 0 0 0 0 0 0 0 |             |
|     | 0 1 0 0 0 0 0 0 |             |
|     | 0 0 1 0 0 0 0 0 |             |
|     | 0 0 0 1 0 0 0 0 |             |
|     | 0 0 0 0 1 0 0 0 |             |
|     | 0 0 0 0 0 1 0 0 |             |
|     | 0 0 0 0 0 0 1 0 |             |
|     | 0 0 0 0 0 0 0 1 |             |
|                                     |
|             8       8               |
|o5 : Matrix S  <--- S                |
+-------------------------------------+

See also
========

  * map(LabeledModule,LabeledModule,Matrix)
    -- creates a
    LabeledModuleMap from a matrix
  * map(Module,Module,Matrix) (Macaulay2Doc)
    -- create the matrix
    induced on generators by a given matrix

Ways to use this method:
========================

  * map(LabeledModule,LabeledModule,LabeledModuleMap)
    -- creates a new
    LabeledModuleMap from a given LabeledModuleMap
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1412:0.

map(LabeledModule,LabeledModule,List) -- creates a LabeledModuleMap from a list
*******************************************************************************

  * Function: map (Macaulay2Doc),
  * Usage:
        map(F,G,L)
  * Inputs:
      * F, a free module with labeled basis,
      * G, a free module with labeled basis,
      * L, a list (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), =>
        ..., default value null,
      * DegreeLift (Macaulay2Doc), => ...,
        default value null,
      * DegreeMap (Macaulay2Doc), => ...,
        default value null,
  * Outputs:
      * a map of labeled modules,

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

This function produces essentially the same output as
map(Module,Module,List) (Macaulay2Doc), except
that the output map belongs to the class LabeledModuleMap, and thus remembers
the labeled module structure of the source and target.

+-------------------------------------------+
|i1 : S=QQ[x,y,z];                          |
+-------------------------------------------+
|i2 : F=labeledModule(S^3)                  |
|                                           |
|      3                                    |
|o2 = S                                     |
|                                           |
|o2 : free S-module with labeled basis      |
+-------------------------------------------+
|i3 : L={{1,2,3},{x,y,z},{3*x^2,x*y,z^2}}   |
|                                           |
|                               2        2  |
|o3 = {{1, 2, 3}, {x, y, z}, {3x , x*y, z }}|
|                                           |
|o3 : List                                  |
+-------------------------------------------+
|i4 : g=map(F,F,L)                          |
|                                           |
|o4 = | 1   2  3  |                         |
|     | x   y  z  |                         |
|     | 3x2 xy z2 |                         |
|                                           |
|             3       3                     |
|o4 : Matrix S  <--- S                      |
+-------------------------------------------+
|i5 : source g                              |
|                                           |
|      3                                    |
|o5 = S                                     |
|                                           |
|o5 : free S-module with labeled basis      |
+-------------------------------------------+

See also
========

  * map(Module,Module,List) (Macaulay2Doc)
    -- create a matrix by giving
    a sparse or dense list of entries

Ways to use this method:
========================

  * map(LabeledModule,LabeledModule,List)
    -- creates a
    LabeledModuleMap from a list
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1474:0.

map(LabeledModule,LabeledModule,Matrix) -- creates a LabeledModuleMap from a matrix
***********************************************************************************

  * Function: map (Macaulay2Doc),
  * Usage:
        map(F,G,M)
  * Inputs:
      * F, a free module with labeled basis,
      * G, a free module with labeled basis,
      * M, a matrix (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), =>
        ..., default value null,
      * DegreeLift (Macaulay2Doc), => ...,
        default value null,
      * DegreeMap (Macaulay2Doc), => ...,
        default value null,
  * Outputs:
      * a map of labeled modules,

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

This function produces essentially the same output as
map(Module,Module,Matrix), except that the output map belongs to the class
LabeledModuleMap, and thus remembers the labeled module structure of the source
and target.

+----------------------------------------------+
|i1 : S=QQ[x,y,z];                             |
+----------------------------------------------+
|i2 : F=labeledModule(S^3)                     |
|                                              |
|      3                                       |
|o2 = S                                        |
|                                              |
|o2 : free S-module with labeled basis         |
+----------------------------------------------+
|i3 : M=matrix{{1,2,3},{x,y,z},{3*x^2,x*y,z^2}}|
|                                              |
|o3 = | 1   2  3  |                            |
|     | x   y  z  |                            |
|     | 3x2 xy z2 |                            |
|                                              |
|             3      3                         |
|o3 : Matrix S  <-- S                          |
+----------------------------------------------+
|i4 : g=map(F,F,M)                             |
|                                              |
|o4 = | 1   2  3  |                            |
|     | x   y  z  |                            |
|     | 3x2 xy z2 |                            |
|                                              |
|             3       3                        |
|o4 : Matrix S  <--- S                         |
+----------------------------------------------+
|i5 : source g                                 |
|                                              |
|      3                                       |
|o5 = S                                        |
|                                              |
|o5 : free S-module with labeled basis         |
+----------------------------------------------+

See also
========

  * map(Module,Module,Matrix) (Macaulay2Doc)
    -- create the matrix
    induced on generators by a given matrix

Ways to use this method:
========================

  * map(LabeledModule,LabeledModule,Matrix)
    -- creates a
    LabeledModuleMap from a matrix
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1442:0.

map(LabeledModule,LabeledModule,ZZ) -- creates scalar multiplication by an integer as a LabeledModuleMap
********************************************************************************************************

  * Function: map (Macaulay2Doc),
  * Usage:
        map(F,G,m)
  * Inputs:
      * F, a free module with labeled basis,
      * G, a free module with labeled basis,
      * m, an integer (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), =>
        ..., default value null,
      * DegreeLift (Macaulay2Doc), => ...,
        default value null,
      * DegreeMap (Macaulay2Doc), => ...,
        default value null,
  * Outputs:
      * a map of labeled modules,

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

This function produces essentially the same output as
map(Module,Module,ZZ) (Macaulay2Doc),
except that the output map belongs to the class LabeledModuleMap, and thus
remembers the labeled module structure of the source and target.  If $m=0$ then
the output is the zero map.  If $m\ne 0$, then $F$ and $G$ must have the same
rank.

+-------------------------------------+
|i1 : S=QQ[x,y,z];                    |
+-------------------------------------+
|i2 : F=labeledModule(S^3);           |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : G=labeledModule(S^2);           |
|                                     |
|o3 : free S-module with labeled basis|
+-------------------------------------+
|i4 : g=map(F,G,0)                    |
|                                     |
|o4 = 0                               |
|                                     |
|             3       2               |
|o4 : Matrix S  <--- S                |
+-------------------------------------+
|i5 : h=map(F,F,1)                    |
|                                     |
|o5 = | 1 0 0 |                       |
|     | 0 1 0 |                       |
|     | 0 0 1 |                       |
|                                     |
|             3       3               |
|o5 : Matrix S  <--- S                |
+-------------------------------------+

See also
========

  * map(Module,Module,ZZ) (Macaulay2Doc)
    -- construct the map
    induced by multiplication by a ring element on the generators

Ways to use this method:
========================

  * map(LabeledModule,LabeledModule,ZZ)
    -- creates scalar
    multiplication by an integer as a LabeledModuleMap
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1505:0.

minorsMap -- creates a map of labeled free modules whose image is the minors of a map of labeled free modules
*************************************************************************************************************

  * Usage:
        minorsMap(f,E)
        minorsMap(M,E)
  * Inputs:
      * f, a map of labeled modules,
      * M, a matrix (Macaulay2Doc),
      * E, a free module with labeled basis,
  * Outputs:
      * a map of labeled modules,

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

This function assumes that $E$ has the form $E=\wedge^b B \otimes \wedge^b A$
where $A$ and $B$ are labeled free $S$-modules and where $f: A^*\to B$ (or
where $M$ is matrix representing such a map).  The output is the map $$ E\to S
$$ sending each basis element to the corresponding $b\times b$ minor of $f$ (or
$M$).

+-------------------------------------------------+
|i1 : S=ZZ/101[x,y,z];                            |
+-------------------------------------------------+
|i2 : A=labeledModule(S^2);                       |
|                                                 |
|o2 : free S-module with labeled basis            |
+-------------------------------------------------+
|i3 : B=labeledModule(S^{3:-2});                  |
|                                                 |
|o3 : free S-module with labeled basis            |
+-------------------------------------------------+
|i4 : M=matrix{{x^2,x*y,y^2},{y^2,y*z,z^2}}       |
|                                                 |
|o4 = | x2 xy y2 |                                |
|     | y2 yz z2 |                                |
|                                                 |
|             2      3                            |
|o4 : Matrix S  <-- S                             |
+-------------------------------------------------+
|i5 : f=map(A,B,M);                               |
|                                                 |
|             2       3                           |
|o5 : Matrix S  <--- S                            |
+-------------------------------------------------+
|i6 : E=(exteriorPower(2,B))**(exteriorPower(2,A))|
|                                                 |
|      3                                          |
|o6 = S                                           |
|                                                 |
|o6 : free S-module with labeled basis            |
+-------------------------------------------------+
|i7 : minorsMap(f,E)                              |
|                                                 |
|o7 = | -xy3+x2yz -y4+x2z2 -y3z+xyz2 |            |
|                                                 |
|             1       3                           |
|o7 : Matrix S  <--- S                            |
+-------------------------------------------------+
|i8 : minorsMap(M,E)                              |
|                                                 |
|o8 = | -xy3+x2yz -y4+x2z2 -y3z+xyz2 |            |
|                                                 |
|             1       3                           |
|o8 : Matrix S  <--- S                            |
+-------------------------------------------------+

Ways to use minorsMap:
======================

  * "minorsMap(LabeledModuleMap,LabeledModule)"
  * "minorsMap(Matrix,LabeledModule)"

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

The object minorsMap, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1938:0.

MonSize
*******

Functions with optional argument named MonSize:
===============================================

  * flattenedESTensor(...,MonSize=>...) (missing documentation)
  * pureResES1(...,MonSize=>...) (missing documentation)

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

The object MonSize (missing documentation) is a symbol (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
/home/runner/work/M2/M2/M2/BUILD/build/Macaulay2/packages/currentString:2:0.

multiSubsets -- produce all subsets of a given size, allowing repetitions
*************************************************************************

  * Usage:
        multiSubsets(L,n)
        multiSubsets(m,n)
  * Inputs:
      * L, a list (Macaulay2Doc),
      * n, an integer (Macaulay2Doc),
      * m, an integer (Macaulay2Doc),
  * Outputs:
      * a list (Macaulay2Doc),

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

multiSubsets(L,n) yields all multisets of cardinality $n$ with element from
$L$.  multiSubsets(m,n) yields all multisets of cardinality $n$ with elements
in the list $\{0,\dots,m-1\}$.

+-----------------------------------------------------+
|i1 : L={a,b,c}                                       |
|                                                     |
|o1 = {a, b, c}                                       |
|                                                     |
|o1 : List                                            |
+-----------------------------------------------------+
|i2 : multiSubsets(L,2)                               |
|                                                     |
|o2 = {{a, a}, {a, b}, {b, b}, {a, c}, {b, c}, {c, c}}|
|                                                     |
|o2 : List                                            |
+-----------------------------------------------------+
|i3 : multiSubsets(3,2)                               |
|                                                     |
|o3 = {{0, 0}, {0, 1}, {1, 1}, {0, 2}, {1, 2}, {2, 2}}|
|                                                     |
|o3 : List                                            |
+-----------------------------------------------------+

See also
========

  * subsets (Macaulay2Doc) -- produce the subsets of a set or
    list

Ways to use multiSubsets:
=========================

  * "multiSubsets(List,ZZ)"
  * "multiSubsets(ZZ,ZZ)"

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

The object multiSubsets, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1717:0.

pureResES -- constructs the Eisenbud--Schreyer pure resolution of a given type
******************************************************************************

  * Usage:
        pureResES(d,kk)
  * Inputs:
      * d, a list (Macaulay2Doc),
      * kk, a ring (Macaulay2Doc),
  * Outputs:
      * a chain complex (OldChainComplexes),

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

Given a degree sequence $d$, this function returns the pure resolution of type
$d$ constructed in by Eisenbud and Schreyer in Section 5 of ``Betti numbers of
graded modules and cohomology of vector bundles''.  The function operates by
resolving the output of pureResES1(d,kk).

+-----------------------------------------------------------------------------+
|i1 : d={0,2,4,5};                                                            |
+-----------------------------------------------------------------------------+
|i2 : FF=pureResES(d,ZZ/32003)                                                |
|                                                                             |
|        ZZ          3        ZZ          10        ZZ          15            |
|o2 = (-----[x ..x ])  <-- (-----[x ..x ])   <-- (-----[x ..x ])   <--        |
|      32003  0   2         32003  0   2          32003  0   2                |
|                                                                             |
|     0                    1                     2                            |
|                                                                             |
|o2 : ChainComplex                                                            |
|-----------------------------------------------------------------------------|
|   ZZ          8                                                             |
|(-----[x ..x ])  <-- 0                                                       |
| 32003  0   2                                                                |
|                     4                                                       |
|3                                                                            |
+-----------------------------------------------------------------------------+
|i3 : betti FF                                                                |
|                                                                             |
|            0  1  2 3                                                        |
|o3 = total: 3 10 15 8                                                        |
|         0: 3  .  . .                                                        |
|         1: . 10  . .                                                        |
|         2: .  . 15 8                                                        |
|                                                                             |
|o3 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * pureResES1 -- computes the first map of the
    Eisenbud--Schreyer pure resolution of a given type

Ways to use pureResES:
======================

  * pureResES(List,Ring) (missing documentation)

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

The object pureResES, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1164:0.

pureResES1 -- computes the first map of the Eisenbud--Schreyer pure resolution of a given type
**********************************************************************************************

  * Usage:
        pureResES1(d,kk)
  * Inputs:
      * d, a list (Macaulay2Doc),
      * kk, a ring (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * MonSize (missing documentation) => ..., default value 32,
  * Outputs:
      * a map of labeled modules,

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

Given a degree sequence $d\in \mathbb Z^{n+1}$ and a field $k$ of arbitrary
characteristic, this produces the first map of pure resolution of type d as
constructed by Eisenbud and Schreyer in Section 5 of ``Betti numbers of graded
modules and cohomology of vector bundles''.  The cokernel of this map is a
module of finite of length over a polynomial ring in $n$ variables.

The code gives an error if d is not strictly increasing with $d_0=0$.

There is an OPTION, MonSize => n (where n is 8,16, or 32). This sets the
MonomialSize (Macaulay2Doc), option when the base ring of
flattenedESTensor is created.

+-----------------------------------------------------------------------------+
|i1 : d={0,2,4,5};                                                            |
+-----------------------------------------------------------------------------+
|i2 : p=pureResES1(d,ZZ/32003)                                                |
|                                                                             |
|o2 = | x_0^2 x_0x_1 x_1^2-x_0x_2 x_0x_2 x_1x_2 x_2^2        0      0         |
|     | 0     x_0^2  x_0x_1       x_0x_1 x_1^2  x_1x_2       x_0x_2 x_1x_2    |
|     | 0     0      x_0^2        0      x_0x_1 x_1^2-x_0x_2 0      x_0x_2    |
|                                                                             |
|               ZZ          3         ZZ          10                          |
|o2 : Matrix (-----[x ..x ])  <--- (-----[x ..x ])                            |
|             32003  0   2          32003  0   2                              |
|-----------------------------------------------------------------------------|
|0      0     |                                                               |
|x_2^2  0     |                                                               |
|x_1x_2 x_2^2 |                                                               |
+-----------------------------------------------------------------------------+
|i3 : betti res coker p                                                       |
|                                                                             |
|            0  1  2 3                                                        |
|o3 = total: 3 10 15 8                                                        |
|         0: 3  .  . .                                                        |
|         1: . 10  . .                                                        |
|         2: .  . 15 8                                                        |
|                                                                             |
|o3 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i4 : dim coker p                                                             |
|                                                                             |
|o4 = 0                                                                       |
+-----------------------------------------------------------------------------+

See also
========

  * pureResES -- constructs the Eisenbud--Schreyer pure
    resolution of a given type

Ways to use pureResES1:
=======================

  * pureResES1(List,Ring) (missing documentation)

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

The object pureResES1, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1135:0.

pureResTC -- constructs the balanced tensor complex of a given type
*******************************************************************

  * Usage:
        pureResTC(d,kk)
  * Inputs:
      * d, a list (Macaulay2Doc),
      * kk, a ring (Macaulay2Doc),
  * Outputs:
      * a chain complex (OldChainComplexes),

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

Given a degree sequence $d$, this function returns a balanced tensor complex
that is a  pure resolution of type $d$, as constructed in Section 3 of the
paper ``Tensor Complexes: Multilinear free resolutions constructed from higher
tensors by Berkesch-Erman-Kummini-Sam. The function operates by resolving the
output of pureResTC1(d,kk).

The code gives an error if d is not strictly increasing with $d_0=0$.

+-----------------------------------------------------------------------------+
|i1 : d={0,2,4,5};                                                            |
+-----------------------------------------------------------------------------+
|i2 : FF=pureResTC(d,ZZ/32003)                                                |
|                                                                             |
|        ZZ                                                                   |
|o2 = (-----[x       , x       , x       , x       , x       , x       ,      |
|      32003  0,0,0,0   0,0,1,0   0,1,0,0   0,1,1,0   1,0,0,0   1,0,1,0       |
|                                                                             |
|     0                                                                       |
|                                                                             |
|o2 : ChainComplex                                                            |
|-----------------------------------------------------------------------------|
|                                                                             |
|x       , x       , x       , x       , x       , x       , x       ,        |
| 1,1,0,0   1,1,1,0   2,0,0,0   2,0,1,0   2,1,0,0   2,1,1,0   3,0,0,0         |
|                                                                             |
|                                                                             |
|-----------------------------------------------------------------------------|
|                                                                      3      |
|x       , x       , x       , x       , x       , x       , x       ])  <--  |
| 3,0,1,0   3,1,0,0   3,1,1,0   4,0,0,0   4,0,1,0   4,1,0,0   4,1,1,0         |
|                                                                             |
|                                                                             |
|-----------------------------------------------------------------------------|
|   ZZ                                                                        |
|(-----[x       , x       , x       , x       , x       , x       , x       , |
| 32003  0,0,0,0   0,0,1,0   0,1,0,0   0,1,1,0   1,0,0,0   1,0,1,0   1,1,0,0  |
|                                                                             |
|1                                                                            |
|-----------------------------------------------------------------------------|
|                                                                             |
|x       , x       , x       , x       , x       , x       , x       ,        |
| 1,1,1,0   2,0,0,0   2,0,1,0   2,1,0,0   2,1,1,0   3,0,0,0   3,0,1,0         |
|                                                                             |
|                                                                             |
|-----------------------------------------------------------------------------|
|                                                            10               |
|x       , x       , x       , x       , x       , x       ])   <--           |
| 3,1,0,0   3,1,1,0   4,0,0,0   4,0,1,0   4,1,0,0   4,1,1,0                   |
|                                                                             |
|                                                                             |
|-----------------------------------------------------------------------------|
|   ZZ                                                                        |
|(-----[x       , x       , x       , x       , x       , x       , x       , |
| 32003  0,0,0,0   0,0,1,0   0,1,0,0   0,1,1,0   1,0,0,0   1,0,1,0   1,1,0,0  |
|                                                                             |
|2                                                                            |
|-----------------------------------------------------------------------------|
|                                                                             |
|x       , x       , x       , x       , x       , x       , x       ,        |
| 1,1,1,0   2,0,0,0   2,0,1,0   2,1,0,0   2,1,1,0   3,0,0,0   3,0,1,0         |
|                                                                             |
|                                                                             |
|-----------------------------------------------------------------------------|
|                                                            15               |
|x       , x       , x       , x       , x       , x       ])   <--           |
| 3,1,0,0   3,1,1,0   4,0,0,0   4,0,1,0   4,1,0,0   4,1,1,0                   |
|                                                                             |
|                                                                             |
|-----------------------------------------------------------------------------|
|   ZZ                                                                        |
|(-----[x       , x       , x       , x       , x       , x       , x       , |
| 32003  0,0,0,0   0,0,1,0   0,1,0,0   0,1,1,0   1,0,0,0   1,0,1,0   1,1,0,0  |
|                                                                             |
|3                                                                            |
|-----------------------------------------------------------------------------|
|                                                                             |
|x       , x       , x       , x       , x       , x       , x       ,        |
| 1,1,1,0   2,0,0,0   2,0,1,0   2,1,0,0   2,1,1,0   3,0,0,0   3,0,1,0         |
|                                                                             |
|-----------------------------------------------------------------------------|
|                                                            8                |
|x       , x       , x       , x       , x       , x       ])  <-- 0          |
| 3,1,0,0   3,1,1,0   4,0,0,0   4,0,1,0   4,1,0,0   4,1,1,0                   |
|                                                                  4          |
+-----------------------------------------------------------------------------+
|i3 : betti FF                                                                |
|                                                                             |
|            0  1  2 3                                                        |
|o3 = total: 3 10 15 8                                                        |
|         0: 3  .  . .                                                        |
|         1: . 10  . .                                                        |
|         2: .  . 15 8                                                        |
|                                                                             |
|o3 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * pureResTC1 -- computes the first map of a balanced
    tensor complex with pure resolution of a given type

Ways to use pureResTC:
======================

  * pureResTC(List,Ring) (missing documentation)

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

The object pureResTC, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1229:0.

pureResTC1 -- computes the first map of a balanced tensor complex with pure resolution of a given type
******************************************************************************************************

  * Usage:
        pureResTC1(d,kk)
  * Inputs:
      * d, a list (Macaulay2Doc),
      * kk, a ring (Macaulay2Doc),
  * Outputs:
      * a map of labeled modules,

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

Given a degree sequence $d\in \mathbb Z^{n+1}$ and a field $k$ of arbitrary
characteristic, this produces the first map of a balanced tensor complex with a
pure resolution of type d, as constructed in Section 3 of the paper ``Tensor
Complexes: Multilinear free resolutions constructed from higher tensors by
Berkesch-Erman-Kummini-Sam.  The cokernel of the output is an indecomposable
module of codimension $n$.

The code gives an error if d is not strictly increasing with $d_0=0$.

+-----------------------------------------------------------------------------+
|i1 : d={0,2,4,5};                                                            |
+-----------------------------------------------------------------------------+
|i2 : p=pureResTC1(d,ZZ/32003)                                                |
|                                                                             |
|o2 = | -x_(0,1,0,0)x_(1,0,0,0)+x_(0,0,0,0)x_(1,1,0,0)                        |
|     | -x_(0,1,1,0)x_(1,0,0,0)-x_(0,1,0,0)x_(1,0,1,0)+x_(0,0,1,0)x_(1,1,0,0)+|
|     | -x_(0,1,1,0)x_(1,0,1,0)+x_(0,0,1,0)x_(1,1,1,0)                        |
|                                                                             |
|               ZZ                                                            |
|o2 : Matrix (-----[x       , x       , x       , x       , x       , x       |
|             32003  0,0,0,0   0,0,1,0   0,1,0,0   0,1,1,0   1,0,0,0   1,0,1,0|
|-----------------------------------------------------------------------------|
|                       -x_(0,1,0,0)x_(2,0,0,0)+x_(0,0,0,0)x_(2,1,0,0)        |
|x_(0,0,0,0)x_(1,1,1,0) -x_(0,1,1,0)x_(2,0,0,0)-x_(0,1,0,0)x_(2,0,1,0)+x_(0,0,|
|                       -x_(0,1,1,0)x_(2,0,1,0)+x_(0,0,1,0)x_(2,1,1,0)        |
|                                                                             |
|                                                                             |
|, x       , x       , x       , x       , x       , x       , x       , x    |
|   1,1,0,0   1,1,1,0   2,0,0,0   2,0,1,0   2,1,0,0   2,1,1,0   3,0,0,0   3,0,|
|-----------------------------------------------------------------------------|
|                                       -x_(1,1,0,0)x_(2,0,0,0)+x_(1,0,0,     |
|1,0)x_(2,1,0,0)+x_(0,0,0,0)x_(2,1,1,0) -x_(1,1,1,0)x_(2,0,0,0)-x_(1,1,0,     |
|                                       -x_(1,1,1,0)x_(2,0,1,0)+x_(1,0,1,     |
|                                                                             |
|                                                                 3           |
|   , x       , x       , x       , x       , x       , x       ])  <---      |
|1,0   3,1,0,0   3,1,1,0   4,0,0,0   4,0,1,0   4,1,0,0   4,1,1,0              |
|-----------------------------------------------------------------------------|
|0)x_(2,1,0,0)                                               -x_(0,1,0,0)x_(3,|
|0)x_(2,0,1,0)+x_(1,0,1,0)x_(2,1,0,0)+x_(1,0,0,0)x_(2,1,1,0) -x_(0,1,1,0)x_(3,|
|0)x_(2,1,1,0)                                               -x_(0,1,1,0)x_(3,|
|                                                                             |
|   ZZ                                                                        |
|(-----[x       , x       , x       , x       , x       , x       , x       , |
| 32003  0,0,0,0   0,0,1,0   0,1,0,0   0,1,1,0   1,0,0,0   1,0,1,0   1,1,0,0  |
|-----------------------------------------------------------------------------|
|0,0,0)+x_(0,0,0,0)x_(3,1,0,0)                                               -|
|0,0,0)-x_(0,1,0,0)x_(3,0,1,0)+x_(0,0,1,0)x_(3,1,0,0)+x_(0,0,0,0)x_(3,1,1,0) -|
|0,1,0)+x_(0,0,1,0)x_(3,1,1,0)                                               -|
|                                                                             |
|                                                                             |
|x       , x       , x       , x       , x       , x       , x       , x      |
| 1,1,1,0   2,0,0,0   2,0,1,0   2,1,0,0   2,1,1,0   3,0,0,0   3,0,1,0   3,1,0,|
|-----------------------------------------------------------------------------|
|x_(1,1,0,0)x_(3,0,0,0)+x_(1,0,0,0)x_(3,1,0,0)                                |
|x_(1,1,1,0)x_(3,0,0,0)-x_(1,1,0,0)x_(3,0,1,0)+x_(1,0,1,0)x_(3,1,0,0)+x_(1,0,0|
|x_(1,1,1,0)x_(3,0,1,0)+x_(1,0,1,0)x_(3,1,1,0)                                |
|                                                                             |
|                                                     10                      |
| , x       , x       , x       , x       , x       ])                        |
|0   3,1,1,0   4,0,0,0   4,0,1,0   4,1,0,0   4,1,1,0                          |
|-----------------------------------------------------------------------------|
|               -x_(2,1,0,0)x_(3,0,0,0)+x_(2,0,0,0)x_(3,1,0,0)                |
|,0)x_(3,1,1,0) -x_(2,1,1,0)x_(3,0,0,0)-x_(2,1,0,0)x_(3,0,1,0)+x_(2,0,1,0)x_(3|
|               -x_(2,1,1,0)x_(3,0,1,0)+x_(2,0,1,0)x_(3,1,1,0)                |
|-----------------------------------------------------------------------------|
|                                                                             |
|,1,0,0)+x_(2,0,0,0)x_(3,1,1,0)                                               |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(0,1,0,0)x_(4,0,0,0)+x_(0,0,0,0)x_(4,1,0,0)                               |
|-x_(0,1,1,0)x_(4,0,0,0)-x_(0,1,0,0)x_(4,0,1,0)+x_(0,0,1,0)x_(4,1,0,0)+x_(0,0,|
|-x_(0,1,1,0)x_(4,0,1,0)+x_(0,0,1,0)x_(4,1,1,0)                               |
|-----------------------------------------------------------------------------|
|                -x_(1,1,0,0)x_(4,0,0,0)+x_(1,0,0,0)x_(4,1,0,0)               |
|0,0)x_(4,1,1,0) -x_(1,1,1,0)x_(4,0,0,0)-x_(1,1,0,0)x_(4,0,1,0)+x_(1,0,1,0)x_(|
|                -x_(1,1,1,0)x_(4,0,1,0)+x_(1,0,1,0)x_(4,1,1,0)               |
|-----------------------------------------------------------------------------|
|                                                                             |
|4,1,0,0)+x_(1,0,0,0)x_(4,1,1,0)                                              |
|                                                                             |
|-----------------------------------------------------------------------------|
|-x_(2,1,0,0)x_(4,0,0,0)+x_(2,0,0,0)x_(4,1,0,0)                               |
|-x_(2,1,1,0)x_(4,0,0,0)-x_(2,1,0,0)x_(4,0,1,0)+x_(2,0,1,0)x_(4,1,0,0)+x_(2,0,|
|-x_(2,1,1,0)x_(4,0,1,0)+x_(2,0,1,0)x_(4,1,1,0)                               |
|-----------------------------------------------------------------------------|
|                -x_(3,1,0,0)x_(4,0,0,0)+x_(3,0,0,0)x_(4,1,0,0)               |
|0,0)x_(4,1,1,0) -x_(3,1,1,0)x_(4,0,0,0)-x_(3,1,0,0)x_(4,0,1,0)+x_(3,0,1,0)x_(|
|                -x_(3,1,1,0)x_(4,0,1,0)+x_(3,0,1,0)x_(4,1,1,0)               |
|-----------------------------------------------------------------------------|
|                                |                                            |
|4,1,0,0)+x_(3,0,0,0)x_(4,1,1,0) |                                            |
|                                |                                            |
+-----------------------------------------------------------------------------+
|i3 : betti res coker p                                                       |
|                                                                             |
|            0  1  2 3                                                        |
|o3 = total: 3 10 15 8                                                        |
|         0: 3  .  . .                                                        |
|         1: . 10  . .                                                        |
|         2: .  . 15 8                                                        |
|                                                                             |
|o3 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * pureResTC -- constructs the balanced tensor complex of a
    given type

Ways to use pureResTC1:
=======================

  * pureResTC1(List,Ring) (missing documentation)

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

The object pureResTC1, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1197:0.

source(LabeledModuleMap) -- the source of a map of a labeled modules
********************************************************************

  * Function: source (Macaulay2Doc),
  * Usage:
        source f
  * Inputs:
      * f, a map of labeled modules,
  * Outputs:
      * a free module with labeled basis,

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

This yields the source of a map of a labeled module, as a labeled module.

+-------------------------------------+
|i1 : S=ZZ/101[x,y,z];                |
+-------------------------------------+
|i2 : F=labeledModule(S^2);           |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : G=symmetricPower(2,F);          |
|                                     |
|o3 : free S-module with labeled basis|
+-------------------------------------+
|i4 : f=map(G,F,{{x,y},{y,z},{z,x}})  |
|                                     |
|o4 = | x y |                         |
|     | y z |                         |
|     | z x |                         |
|                                     |
|             3       2               |
|o4 : Matrix S  <--- S                |
+-------------------------------------+
|i5 : source f                        |
|                                     |
|      2                              |
|o5 = S                               |
|                                     |
|o5 : free S-module with labeled basis|
+-------------------------------------+
|i6 : basisList source f              |
|                                     |
|o6 = {0, 1}                          |
|                                     |
|o6 : List                            |
+-------------------------------------+

See also
========

  * target(LabeledModuleMap) -- the target
    of a map of a labeled modules

Ways to use this method:
========================

  * source(LabeledModuleMap) -- the source
    of a map of a labeled modules
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1864:0.

symmetricMultiplication -- creates the symmetric multiplication map
*******************************************************************

  * Usage:
        symmetricMultiplication(F,i,j)
  * Inputs:
      * F, a free module with labeled basis,
      * i, an integer (Macaulay2Doc),
      * j, an integer (Macaulay2Doc),
  * Outputs:
      * a map of labeled modules,

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

Given a labeled free module $F$, and two nonnegative integers $i$ and $j$, this
yields the multiplication map $$ f: S^i(F)\otimes S^j(F)\to S^{i+j}(F). $$ The
output map is treated as a map of labeled modules, and the source and target
are inherit the natural structure as labeled modules from $F$.  For instance,
if the basis list of $F$ is $L$, then the basis list of the target of $f$ is
the list multiSubsets(i+j,L).

+-----------------------------------------------------------------------------+
|i1 : S=ZZ/101[x,y,z];                                                        |
+-----------------------------------------------------------------------------+
|i2 : F=labeledModule(S^2);                                                   |
|                                                                             |
|o2 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i3 : f=symmetricMultiplication(F,2,2)                                        |
|                                                                             |
|o3 = | 1 0 0 0 0 0 0 0 0 |                                                   |
|     | 0 1 0 1 0 0 0 0 0 |                                                   |
|     | 0 0 1 0 1 0 1 0 0 |                                                   |
|     | 0 0 0 0 0 1 0 1 0 |                                                   |
|     | 0 0 0 0 0 0 0 0 1 |                                                   |
|                                                                             |
|             5       9                                                       |
|o3 : Matrix S  <--- S                                                        |
+-----------------------------------------------------------------------------+
|i4 : source f                                                                |
|                                                                             |
|      9                                                                      |
|o4 = S                                                                       |
|                                                                             |
|o4 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i5 : basisList F                                                             |
|                                                                             |
|o5 = {0, 1}                                                                  |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : basisList source f                                                      |
|                                                                             |
|o6 = {{{0, 0}, {0, 0}}, {{0, 0}, {0, 1}}, {{0, 0}, {1, 1}}, {{0, 1}, {0, 0}},|
|     ------------------------------------------------------------------------|
|     {{0, 1}, {0, 1}}, {{0, 1}, {1, 1}}, {{1, 1}, {0, 0}}, {{1, 1}, {0, 1}}, |
|     ------------------------------------------------------------------------|
|     {{1, 1}, {1, 1}}}                                                       |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : basisList target f                                                      |
|                                                                             |
|o7 = {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 1}, {0, 1, 1, 1}, {1, 1, 1, 1}}  |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use symmetricMultiplication:
====================================

  * "symmetricMultiplication(LabeledModule,ZZ,ZZ)"

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

The object symmetricMultiplication, is a
method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1901:0.

symmetricPower(ZZ,LabeledModule) -- Symmetric power of a @TO LabeledModule@
***************************************************************************

  * Function: symmetricPower (Macaulay2Doc),
  * Usage:
        E = symmetricPower(i,M)
  * Inputs:
      * i, an integer (Macaulay2Doc),
      * M, a free module with labeled basis,
  * Outputs:
      * E, a free module with labeled basis,

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

This produces the symmetric power of a labeled module as a labeled module with
the natural basis list.  For instance if $M$ is a labeled module with basis
list $L$, then exteriorPower(2,M) is a labeled module with basis list
multiSubsets(2,L) and with $M$ as an underlying module,

+-----------------------------------------------------------------------------+
|i1 : S=ZZ/101[x,y,z];                                                        |
+-----------------------------------------------------------------------------+
|i2 : M=labeledModule(S^3);                                                   |
|                                                                             |
|o2 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i3 : F=symmetricPower(2,M)                                                   |
|                                                                             |
|      6                                                                      |
|o3 = S                                                                       |
|                                                                             |
|o3 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i4 : basisList F                                                             |
|                                                                             |
|o4 = {{0, 0}, {0, 1}, {1, 1}, {0, 2}, {1, 2}, {2, 2}}                        |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
|i5 : underlyingModules F                                                     |
|                                                                             |
|       3                                                                     |
|o5 = {S }                                                                    |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : G=symmetricPower(2,F);                                                  |
|                                                                             |
|o6 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i7 : basisList G                                                             |
|                                                                             |
|o7 = {{{0, 0}, {0, 0}}, {{0, 0}, {0, 1}}, {{0, 1}, {0, 1}}, {{0, 0}, {1, 1}},|
|     ------------------------------------------------------------------------|
|     {{0, 1}, {1, 1}}, {{1, 1}, {1, 1}}, {{0, 0}, {0, 2}}, {{0, 1}, {0, 2}}, |
|     ------------------------------------------------------------------------|
|     {{1, 1}, {0, 2}}, {{0, 2}, {0, 2}}, {{0, 0}, {1, 2}}, {{0, 1}, {1, 2}}, |
|     ------------------------------------------------------------------------|
|     {{1, 1}, {1, 2}}, {{0, 2}, {1, 2}}, {{1, 2}, {1, 2}}, {{0, 0}, {2, 2}}, |
|     ------------------------------------------------------------------------|
|     {{0, 1}, {2, 2}}, {{1, 1}, {2, 2}}, {{0, 2}, {2, 2}}, {{1, 2}, {2, 2}}, |
|     ------------------------------------------------------------------------|
|     {{2, 2}, {2, 2}}}                                                       |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

The first symmetric power of a labeled module is not the identity in the
category of labeled modules.  For instance, if $M$ is a free labeled module
with basis list $\{0,1\}$ and with no underlying modules, then
$symmetricPower(1,M)$ is a labeled module with basis list $\{ \{0\}, \{1\},\}$
and with $M$ as an underlying module.

+--------------------------------------+
|i8 : S=ZZ/101[x,y,z];                 |
+--------------------------------------+
|i9 : M=labeledModule(S^2);            |
|                                      |
|o9 : free S-module with labeled basis |
+--------------------------------------+
|i10 : E=symmetricPower(1,M);          |
|                                      |
|o10 : free S-module with labeled basis|
+--------------------------------------+
|i11 : basisList M                     |
|                                      |
|o11 = {0, 1}                          |
|                                      |
|o11 : List                            |
+--------------------------------------+
|i12 : basisList E                     |
|                                      |
|o12 = {{0}, {1}}                      |
|                                      |
|o12 : List                            |
+--------------------------------------+
|i13 : underlyingModules M             |
|                                      |
|o13 = {}                              |
|                                      |
|o13 : List                            |
+--------------------------------------+
|i14 : underlyingModules E             |
|                                      |
|        2                             |
|o14 = {S }                            |
|                                      |
|o14 : List                            |
+--------------------------------------+

By convention, the zeroeth symmetric power of an $S$-module is the labeled
module $S^1$ with basis list $\{\{\}\}$ and with no underlying modules.

+--------------------------------------+
|i15 : S=ZZ/101[x,y,z];                |
+--------------------------------------+
|i16 : M=labeledModule(S^2);           |
|                                      |
|o16 : free S-module with labeled basis|
+--------------------------------------+
|i17 : E=symmetricPower(0,M)           |
|                                      |
|       1                              |
|o17 = S                               |
|                                      |
|o17 : free S-module with labeled basis|
+--------------------------------------+
|i18 : basisList E                     |
|                                      |
|o18 = {{}}                            |
|                                      |
|o18 : List                            |
+--------------------------------------+
|i19 : underlyingModules E             |
|                                      |
|o19 = {}                              |
|                                      |
|o19 : List                            |
+--------------------------------------+

Ways to use this method:
========================

  * symmetricPower(ZZ,LabeledModule)
    -- Symmetric power of a @TO
    LabeledModule@
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1100:0.

target(LabeledModuleMap) -- the target of a map of a labeled modules
********************************************************************

  * Function: target (Macaulay2Doc),
  * Usage:
        target f
  * Inputs:
      * f, a map of labeled modules,
  * Outputs:
      * a free module with labeled basis,

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

This yields the target of a map of a labeled module, as a labeled module.

+-------------------------------------+
|i1 : S=ZZ/101[x,y,z];                |
+-------------------------------------+
|i2 : F=labeledModule(S^2);           |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : G=symmetricPower(2,F);          |
|                                     |
|o3 : free S-module with labeled basis|
+-------------------------------------+
|i4 : f=map(F,G,{{x,y,z},{y,z,x}})    |
|                                     |
|o4 = | x y z |                       |
|     | y z x |                       |
|                                     |
|             2       3               |
|o4 : Matrix S  <--- S                |
+-------------------------------------+
|i5 : target f                        |
|                                     |
|      2                              |
|o5 = S                               |
|                                     |
|o5 : free S-module with labeled basis|
+-------------------------------------+
|i6 : basisList target f              |
|                                     |
|o6 = {0, 1}                          |
|                                     |
|o6 : List                            |
+-------------------------------------+

See also
========

  * source(LabeledModuleMap) -- the source
    of a map of a labeled modules

Ways to use this method:
========================

  * target(LabeledModuleMap) -- the target
    of a map of a labeled modules
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1838:0.

tensor(LabeledModule,LabeledModule) -- creates the tensor product of two labeled modules, as a labeled module
*************************************************************************************************************

  * Function: tensor (Macaulay2Doc),
  * Usage:
        tensor(F,E)
  * Inputs:
      * F, a free module with labeled basis,
      * E, a free module with labeled basis,
  * Outputs:
      * a free module with labeled basis,

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

This tensor(F,E) is the same as tensorProduct(F,E).  See tensorProduct,
for more details.

+-----------------------------------------------------+
|i1 : S=ZZ/101[x,y,z];                                |
+-----------------------------------------------------+
|i2 : F=labeledModule(S^2);                           |
|                                                     |
|o2 : free S-module with labeled basis                |
+-----------------------------------------------------+
|i3 : E=labeledModule(S^3);                           |
|                                                     |
|o3 : free S-module with labeled basis                |
+-----------------------------------------------------+
|i4 : G=tensor(F,E)                                   |
|                                                     |
|      6                                              |
|o4 = S                                               |
|                                                     |
|o4 : free S-module with labeled basis                |
+-----------------------------------------------------+
|i5 : basisList G                                     |
|                                                     |
|o5 = {{0, 0}, {0, 1}, {0, 2}, {1, 0}, {1, 1}, {1, 2}}|
|                                                     |
|o5 : List                                            |
+-----------------------------------------------------+

Ways to use this method:
========================

  * tensor(LabeledModule,LabeledModule)
    -- creates the tensor product of
    two labeled modules, as a labeled module
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1964:0.

tensor(LabeledModuleMap,LabeledModuleMap) -- creates the tensor product of two maps of labeled modules, as a map of labeled module
**********************************************************************************************************************************

  * Function: tensor (Macaulay2Doc),
  * Usage:
        tensor(f,g)
  * Inputs:
      * f, a map of labeled modules,
      * g, a map of labeled modules,
  * Outputs:
      * a map of labeled modules,

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

If $f: A\to B$ and $g: C\to D$ are maps of labeled modules, then tensor(f,g) is
the map of labeled modules $$ f\otimes g: A\otimes C \to B\otimes D. $$

+-------------------------------------+
|i1 : S=ZZ/101[x,y,z];                |
+-------------------------------------+
|i2 : A=labeledModule(S^2);           |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : B=labeledModule(S^3);           |
|                                     |
|o3 : free S-module with labeled basis|
+-------------------------------------+
|i4 : C=labeledModule(S^3);           |
|                                     |
|o4 : free S-module with labeled basis|
+-------------------------------------+
|i5 : D=labeledModule(S^{2:-1});      |
|                                     |
|o5 : free S-module with labeled basis|
+-------------------------------------+
|i6 : f=map(A,B,{{1,1,1},{0,3,5}})    |
|                                     |
|o6 = | 1 1 1 |                       |
|     | 0 3 5 |                       |
|                                     |
|             2       3               |
|o6 : Matrix S  <--- S                |
+-------------------------------------+
|i7 : g=map(C,D,{{x,y},{0,z},{y,0}})  |
|                                     |
|o7 = | x y |                         |
|     | 0 z |                         |
|     | y 0 |                         |
|                                     |
|             3       2               |
|o7 : Matrix S  <--- S                |
+-------------------------------------+
|i8 : tensor(f,g)                     |
|                                     |
|o8 = | x y x  y  x  y  |             |
|     | 0 z 0  z  0  z  |             |
|     | y 0 y  0  y  0  |             |
|     | 0 0 3x 3y 5x 5y |             |
|     | 0 0 0  3z 0  5z |             |
|     | 0 0 3y 0  5y 0  |             |
|                                     |
|             6       6               |
|o8 : Matrix S  <--- S                |
+-------------------------------------+

Ways to use this method:
========================

  * tensor(LabeledModuleMap,LabeledModuleMap)
    -- creates the tensor
    product of two maps of labeled modules, as a map of labeled module
-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1996:0.

tensorComplex1 -- computes the first map of the tensor complex
**************************************************************

  * Usage:
        tensorComplex1(f,w)
        tensorComplex1 f
  * Inputs:
      * f, a map of labeled modules,
      * w, a list (Macaulay2Doc), of ZZ
  * Outputs:
      * a map of labeled modules,

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

Let $X := Proj(Spec S \times \mathbb P^{b_1-1}\times \cdots \times \mathbb
P^{b_n-1})$, and let $$ \mathbf K := \cdots \wedge^2 \oplus_1^a O_X(-1,\dots,
-1) \to  O_X  \to 0 $$ be the Koszul complex of the multilinear forms
corresponding to f, on $X$. The output of tensorComplex1(f,w) is the first map
of the complex obtained by pushing $\mathbf K \otimes {\mathcal
O}_X(w_1,\dots,w_n)$ down to $Spec S$.

This script implements the construction of tensor complexes from the paper
``Tensor Complexes: Multilinear free resolutions constructed from higher
tensors'' of Berkesch, Erman, Kummini and Sam (BEKS).

The program requires that $f$ is a flattened tensor, that is, a map $A \to
B_1\otimes\cdots\otimes B_n$. Returns the first map in the tensor complex
$F(f,w)$ of BEKS, requiring that $w$ satisfies: $$ w_0 = 0, w_1 \geq 0, w_2
\geq w_1+b_1, \ {\rm and }\  w_i>w_{i-1} \ {\rm for }\ i\geq 2. $$

When $rank A=\sum rank B_i$, that is, $L_0 = \sum_{i=1}^n L_i$ then we are in
the ``balanced case'' discussed in Section 3 of BEKS. In this case giving a
weight vector is unnecessary, and one can use the format tensorComplex1 f.

The example from section 12 of BEKS appears below.

+-----------------------------------------------------------------------------+
|i1 : f = flattenedGenericTensor({4,2,2},ZZ/32003)                            |
|                                                                             |
|o1 = | x_(0,0,0) x_(1,0,0) x_(2,0,0) x_(3,0,0) |                             |
|     | x_(0,0,1) x_(1,0,1) x_(2,0,1) x_(3,0,1) |                             |
|     | x_(0,1,0) x_(1,1,0) x_(2,1,0) x_(3,1,0) |                             |
|     | x_(0,1,1) x_(1,1,1) x_(2,1,1) x_(3,1,1) |                             |
|                                                                             |
|               ZZ                  4         ZZ                  4           |
|o1 : Matrix (-----[x     ..x     ])  <--- (-----[x     ..x     ])            |
|             32003  0,0,0   3,1,1          32003  0,0,0   3,1,1              |
+-----------------------------------------------------------------------------+
|i2 : S = ring f;                                                             |
+-----------------------------------------------------------------------------+
|i3 : g = tensorComplex1(f,{0,0,2})                                           |
|                                                                             |
|o3 = | -x_(0,1,0)x_(1,0,0)+x_(0,0,0)x_(1,1,0)                                |
|     | -x_(0,1,1)x_(1,0,0)-x_(0,1,0)x_(1,0,1)+x_(0,0,1)x_(1,1,0)+x_(0,0,0)x_(|
|     | -x_(0,1,1)x_(1,0,1)+x_(0,0,1)x_(1,1,1)                                |
|                                                                             |
|             3       6                                                       |
|o3 : Matrix S  <--- S                                                        |
|-----------------------------------------------------------------------------|
|       -x_(0,1,0)x_(2,0,0)+x_(0,0,0)x_(2,1,0)                                |
|1,1,1) -x_(0,1,1)x_(2,0,0)-x_(0,1,0)x_(2,0,1)+x_(0,0,1)x_(2,1,0)+x_(0,0,0)x_(|
|       -x_(0,1,1)x_(2,0,1)+x_(0,0,1)x_(2,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(1,1,0)x_(2,0,0)+x_(1,0,0)x_(2,1,0)                                |
|2,1,1) -x_(1,1,1)x_(2,0,0)-x_(1,1,0)x_(2,0,1)+x_(1,0,1)x_(2,1,0)+x_(1,0,0)x_(|
|       -x_(1,1,1)x_(2,0,1)+x_(1,0,1)x_(2,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(0,1,0)x_(3,0,0)+x_(0,0,0)x_(3,1,0)                                |
|2,1,1) -x_(0,1,1)x_(3,0,0)-x_(0,1,0)x_(3,0,1)+x_(0,0,1)x_(3,1,0)+x_(0,0,0)x_(|
|       -x_(0,1,1)x_(3,0,1)+x_(0,0,1)x_(3,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(1,1,0)x_(3,0,0)+x_(1,0,0)x_(3,1,0)                                |
|3,1,1) -x_(1,1,1)x_(3,0,0)-x_(1,1,0)x_(3,0,1)+x_(1,0,1)x_(3,1,0)+x_(1,0,0)x_(|
|       -x_(1,1,1)x_(3,0,1)+x_(1,0,1)x_(3,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(2,1,0)x_(3,0,0)+x_(2,0,0)x_(3,1,0)                                |
|3,1,1) -x_(2,1,1)x_(3,0,0)-x_(2,1,0)x_(3,0,1)+x_(2,0,1)x_(3,1,0)+x_(2,0,0)x_(|
|       -x_(2,1,1)x_(3,0,1)+x_(2,0,1)x_(3,1,1)                                |
|-----------------------------------------------------------------------------|
|       |                                                                     |
|3,1,1) |                                                                     |
|       |                                                                     |
+-----------------------------------------------------------------------------+
|i4 : g1 = tensorComplex1 f                                                   |
|                                                                             |
|o4 = | -x_(0,1,0)x_(1,0,0)+x_(0,0,0)x_(1,1,0)                                |
|     | -x_(0,1,1)x_(1,0,0)-x_(0,1,0)x_(1,0,1)+x_(0,0,1)x_(1,1,0)+x_(0,0,0)x_(|
|     | -x_(0,1,1)x_(1,0,1)+x_(0,0,1)x_(1,1,1)                                |
|                                                                             |
|             3       6                                                       |
|o4 : Matrix S  <--- S                                                        |
|-----------------------------------------------------------------------------|
|       -x_(0,1,0)x_(2,0,0)+x_(0,0,0)x_(2,1,0)                                |
|1,1,1) -x_(0,1,1)x_(2,0,0)-x_(0,1,0)x_(2,0,1)+x_(0,0,1)x_(2,1,0)+x_(0,0,0)x_(|
|       -x_(0,1,1)x_(2,0,1)+x_(0,0,1)x_(2,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(1,1,0)x_(2,0,0)+x_(1,0,0)x_(2,1,0)                                |
|2,1,1) -x_(1,1,1)x_(2,0,0)-x_(1,1,0)x_(2,0,1)+x_(1,0,1)x_(2,1,0)+x_(1,0,0)x_(|
|       -x_(1,1,1)x_(2,0,1)+x_(1,0,1)x_(2,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(0,1,0)x_(3,0,0)+x_(0,0,0)x_(3,1,0)                                |
|2,1,1) -x_(0,1,1)x_(3,0,0)-x_(0,1,0)x_(3,0,1)+x_(0,0,1)x_(3,1,0)+x_(0,0,0)x_(|
|       -x_(0,1,1)x_(3,0,1)+x_(0,0,1)x_(3,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(1,1,0)x_(3,0,0)+x_(1,0,0)x_(3,1,0)                                |
|3,1,1) -x_(1,1,1)x_(3,0,0)-x_(1,1,0)x_(3,0,1)+x_(1,0,1)x_(3,1,0)+x_(1,0,0)x_(|
|       -x_(1,1,1)x_(3,0,1)+x_(1,0,1)x_(3,1,1)                                |
|-----------------------------------------------------------------------------|
|       -x_(2,1,0)x_(3,0,0)+x_(2,0,0)x_(3,1,0)                                |
|3,1,1) -x_(2,1,1)x_(3,0,0)-x_(2,1,0)x_(3,0,1)+x_(2,0,1)x_(3,1,0)+x_(2,0,0)x_(|
|       -x_(2,1,1)x_(3,0,1)+x_(2,0,1)x_(3,1,1)                                |
|-----------------------------------------------------------------------------|
|       |                                                                     |
|3,1,1) |                                                                     |
|       |                                                                     |
+-----------------------------------------------------------------------------+
|i5 : betti matrix g                                                          |
|                                                                             |
|            0 1                                                              |
|o5 = total: 3 6                                                              |
|        -1: . 6                                                              |
|         0: 3 .                                                              |
|                                                                             |
|o5 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i6 : betti matrix g1                                                         |
|                                                                             |
|            0 1                                                              |
|o6 = total: 3 6                                                              |
|        -1: . 6                                                              |
|         0: 3 .                                                              |
|                                                                             |
|o6 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i7 : betti res coker g                                                       |
|                                                                             |
|            0 1 2                                                            |
|o7 = total: 3 6 3                                                            |
|         0: 3 . .                                                            |
|         1: . 6 .                                                            |
|         2: . . 3                                                            |
|                                                                             |
|o7 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

We can recover the Eagon-Northcott complex as follows.

+----------------------------------------------------------+
|i8 : f = flattenedGenericTensor({6,2}, ZZ/32003)          |
|                                                          |
|o8 = | x_(0,0) x_(1,0) x_(2,0) x_(3,0) x_(4,0) x_(5,0) |  |
|     | x_(0,1) x_(1,1) x_(2,1) x_(3,1) x_(4,1) x_(5,1) |  |
|                                                          |
|               ZZ              2         ZZ              6|
|o8 : Matrix (-----[x   ..x   ])  <--- (-----[x   ..x   ]) |
|             32003  0,0   5,1          32003  0,0   5,1   |
+----------------------------------------------------------+
|i9 : S = ring f;                                          |
+----------------------------------------------------------+
|i10 : g = tensorComplex1(f,{0,0});                        |
|                                                          |
|              1       15                                  |
|o10 : Matrix S  <--- S                                    |
+----------------------------------------------------------+
|i11 : transpose g                                         |
|                                                          |
|o11 = | -x_(0,1)x_(1,0)+x_(0,0)x_(1,1) |                  |
|      | -x_(0,1)x_(2,0)+x_(0,0)x_(2,1) |                  |
|      | -x_(1,1)x_(2,0)+x_(1,0)x_(2,1) |                  |
|      | -x_(0,1)x_(3,0)+x_(0,0)x_(3,1) |                  |
|      | -x_(1,1)x_(3,0)+x_(1,0)x_(3,1) |                  |
|      | -x_(2,1)x_(3,0)+x_(2,0)x_(3,1) |                  |
|      | -x_(0,1)x_(4,0)+x_(0,0)x_(4,1) |                  |
|      | -x_(1,1)x_(4,0)+x_(1,0)x_(4,1) |                  |
|      | -x_(2,1)x_(4,0)+x_(2,0)x_(4,1) |                  |
|      | -x_(3,1)x_(4,0)+x_(3,0)x_(4,1) |                  |
|      | -x_(0,1)x_(5,0)+x_(0,0)x_(5,1) |                  |
|      | -x_(1,1)x_(5,0)+x_(1,0)x_(5,1) |                  |
|      | -x_(2,1)x_(5,0)+x_(2,0)x_(5,1) |                  |
|      | -x_(3,1)x_(5,0)+x_(3,0)x_(5,1) |                  |
|      | -x_(4,1)x_(5,0)+x_(4,0)x_(5,1) |                  |
|                                                          |
|              15       1                                  |
|o11 : Matrix S   <--- S                                   |
+----------------------------------------------------------+
|i12 : betti res coker g                                   |
|                                                          |
|             0  1  2  3  4 5                              |
|o12 = total: 1 15 40 45 24 5                              |
|          0: 1  .  .  .  . .                              |
|          1: . 15 40 45 24 5                              |
|                                                          |
|o12 : BettiTally                                          |
+----------------------------------------------------------+
|i13 : betti eagonNorthcott matrix entries matrix f        |
|                                                          |
|             0  1  2  3  4 5                              |
|o13 = total: 1 15 40 45 24 5                              |
|          0: 1  .  .  .  . .                              |
|          1: . 15 40 45 24 5                              |
|                                                          |
|o13 : BettiTally                                          |
+----------------------------------------------------------+

The following example is taken from the introduction to BEKS.

+-----------------------------------------------------------------------------+
|i14 : f = flattenedGenericTensor({7,1,2,1,2,1},ZZ/32003);                    |
|                                                                             |
|                ZZ                                                           |
|o14 : Matrix (-----[x           , x           , x           , x           ,  |
|              32003  0,0,0,0,0,0   0,0,0,0,1,0   0,0,1,0,0,0   0,0,1,0,1,0   |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 1,0,0,0,0,0   1,0,0,0,1,0   1,0,1,0,0,0   1,0,1,0,1,0   2,0,0,0,0,0         |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 2,0,0,0,1,0   2,0,1,0,0,0   2,0,1,0,1,0   3,0,0,0,0,0   3,0,0,0,1,0         |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 3,0,1,0,0,0   3,0,1,0,1,0   4,0,0,0,0,0   4,0,0,0,1,0   4,0,1,0,0,0         |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 4,0,1,0,1,0   5,0,0,0,0,0   5,0,0,0,1,0   5,0,1,0,0,0   5,0,1,0,1,0         |
|-----------------------------------------------------------------------------|
|                                                        4                    |
|x           , x           , x           , x           ])  <---               |
| 6,0,0,0,0,0   6,0,0,0,1,0   6,0,1,0,0,0   6,0,1,0,1,0                       |
|-----------------------------------------------------------------------------|
|   ZZ                                                                        |
|(-----[x           , x           , x           , x           , x           , |
| 32003  0,0,0,0,0,0   0,0,0,0,1,0   0,0,1,0,0,0   0,0,1,0,1,0   1,0,0,0,0,0  |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 1,0,0,0,1,0   1,0,1,0,0,0   1,0,1,0,1,0   2,0,0,0,0,0   2,0,0,0,1,0         |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 2,0,1,0,0,0   2,0,1,0,1,0   3,0,0,0,0,0   3,0,0,0,1,0   3,0,1,0,0,0         |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 3,0,1,0,1,0   4,0,0,0,0,0   4,0,0,0,1,0   4,0,1,0,0,0   4,0,1,0,1,0         |
|-----------------------------------------------------------------------------|
|                                                                             |
|x           , x           , x           , x           , x           ,        |
| 5,0,0,0,0,0   5,0,0,0,1,0   5,0,1,0,0,0   5,0,1,0,1,0   6,0,0,0,0,0         |
|-----------------------------------------------------------------------------|
|                                          7                                  |
|x           , x           , x           ])                                   |
| 6,0,0,0,1,0   6,0,1,0,0,0   6,0,1,0,1,0                                     |
+-----------------------------------------------------------------------------+
|i15 : S = ring f;                                                            |
+-----------------------------------------------------------------------------+
|i16 : g = tensorComplex1 f;                                                  |
|                                                                             |
|              10       28                                                    |
|o16 : Matrix S   <--- S                                                      |
+-----------------------------------------------------------------------------+
|i17 : betti res coker g                                                      |
|                                                                             |
|              0  1  2  3  4  5                                               |
|o17 = total: 10 28 70 70 28 10                                               |
|          0: 10 28  .  .  .  .                                               |
|          1:  .  . 70 70  .  .                                               |
|          2:  .  .  .  . 28 10                                               |
|                                                                             |
|o17 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

The input map need not be generic.

+-----------------------------------------------------------------------------+
|i18 : S = QQ[x,y,z];                                                         |
+-----------------------------------------------------------------------------+
|i19 : F = labeledModule S^5                                                  |
|                                                                             |
|       5                                                                     |
|o19 = S                                                                      |
|                                                                             |
|o19 : free S-module with labeled basis                                       |
+-----------------------------------------------------------------------------+
|i20 : G = tensorProduct(labeledModule S^2, labeledModule S^2)                |
|                                                                             |
|       4                                                                     |
|o20 = S                                                                      |
|                                                                             |
|o20 : free S-module with labeled basis                                       |
+-----------------------------------------------------------------------------+
|i21 : f = map(G,F, (i,j) -> random(1,S))                                     |
|                                                                             |
|o21 = | 9/2x+9/4y+3/4z  7/4x+7/9y+7/10z 7/10x+7/3y+7z  3/7x+6/7y+6z          |
|      | 3/7x+5y+10/9z   10x+3/2y+7/8z   5/6x+5y+2/5z   5/3x+7/2y+2/5z        |
|      | 5/3x+1/10y+4/3z 3/7x+9/10y+4/7z 5/9x+5/9y+6/7z 6x+5/4y+2/9z          |
|      | 9/8x+1/8y+10/3z 4x+1/3y+9/10z   5/4x+1/7y+7/5z 1/5x+5/7y+3/8z        |
|                                                                             |
|              4       5                                                      |
|o21 : Matrix S  <--- S                                                       |
|-----------------------------------------------------------------------------|
|5/4x+2/9y+3/10z |                                                            |
|6/5x+5/7y+5/9z  |                                                            |
|8/5x+9/4y+2/9z  |                                                            |
|5/2x+1/6y+8/5z  |                                                            |
+-----------------------------------------------------------------------------+
|i22 : g = tensorComplex1(f, {0,0,2});                                        |
|                                                                             |
|              3       10                                                     |
|o22 : Matrix S  <--- S                                                       |
+-----------------------------------------------------------------------------+
|i23 : betti res coker g                                                      |
|                                                                             |
|             0  1  2 3                                                       |
|o23 = total: 3 10 15 8                                                       |
|          0: 3  .  . .                                                       |
|          1: . 10  . .                                                       |
|          2: .  . 15 8                                                       |
|                                                                             |
|o23 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

Caveat
======

Unlike BEKS, this method does not work with arbitrary weight vectors w.

See also
========

  * flattenedGenericTensor -- Make a generic
    tensor of given format
  * flattenedESTensor -- make a flattened tensor from
    elementary symmetric functions
  * hyperdeterminant -- computes the hyperdeterminant
    of a boundary format tensor
  * hyperdeterminantMatrix -- computes a matrix
    whose determinant equals the hyperdeterminant of a boundary format tensor

Ways to use tensorComplex1:
===========================

  * "tensorComplex1(LabeledModuleMap)"
  * "tensorComplex1(LabeledModuleMap,List)"

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

The object tensorComplex1, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:795:0.

tensorProduct -- tensor product of Modules and LabeledModules, Matrices, Maps and LabeledModuleMaps
***************************************************************************************************

  * Usage:
        tensorProduct L
        (tensorProduct List)
        (tensorProduct Sequence)
  * Inputs:
      * L, a list (Macaulay2Doc), or Sequence (Macaulay2Doc),
        of objects of type Matrix (Macaulay2Doc),
        see Module (Macaulay2Doc),
        LabeledModule, or LabeledModuleMap,
  * Outputs:
      * a matrix (Macaulay2Doc), or, in general, an object of the
        same type as the inputs.

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

Forms the tensor product of the objects in the input list or sequence. In the
case where the inputs are of type LabeledModule, the
output is a labeled module whose basis list is the set of tuples of elements of
the basis lists of the input modules

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/101[x,y]                                                         |
|                                                                             |
|o1 = S                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : M = labeledModule(S^4)                                                  |
|                                                                             |
|      4                                                                      |
|o2 = S                                                                       |
|                                                                             |
|o2 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i3 : basisList M                                                             |
|                                                                             |
|o3 = {0, 1, 2, 3}                                                            |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : E = exteriorPower(2,M)                                                  |
|                                                                             |
|      6                                                                      |
|o4 = S                                                                       |
|                                                                             |
|o4 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i5 : basisList E                                                             |
|                                                                             |
|o5 = {{0, 1}, {0, 2}, {1, 2}, {0, 3}, {1, 3}, {2, 3}}                        |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : underlyingModules E                                                     |
|                                                                             |
|       4                                                                     |
|o6 = {S }                                                                    |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : N = tensorProduct(E,labeledModule(S^2))                                 |
|                                                                             |
|      12                                                                     |
|o7 = S                                                                       |
|                                                                             |
|o7 : free S-module with labeled basis                                        |
+-----------------------------------------------------------------------------+
|i8 : basisList N                                                             |
|                                                                             |
|o8 = {{{0, 1}, 0}, {{0, 1}, 1}, {{0, 2}, 0}, {{0, 2}, 1}, {{1, 2}, 0}, {{1,  |
|     ------------------------------------------------------------------------|
|     2}, 1}, {{0, 3}, 0}, {{0, 3}, 1}, {{1, 3}, 0}, {{1, 3}, 1}, {{2, 3}, 0},|
|     ------------------------------------------------------------------------|
|     {{2, 3}, 1}}                                                            |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : underlyingModules N                                                     |
|                                                                             |
|       6   2                                                                 |
|o9 = {S , S }                                                                |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * basisList -- gives the list used to label the basis
    elements of a labeled module
  * underlyingModules -- gives the list of underlying
    modules of a labeled module
  * LabeledModule -- the class of free modules with a
    labeled basis
  * LabeledModuleMap -- the class of maps between
    LabeledModules
  * ** (Macaulay2Doc) -- a binary operator, usually used for
    tensor product or Cartesian product

Ways to use tensorProduct:
==========================

  * tensorProduct(List) (missing documentation)
  * tensorProduct(Sequence) (missing documentation)

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

The object tensorProduct, is a method function with a single argument (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:908:0.

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

  * Usage:
        toOrdinal(i,F)
  * Inputs:
      * l, a thing (Macaulay2Doc),
      * F, a free module with labeled basis,
  * Outputs:
      * an integer (Macaulay2Doc),

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

This function allows one to move from the labels of the basis elements of a
labeled free module of rank $r$ to 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
========

  * basisList -- gives the list used to label the basis
    elements of a labeled module
  * fromOrdinal -- outputs the label of a basis element of
    a labeled module

Ways to use toOrdinal:
======================

  * "toOrdinal(Thing,LabeledModule)"

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

The object toOrdinal, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1687:0.

traceMap -- produces the trace map from a ring to a free module tensored with its dual
**************************************************************************************

  * Usage:
        traceMap F
  * Inputs:
      * F, a free module with labeled basis,
  * Outputs:
      * a map of labeled modules,

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

If $F$ is a free labeled module, then this produces the trace map $S\to
F\otimes F^*$.

+-------------------------------------+
|i1 : S=ZZ/101[x,y,z];                |
+-------------------------------------+
|i2 : F=labeledModule(S^3);           |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : traceMap F                      |
|                                     |
|o3 = | 1 |                           |
|     | 0 |                           |
|     | 0 |                           |
|     | 0 |                           |
|     | 1 |                           |
|     | 0 |                           |
|     | 0 |                           |
|     | 0 |                           |
|     | 1 |                           |
|                                     |
|             9       1               |
|o3 : Matrix S  <--- S                |
+-------------------------------------+

Ways to use traceMap:
=====================

  * "traceMap(LabeledModule)"

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

The object traceMap, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1741:0.

underlyingModules -- gives the list of underlying modules of a labeled module
*****************************************************************************

  * Usage:
        underlyingModules(F)
  * Inputs:
      * F, a free module with labeled basis,
  * Outputs:
      * a list (Macaulay2Doc),

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

One of the key features of a labeled module is that it comes equipped with a
list of modules used in its construction.  For instance, if $F$ is the tensor
product of $A$ and $B$, then the underlying modules of $F$ would be the set $\{
A,B\}$.  Similarly, if $G=\wedge^2 A$, then $A$ is the only underlying module
of $G$.

+-------------------------------------+
|i1 : S=ZZ/101[x,y,z];                |
+-------------------------------------+
|i2 : A=labeledModule(S^2);           |
|                                     |
|o2 : free S-module with labeled basis|
+-------------------------------------+
|i3 : B=labeledModule(S^5);           |
|                                     |
|o3 : free S-module with labeled basis|
+-------------------------------------+
|i4 : F=A**B                          |
|                                     |
|      10                             |
|o4 = S                               |
|                                     |
|o4 : free S-module with labeled basis|
+-------------------------------------+
|i5 : underlyingModules(F)            |
|                                     |
|       2   5                         |
|o5 = {S , S }                        |
|                                     |
|o5 : List                            |
+-------------------------------------+
|i6 : G=exteriorPower(2,A)            |
|                                     |
|      1                              |
|o6 = S                               |
|                                     |
|o6 : free S-module with labeled basis|
+-------------------------------------+
|i7 : underlyingModules(G)            |
|                                     |
|       2                             |
|o7 = {S }                            |
|                                     |
|o7 : List                            |
+-------------------------------------+

Ways to use underlyingModules:
==============================

  * "underlyingModules(LabeledModule)"

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

The object underlyingModules, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in TensorComplexes.m2:1576:0.