This is HighestWeights.info, produced by Macaulay2, version 1.22

HighestWeights -- decompose free resolutions and graded modules with a semisimple Lie group action
**************************************************************************************************

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

This package provides tools to study the representation theoretic structure of
equivariant free resolutions and graded modules with the action of a semisimple
Lie group. The methods of this package allow one to consider the free modules
in an equivariant resolution, or the graded components of a module, as
representations of a semisimple Lie group by means of their weights and to
obtain their decomposition into highest weight representations.

This package implements an algorithm introduced in Galetto - Propagating
weights of tori along free resolutions (see
http://dx.doi.org/10.1016/j.jsc.2015.05.004 ). The methods of this package are
meant to be used in characteristic zero.

The following links contain some sample computations carried out using this
package. The first and second example are discussed in more detail, so we
recommend reading through them first.

  * Example 1 -- The coordinate ring of the Grassmannian
  * Example 2 -- The Buchsbaum-Rim complex
  * Example 3 -- A multigraded Eagon-Northcott complex
  * Example 4 -- The Eisenbud-Fløystad-Weyman complex
  * Example 5 -- The singular locus of a symplectic invariant
  * Example 6 -- The coordinate ring of the spinor variety
  * Example 7 -- With the exceptional group G2

Author
======

  * Federico Galetto (see http://math.galetto.org )
    <galetto.federico@gmail.com>

Certification a gold star
=========================

Version 0.6.5 of this package was accepted for publication in volume 7 (see
http://msp.org/jsag/2015/7-1/ ) of The Journal of Software for Algebra and
Geometry (see http://j-sag.org/ ) on 5 June 2015, in the article Free
resolutions and modules with a semisimple Lie group action (see
http://msp.org/jsag/2015/7-1/p03.xhtml ). That version can be obtained from the
journal (see http://msp.org/jsag/2015/7-1/jsag-v7-n1-x03-HW.zip ) or from the
Macaulay2 source code repository (see
http://github.com/Macaulay2/M2/blob/a434adb94f76f9be38131f87745867b0d7925405/M2
/Macaulay2/packages/HighestWeights.m2 ).

Version
=======

This documentation describes version 0.6.5 of HighestWeights.

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

The source code from which this documentation is derived is in the file
HighestWeights.m2 (see common/share/Macaulay2/HighestWeights.m2 ). The
auxiliary files accompanying it are in the directory HighestWeights/ (see
common/share/Macaulay2/HighestWeights/ ).

Exports
=======

  * Functions and commands
      * decomposeWeightsList -- decompose a list
        of weights into highest weights
      * getWeights -- retrieve the (Lie theoretic) weight of
        a monomial
      * highestWeightsDecomposition, --
        irreducible decomposition of a complex, ring, ideal or module
      * propagateWeights -- propagate (Lie theoretic)
        weights along equivariant maps
      * setWeights -- attach (Lie theoretic) weights to the
        variables of a ring
  * Methods
      * getWeights(RingElement) -- retrieve
        the (Lie theoretic) weight of a monomial
      * "highestWeightsDecomposition(ChainComplex)" -- see
        highestWeightsDecomposition(ChainComplex,ZZ,List),
        -- decompose
        an equivariant complex of graded free modules
      * highestWeightsDecomposition(ChainComplex,ZZ,List)
        -- decompose
        an equivariant complex of graded free modules
      * highestWeightsDecomposition(Ideal,List)
        -- decompose an ideal
        with a semisimple Lie group action
      * "highestWeightsDecomposition(Ideal,ZZ)" -- see
        highestWeightsDecomposition(Ideal,List),
        -- decompose an ideal
        with a semisimple Lie group action
      * "highestWeightsDecomposition(Ideal,ZZ,ZZ)" -- see
        highestWeightsDecomposition(Ideal,List),
        -- decompose an ideal
        with a semisimple Lie group action
      * highestWeightsDecomposition(Module,List,List)
        -- decompose a
        module with a semisimple Lie group action
      * "highestWeightsDecomposition(Module,ZZ,List)" -- see
        highestWeightsDecomposition(Module,List,List),
        -- decompose a
        module with a semisimple Lie group action
      * "highestWeightsDecomposition(Module,ZZ,ZZ,List)" -- see
        highestWeightsDecomposition(Module,List,List),
        -- decompose a
        module with a semisimple Lie group action
      * highestWeightsDecomposition(Ring,List)
        -- decompose a ring with
        a semisimple Lie group action
      * "highestWeightsDecomposition(Ring,ZZ)" -- see
        highestWeightsDecomposition(Ring,List),
        -- decompose a ring with
        a semisimple Lie group action
      * "highestWeightsDecomposition(Ring,ZZ,ZZ)" -- see
        highestWeightsDecomposition(Ring,List),
        -- decompose a ring with
        a semisimple Lie group action
      * propagateWeights(Matrix,List)
        -- propagate (Lie theoretic)
        weights along an equivariant map of graded free modules
      * setWeights(PolynomialRing,DynkinType,List)
        -- attach (Lie
        theoretic) weights to the variables of a ring
  * Symbols
      * Forward -- propagate weights from domain to codomain
      * GroupActing -- stores the Dynkin type of the group
        acting on a ring
      * LeadingTermTest -- check the columns of the
        input matrix for repeated leading terms
      * LieWeights -- stores the (Lie theoretic) weights of
        the variables of a ring
      * MinimalityTest -- check that the input map is
        minimal
      * Range -- decompose only part of a complex

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

The object HighestWeights, is a package (Macaulay2Doc).

decomposeWeightsList -- decompose a list of weights into highest weights
************************************************************************

Synopsis
========

  * Usage:
        decomposeWeightsList(D,L)
  * Inputs:
      * D, an instance of the type DynkinType (WeylGroups),
      * L, a list (Macaulay2Doc),
  * Outputs:
      * T, a tally (Macaulay2Doc),

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

This function takes in the Dynkin type of a root system along with the complete
list of weights of a representation and returns the decomposition into highest
weight representations. It implements a modified version of Freudenthal's
multiplicity formula based on the algorithm discussed in chapter 8.9 of W. A.
de Graaf, Lie algebras: theory and algorithms, North-Holland Publishing, and
the article R. V. Moody and J. Patera - Fast recursion formula for weight
multiplicities (see http://dx.doi.org/10.1090/S0273-0979-1982-15021-2 ).

The only application of this function is to decompose the list of weights
obtained with propagateWeights.

+--------------------------------------------+
|i1 : D=dynkinType{{"A",3}};                 |
+--------------------------------------------+
|i2 : L={{1,0,0},{-1,1,0},{0,-1,1},{0,0,-1}};|
+--------------------------------------------+
|i3 : decomposeWeightsList(D,L)              |
|                                            |
|o3 = Tally{{1, 0, 0} => 1}                  |
|                                            |
|o3 : Tally                                  |
+--------------------------------------------+

Caveat
======

To speed up the decomposition of the list of weights in the input, this
function discards all non dominant weights, then decomposes the dominant
character obtained from the remaining dominant weights. If the dominant weights
in the list do not form the dominant character of a representation an error is
returned. This is typically caused by assigning the wrong weights to the
variables of the ring or to the presentation of a module. However, if the non
dominant weights in L do not belong to the character of a representation, this
will go undetected by this function.

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

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

The object decomposeWeightsList, is a
function closure (Macaulay2Doc).

Example 1 -- The coordinate ring of the Grassmannian
****************************************************

Let $E={\mathbb C}^6$, the standard representation of $SL_6 ({\mathbb C})$,
with coordinate basis $\{e_0,\ldots,e_5\}$. The Grassmannian $V = Gr (2,E^*)$
is the projective variety which parametrizes two dimensional subspaces of
$E^*$; it is embedded in $\PP (\wedge^2 E^*)$ using the Pl\"ucker equations
(see Shafarevich - Basic Algebraic Geometry 1, Ch. I, Sec. 4.1). Consider
$\wedge^2 E^*$ as a complex affine space. Let $C$ be the affine cone over $V$,
i.e., the subvariety of $\wedge^2 E^*$ which is the union of all the one
dimensional subspaces of $\wedge^2 E^*$ belonging to $V$. The space $\wedge^2
E^*$ has a natural action of $SL_6 ({\mathbb C})$ which fixes $C$.

Our polynomial ring $R$ is the ring of polynomial functions over $\wedge^2
E^*$, i.e., the symmetric algebra $Sym(\wedge^2 E)$. The elements $p_{i,j} =
e_i \wedge e_j$, for $0\leq i < j \leq 5$, form a basis of weight vectors of
$\wedge^2 E$ and will be the variables in $R$. The defining ideal of $C$ is
generated by the Pl\"ucker equations; this ideal, which we call $I$, can be
conveniently obtained in M2 using the command Grassmannian (Macaulay2Doc).
We resolve the quotient $R/I$ as an
$R$-module and call RI the minimal free resolution.

+-----------------------------------------------------------------------------+
|i1 : I=Grassmannian(1,5,CoefficientRing=>QQ); R=ring I;                      |
|                                                                             |
|o1 : Ideal of QQ[p   ..p   , p   , p   , p   , p   , p   , p   , p   , p   , |
|                  0,1   0,2   1,2   0,3   1,3   2,3   0,4   1,4   2,4   3,4  |
|-----------------------------------------------------------------------------|
|p   , p   , p   , p   , p   ]                                                |
| 0,5   1,5   2,5   3,5   4,5                                                 |
+-----------------------------------------------------------------------------+
|i3 : RI=res I; betti RI                                                      |
|                                                                             |
|            0  1  2  3  4  5 6                                               |
|o4 = total: 1 15 35 42 35 15 1                                               |
|         0: 1  .  .  .  .  . .                                               |
|         1: . 15 35 21  .  . .                                               |
|         2: .  .  . 21 35 15 .                                               |
|         3: .  .  .  .  .  . 1                                               |
|                                                                             |
|o4 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

Now we assign weights to the variables of $R$. First we input the weights of
$e_0,\ldots,e_5$ in a list L.

+-----------------------------------------------------------------------------+
|i5 : L={{1,0,0,0,0},{-1,1,0,0,0},{0,-1,1,0,0},{0,0,-1,1,0},{0,0,0,-1,1},{0,0,|
|                                                                             |
|o5 = {{1, 0, 0, 0, 0}, {-1, 1, 0, 0, 0}, {0, -1, 1, 0, 0}, {0, 0, -1, 1, 0}, |
|     ------------------------------------------------------------------------|
|     {0, 0, 0, -1, 1}, {0, 0, 0, 0, -1}}                                     |
|                                                                             |
|o5 : List                                                                    |
|-----------------------------------------------------------------------------|
|0,0,-1}}                                                                     |
+-----------------------------------------------------------------------------+

The weight of $p_{i,j} = e_i \wedge e_j$ is the sum of the weights of $e_i$ and
$e_j$. The subscripts of the variables $p_{i,j}$ are the elements of
subsets({0,1,2,3,4,5},2), the 2-subsets of the set $\{0,1,2,3,4,5\}$. Hence
taking sums of pairs of weights in L over this indexing set will give us a
complete list of weights for the variables $p_{i,j}$, as listed by M2.

+-----------------------------------------------------------------------------+
|i6 : W=apply(subsets({0,1,2,3,4,5},2),s->L_(s_0)+L_(s_1))                    |
|                                                                             |
|o6 = {{0, 1, 0, 0, 0}, {1, -1, 1, 0, 0}, {-1, 0, 1, 0, 0}, {1, 0, -1, 1, 0}, |
|     ------------------------------------------------------------------------|
|     {-1, 1, -1, 1, 0}, {0, -1, 0, 1, 0}, {1, 0, 0, -1, 1}, {-1, 1, 0, -1,   |
|     ------------------------------------------------------------------------|
|     1}, {0, -1, 1, -1, 1}, {0, 0, -1, 0, 1}, {1, 0, 0, 0, -1}, {-1, 1, 0, 0,|
|     ------------------------------------------------------------------------|
|     -1}, {0, -1, 1, 0, -1}, {0, 0, -1, 1, -1}, {0, 0, 0, -1, 0}}            |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+

We declare D to be the Dynkin type $A_5$, which is the type of the group $SL_6
({\mathbb C})$. Then we attach the weights in W to the variables in $R$ using
the command setWeights,; the arguments are in order the ring,
the type and the weights of the variables.

The output will be the highest weight decomposition of the ${\mathbb C}$-linear
subspace of $R$ generated by its variables; it is given in the form of a Tally,
with keys describing the highest weights of the irreducible representation
appearing in the decomposition and values equal to the multiplicities of those
representations.

In this case, we get simply {0, 1, 0, 0, 0} => 1 which means that the
decomposition contains only one copy of the irreducible representation with
highest weight {0, 1, 0, 0, 0}, i.e., $\wedge^2 E$ as expected.

+---------------------------------------------+
|i7 : D=dynkinType{{"A",5}}; setWeights(R,D,W)|
|                                             |
|o8 = Tally{{0, 1, 0, 0, 0} => 1}             |
|                                             |
|o8 : Tally                                   |
+---------------------------------------------+

All monomials in $R$ are weight vectors. To recover the weight of a monomial,
use the command getWeights, with the monomial as the
argument.

+--------------------------------+
|i9 : getWeights(p_(0,1)*p_(1,2))|
|                                |
|o9 = {-1, 1, 1, 0, 0}           |
|                                |
|o9 : List                       |
+--------------------------------+

We can now issue the command highestWeightsDecomposition,
to obtain the decomposition of the representations
corresponding to the free modules in the resolution; the only argument is the
resolution RI. Suppose the free modules in RI are $F_0, \ldots, F_6$. The
outermost HashTable in the output has keys equal to the subscripts of the free
modules in RI. The value corresponding to a key $i$ is itself a  HashTable with
keys equal to the degrees of the generators of $F_i$. Finally the value
corresponding to a certain degree $d$ is a Tally containing the highest weight
decomposition of the representation $(F_i/m F_i)_d$ where $m$ is the maximal
ideal generated by the variables in $R$.

+-------------------------------------------------------------------+
|i10 : highestWeightsDecomposition(RI)                              |
|                                                                   |
|o10 = HashTable{0 => HashTable{{0} => Tally{{0, 0, 0, 0, 0} => 1}}}|
|                1 => HashTable{{2} => Tally{{0, 0, 0, 1, 0} => 1}} |
|                2 => HashTable{{3} => Tally{{1, 0, 0, 0, 1} => 1}} |
|                3 => HashTable{{4} => Tally{{2, 0, 0, 0, 0} => 1}} |
|                               {5} => Tally{{0, 0, 0, 0, 2} => 1}  |
|                4 => HashTable{{6} => Tally{{1, 0, 0, 0, 1} => 1}} |
|                5 => HashTable{{7} => Tally{{0, 1, 0, 0, 0} => 1}} |
|                6 => HashTable{{9} => Tally{{0, 0, 0, 0, 0} => 1}} |
|                                                                   |
|o10 : HashTable                                                    |
+-------------------------------------------------------------------+

By analyzing the above output, we obtain the following description for RI: $$R
\leftarrow \wedge^4 E \otimes R(-2) \leftarrow S_{2,1,1,1,1} E \otimes R(-3)
\leftarrow S_{2} E \otimes R(-4) \oplus S_{2,2,2,2,2} E \otimes R(-5)
\leftarrow S_{2,1,1,1,1} E \otimes R(-6) \leftarrow \wedge^2 E \otimes R(-7)
\leftarrow R(-9) \leftarrow 0$$ Here $S_\lambda$ denotes the Schur functor
associated to the partition $\lambda$ (for the construction of  Schur functors
see Fulton, Harris - Representation Theory, Ch. 6 or Fulton - Young Tableaux,
Ch. 8). Recall that the Schur module $S_{\lambda} {\mathbb C}^{n+1}$ is the
irreducible representation of $SL_{n+1} {\mathbb C}$ with highest weight
$(\lambda_1 -\lambda_2,\ldots,\lambda_{n-1} -\lambda_n,\lambda_n)$ written in
the basis of fundamental weights (as all lists of weights used by this
package).

Next we turn to the coordinate ring of $C$, i.e., the quotient ring $Q=R/I$. We
decompose its graded components in the range of degrees from 0 to 4, again with
the command highestWeightsDecomposition.
This time the arguments are the ring followed by the lowest and highest degrees
in the range to be decomposed.

+-------------------------------------------------+
|i11 : Q=R/I; highestWeightsDecomposition(Q,0,4)  |
|                                                 |
|o12 = HashTable{0 => Tally{{0, 0, 0, 0, 0} => 1}}|
|                1 => Tally{{0, 1, 0, 0, 0} => 1} |
|                2 => Tally{{0, 2, 0, 0, 0} => 1} |
|                3 => Tally{{0, 3, 0, 0, 0} => 1} |
|                4 => Tally{{0, 4, 0, 0, 0} => 1} |
|                                                 |
|o12 : HashTable                                  |
+-------------------------------------------------+

We deduce that, for $d\in\{0,\ldots,4\}$, $(R/I)_d = S_{d,d} E$. We can also
decompose the graded components of the ring $R$ in a range of degrees or in a
single degree.

+--------------------------------------+
|i13 : highestWeightsDecomposition(R,2)|
|                                      |
|o13 = Tally{{0, 0, 0, 1, 0} => 1}     |
|            {0, 2, 0, 0, 0} => 1      |
|                                      |
|o13 : Tally                           |
+--------------------------------------+

For example, $R_2 = \wedge^4 E \oplus S_{2,2} E$. Since the representation
$\wedge^4 E$ appears in $R_2$ but not in $(R/I)_2$, we deduce that it must be
in $I_2$, the graded component of $I$ of degree 2. This can be verified
directly by decomposing $I_2$ as follows.

+--------------------------------------+
|i14 : highestWeightsDecomposition(I,2)|
|                                      |
|o14 = Tally{{0, 0, 0, 1, 0} => 1}     |
|                                      |
|o14 : Tally                           |
+--------------------------------------+

Example 2 -- The Buchsbaum-Rim complex
**************************************

Let $E={\mathbb C}^6$ with coordinate basis $\{e_1,\ldots,e_6\}$ and
$F={\mathbb C}^3$ with coordinate basis $\{f_1,f_2,f_3\}$. Denote $R$ the
symmetric algebra $Sym(E\otimes F)$; $R$ is a polynomial ring with variables
$x_{i,j} = e_i\otimes f_j$. We take $M$ to be the cokernel of a generic
$3\times 6$ matrix of variables in $R$. The minimal free resolution of $M$ is
an example of a Buchsbaum-Rim complex (see Eisenbud - Commutative Algebra,
Appendix A2.6). We call this complex BR.

+--------------------------------------------------------+
|i1 : R=QQ[x_(1,1)..x_(6,3)];                            |
+--------------------------------------------------------+
|i2 : G=genericMatrix(R,3,6)                             |
|                                                        |
|o2 = | x_(1,1) x_(2,1) x_(3,1) x_(4,1) x_(5,1) x_(6,1) ||
|     | x_(1,2) x_(2,2) x_(3,2) x_(4,2) x_(5,2) x_(6,2) ||
|     | x_(1,3) x_(2,3) x_(3,3) x_(4,3) x_(5,3) x_(6,3) ||
|                                                        |
|             3       6                                  |
|o2 : Matrix R  <--- R                                   |
+--------------------------------------------------------+
|i3 : M=coker G; BR=res M; betti BR                      |
|                                                        |
|            0 1  2  3 4                                 |
|o5 = total: 3 6 15 18 6                                 |
|         0: 3 6  .  . .                                 |
|         1: . .  .  . .                                 |
|         2: . . 15 18 6                                 |
|                                                        |
|o5 : BettiTally                                         |
+--------------------------------------------------------+

The ring $R$ carries a degree compatible action of $SL_6 ({\mathbb C}) \times
SL_3 ({\mathbb C})$. Define the map of graded free $R$-modules $$\phi : E
\otimes R(-1) \rightarrow F^* \otimes R, e_i \otimes 1 \mapsto \sum_{j=1}^3
f_j^* \otimes x_{i,j}$$ where $\{f_1^*,f_2^*,f_3^*\}$ is the dual basis in
$F^*$. The matrix of $\phi$ with respect to the bases $\{e_1\otimes
1,\ldots,e_6\otimes 1\}$ and $\{f_1^*\otimes 1,f_2^*\otimes 1,f_3^*\otimes 1\}$
is precisely the generic matrix $G$ introduced above. Moreover $\phi$ is $SL_6
({\mathbb C}) \times SL_3 ({\mathbb C})$-equivariant, meaning that $\forall
g\in SL_6 ({\mathbb C}) \times SL_3 ({\mathbb C})$, $\forall e\in E$ and
$\forall r\in R$, we have $\phi (g.(e\otimes r)) = g.\phi (e\otimes r)$. This
makes its cokernel $M$ a module with a compatible $SL_6 ({\mathbb C}) \times
SL_3 ({\mathbb C})$-action.

The weight of $x_{i,j} = e_i\otimes f_j$ is obtained by concatenating the
weight of $e_i$ with that of $f_j$. First we record the weights of
$e_1,\ldots,e_6$ in a list e and those of $f_1,f_2,f_3$ in a list f. Then we
concatenate them as illustrated below and attach the resulting list to the
variables $x_{i,j}$. Care must be taken that the order of the weights matches
the order of the variables.

+-----------------------------------------------------------------------------+
|i6 : e={{1,0,0,0,0},{-1,1,0,0,0},{0,-1,1,0,0},{0,0,-1,1,0},{0,0,0,-1,1},{0,0,|
|-----------------------------------------------------------------------------|
|0,0,-1}};                                                                    |
+-----------------------------------------------------------------------------+
|i7 : f={{1,0},{-1,1},{0,-1}};                                                |
+-----------------------------------------------------------------------------+
|i8 : W=flatten table(e,f,(u,v)->u|v)                                         |
|                                                                             |
|o8 = {{1, 0, 0, 0, 0, 1, 0}, {1, 0, 0, 0, 0, -1, 1}, {1, 0, 0, 0, 0, 0, -1}, |
|     ------------------------------------------------------------------------|
|     {-1, 1, 0, 0, 0, 1, 0}, {-1, 1, 0, 0, 0, -1, 1}, {-1, 1, 0, 0, 0, 0,    |
|     ------------------------------------------------------------------------|
|     -1}, {0, -1, 1, 0, 0, 1, 0}, {0, -1, 1, 0, 0, -1, 1}, {0, -1, 1, 0, 0,  |
|     ------------------------------------------------------------------------|
|     0, -1}, {0, 0, -1, 1, 0, 1, 0}, {0, 0, -1, 1, 0, -1, 1}, {0, 0, -1, 1,  |
|     ------------------------------------------------------------------------|
|     0, 0, -1}, {0, 0, 0, -1, 1, 1, 0}, {0, 0, 0, -1, 1, -1, 1}, {0, 0, 0,   |
|     ------------------------------------------------------------------------|
|     -1, 1, 0, -1}, {0, 0, 0, 0, -1, 1, 0}, {0, 0, 0, 0, -1, -1, 1}, {0, 0,  |
|     ------------------------------------------------------------------------|
|     0, 0, -1, 0, -1}}                                                       |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : D=dynkinType{{"A",5},{"A",2}}; setWeights(R,D,W)                        |
|                                                                             |
|o10 = Tally{{1, 0, 0, 0, 0, 1, 0} => 1}                                      |
|                                                                             |
|o10 : Tally                                                                  |
+-----------------------------------------------------------------------------+

In order to decompose the representations in a resolution, we need to ensure
that the coordinate basis for at least one of the free modules in the
resolution is a basis of weight vectors and then we need to input the weights
of the elements of that basis. For our resolution BR, we could choose the first
or the second free module. In fact, the first differential of BR is the map
$\phi : E \otimes R(-1) \rightarrow F^* \otimes R$ whose matrix was written
with respect to the bases of weight vectors $\{e_1\otimes 1,\ldots,e_6\otimes
1\}$ and $\{f_1^*\otimes 1,f_2^*\otimes 1,f_3^*\otimes 1\}$. We choose to work
with the first module, i.e., the codomain of $\phi$. Notice that the element
$1\in R$ appearing in the tensor product has weight zero, hence it does not
contribute to the weight of the basis elements. Also the $SL_6 ({\mathbb C})$
factor of our group acts trivially on $F^*$, hence to obtain the weight of
$f_1^*\otimes 1$ we concatenate {0,0,0,0,0}, the weight of the trivial
representation of $SL_6 ({\mathbb C})$, with {-1,0}, the weight of $f_1^*$. We
proceed similarly for the other basis vectors and record the weights in the
list U0.

+-------------------------------------------------------------+
|i11 : U0={{0,0,0,0,0,-1,0},{0,0,0,0,0,1,-1},{0,0,0,0,0,0,1}};|
+-------------------------------------------------------------+

Now we are ready to decompose BR. We issue the command
highestWeightsDecomposition, with three arguments:
the first is BR; the second is an integer $i$ informing M2 that we wish to
provide the weights in the $i$-th free module of the complex, and the third is
the list of weights in the coordinate basis of the $i$-th module (remember the
indexing of the modules starts from zero in M2).

+-------------------------------------------------------------------------+
|i12 : H0=highestWeightsDecomposition(BR,0,U0)                            |
|                                                                         |
|o12 = HashTable{0 => HashTable{{0} => Tally{{0, 0, 0, 0, 0, 0, 1} => 1}}}|
|                1 => HashTable{{1} => Tally{{1, 0, 0, 0, 0, 0, 0} => 1}} |
|                2 => HashTable{{4} => Tally{{0, 0, 0, 1, 0, 0, 0} => 1}} |
|                3 => HashTable{{5} => Tally{{0, 0, 0, 0, 1, 1, 0} => 1}} |
|                4 => HashTable{{6} => Tally{{0, 0, 0, 0, 0, 2, 0} => 1}} |
|                                                                         |
|o12 : HashTable                                                          |
+-------------------------------------------------------------------------+

We deduce that BR decomposes as: $$F^*\otimes R \leftarrow E\otimes R(-1)
\leftarrow \wedge^4 E \otimes R(-4) \leftarrow \wedge^5 E \otimes F \otimes
R(-5) \leftarrow \mathbb{S}_2 F \otimes R(-6) \leftarrow 0$$ Here $S_\lambda$
denotes the Schur functor associated to the partition $\lambda$ (for the
construction of  Schur functors see Fulton, Harris - Representation Theory, Ch.
6 or Fulton - Young Tableaux, Ch. 8). Recall that the Schur module $S_{\lambda}
{\mathbb C}^{n+1}$ is the irreducible representation of $SL_{n+1} {\mathbb C}$
with highest weight $(\lambda_1 -\lambda_2,\ldots,\lambda_{n-1}
-\lambda_n,\lambda_n)$ written in the basis of fundamental weights (as all
lists of weights used by this package).

If we choose to start from the second module, we need to provide the list of
weights of the elements $e_1\otimes 1,\ldots,e_6\otimes 1$. The commands look
as follows:

+-----------------------------------------------------------------------------+
|i13 : U1={{1,0,0,0,0,0,0},{-1,1,0,0,0,0,0},{0,-1,1,0,0,0,0},{0,0,-1,1,0,0,0  |
|-----------------------------------------------------------------------------|
|},{0,0,0,-1,1,0,0},{0,0,0,0,-1,0,0}};                                        |
+-----------------------------------------------------------------------------+
|i14 : H1=highestWeightsDecomposition(BR,1,U1); H0===H1                       |
|                                                                             |
|o15 = true                                                                   |
+-----------------------------------------------------------------------------+

Indeed the decomposition is the same.

As with rings and ideals, we can decompose the graded components of a module.
The difference is that we need to provide a list of weights for the generators
of the presentation used to define the module. For our module $M$, this is
exactly the list U0 introduced earlier. As usual, we may request to decompose a
single degree or a range.

+-------------------------------------------------------+
|i16 : highestWeightsDecomposition(M,-1,2,U0)           |
|                                                       |
|o16 = HashTable{-1 => Tally{}                         }|
|                0 => Tally{{0, 0, 0, 0, 0, 0, 1} => 1} |
|                1 => Tally{{1, 0, 0, 0, 0, 1, 1} => 1} |
|                2 => Tally{{0, 1, 0, 0, 0, 0, 2} => 1} |
|                           {2, 0, 0, 0, 0, 2, 1} => 1  |
|                                                       |
|o16 : HashTable                                        |
+-------------------------------------------------------+

Since $M$ is generated in degree zero, we see that the output contains an empty
decomposition in degree $-1$. Whereas we see, for example, that $M_2 = \wedge^2
E \otimes S_{2,2} F \oplus S_{2} E \otimes S_{3,1} F$.

Example 3 -- A multigraded Eagon-Northcott complex
**************************************************

Let $E={\mathbb C}^3$ with coordinate basis $\{e_1,e_2,e_3\}$, $F={\mathbb
C}^4$ with coordinate basis $\{f_1,\ldots,f_4\}$ and $H={\mathbb C}^2$ with
coordinate basis $\{h_1,h_2\}$. Denote $R$ the symmetric algebra $Sym((E\oplus
F)\otimes H)$; $R$ is a polynomial ring with variables $x_{i,j} = e_i\otimes
h_j$ and $y_{i,j} = f_i\otimes h_j$. We take the variables $x_{i,j}$ to have
degree $(1,0)$ and the variables $y_{i,j}$ to have degree $(0,1)$. Let $G$ be a
$2\times 7$ generic matrix of variables in $R$ and $I$ the ideal generated by
the $2\times 2$ minors of $G$. The minimal free resolution of $I$ is an example
of an Eagon-Northcott complex (see Eisenbud - Commutative Algebra, Appendix
A2.6).

+-----------------------------------------------------------------------+
|i1 : R=QQ[x_(1,1)..x_(3,2),y_(1,1)..y_(4,2),Degrees=>{6:{1,0},8:{0,1}}]|
|                                                                       |
|o1 = R                                                                 |
|                                                                       |
|o1 : PolynomialRing                                                    |
+-----------------------------------------------------------------------+
|i2 : G=genericMatrix(R,2,3)|genericMatrix(R,y_(1,1),2,4)               |
|                                                                       |
|o2 = | x_(1,1) x_(2,1) x_(3,1) y_(1,1) y_(2,1) y_(3,1) y_(4,1) |       |
|     | x_(1,2) x_(2,2) x_(3,2) y_(1,2) y_(2,2) y_(3,2) y_(4,2) |       |
|                                                                       |
|             2       7                                                 |
|o2 : Matrix R  <--- R                                                  |
+-----------------------------------------------------------------------+
|i3 : I=minors(2,G);                                                    |
|                                                                       |
|o3 : Ideal of R                                                        |
+-----------------------------------------------------------------------+
|i4 : EN=res I; betti EN                                                |
|                                                                       |
|            0  1  2   3  4  5 6                                        |
|o5 = total: 1 21 70 105 84 35 6                                        |
|         0: 1  .  .   .  .  . .                                        |
|         1: . 21 70 105 84 35 6                                        |
|                                                                       |
|o5 : BettiTally                                                        |
+-----------------------------------------------------------------------+

Notice how the first three columns of $G$ involve only the $x_{i,j}$ variables
while the other columns involve only the $y_{i,j}$ variables. In fact, $G$ is
the matrix of the map $$\phi : E\otimes R(-1,0) \oplus F\otimes R(0,-1)
\rightarrow H^* \otimes R, e_i \otimes 1 \mapsto \sum_{k=1}^2 h_k^* \otimes
x_{i,k}, f_j \otimes 1 \mapsto \sum_{k=1}^2 h_k^* \otimes y_{j,k}$$ with
respect to the bases $\{e_1\otimes 1,\ldots,e_3\otimes 1,f_1\otimes
1,\ldots,f_4\otimes 1\}$ of the domain and $\{h_1^*\otimes 1,h_2^*\otimes 1\}$
of the codomain.

The ring $R$ carries a degree compatible action of $SL_3 ({\mathbb C}) \times
SL_4 ({\mathbb C}) \times SL_2 ({\mathbb C})$. Notice how the $SL_3 ({\mathbb
C})$ factor acts non trivially on $E$, i.e., on the variables $x_{i,j}$, and
trivially on $F$, i.e., on the variables $y_{i,j}$. The opposite holds for the
$SL_4 ({\mathbb C})$ factor. The map $\phi$ is $G$-equivariant and so the ideal
generated by the $2\times 2$ of $\phi$ inherits the $G$-action on $R$.

The weight of $x_{i,j} = e_i\otimes h_j$ is obtained by concatenating the
weight of $e_i$ with the trivial weight {0,0,0} for the action of $SL_4
({\mathbb C})$ and then with the weight of $h_j$. Similarly the weight of
$y_{i,j} = f_i\otimes h_j$ is obtained by concatenating the trivial weight
{0,0} for the action of $SL_3 ({\mathbb C})$ with the weight of $f_i$ and then
with the weight of $h_j$. As in Example 2, we automate the
process as illustrated below and then we attach the list of weights to the ring
$R$.

+-----------------------------------------------------------------------------+
|i6 : e={{1,0},{-1,1},{0,-1}}                                                 |
|                                                                             |
|o6 = {{1, 0}, {-1, 1}, {0, -1}}                                              |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : f={{1,0,0},{-1,1,0},{0,-1,1},{0,0,-1}}                                  |
|                                                                             |
|o7 = {{1, 0, 0}, {-1, 1, 0}, {0, -1, 1}, {0, 0, -1}}                         |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : h={{1},{-1}}                                                            |
|                                                                             |
|o8 = {{1}, {-1}}                                                             |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : W=(flatten table(e,h,(u,v)->u|{0,0,0}|v))|(flatten table(f,h,(u,v)->{0,0|
|                                                                             |
|o9 = {{1, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, -1}, {-1, 1, 0, 0, 0, 1}, {-1, 1,  |
|     ------------------------------------------------------------------------|
|     0, 0, 0, -1}, {0, -1, 0, 0, 0, 1}, {0, -1, 0, 0, 0, -1}, {0, 0, 1, 0, 0,|
|     ------------------------------------------------------------------------|
|     1}, {0, 0, 1, 0, 0, -1}, {0, 0, -1, 1, 0, 1}, {0, 0, -1, 1, 0, -1}, {0, |
|     ------------------------------------------------------------------------|
|     0, 0, -1, 1, 1}, {0, 0, 0, -1, 1, -1}, {0, 0, 0, 0, -1, 1}, {0, 0, 0, 0,|
|     ------------------------------------------------------------------------|
|     -1, -1}}                                                                |
|                                                                             |
|o9 : List                                                                    |
|-----------------------------------------------------------------------------|
|}|u|v))                                                                      |
+-----------------------------------------------------------------------------+
|i10 : D=dynkinType{{"A",2},{"A",3},{"A",1}}; setWeights(R,D,W)               |
|                                                                             |
|o11 = Tally{{0, 0, 1, 0, 0, 1} => 1}                                         |
|            {1, 0, 0, 0, 0, 1} => 1                                          |
|                                                                             |
|o11 : Tally                                                                  |
+-----------------------------------------------------------------------------+

Now we decompose the resolution of $I$.

+-------------------------------------------------------------------------+
|i12 : highestWeightsDecomposition(EN)                                    |
|                                                                         |
|o12 = HashTable{0 => HashTable{{0, 0} => Tally{{0, 0, 0, 0, 0, 0} => 1}}}|
|                1 => HashTable{{0, 2} => Tally{{0, 0, 0, 1, 0, 0} => 1}} |
|                               {1, 1} => Tally{{1, 0, 1, 0, 0, 0} => 1}  |
|                               {2, 0} => Tally{{0, 1, 0, 0, 0, 0} => 1}  |
|                2 => HashTable{{0, 3} => Tally{{0, 0, 0, 0, 1, 1} => 1}} |
|                               {1, 2} => Tally{{1, 0, 0, 1, 0, 1} => 1}  |
|                               {2, 1} => Tally{{0, 1, 1, 0, 0, 1} => 1}  |
|                               {3, 0} => Tally{{0, 0, 0, 0, 0, 1} => 1}  |
|                3 => HashTable{{0, 4} => Tally{{0, 0, 0, 0, 0, 2} => 1}} |
|                               {1, 3} => Tally{{1, 0, 0, 0, 1, 2} => 1}  |
|                               {2, 2} => Tally{{0, 1, 0, 1, 0, 2} => 1}  |
|                               {3, 1} => Tally{{0, 0, 1, 0, 0, 2} => 1}  |
|                4 => HashTable{{1, 4} => Tally{{1, 0, 0, 0, 0, 3} => 1}} |
|                               {2, 3} => Tally{{0, 1, 0, 0, 1, 3} => 1}  |
|                               {3, 2} => Tally{{0, 0, 0, 1, 0, 3} => 1}  |
|                5 => HashTable{{2, 4} => Tally{{0, 1, 0, 0, 0, 4} => 1}} |
|                               {3, 3} => Tally{{0, 0, 0, 0, 1, 4} => 1}  |
|                6 => HashTable{{3, 4} => Tally{{0, 0, 0, 0, 0, 5} => 1}} |
|                                                                         |
|o12 : HashTable                                                          |
+-------------------------------------------------------------------------+

We show what part of the resolution looks like in terms of Schur functors: $$R
\leftarrow (\wedge^2 F \otimes R(0,-2)) \oplus (E \otimes F \otimes R(-1,-1))
\oplus (\wedge^2 E \otimes R(-2,0)) \leftarrow (\wedge^3 F \otimes H \otimes
R(0,-3)) \oplus (E \otimes \wedge^2 F \otimes H \otimes R(-1,-2)) \oplus
(\wedge^2 E \otimes F \otimes H \otimes R(-2,-1)) \oplus (H \otimes R(-3,0))
\leftarrow \ldots$$

Finally we decompose some graded components in the quotient ring $R/I$. Unlike
with $\ZZ$-gradings, when working in the multigraded setting it is not possible
to decompose a range of degrees but only one multidegree at a time.

+------------------------------------------+
|i13 : Q=R/I                               |
|                                          |
|o13 = Q                                   |
|                                          |
|o13 : QuotientRing                        |
+------------------------------------------+
|i14 : highestWeightsDecomposition(Q,{2,0})|
|                                          |
|o14 = Tally{{2, 0, 0, 0, 0, 2} => 1}      |
|                                          |
|o14 : Tally                               |
+------------------------------------------+
|i15 : highestWeightsDecomposition(Q,{1,1})|
|                                          |
|o15 = Tally{{1, 0, 1, 0, 0, 2} => 1}      |
|                                          |
|o15 : Tally                               |
+------------------------------------------+
|i16 : highestWeightsDecomposition(Q,{0,2})|
|                                          |
|o16 = Tally{{0, 0, 2, 0, 0, 2} => 1}      |
|                                          |
|o16 : Tally                               |
+------------------------------------------+

We have $Q_{(2,0)} = S_2 E \otimes S_2 H$, $Q_{(1,1)} = E \otimes F \otimes S_2
H$ and $Q_{(0,2)} = S_2 F \otimes S_2 H$.

Example 4 -- The Eisenbud-Fløystad-Weyman complex
*************************************************

We construct and decompose the Eisenbud-Fløystad-Weyman complex of type
(0,2,3,6) over a polynomial ring in 3 variables. The ring can be identified
with $Sym(E)$, where $E$ is a complex vector space of dimension 3. The ring and
the complex carry an action of $SL(E)$.

The complex is constructed using the package PieriMaps.
For more information on these complexes, we invite the reader to consult the
documentation of that package and the accompanying article.

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x,y,z];                                                            |
+-----------------------------------------------------------------------------+
|i2 : L={{1,0},{-1,1},{0,-1}};                                                |
+-----------------------------------------------------------------------------+
|i3 : D=dynkinType{{"A",2}};                                                  |
+-----------------------------------------------------------------------------+
|i4 : setWeights(R,D,L)                                                       |
|                                                                             |
|o4 = Tally{{1, 0} => 1}                                                      |
|                                                                             |
|o4 : Tally                                                                   |
+-----------------------------------------------------------------------------+
|i5 : loadPackage "PieriMaps";                                                |
+-----------------------------------------------------------------------------+
|i6 : f=pureFree({0,2,3,6},R)                                                 |
|                                                                             |
|o6 = | 12x2 0    0    6xy 0   0   6xz   0    0   2y2 0   0   2yz  0    0     |
|     | 0    12x2 0    0   6xy 0   0     6xz  0   0   2y2 0   0    2yz  0     |
|     | 0    0    12x2 0   0   6xy 0     0    6xz 0   0   2y2 0    0    2yz   |
|     | 0    0    0    0   6x2 0   -12x2 0    0   0   8xy 0   -8xy 4xz  0     |
|     | 0    0    0    0   0   6x2 0     -3x2 0   0   0   8xy 0    -2xy 4xz   |
|     | 0    0    0    0   0   0   0     0    0   0   0   2x2 0    -x2  0     |
|     ------------------------------------------------------------------------|
|     2z2   0    0   0   0   0    0   0    0   0    0   0   |                 |
|     0     2z2  0   0   0   0    0   0    0   0    0   0   |                 |
|     0     0    2z2 0   0   0    0   0    0   0    0   0   |                 |
|     -16xz 0    0   6y2 0   4yz  0   2z2  0   0    0   0   |                 |
|     0     -4xz 0   0   6y2 -y2  4yz -2yz 2z2 0    0   0   |                 |
|     2x2   0    0   0   6xy -2xy 2xz -2xz 0   12y2 6yz 2z2 |                 |
|                                                                             |
|             6       27                                                      |
|o6 : Matrix R  <--- R                                                        |
+-----------------------------------------------------------------------------+

The matrix above is a presentation of the module whose resolution is the
complex in the title. The rows of the matrix are indexed by standard tableaux
of shape $(2,2)$ and entries from $\{0,1,2\}$. The weight of one such tableau
is $m_0*L_0+m_1*L_1+m_2*L_2$, where $m_i$ is the multiplicity of $i$ in the
tableau. The command below generates all the weights.

+-----------------------------------------------------------------------------+
|i7 : W=apply(apply(standardTableaux(3, {2,2}), flatten), i->sum(apply(i,j->L_|
|                                                                             |
|o7 = {{0, 2}, {1, 0}, {2, -2}, {-1, 1}, {0, -1}, {-2, 0}}                    |
|                                                                             |
|o7 : List                                                                    |
|-----------------------------------------------------------------------------|
|j)))                                                                         |
+-----------------------------------------------------------------------------+

Next we generate the resolution and obtain its decomposition.

+----------------------------------------------------------+
|i8 : EFW=res coker f; betti EFW                           |
|                                                          |
|            0  1  2 3                                     |
|o9 = total: 6 27 24 3                                     |
|         0: 6  .  . .                                     |
|         1: . 27 24 .                                     |
|         2: .  .  . .                                     |
|         3: .  .  . 3                                     |
|                                                          |
|o9 : BettiTally                                           |
+----------------------------------------------------------+
|i10 : highestWeightsDecomposition(EFW,0,W)                |
|                                                          |
|o10 = HashTable{0 => HashTable{{0} => Tally{{0, 2} => 1}}}|
|                1 => HashTable{{2} => Tally{{2, 2} => 1}} |
|                2 => HashTable{{3} => Tally{{1, 3} => 1}} |
|                3 => HashTable{{6} => Tally{{1, 0} => 1}} |
|                                                          |
|o10 : HashTable                                           |
+----------------------------------------------------------+

We conclude that with the action of $SL(E)$ the complex has the following
structure: $$S_{2,2} E \otimes R \leftarrow S_{4,2} E \otimes R(-2) \leftarrow
S_{4,3} E \otimes R(-3) \leftarrow E \otimes R(-6) \leftarrow 0$$ where
$S_\lambda$ denotes the Schur functor associated with the partition $\lambda$.

Example 5 -- The singular locus of a symplectic invariant
*********************************************************

Consider the symplectic group $Sp(6,{\mathbb C})$ of type $C_3$. We denote
$V(\omega)$ the highest weight representation of $Sp(6,{\mathbb C})$ with
highest weight $\omega$. We denote by $\omega_1,...,\omega_3$ the fundamental
weights in the root system of type $C_3$.

The action of $Sp(6,{\mathbb C})$ on $V(\omega_3)$, the third fundamental
representation, has a unique invariant $\Delta$ of degree 4. If we regard
$V(\omega_3)$ as a complex affine space, $\Delta$ describes a hypersurface. We
will determine and decompose the minimal free resolution of the coordinate ring
of the singular locus of this hypersurface. This singular locus is one of the
four orbit closures for the action of $Sp(6,{\mathbb C})$ on $V(\omega_3)$ and
has been studied, for example, in Galetto - Free resolutions of orbit closures
for the representations associated to gradings on Lie algebras of type E6, F4
and G2 (see http://arxiv.org/abs/1210.6410 ). A concise description of this
singular locus, together with a construction of the representation
$V(\omega_3)$, was also given in Iliev, Ranestad - Geometry of the Lagrangian
Grassmannian LG(3,6) with Applications to Brill–Noether Loci (see
http://dx.doi.org/10.1307/mmj/1123090775 ). We will follow the notation of this
second source.

The standard representation $V=V(\omega_1)$ of $Sp(6,{\mathbb C})$ is a six
dimensional complex vector space endowed with a symplectic form. Being a
symplectic space, $V$ is self dual. Let $x_1,...,x_6$ be a basis for the
coordinate functions on $V$. The symplectic form on $V$ can be written as
$x_1\wedge x_4 +x_3\wedge x_5 +x_3\wedge x_6 \in \wedge^2 V^*$. The wedge
product with this form induces a map $V^* \to \wedge^3 V^*$ whose cokernel is
the representation $V(\omega_3)$. As such, the residue classes $x_{i,j,k}$ of
the tensors $x_i\wedge x_j\wedge x_k$ span $V(\omega_3)$. Since $V(\omega_3)$
is self dual, we can take the $x_{i,j,k}$ to span the coordinate functions on
$V(\omega_3)$. Finally, some of the $x_{i,j,k}$ can be omitted and the
remaining ones will be variables in our polynomial ring $R$.

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x_{1,2,3},x_{1,2,4},x_{1,2,5},x_{1,2,6},x_{1,3,4},x_{1,3,5},x_{1,4,|
|                                                                             |
|o1 = R                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
|-----------------------------------------------------------------------------|
|5},x_{1,4,6},x_{1,5,6},x_{2,3,4},x_{2,4,5},x_{2,4,6},x_{3,4,5},x_{4,5,6}]    |
+-----------------------------------------------------------------------------+

The invariant $\Delta$ can be written in terms of certain matrices of
variables, as indicated in our source.

+-----------------------------------------------------------------------------+
|i2 : X=matrix{{x_{2,3,4},-x_{1,3,4},x_{1,2,4}},{-x_{1,3,4},-x_{1,3,5},x_{1,2,|
|                                                                             |
|o2 = | x_{2, 3, 4}  -x_{1, 3, 4} x_{1, 2, 4} |                               |
|     | -x_{1, 3, 4} -x_{1, 3, 5} x_{1, 2, 5} |                               |
|     | x_{1, 2, 4}  x_{1, 2, 5}  x_{1, 2, 6} |                               |
|                                                                             |
|             3       3                                                       |
|o2 : Matrix R  <--- R                                                        |
|-----------------------------------------------------------------------------|
|5}},{x_{1,2,4},x_{1,2,5},x_{1,2,6}}}                                         |
+-----------------------------------------------------------------------------+
|i3 : Y=matrix{{x_{1,5,6},-x_{1,4,6},x_{1,4,5}},{-x_{1,4,6},-x_{2,4,6},x_{2,4,|
|                                                                             |
|o3 = | x_{1, 5, 6}  -x_{1, 4, 6} x_{1, 4, 5} |                               |
|     | -x_{1, 4, 6} -x_{2, 4, 6} x_{2, 4, 5} |                               |
|     | x_{1, 4, 5}  x_{2, 4, 5}  x_{3, 4, 5} |                               |
|                                                                             |
|             3       3                                                       |
|o3 : Matrix R  <--- R                                                        |
|-----------------------------------------------------------------------------|
|5}},{x_{1,4,5},x_{2,4,5},x_{3,4,5}}}                                         |
+-----------------------------------------------------------------------------+
|i4 : Delta=(x_{1,2,3}*x_{4,5,6}-trace(X*Y))^2+4*x_{1,2,3}*det(Y)+4*x_{4,5,6}*|
|-----------------------------------------------------------------------------|
|det(X)-4*sum(3,i->sum(3,j->det(submatrix'(X,{i},{j}))*det(submatrix'(Y,{i},{j|
|-----------------------------------------------------------------------------|
|}))));                                                                       |
+-----------------------------------------------------------------------------+

The equations of the singular locus of the hypersurface cut out by $\Delta$ are
the partial derivatives of $\Delta$. Let us calculate the resolution of this
ideal.

+----------------------------------+
|i5 : I=ideal jacobian ideal Delta;|
|                                  |
|o5 : Ideal of R                   |
+----------------------------------+
|i6 : RI=res I; betti RI           |
|                                  |
|            0  1  2  3 4          |
|o7 = total: 1 14 21 14 6          |
|         0: 1  .  .  . .          |
|         1: .  .  .  . .          |
|         2: . 14 21  . .          |
|         3: .  .  . 14 6          |
|                                  |
|o7 : BettiTally                   |
+----------------------------------+

The root system of type $C_3$ is contained in $\RR^3$. It is easy to express
the weight of each variable of the ring $R$ with respect to the coordinate
basis of $\RR^3$. The weight of $x_{i,j,k}$ is the vector $v_i+v_j+v_k$, where
$v_h$ is the weight of $x_h$ in the coordinate basis of $\RR^3$.

+-----------------------------------------------------------------------------+
|i8 : v_1={1,0,0}; v_2={0,1,0}; v_3={0,0,1}; v_4={-1,0,0}; v_5={0,-1,0};      |
|-----------------------------------------------------------------------------|
|v_6={0,0,-1};                                                                |
+-----------------------------------------------------------------------------+
|i14 : ind = apply(gens R,g->(baseName g)#1)                                  |
|                                                                             |
|o14 = {{1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 2, 6}, {1, 3, 4}, {1, 3, 5}, {1, |
|      -----------------------------------------------------------------------|
|      4, 5}, {1, 4, 6}, {1, 5, 6}, {2, 3, 4}, {2, 4, 5}, {2, 4, 6}, {3, 4,   |
|      -----------------------------------------------------------------------|
|      5}, {4, 5, 6}}                                                         |
|                                                                             |
|o14 : List                                                                   |
+-----------------------------------------------------------------------------+
|i15 : W'=apply(ind,j->v_(j_0)+v_(j_1)+v_(j_2))                               |
|                                                                             |
|o15 = {{1, 1, 1}, {0, 1, 0}, {1, 0, 0}, {1, 1, -1}, {0, 0, 1}, {1, -1, 1},   |
|      -----------------------------------------------------------------------|
|      {0, -1, 0}, {0, 0, -1}, {1, -1, -1}, {-1, 1, 1}, {-1, 0, 0}, {-1, 1,   |
|      -----------------------------------------------------------------------|
|      -1}, {-1, -1, 1}, {-1, -1, -1}}                                        |
|                                                                             |
|o15 : List                                                                   |
+-----------------------------------------------------------------------------+

Now we convert these weights into the basis of fundamental weights. To achieve
this we make each previous weight into a column vector and join all column
vectors into a matrix. Then we multiply on the left by the matrix $M$
expressing the change of basis from the coordinate basis of $\RR^3$ to the base
of simple roots of $C_3$ (as described in Humphreys - Introduction to Lie
Algebras and Representation Theory, Ch. 12.1). Finally we multiply the
resulting matrix on the left by $N$, the transpose of the Cartan matrix of
$C_3$, which expresses the change of basis from the simple roots to the
fundamental weights of $C_3$. The columns of the matrix thus obtained are the
desired weights, so they can be attached to the ring $R$.

+-----------------------------------------------------------------------------+
|i16 : M=inverse promote(matrix{{1,0,0},{-1,1,0},{0,-1,2}},QQ)                |
|                                                                             |
|o16 = | 1   0   0   |                                                        |
|      | 1   1   0   |                                                        |
|      | 1/2 1/2 1/2 |                                                        |
|                                                                             |
|               3        3                                                    |
|o16 : Matrix QQ  <--- QQ                                                     |
+-----------------------------------------------------------------------------+
|i17 : D=dynkinType{{"C",3}}                                                  |
|                                                                             |
|o17 = DynkinType{{C, 3}}                                                     |
|                                                                             |
|o17 : DynkinType                                                             |
+-----------------------------------------------------------------------------+
|i18 : N=transpose promote(cartanMatrix(rootSystem(D)),QQ)                    |
|                                                                             |
|o18 = | 2  -1 0  |                                                           |
|      | -1 2  -2 |                                                           |
|      | 0  -1 2  |                                                           |
|                                                                             |
|               3        3                                                    |
|o18 : Matrix QQ  <--- QQ                                                     |
+-----------------------------------------------------------------------------+
|i19 : W=entries transpose lift(N*M*(transpose matrix W'),ZZ)                 |
|                                                                             |
|o19 = {{0, 0, 1}, {-1, 1, 0}, {1, 0, 0}, {0, 2, -1}, {0, -1, 1}, {2, -2, 1}, |
|      -----------------------------------------------------------------------|
|      {1, -1, 0}, {0, 1, -1}, {2, 0, -1}, {-2, 0, 1}, {-1, 0, 0}, {-2, 2,    |
|      -----------------------------------------------------------------------|
|      -1}, {0, -2, 1}, {0, 0, -1}}                                           |
|                                                                             |
|o19 : List                                                                   |
+-----------------------------------------------------------------------------+
|i20 : setWeights(R,D,W)                                                      |
|                                                                             |
|o20 = Tally{{0, 0, 1} => 1}                                                  |
|                                                                             |
|o20 : Tally                                                                  |
+-----------------------------------------------------------------------------+

At this stage, we can issue the command to decompose the resolution.

+-------------------------------------------------------------+
|i21 : highestWeightsDecomposition(RI)                        |
|                                                             |
|o21 = HashTable{0 => HashTable{{0} => Tally{{0, 0, 0} => 1}}}|
|                1 => HashTable{{3} => Tally{{0, 0, 1} => 1}} |
|                2 => HashTable{{4} => Tally{{2, 0, 0} => 1}} |
|                3 => HashTable{{6} => Tally{{0, 1, 0} => 1}} |
|                4 => HashTable{{7} => Tally{{1, 0, 0} => 1}} |
|                                                             |
|o21 : HashTable                                              |
+-------------------------------------------------------------+

We deduce that the resolution has the following structure $$R \leftarrow
V(\omega_3) \otimes R(-3) \leftarrow V(2\omega_1) \otimes R(-4) \leftarrow
V(\omega_2) \otimes R(-6) \leftarrow V(\omega_1) \otimes R(-7) \leftarrow 0$$

Let us also decompose some graded components of the quotient $R/I$.

+-------------------------------------------+
|i22 : highestWeightsDecomposition(R/I,0,4) |
|                                           |
|o22 = HashTable{0 => Tally{{0, 0, 0} => 1}}|
|                1 => Tally{{0, 0, 1} => 1} |
|                2 => Tally{{0, 0, 2} => 1} |
|                           {2, 0, 0} => 1  |
|                3 => Tally{{0, 0, 3} => 1} |
|                           {2, 0, 1} => 1  |
|                4 => Tally{{0, 0, 4} => 1} |
|                           {2, 0, 2} => 1  |
|                           {4, 0, 0} => 1  |
|                                           |
|o22 : HashTable                            |
+-------------------------------------------+

Example 6 -- The coordinate ring of the spinor variety
******************************************************

Consider the complex Lie group $SO(10)$ of type $D_5$. We denote $V(\omega)$
the highest weight representation of $SO(10)$ with highest weight $\omega$. We
denote by $\omega_1,...,\omega_5$ the fundamental weights in the root system of
type $D_5$.

We will obtain the minimal free resolution of the coordinate ring of the spinor
variety of type $D_5$ (see Rincon - Isotropical linear spaces and valuated
delta-matroids (see http://dx.doi.org/10.1016/j.jcta.2011.08.001 ), Sec. 2, for
a concise introduction to spinor varieties). The affine cone over the spinor
variety of type $D_5$ lives in the representation $V(\omega_5)$, the 5th
fundamental representation of $SO(10)$, considered as an affine space.
Polynomial functions on this affine space are given by the symmetric algebra
over the dual representation, i.e., $V(\omega_4)$.

Following the description in Fulton, Harris - Representation Theory, Ch. 20.1,
we can construct $V(\omega_4)$ as $\wedge^0 E \oplus \wedge^2 E \oplus \wedge^4
E$, where $E$ is a 5 dimensional complex vector space. Let $\{e_0,...,e_4\}$ be
a basis of $E$. Then a basis of $V(\omega_4)$ is given by the exterior products
$e_J = e_{j_1} \wedge ... \wedge e_{j_{2r}}$, for all subsets
$J=\{j_1,...,j_{2r}\}$ of even cardinality of $\{0,..., 4\}$. Denote by $x_J$
the variable corresponding to $e_J$ in $R$.

The spinor variety of type $D_5$ is cut out by quadratic equations which
represent all possible relations among the sub Pfaffians of a $5\times 5$
generic skew symmetric matrix. A general description can be found for example
in Manivel - On Spinor Varieties and Their Secants (see
http://dx.doi.org/10.3842/SIGMA.2009.078 ).

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x_{}, x_{0,1}, x_{0,2}, x_{1,2}, x_{0,3}, x_{1,3}, x_{2,3},        |
|                                                                             |
|o1 = R                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
|-----------------------------------------------------------------------------|
|x_{0,4}, x_{1,4}, x_{2,4}, x_{3,4}, x_{0,1,2,3}, x_{0,1,2,4}, x_{0,1,3,4},   |
|-----------------------------------------------------------------------------|
|x_{0,2,3,4}, x_{1,2,3,4}]                                                    |
+-----------------------------------------------------------------------------+
|i2 : I=ideal(x_{}*x_{0,1,2,3}-x_{0,1}*x_{2,3}+x_{0,2}*x_{1,3}-x_{0,3}*x_{1,  |
|         x_{}*x_{0,1,2,4}-x_{0,1}*x_{2,4}+x_{0,2}*x_{1,4}-x_{0,4}*x_{1,2},   |
|         x_{}*x_{0,1,3,4}-x_{0,1}*x_{3,4}+x_{0,3}*x_{1,4}-x_{0,4}*x_{1,3},   |
|         x_{}*x_{0,2,3,4}-x_{0,2}*x_{3,4}+x_{0,3}*x_{2,4}-x_{0,4}*x_{2,3},   |
|         x_{}*x_{1,2,3,4}-x_{1,2}*x_{3,4}+x_{1,3}*x_{2,4}-x_{1,4}*x_{2,3},   |
|         x_{0,1}*x_{0,2,3,4}-x_{0,2}*x_{0,1,3,4}+x_{0,3}*x_{0,1,2,4}-x_{0,4  |
|         -x_{0,1}*x_{1,2,3,4}+x_{1,2}*x_{0,1,3,4}-x_{1,3}*x_{0,1,2,4}+x_{1,  |
|         x_{0,2}*x_{1,2,3,4}-x_{1,2}*x_{0,2,3,4}+x_{2,3}*x_{0,1,2,4}-x_{2,4  |
|         -x_{0,3}*x_{1,2,3,4}+x_{1,3}*x_{0,2,3,4}-x_{2,3}*x_{0,1,3,4}+x_{3,  |
|         x_{0,4}*x_{1,2,3,4}-x_{1,4}*x_{0,2,3,4}+x_{2,4}*x_{0,1,3,4}-x_{3,4  |
|                                                                             |
|o2 : Ideal of R                                                              |
|-----------------------------------------------------------------------------|
|2},                                                                          |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|}*x_{0,1,2,3},                                                               |
|4}*x_{0,1,2,3},                                                              |
|}*x_{0,1,2,3},                                                               |
|4}*x_{0,1,2,3},                                                              |
|}*x_{0,1,2,4});                                                              |
+-----------------------------------------------------------------------------+
|i3 : RI=res I; betti RI                                                      |
|                                                                             |
|            0  1  2  3  4 5                                                  |
|o4 = total: 1 10 16 16 10 1                                                  |
|         0: 1  .  .  .  . .                                                  |
|         1: . 10 16  .  . .                                                  |
|         2: .  .  . 16 10 .                                                  |
|         3: .  .  .  .  . 1                                                  |
|                                                                             |
|o4 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

The root system of type $D_5$ is contained in $\RR^5$. It is easy to express
the weight of each variable of the ring $R$ with respect to the coordinate
basis of $\RR^5$. The weight of $x_J$ is a vector $(a_1,...,a_5)\in\RR^5$, with
$a_k = 1/2$ if $k\in J$ and $a_k = -1/2$ otherwise.

+-----------------------------------------------------------------------------+
|i5 : ind = apply(gens R,g->(baseName g)#1)                                   |
|                                                                             |
|o5 = {{}, {0, 1}, {0, 2}, {1, 2}, {0, 3}, {1, 3}, {2, 3}, {0, 4}, {1, 4}, {2,|
|     ------------------------------------------------------------------------|
|     4}, {3, 4}, {0, 1, 2, 3}, {0, 1, 2, 4}, {0, 1, 3, 4}, {0, 2, 3, 4}, {1, |
|     ------------------------------------------------------------------------|
|     2, 3, 4}}                                                               |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : makeWeight = J -> apply(5,i->if member(i,J) then 1/2 else -1/2)         |
|                                                                             |
|o6 = makeWeight                                                              |
|                                                                             |
|o6 : FunctionClosure                                                         |
+-----------------------------------------------------------------------------+
|i7 : W'=apply(ind,makeWeight)                                                |
|                                                                             |
|         1    1    1    1    1    1  1    1    1    1    1    1  1    1      |
|o7 = {{- -, - -, - -, - -, - -}, {-, -, - -, - -, - -}, {-, - -, -, - -, -   |
|         2    2    2    2    2    2  2    2    2    2    2    2  2    2      |
|     ------------------------------------------------------------------------|
|     1      1  1  1    1    1    1    1    1  1    1      1  1    1  1    1  |
|     -}, {- -, -, -, - -, - -}, {-, - -, - -, -, - -}, {- -, -, - -, -, - -},|
|     2      2  2  2    2    2    2    2    2  2    2      2  2    2  2    2  |
|     ------------------------------------------------------------------------|
|        1    1  1  1    1    1    1    1    1  1      1  1    1    1  1      |
|     {- -, - -, -, -, - -}, {-, - -, - -, - -, -}, {- -, -, - -, - -, -}, {- |
|        2    2  2  2    2    2    2    2    2  2      2  2    2    2  2      |
|     ------------------------------------------------------------------------|
|     1    1  1    1  1      1    1    1  1  1    1  1  1  1    1    1  1  1  |
|     -, - -, -, - -, -}, {- -, - -, - -, -, -}, {-, -, -, -, - -}, {-, -, -, |
|     2    2  2    2  2      2    2    2  2  2    2  2  2  2    2    2  2  2  |
|     ------------------------------------------------------------------------|
|       1  1    1  1    1  1  1    1    1  1  1  1      1  1  1  1  1         |
|     - -, -}, {-, -, - -, -, -}, {-, - -, -, -, -}, {- -, -, -, -, -}}       |
|       2  2    2  2    2  2  2    2    2  2  2  2      2  2  2  2  2         |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

Now we convert these weights into the basis of fundamental weights. To achieve
this we make each previous weight into a column vector and join all column
vectors into a matrix. Then we multiply on the left by the matrix $M$
expressing the change of basis from the coordinate basis of $\RR^5$ to the base
of simple roots of $D_5$ (as described in Humphreys - Introduction to Lie
Algebras and Representation Theory, Ch. 12.1). Finally we multiply the
resulting matrix on the left by $N$, the transpose of the Cartan matrix of
$D_5$, which expresses the change of basis from the simple roots to the
fundamental weights of $D_5$. The columns of the matrix thus obtained are the
desired weights, so they can be attached to the ring $R$.

+-----------------------------------------------------------------------------+
|i8 : M=inverse promote(matrix{{1,0,0,0,0},{-1,1,0,0,0},{0,-1,1,0,0},{0,0,-1,1|
|                                                                             |
|o8 = | 1   0   0   0   0    |                                                |
|     | 1   1   0   0   0    |                                                |
|     | 1   1   1   0   0    |                                                |
|     | 1/2 1/2 1/2 1/2 -1/2 |                                                |
|     | 1/2 1/2 1/2 1/2 1/2  |                                                |
|                                                                             |
|              5        5                                                     |
|o8 : Matrix QQ  <--- QQ                                                      |
|-----------------------------------------------------------------------------|
|,1},{0,0,0,-1,1}},QQ)                                                        |
+-----------------------------------------------------------------------------+
|i9 : D=dynkinType{{"D",5}}                                                   |
|                                                                             |
|o9 = DynkinType{{D, 5}}                                                      |
|                                                                             |
|o9 : DynkinType                                                              |
+-----------------------------------------------------------------------------+
|i10 : N=transpose promote(cartanMatrix(rootSystem(D)),QQ)                    |
|                                                                             |
|o10 = | 2  -1 0  0  0  |                                                     |
|      | -1 2  -1 0  0  |                                                     |
|      | 0  -1 2  -1 -1 |                                                     |
|      | 0  0  -1 2  0  |                                                     |
|      | 0  0  -1 0  2  |                                                     |
|                                                                             |
|               5        5                                                    |
|o10 : Matrix QQ  <--- QQ                                                     |
+-----------------------------------------------------------------------------+
|i11 : W=entries transpose lift(N*M*(transpose matrix W'),ZZ)                 |
|                                                                             |
|o11 = {{0, 0, 0, 0, -1}, {0, 1, 0, 0, -1}, {1, -1, 1, 0, -1}, {-1, 0, 1, 0,  |
|      -----------------------------------------------------------------------|
|      -1}, {1, 0, -1, 1, 0}, {-1, 1, -1, 1, 0}, {0, -1, 0, 1, 0}, {1, 0, 0,  |
|      -----------------------------------------------------------------------|
|      -1, 0}, {-1, 1, 0, -1, 0}, {0, -1, 1, -1, 0}, {0, 0, -1, 0, 1}, {0, 0, |
|      -----------------------------------------------------------------------|
|      0, 1, 0}, {0, 0, 1, -1, 0}, {0, 1, -1, 0, 1}, {1, -1, 0, 0, 1}, {-1, 0,|
|      -----------------------------------------------------------------------|
|      0, 0, 1}}                                                              |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+
|i12 : setWeights(R,D,W)                                                      |
|                                                                             |
|o12 = Tally{{0, 0, 0, 1, 0} => 1}                                            |
|                                                                             |
|o12 : Tally                                                                  |
+-----------------------------------------------------------------------------+

At this stage, we can issue the command to decompose the resolution.

+-------------------------------------------------------------------+
|i13 : highestWeightsDecomposition(RI)                              |
|                                                                   |
|o13 = HashTable{0 => HashTable{{0} => Tally{{0, 0, 0, 0, 0} => 1}}}|
|                1 => HashTable{{2} => Tally{{1, 0, 0, 0, 0} => 1}} |
|                2 => HashTable{{3} => Tally{{0, 0, 0, 0, 1} => 1}} |
|                3 => HashTable{{5} => Tally{{0, 0, 0, 1, 0} => 1}} |
|                4 => HashTable{{6} => Tally{{1, 0, 0, 0, 0} => 1}} |
|                5 => HashTable{{8} => Tally{{0, 0, 0, 0, 0} => 1}} |
|                                                                   |
|o13 : HashTable                                                    |
+-------------------------------------------------------------------+

We deduce that the resolution has the following structure $$R \leftarrow
V(\omega_1) \otimes R(-2) \leftarrow V(\omega_5) \otimes R(-3) \leftarrow
V(\omega_4) \otimes R(-5) \leftarrow V(\omega_1) \otimes R(-6) \leftarrow R(-8)
\leftarrow 0$$

Let us also decompose some graded components of the quotient $R/I$.

+-------------------------------------------------+
|i14 : highestWeightsDecomposition(R/I,0,4)       |
|                                                 |
|o14 = HashTable{0 => Tally{{0, 0, 0, 0, 0} => 1}}|
|                1 => Tally{{0, 0, 0, 1, 0} => 1} |
|                2 => Tally{{0, 0, 0, 2, 0} => 1} |
|                3 => Tally{{0, 0, 0, 3, 0} => 1} |
|                4 => Tally{{0, 0, 0, 4, 0} => 1} |
|                                                 |
|o14 : HashTable                                  |
+-------------------------------------------------+

We deduce that, for $d\in\{0,...,4\}$, $(R/I)_d = V(d\omega_4)$.

Example 7 -- With the exceptional group G2
******************************************

Consider the exceptional group of type $G_2$; we denote $V(a,b)$ the highest
weight representation of $G_2$ with highest weight $a\omega_1 + b\omega_2$,
where $\omega_1$ and $\omega_2$ are the fundamental weights for $G_2$ (see
Fulton, Harris - Representation Theory, Ch, 22.3 for a construction of the
representations appearing in this example). We work over the polynomial ring
$Sym(V(1,0))$, which has a natural action of $G_2$. For lack of a better
notation, we index the variables in $R$ by their weight (recall that variables
in $R$ must be weight vectors). Consider the maximal ideal $m$ generated by the
variables of $R$. This ideal is clearly stable under the action of $G_2$.
Moreover the minimal free resolution of $R/I$ is the Koszul complex over the
variables of $R$ (see Eisenbud - Commutative Algebra, Ch. 17).

+----------------------------------------------------------------------------+
|i1 : R=QQ[x_(-2, 1),x_(-1, 0),x_(-1, 1),x_(0, 0),x_(1,-1),x_(1, 0),x_(2,-1)]|
|                                                                            |
|o1 = R                                                                      |
|                                                                            |
|o1 : PolynomialRing                                                         |
+----------------------------------------------------------------------------+
|i2 : m=ideal vars R;                                                        |
|                                                                            |
|o2 : Ideal of R                                                             |
+----------------------------------------------------------------------------+
|i3 : K=koszul gens m; betti K                                               |
|                                                                            |
|            0 1  2  3  4  5 6 7                                             |
|o4 = total: 1 7 21 35 35 21 7 1                                             |
|         0: 1 7 21 35 35 21 7 1                                             |
|                                                                            |
|o4 : BettiTally                                                             |
+----------------------------------------------------------------------------+

Now we define  the list of weights of the variables and attach it to the ring.

+------------------------------------------------------------------+
|i5 : W={{-2, 1},{-1, 0},{-1, 1},{0, 0},{1,-1},{1, 0},{2,-1}}      |
|                                                                  |
|o5 = {{-2, 1}, {-1, 0}, {-1, 1}, {0, 0}, {1, -1}, {1, 0}, {2, -1}}|
|                                                                  |
|o5 : List                                                         |
+------------------------------------------------------------------+
|i6 : D=dynkinType{{"G",2}}; setWeights(R,D,W)                     |
|                                                                  |
|o7 = Tally{{1, 0} => 1}                                           |
|                                                                  |
|o7 : Tally                                                        |
+------------------------------------------------------------------+

We can ask to decompose the complex $K$ up to homological degree 3 using the
option Range,:

+---------------------------------------------------------+
|i8 : highestWeightsDecomposition(K,Range=>{0,3})         |
|                                                         |
|o8 = HashTable{0 => HashTable{{0} => Tally{{0, 0} => 1}}}|
|               1 => HashTable{{1} => Tally{{1, 0} => 1}} |
|               2 => HashTable{{2} => Tally{{0, 1} => 1}} |
|                                           {1, 0} => 1   |
|               3 => HashTable{{3} => Tally{{0, 0} => 1}} |
|                                           {1, 0} => 1   |
|                                           {2, 0} => 1   |
|                                                         |
|o8 : HashTable                                           |
+---------------------------------------------------------+

Then the first half of $K$ is: $$R \leftarrow V(1,0) \otimes R(-1) \leftarrow
(V(0,1)\oplus V(1,0)) \otimes R(-2) \leftarrow (V(0,0)\oplus V(1,0)\oplus
V(2,0)) \otimes R(-3) \leftarrow \ldots $$ The second half can be reconstructed
using the duality of the Koszul complex and the fact that all the
representations in the first half are self dual.

While the quotient ring $R/m$ is isomorphic to ${\mathbb C}$, the trivial
representation of $G_2$, it may be more interesting to decompose some graded
components of $m$.

+---------------------------------------+
|i9 : highestWeightsDecomposition(m,0,4)|
|                                       |
|o9 = HashTable{0 => Tally{}           }|
|               1 => Tally{{1, 0} => 1} |
|               2 => Tally{{0, 0} => 1} |
|                          {2, 0} => 1  |
|               3 => Tally{{1, 0} => 1} |
|                          {3, 0} => 1  |
|               4 => Tally{{0, 0} => 1} |
|                          {2, 0} => 1  |
|                          {4, 0} => 1  |
|                                       |
|o9 : HashTable                         |
+---------------------------------------+

Since $m$ is generated by the variables, it contains all graded components of
$R$ except for the one in degree zero. In particular, the graded components of
$R$ and $m$ coincide in degree 1 and higher, which is illustrated up to degree
4 by the computation below.

+----------------------------------------+
|i10 : highestWeightsDecomposition(R,0,4)|
|                                        |
|o10 = HashTable{0 => Tally{{0, 0} => 1}}|
|                1 => Tally{{1, 0} => 1} |
|                2 => Tally{{0, 0} => 1} |
|                           {2, 0} => 1  |
|                3 => Tally{{1, 0} => 1} |
|                           {3, 0} => 1  |
|                4 => Tally{{0, 0} => 1} |
|                           {2, 0} => 1  |
|                           {4, 0} => 1  |
|                                        |
|o10 : HashTable                         |
+----------------------------------------+

Forward -- propagate weights from domain to codomain
****************************************************

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

Set this argument to true to ensure weights are propagated forward along a map
of graded free modules, i.e., from domain to the codomain of the map. The
default setting is false meaning that weights are propagated backwards, i.e.,
from codomain to domain.

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

Functions with optional argument named Forward :
================================================

  * propagateWeights(...,Forward=>...)
    -- propagate weights
    from domain to codomain

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

The object Forward, is a symbol (Macaulay2Doc).

getWeights -- retrieve the (Lie theoretic) weight of a monomial
***************************************************************

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

Suppose an algebraic torus acts on a polynomial ring compatibly with the
grading. If each variable is a weight vector, then each monomial is also a
weight vector. Use this method to obtain the weight of a monomial.

See also
========

  * setWeights -- attach (Lie theoretic) weights to the
    variables of a ring

Ways to use getWeights :
========================

  * getWeights(RingElement) -- retrieve the
    (Lie theoretic) weight of a monomial

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

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

getWeights(RingElement) -- retrieve the (Lie theoretic) weight of a monomial
****************************************************************************

Synopsis
========

  * Function: getWeights,
  * Usage:
        w = getWeights(r)
  * Inputs:
      * r, a ring element (Macaulay2Doc),
  * Outputs:
      * w, a list (Macaulay2Doc),

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

If r is a monomial, this will return the weight of r which is simply the sum of
the weights of the variables in the support of r each counted with multiplicity
equal to its exponent. If r is a polynomial, then the weight of the leading
monomial is returned (which may differ from the weights of the other monomials
of r).

In the following example, the polynomial ring R is the symmetric algebra over
$V$, where $V=\mathbb{C}^4$ and is acted upon by the group $SL_4 (\mathbb{C})$.

+--------------------------------------------+
|i1 : R=QQ[x_1..x_4];                        |
+--------------------------------------------+
|i2 : D=dynkinType{{"A",3}};                 |
+--------------------------------------------+
|i3 : W={{1,0,0},{-1,1,0},{0,-1,1},{0,0,-1}};|
+--------------------------------------------+
|i4 : setWeights(R,D,W);                     |
+--------------------------------------------+
|i5 : getWeights(x_1^4*x_2*x_4^6)            |
|                                            |
|o5 = {3, 1, -6}                             |
|                                            |
|o5 : List                                   |
+--------------------------------------------+

Caveat
======

The weight of 0 is undefined, so an error is returned if r is 0.

See also
========

  * setWeights -- attach (Lie theoretic) weights to the
    variables of a ring

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

  * getWeights(RingElement) -- retrieve the
    (Lie theoretic) weight of a monomial

GroupActing -- stores the Dynkin type of the group acting on a ring
*******************************************************************

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

A key in the hash table of a ring which is used to store the Dynkin type of the
group acting on the ring. Set this using the setWeights,
command.

See also
========

  * setWeights -- attach (Lie theoretic) weights to the
    variables of a ring

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

The object GroupActing, is a symbol (Macaulay2Doc).

highestWeightsDecomposition -- irreducible decomposition of a complex, ring, ideal or module
********************************************************************************************

Synopsis
========

  * Optional inputs (Macaulay2Doc),:
      * Range,
        => ..., default value {-infinity, infinity}, decompose only part
        of a complex

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

Let $G$ be a semisimple algebraic group which acts on a polynomial ring $R$
compatibly with the grading. Let $T\subseteq G$ be a maximal torus and assume
the variables in $R$ are weight vectors for the action of $T$.

This method can be used to obtain the decomposition into highest weight
representations of various objects over $R$ that carry a compatible $G$-action.
These objects can be ideals in $R$, quotients of $R$ by an ideal, $R$-modules
or the terms in a complex of free $R$-modules.

The weights of the variables in the ring $R$  must be set a priori, using the
method setWeights.

The decomposition of a representation is described by means of a Tally, with
keys equal to some highest weights and values equal to the multiplicity of the
corresponding irreducible representations. Where more than one degree (resp.
homological dimension) is decomposed, the result is a hash table with keys
equal to the degrees (resp. homological dimensions) and values equal to the
corresponding decomposition.

All weights are expressed with respect to the basis of fundamental weights in
the associated weight lattice. Each weight $w$ is represented by a list of
integers, namely the coefficients of $w$ in the basis of fundamental weights.

See also
========

  * setWeights -- attach (Lie theoretic) weights to the
    variables of a ring

Ways to use highestWeightsDecomposition :
=========================================

  * "highestWeightsDecomposition(ChainComplex)" -- see
    highestWeightsDecomposition(ChainComplex,ZZ,List),
    -- decompose an
    equivariant complex of graded free modules
  * highestWeightsDecomposition(ChainComplex,ZZ,List)
    -- decompose an
    equivariant complex of graded free modules
  * highestWeightsDecomposition(Ideal,List)
    -- decompose an ideal with a
    semisimple Lie group action
  * "highestWeightsDecomposition(Ideal,ZZ)" -- see
    highestWeightsDecomposition(Ideal,List),
    -- decompose an ideal with a
    semisimple Lie group action
  * "highestWeightsDecomposition(Ideal,ZZ,ZZ)" -- see
    highestWeightsDecomposition(Ideal,List),
    -- decompose an ideal with a
    semisimple Lie group action
  * highestWeightsDecomposition(Module,List,List)
    -- decompose a
    module with a semisimple Lie group action
  * "highestWeightsDecomposition(Module,ZZ,List)" -- see
    highestWeightsDecomposition(Module,List,List),
    -- decompose a
    module with a semisimple Lie group action
  * "highestWeightsDecomposition(Module,ZZ,ZZ,List)" -- see
    highestWeightsDecomposition(Module,List,List),
    -- decompose a
    module with a semisimple Lie group action
  * highestWeightsDecomposition(Ring,List)
    -- decompose a ring with a
    semisimple Lie group action
  * "highestWeightsDecomposition(Ring,ZZ)" -- see
    highestWeightsDecomposition(Ring,List),
    -- decompose a ring with a
    semisimple Lie group action
  * "highestWeightsDecomposition(Ring,ZZ,ZZ)" -- see
    highestWeightsDecomposition(Ring,List),
    -- decompose a ring with a
    semisimple Lie group action

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

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

highestWeightsDecomposition(...,Range=>...) -- decompose only part of a complex
*******************************************************************************

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

Restrict the range of a complex to be decomposed into highest weight modules.
Set this argument to {lo,hi} to restrict to homological dimensions from lo to
hi.

Further information
===================

  * Default value: {-infinity, infinity}
  * Function: highestWeightsDecomposition,
    -- irreducible decomposition of a complex, ring, ideal or module
  * Option key: Range, -- decompose only part of a complex

Caveat
======

This argument is not used when decomposing rings, ideals or modules but only
with complexes.

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

Functions with optional argument named Range :
==============================================

  * highestWeightsDecomposition(...,Range=>...)
    -- decompose
    only part of a complex

highestWeightsDecomposition(ChainComplex,ZZ,List) -- decompose an equivariant complex of graded free modules
************************************************************************************************************

Synopsis
========

  * Function: highestWeightsDecomposition,
  * Usage:
        highestWeightsDecomposition(C,i,W)
  * Inputs:
      * C, a chain complex (Macaulay2Doc), an equivariant
        minimal complex of graded free modules
      * i, an integer (Macaulay2Doc), the homological dimension of a
        module of C
      * W, a list (Macaulay2Doc), a table of weights for C_i
  * Optional inputs (Macaulay2Doc),:
      * Range,
        => a list (Macaulay2Doc), default value {-infinity,
        infinity}, decompose only part of C
  * Outputs:
      * H, a hash table (Macaulay2Doc), the decomposition of
        the modules of C

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

Let $G$ be a semisimple algebraic group which acts on a polynomial ring $R$
compatibly with the grading. Let $T\subseteq G$ be a maximal torus and assume
the variables in $R$ are weight vectors for the action of $T$.

Suppose C is a minimal $G$-equivariant complex of graded free $R$-modules.
Suppose the coordinate basis for the module C_i is a homogeneous basis of
weight vectors and the weight of the $j$-th basis vector is $w_j$.

Use this function to obtain the decomposition of the modules in C into highest
weight representations. The input is the complex C, the index i and the list of
weights $\{w_j\}$.

The output is a hash table with keys equal to the indices of the non zero
modules of C (within the selected range). The values are themselves hash tables
with keys equal to the degrees of the generators of the corresponding free
module. Finally the keys of the nested hash tables are tallies whose keys are
the highest weights of certain irreducible representations and those
representations.

In the following example, the polynomial ring R is the symmetric algebra over
$\mathbb{C}^3 \otimes \mathbb{C}^4$, with the natural action of $G = SL_3
(\mathbb{C}) \times SL_4 (\mathbb{C})$. The complex is the minimal free
resolution of the ideal of $2\times 2$ minors of a generic $3\times 4$ matrix.
We choose to provide the weights for the module in homological dimension zero,
so we input 0 for the second argument. The module in homological dimension zero
has rank one and $G$ acts trivially on it hence it has only one weight, the
zero weight.

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x_(1,1)..x_(3,4)];                                                 |
+-----------------------------------------------------------------------------+
|i2 : G=genericMatrix(R,4,3)                                                  |
|                                                                             |
|o2 = | x_(1,1) x_(2,1) x_(3,1) |                                             |
|     | x_(1,2) x_(2,2) x_(3,2) |                                             |
|     | x_(1,3) x_(2,3) x_(3,3) |                                             |
|     | x_(1,4) x_(2,4) x_(3,4) |                                             |
|                                                                             |
|             4       3                                                       |
|o2 : Matrix R  <--- R                                                        |
+-----------------------------------------------------------------------------+
|i3 : I=minors(2,G);                                                          |
|                                                                             |
|o3 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i4 : resI=res I                                                              |
|                                                                             |
|      1      18      52      60      34      12      3                       |
|o4 = R  <-- R   <-- R   <-- R   <-- R   <-- R   <-- R  <-- 0                 |
|                                                                             |
|     0      1       2       3       4       5       6      7                 |
|                                                                             |
|o4 : ChainComplex                                                            |
+-----------------------------------------------------------------------------+
|i5 : betti resI                                                              |
|                                                                             |
|            0  1  2  3  4  5 6                                               |
|o5 = total: 1 18 52 60 34 12 3                                               |
|         0: 1  .  .  .  .  . .                                               |
|         1: . 18 52 60 24  . .                                               |
|         2: .  .  .  . 10 12 3                                               |
|                                                                             |
|o5 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i6 : D=dynkinType{{"A",2},{"A",3}};                                          |
+-----------------------------------------------------------------------------+
|i7 : U={{1,0,1,0,0},{1,0,-1,1,0},{1,0,0,-1,1},{1,0,0,0,-1},{-1,1,1,0,0},{-1,1|
|-----------------------------------------------------------------------------|
|,-1,1,0},{-1,1,0,-1,1},{-1,1,0,0,-1},{0,-1,1,0,0},{0,-1,-1,1,0},{0,-1,0,-1,1 |
|-----------------------------------------------------------------------------|
|},{0,-1,0,0,-1}};                                                            |
+-----------------------------------------------------------------------------+
|i8 : setWeights(R,D,U)                                                       |
|                                                                             |
|o8 = Tally{{1, 0, 1, 0, 0} => 1}                                             |
|                                                                             |
|o8 : Tally                                                                   |
+-----------------------------------------------------------------------------+
|i9 : highestWeightsDecomposition(resI,0,{{0,0,0,0,0}})                       |
|                                                                             |
|o9 = HashTable{0 => HashTable{{0} => Tally{{0, 0, 0, 0, 0} => 1}}}           |
|               1 => HashTable{{2} => Tally{{0, 1, 0, 1, 0} => 1}}            |
|               2 => HashTable{{3} => Tally{{0, 0, 1, 1, 0} => 1}}            |
|                                           {1, 1, 0, 0, 1} => 1              |
|               3 => HashTable{{4} => Tally{{1, 0, 1, 0, 1} => 1}}            |
|                                           {2, 1, 0, 0, 0} => 1              |
|               4 => HashTable{{5} => Tally{{2, 0, 1, 0, 0} => 1}}            |
|                              {6} => Tally{{0, 0, 0, 0, 2} => 1}             |
|               5 => HashTable{{7} => Tally{{1, 0, 0, 0, 1} => 1}}            |
|               6 => HashTable{{8} => Tally{{0, 1, 0, 0, 0} => 1}}            |
|                                                                             |
|o9 : HashTable                                                               |
+-----------------------------------------------------------------------------+

This shows, for example, that the third module in the complex decomposes as
$\mathbb{C}^3\otimes S_{2,1,1} \mathbb{C}^4 \oplus S_{3,1}\mathbb{C}^3$
generated in degree 4. Similarly, the fourth module decomposes as $S_2
\mathbb{C}^3 \otimes \mathbb{C}^4$ in degree 5 and $S_{2,2,2} \mathbb{C}^4$ in
degree 6. Here $S_\lambda$ denotes the Schur functor corresponding to the
partition $\lambda$.

To obtain only a partial decomposition, we may use the optional argument
Range.

+--------------------------------------------------------------------+
|i10 : highestWeightsDecomposition(resI,0,{{0,0,0,0,0}},Range=>{0,2})|
|                                                                    |
|o10 = HashTable{0 => HashTable{{0} => Tally{{0, 0, 0, 0, 0} => 1}}} |
|                1 => HashTable{{2} => Tally{{0, 1, 0, 1, 0} => 1}}  |
|                2 => HashTable{{3} => Tally{{0, 0, 1, 1, 0} => 1}}  |
|                                            {1, 1, 0, 0, 1} => 1    |
|                                                                    |
|o10 : HashTable                                                     |
+--------------------------------------------------------------------+

When the first free module in the complex has rank one, as when resolving a
quotient of R, then the group $G$ acts trivially on it. Then we may use a
simplified version of the command with the complex as the only argument.

+-------------------------------------------------------------------+
|i11 : highestWeightsDecomposition(resI)                            |
|                                                                   |
|o11 = HashTable{0 => HashTable{{0} => Tally{{0, 0, 0, 0, 0} => 1}}}|
|                1 => HashTable{{2} => Tally{{0, 1, 0, 1, 0} => 1}} |
|                2 => HashTable{{3} => Tally{{0, 0, 1, 1, 0} => 1}} |
|                                            {1, 1, 0, 0, 1} => 1   |
|                3 => HashTable{{4} => Tally{{1, 0, 1, 0, 1} => 1}} |
|                                            {2, 1, 0, 0, 0} => 1   |
|                4 => HashTable{{5} => Tally{{2, 0, 1, 0, 0} => 1}} |
|                               {6} => Tally{{0, 0, 0, 0, 2} => 1}  |
|                5 => HashTable{{7} => Tally{{1, 0, 0, 0, 1} => 1}} |
|                6 => HashTable{{8} => Tally{{0, 1, 0, 0, 0} => 1}} |
|                                                                   |
|o11 : HashTable                                                    |
+-------------------------------------------------------------------+

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

  * "highestWeightsDecomposition(ChainComplex)"
  * highestWeightsDecomposition(ChainComplex,ZZ,List)
    -- decompose an
    equivariant complex of graded free modules

highestWeightsDecomposition(Ideal,List) -- decompose an ideal with a semisimple Lie group action
************************************************************************************************

Synopsis
========

  * Function: highestWeightsDecomposition,
  * Usage:
        highestWeightsDecomposition(I,L)
        highestWeightsDecomposition(I,deg)
        highestWeightsDecomposition(I,lo,hi)
  * Inputs:
      * I, an ideal (Macaulay2Doc), in a polynomial ring
      * L, a list (Macaulay2Doc), a multidegree
  * Optional inputs (Macaulay2Doc),:
      * Range,
        => ..., default value {-infinity, infinity}, decompose only part
        of a complex
  * Outputs:
      * T, a tally (Macaulay2Doc), the decomposition of I in
        degree L

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

Let $G$ be a semisimple algebraic group which acts on a polynomial ring $R$
compatibly with the grading. Let $T\subseteq G$ be a maximal torus and assume
the variables in $R$ are weight vectors for the action of $T$.

Suppose I is an ideal which is stable under the action of $G$.

Use this function to obtain the decomposition of a graded component of I. The
input is the ideal I and the (multi)degree of the graded component.

The output is a tally whose keys are the highest weights of certain irreducible
representations and whose values are the multiplicities of those
representations.

In the following example, the polynomial ring R is the symmetric algebra over
$\mathbb{C}^3 \otimes \mathbb{C}^4$, with the natural action of $G = SL_3
(\mathbb{C}) \times SL_4 (\mathbb{C})$. The ideal is generated by the $2\times
2$ minors of a generic $3\times 4$ matrix.

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x_(1,1)..x_(3,4)];                                                 |
+-----------------------------------------------------------------------------+
|i2 : G=genericMatrix(R,4,3)                                                  |
|                                                                             |
|o2 = | x_(1,1) x_(2,1) x_(3,1) |                                             |
|     | x_(1,2) x_(2,2) x_(3,2) |                                             |
|     | x_(1,3) x_(2,3) x_(3,3) |                                             |
|     | x_(1,4) x_(2,4) x_(3,4) |                                             |
|                                                                             |
|             4       3                                                       |
|o2 : Matrix R  <--- R                                                        |
+-----------------------------------------------------------------------------+
|i3 : I=minors(2,G);                                                          |
|                                                                             |
|o3 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i4 : D=dynkinType{{"A",2},{"A",3}};                                          |
+-----------------------------------------------------------------------------+
|i5 : U={{1,0,1,0,0},{1,0,-1,1,0},{1,0,0,-1,1},{1,0,0,0,-1},{-1,1,1,0,0},{-1,1|
|-----------------------------------------------------------------------------|
|,-1,1,0},{-1,1,0,-1,1},{-1,1,0,0,-1},{0,-1,1,0,0},{0,-1,-1,1,0},{0,-1,0,-1,1 |
|-----------------------------------------------------------------------------|
|},{0,-1,0,0,-1}};                                                            |
+-----------------------------------------------------------------------------+
|i6 : setWeights(R,D,U)                                                       |
|                                                                             |
|o6 = Tally{{1, 0, 1, 0, 0} => 1}                                             |
|                                                                             |
|o6 : Tally                                                                   |
+-----------------------------------------------------------------------------+
|i7 : highestWeightsDecomposition(I,{2})                                      |
|                                                                             |
|o7 = Tally{{0, 1, 0, 1, 0} => 1}                                             |
|                                                                             |
|o7 : Tally                                                                   |
+-----------------------------------------------------------------------------+

This shows that the component of I of degree 2 is the representation $S_{1,1}
\mathbb{C}^3 \otimes S_{1,1} \mathbb{C}^4$. Here $S_\lambda$ denotes the Schur
functor corresponding to the partition $\lambda$.

When the polynomial ring is $\mathbb{Z}$-graded the degree can be given as an
integer instead of a list. Moreover, in the $\mathbb{Z}$-graded case, one can
decompose a range of degrees all at once as illustrated below.

+------------------------------------------------+
|i8 : highestWeightsDecomposition(I,2)           |
|                                                |
|o8 = Tally{{0, 1, 0, 1, 0} => 1}                |
|                                                |
|o8 : Tally                                      |
+------------------------------------------------+
|i9 : highestWeightsDecomposition(I,0,4)         |
|                                                |
|o9 = HashTable{0 => Tally{}                    }|
|               1 => Tally{}                     |
|               2 => Tally{{0, 1, 0, 1, 0} => 1} |
|               3 => Tally{{0, 0, 0, 0, 1} => 1} |
|                          {1, 1, 1, 1, 0} => 1  |
|               4 => Tally{{0, 2, 0, 2, 0} => 1} |
|                          {1, 0, 1, 0, 1} => 1  |
|                          {2, 1, 2, 1, 0} => 1  |
|                                                |
|o9 : HashTable                                  |
+------------------------------------------------+

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

  * highestWeightsDecomposition(Ideal,List)
    -- decompose an ideal with a
    semisimple Lie group action
  * "highestWeightsDecomposition(Ideal,ZZ)"
  * "highestWeightsDecomposition(Ideal,ZZ,ZZ)"

highestWeightsDecomposition(Module,List,List) -- decompose a module with a semisimple Lie group action
******************************************************************************************************

Synopsis
========

  * Function: highestWeightsDecomposition,
  * Usage:
        highestWeightsDecomposition(M,L,W)
        highestWeightsDecomposition(M,deg,W)
        highestWeightsDecomposition(M,lo,hi,W)
  * Inputs:
      * M, a module (Macaulay2Doc), over a polynomial ring
      * L, a list (Macaulay2Doc), a multidegree
      * W, a list (Macaulay2Doc), a table of weights for the
        generators of M
  * Optional inputs (Macaulay2Doc),:
      * Range,
        => ..., default value {-infinity, infinity}, decompose only part
        of a complex
  * Outputs:
      * T, a tally (Macaulay2Doc), the decomposition of M in
        degree L

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

Let $G$ be a semisimple algebraic group which acts on a polynomial ring $R$
compatibly with the grading. Let $T\subseteq G$ be a maximal torus and assume
the variables in $R$ are weight vectors for the action of $T$.

Suppose M is a finitely generated module over $R$ which is stable under the
action of $G$. We assume that M was input in Macaulay2 using a specific
presentation $\phi : E\rightarrow F$, where $E$ and $F$ are graded free
$R$-modules of finite rank. Moreover assume the coordinate basis of $F$ is a
homogeneous basis of weight vectors for the action of $T$ and the weight of the
$j$-th basis vector is $w_j$.

Use this function to obtain the decomposition of a graded component of M. The
input consists of three parameter: the module M, the (multi)degree of the
graded component, and the list of weights $\{w_j\}$.

The output is a tally whose keys are the highest weights of certain irreducible
representations and whose values are the multiplicities of those
representations.

In the following example, the polynomial ring R is the symmetric algebra over
$\mathbb{C}^2 \otimes \mathbb{C}^4$, with the natural action of $G=SL_2
(\mathbb{C}) \times SL_4 (\mathbb{C})$. The map $\phi$ is the unique (up to
scalars) equivariant map $\mathbb{C}^4 \otimes R(-1) \rightarrow
(\mathbb{C}^2)^* \otimes R$. If $\{f_1,f_2\}$ and $\{e_1,e_2,e_3,e_4\}$ are the
coordinate bases of $\mathbb{C}^2$ and $\mathbb{C}^4$ respectively, then the
matrix of $\phi$ with respect to the bases $\{f_1^*,f_2^*\}$ and
$\{e_1,e_2,e_3,e_4\}$ is a generic matrix of indeterminates.

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x_(1,1)..x_(4,2)];                                                 |
+-----------------------------------------------------------------------------+
|i2 : D=dynkinType{{"A",1},{"A",3}};                                          |
+-----------------------------------------------------------------------------+
|i3 : U={{1,1,0,0},{-1,1,0,0},{1,-1,1,0},{-1,-1,1,0},{1,0,-1,1},{-1,0,-1,1},{1|
|-----------------------------------------------------------------------------|
|,0,0,-1},{-1,0,0,-1}};                                                       |
+-----------------------------------------------------------------------------+
|i4 : setWeights(R,D,U);                                                      |
+-----------------------------------------------------------------------------+
|i5 : G=genericMatrix(R,2,4);                                                 |
|                                                                             |
|             2       4                                                       |
|o5 : Matrix R  <--- R                                                        |
+-----------------------------------------------------------------------------+
|i6 : M=coker G                                                               |
|                                                                             |
|o6 = cokernel | x_(1,1) x_(2,1) x_(3,1) x_(4,1) |                            |
|              | x_(1,2) x_(2,2) x_(3,2) x_(4,2) |                            |
|                                                                             |
|                            2                                                |
|o6 : R-module, quotient of R                                                 |
+-----------------------------------------------------------------------------+
|i7 : highestWeightsDecomposition(M,{2},{{-1,0,0,0},{1,0,0,0}})               |
|                                                                             |
|o7 = Tally{{3, 2, 0, 0} => 1}                                                |
|                                                                             |
|o7 : Tally                                                                   |
+-----------------------------------------------------------------------------+

This shows that the component of M of degree 2 is the representation $S_3
\mathbb{C}^3 \otimes S_2 \mathbb{C}^4$. Here $S_\lambda$ denotes the Schur
functor corresponding to the partition $\lambda$.

When the polynomial ring is $\mathbb{Z}$-graded the degree can be given as an
integer instead of a list. Moreover, in the $\mathbb{Z}$-graded case, one can
decompose a range of degrees all at once as illustrated below.

+--------------------------------------------------------------+
|i8 : highestWeightsDecomposition(M,2,{{-1,0,0,0},{1,0,0,0}})  |
|                                                              |
|o8 = Tally{{3, 2, 0, 0} => 1}                                 |
|                                                              |
|o8 : Tally                                                    |
+--------------------------------------------------------------+
|i9 : highestWeightsDecomposition(M,0,4,{{-1,0,0,0},{1,0,0,0}})|
|                                                              |
|o9 = HashTable{0 => Tally{{1, 0, 0, 0} => 1}}                 |
|               1 => Tally{{2, 1, 0, 0} => 1}                  |
|               2 => Tally{{3, 2, 0, 0} => 1}                  |
|               3 => Tally{{4, 3, 0, 0} => 1}                  |
|               4 => Tally{{5, 4, 0, 0} => 1}                  |
|                                                              |
|o9 : HashTable                                                |
+--------------------------------------------------------------+

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

  * highestWeightsDecomposition(Module,List,List)
    -- decompose a
    module with a semisimple Lie group action
  * "highestWeightsDecomposition(Module,ZZ,List)"
  * "highestWeightsDecomposition(Module,ZZ,ZZ,List)"

highestWeightsDecomposition(Ring,List) -- decompose a ring with a semisimple Lie group action
*********************************************************************************************

Synopsis
========

  * Function: highestWeightsDecomposition,
  * Usage:
        highestWeightsDecomposition(Q,L)
        highestWeightsDecomposition(Q,deg)
        highestWeightsDecomposition(Q,lo,hi)
  * Inputs:
      * Q, a ring (Macaulay2Doc), a (quotient of a) polynomial ring
      * L, a list (Macaulay2Doc), a multidegree
  * Optional inputs (Macaulay2Doc),:
      * Range,
        => ..., default value {-infinity, infinity}, decompose only part
        of a complex
  * Outputs:
      * T, a tally (Macaulay2Doc), the decomposition of Q in
        degree L

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

Let $G$ be a semisimple algebraic group which acts on a polynomial ring $R$
compatibly with the grading. Let $T\subseteq G$ be a maximal torus and assume
the variables in $R$ are weight vectors for the action of $T$.

Suppose Q is a quotient of $R$ by an ideal which is stable under the action of
$G$.

Use this function to obtain the decomposition of a graded component of Q. The
input is the ring Q and the (multi)degree of the graded component.

The output is a tally whose keys are the highest weights of certain irreducible
representations and whose values are the multiplicities of those
representations.

In the following example, the polynomial ring $R$ is the symmetric algebra over
$\mathbb{C}^3 \otimes \mathbb{C}^4$, with the natural action of $G = SL_3
(\mathbb{C}) \times SL_4 (\mathbb{C})$. The ring is the quotient of $R$ by the
ideal generated by the $2\times 2$ minors of a generic $3\times 4$ matrix.

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x_(1,1)..x_(3,4)];                                                 |
+-----------------------------------------------------------------------------+
|i2 : G=genericMatrix(R,4,3)                                                  |
|                                                                             |
|o2 = | x_(1,1) x_(2,1) x_(3,1) |                                             |
|     | x_(1,2) x_(2,2) x_(3,2) |                                             |
|     | x_(1,3) x_(2,3) x_(3,3) |                                             |
|     | x_(1,4) x_(2,4) x_(3,4) |                                             |
|                                                                             |
|             4       3                                                       |
|o2 : Matrix R  <--- R                                                        |
+-----------------------------------------------------------------------------+
|i3 : I=minors(2,G);                                                          |
|                                                                             |
|o3 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i4 : Q=R/I;                                                                  |
+-----------------------------------------------------------------------------+
|i5 : D=dynkinType{{"A",2},{"A",3}};                                          |
+-----------------------------------------------------------------------------+
|i6 : U={{1,0,1,0,0},{1,0,-1,1,0},{1,0,0,-1,1},{1,0,0,0,-1},{-1,1,1,0,0},{-1,1|
|-----------------------------------------------------------------------------|
|,-1,1,0},{-1,1,0,-1,1},{-1,1,0,0,-1},{0,-1,1,0,0},{0,-1,-1,1,0},{0,-1,0,-1,1 |
|-----------------------------------------------------------------------------|
|},{0,-1,0,0,-1}};                                                            |
+-----------------------------------------------------------------------------+
|i7 : setWeights(R,D,U)                                                       |
|                                                                             |
|o7 = Tally{{1, 0, 1, 0, 0} => 1}                                             |
|                                                                             |
|o7 : Tally                                                                   |
+-----------------------------------------------------------------------------+
|i8 : highestWeightsDecomposition(Q,{2})                                      |
|                                                                             |
|o8 = Tally{{2, 0, 2, 0, 0} => 1}                                             |
|                                                                             |
|o8 : Tally                                                                   |
+-----------------------------------------------------------------------------+

This shows that the component of Q of degree 2 is the representation $S_2
\mathbb{C}^3 \otimes S_2 \mathbb{C}^4$. Here $S_\lambda$ denotes the Schur
functor corresponding to the partition $\lambda$.

When the ring Q is $\mathbb{Z}$-graded the degree can be given as an integer
instead of a list. Moreover, in the $\mathbb{Z}$-graded case, one can decompose
a range of degrees all at once as illustrated below.

+-------------------------------------------------+
|i9 : highestWeightsDecomposition(Q,2)            |
|                                                 |
|o9 = Tally{{2, 0, 2, 0, 0} => 1}                 |
|                                                 |
|o9 : Tally                                       |
+-------------------------------------------------+
|i10 : highestWeightsDecomposition(Q,0,4)         |
|                                                 |
|o10 = HashTable{0 => Tally{{0, 0, 0, 0, 0} => 1}}|
|                1 => Tally{{1, 0, 1, 0, 0} => 1} |
|                2 => Tally{{2, 0, 2, 0, 0} => 1} |
|                3 => Tally{{3, 0, 3, 0, 0} => 1} |
|                4 => Tally{{4, 0, 4, 0, 0} => 1} |
|                                                 |
|o10 : HashTable                                  |
+-------------------------------------------------+

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

  * highestWeightsDecomposition(Ring,List)
    -- decompose a ring with a
    semisimple Lie group action
  * "highestWeightsDecomposition(Ring,ZZ)"
  * "highestWeightsDecomposition(Ring,ZZ,ZZ)"

LeadingTermTest -- check the columns of the input matrix for repeated leading terms
***********************************************************************************

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

The method propagateWeights tests whether the input map is represented by a
matrix whose columns have all different leading terms. Set this argument to
false to bypass this test.

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

Functions with optional argument named LeadingTermTest :
========================================================

  * propagateWeights(...,LeadingTermTest=>...)
    -- check the
    columns of the input matrix for repeated leading terms

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

The object LeadingTermTest, is a symbol (Macaulay2Doc).

LieWeights -- stores the (Lie theoretic) weights of the variables of a ring
***************************************************************************

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

A key in the hash table of a ring which is used to store the (Lie theoretic)
weights of the variables of the ring. Set this using the setWeights,
command.

See also
========

  * setWeights -- attach (Lie theoretic) weights to the
    variables of a ring

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

The object LieWeights, is a symbol (Macaulay2Doc).

MinimalityTest -- check that the input map is minimal
*****************************************************

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

The method propagateWeights tests whether the input is a minimal map (i.e., a
minimal presentation of its cokernel). Set this argument to false to bypass
this test.

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

Functions with optional argument named MinimalityTest :
=======================================================

  * propagateWeights(...,MinimalityTest=>...)
    -- check that
    the input map is minimal

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

The object MinimalityTest, is a symbol (Macaulay2Doc).

propagateWeights -- propagate (Lie theoretic) weights along equivariant maps
****************************************************************************

Synopsis
========

  * Optional inputs (Macaulay2Doc),:
      * Forward, =>
        ..., default value false, propagate weights from domain to codomain
      * LeadingTermTest,
        => ...,
        default value true, check the columns of the input matrix for repeated
        leading terms
      * MinimalityTest,
        => ..., default value true, check that the input map is
        minimal

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

Let $T$ be a torus which acts on a polynomial ring compatibly with the grading.
Assume the variables in the ring are weight vectors for the action of $T$.

Use this method on a $T$-equivariant map of graded free modules, to obtain the
weights of the domain from the weights of the codomain (or vice-versa).

The weights of the variables in the ring must be set a priori, using the method
setWeights.

This method is called by other methods in this package. The only reason for
using this method directly is that it returns a complete list of weights for
the domain (resp. codomain) of an equivariant map, instead of the highest
weights decomposition.

This method implements an algorithm introduced in Galetto - Propagating weights
of tori along free resolutions (see http://dx.doi.org/10.1016/j.jsc.2015.05.004
).

See also
========

  * setWeights -- attach (Lie theoretic) weights to the
    variables of a ring

Ways to use propagateWeights :
==============================

  * propagateWeights(Matrix,List),
    -- propagate (Lie theoretic) weights along an equivariant map of graded
    free modules

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

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

propagateWeights(...,Forward=>...) -- propagate weights from domain to codomain
*******************************************************************************

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

Set this argument to true to ensure weights are propagated forward along a map
of graded free modules, i.e., from domain to the codomain of the map. The
default setting is false meaning that weights are propagated backwards, i.e.,
from codomain to domain.

Further information
===================

  * Default value: false (Macaulay2Doc),
  * Function: propagateWeights, -- propagate (Lie
    theoretic) weights along equivariant maps
  * Option key: Forward, -- propagate weights from domain to
    codomain

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

Functions with optional argument named Forward :
================================================

  * propagateWeights(...,Forward=>...)
    -- propagate weights
    from domain to codomain

propagateWeights(...,LeadingTermTest=>...) -- check the columns of the input matrix for repeated leading terms
**************************************************************************************************************

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

The method propagateWeights tests whether the input map is represented by a
matrix whose columns have all different leading terms. Set this argument to
false to bypass this test.

Further information
===================

  * Default value: true (Macaulay2Doc),
  * Function: propagateWeights, -- propagate (Lie
    theoretic) weights along equivariant maps
  * Option key: LeadingTermTest, -- check the columns of
    the input matrix for repeated leading terms

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

Functions with optional argument named LeadingTermTest :
========================================================

  * propagateWeights(...,LeadingTermTest=>...)
    -- check the
    columns of the input matrix for repeated leading terms

propagateWeights(...,MinimalityTest=>...) -- check that the input map is minimal
********************************************************************************

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

The method propagateWeights tests whether the input is a minimal map (i.e., a
minimal presentation of its cokernel). Set this argument to false to bypass
this test.

Further information
===================

  * Default value: true (Macaulay2Doc),
  * Function: propagateWeights, -- propagate (Lie
    theoretic) weights along equivariant maps
  * Option key: MinimalityTest, -- check that the input
    map is minimal

See also
========

  * propagateWeights -- propagate (Lie theoretic)
    weights along equivariant maps

Functions with optional argument named MinimalityTest :
=======================================================

  * propagateWeights(...,MinimalityTest=>...)
    -- check that
    the input map is minimal

propagateWeights(Matrix,List) -- propagate (Lie theoretic) weights along an equivariant map of graded free modules
******************************************************************************************************************

Synopsis
========

  * Function: propagateWeights,
  * Usage:
        (V,C) = propagateWeights(M,W)
  * Inputs:
      * M, a matrix (Macaulay2Doc), an equivariant minimal
        homogeneous map of graded free modules
      * W, a list (Macaulay2Doc), a table of weights for the
        codomain (resp. domain) of M
  * Optional inputs (Macaulay2Doc),:
      * Forward, =>
        a Boolean value (Macaulay2Doc), default value false,
        propagate weights to domain (when false) or codomain (when true)
      * MinimalityTest,
        => a Boolean value (Macaulay2Doc), default
        value true, check whether M is a minimal map
      * LeadingTermTest,
        => a
        Boolean value (Macaulay2Doc), default value true, check
        whether the leading terms of the columns of M are all distinct
  * Outputs:
      * V, a list (Macaulay2Doc), a table of weights for the domain
        (resp. codomain) of M
      * C, a matrix (Macaulay2Doc), a change of basis so that the
        columns of M*inverse(C) have different leading terms

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

Let $\phi:E\rightarrow F$ be a homogeneous map of graded free modules. Fix a
homogeneous basis $\{e_i\}$ of $E$ and assume $\phi$ is minimal, in the sense
that $\{\phi (e_i)\}$ is a minimal set of generators of the image of $\phi$.
Moreover, suppose $\phi$ is equivariant for the action of an algebraic torus
and fix a homogeneous basis of weight vectors $\{f_j\}$ of $F$. Use this
function to recover the weights of the domain $E$ from the weights of the
codomain $F$ (or vice-versa, setting the optional input Forward,
to true.).

The input consists of M, the matrix of $\phi$ with respect to the bases
$\{e_i\}$ and $\{f_j\}$, together with W, a list of weights $\{w_j\}$ such that
$w_j$ is the weight of $f_j$.

If the optional argument LeadingTermTest, is true (and
it is by default), a new homogeneous basis $\{e_i'\}$ for $E$ is computed. The
change of basis from $\{e_i\}$ to $\{e_i'\}$, given by the matrix C, is chosen
so that the columns of the matrix M*inverse(C) have all different leading
terms. This is a sufficient condition for the algorithm to work. The matrix C
is part of the output. The user can choose to avoid this change of basis by
setting this optional argument to false; then C is taken to be the identity
matrix.

The output V is a list of weights $\{v_i\}$ such that there is a basis of
homogeneous weight vectors $\{e_i''\}$ of $E$, with $v_i$ the weight of
$e_i''$. Notice that the change of basis from $\{e_i\}$ to $\{e_i''\}$ is not
returned.

This method implements an algorithm introduced in Galetto - Propagating weights
of tori along free resolutions (see http://dx.doi.org/10.1016/j.jsc.2015.05.004
).

In the following example, the polynomial ring R is the symmetric algebra over
$\mathbb{C}^2 \otimes \mathbb{C}^4$, with the natural action of $SL_2
(\mathbb{C}) \times SL_4 (\mathbb{C})$. The map $\phi$ is the unique (up to
scalars) equivariant map $\mathbb{C}^4 \otimes R(-1) \rightarrow
(\mathbb{C}^2)^* \otimes R$. If $\{f_1,f_2\}$ and $\{e_1,e_2,e_3,e_4\}$ are the
coordinate bases of $\mathbb{C}^2$ and $\mathbb{C}^4$ respectively, then M is
the matrix of $\phi$ with respect to the bases $\{f_1^*,f_2^*\}$ and
$\{e_1,e_1+e_2,e_3,e_4\}$.

+-----------------------------------------------------------------------------+
|i1 : R=QQ[x_(1,1)..x_(2,4)];                                                 |
+-----------------------------------------------------------------------------+
|i2 : D=dynkinType{{"A",1},{"A",3}};                                          |
+-----------------------------------------------------------------------------+
|i3 : U={{1,1,0,0},{1,-1,1,0},{1,0,-1,1},{1,0,0,-1},{-1,1,0,0},{-1,-1,1,0},{-1|
|-----------------------------------------------------------------------------|
|,0,-1,1},{-1,0,0,-1}};                                                       |
+-----------------------------------------------------------------------------+
|i4 : setWeights(R,D,U);                                                      |
+-----------------------------------------------------------------------------+
|i5 : M=map(R^2,R^{4:-1},{{x_(1,1),x_(1,1)+x_(1,2),x_(1,3),x_(1,4)},{x_(2,1),x|
|                                                                             |
|o5 = | x_(1,1) x_(1,1)+x_(1,2) x_(1,3) x_(1,4) |                             |
|     | x_(2,1) x_(2,1)+x_(2,2) x_(2,3) x_(2,4) |                             |
|                                                                             |
|             2       4                                                       |
|o5 : Matrix R  <--- R                                                        |
|-----------------------------------------------------------------------------|
|_(2,2)+x_(2,1),x_(2,3),x_(2,4)}})                                            |
+-----------------------------------------------------------------------------+
|i6 : (V,C)=propagateWeights(M,{{-1,0,0,0},{1,0,0,0}});                       |
+-----------------------------------------------------------------------------+
|i7 : V                                                                       |
|                                                                             |
|o7 = {{0, 0, 0, -1}, {0, 0, -1, 1}, {0, -1, 1, 0}, {0, 1, 0, 0}}             |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : C                                                                       |
|                                                                             |
|o8 = {1} | 0 0 0 1 |                                                         |
|     {1} | 0 0 1 0 |                                                         |
|     {1} | 0 1 0 0 |                                                         |
|     {1} | 1 1 0 0 |                                                         |
|                                                                             |
|             4       4                                                       |
|o8 : Matrix R  <--- R                                                        |
+-----------------------------------------------------------------------------+
|i9 : M*inverse(C)                                                            |
|                                                                             |
|o9 = | x_(1,4) x_(1,3) x_(1,2) x_(1,1) |                                     |
|     | x_(2,4) x_(2,3) x_(2,2) x_(2,1) |                                     |
|                                                                             |
|             2       4                                                       |
|o9 : Matrix R  <--- R                                                        |
+-----------------------------------------------------------------------------+

While the first and second columns of M have the same leading terms, all the
columns of M*inverse(C) have different leading terms. The weights in V are in
order the weights of $e_4$, $e_3$, $e_2$ and $e_1$.

A list of weights obtained using this method can be decomposed into highest
weights using the function decomposeWeightsList.

Caveat
======

This function does not check that M is an equivariant map. When used on a map
that is not equivariant, this function will produce meaningless results.

See also
========

  * decomposeWeightsList -- decompose a list of
    weights into highest weights

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

  * propagateWeights(Matrix,List),
    -- propagate (Lie theoretic) weights along an equivariant map of graded
    free modules

Range -- decompose only part of a complex
*****************************************

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

Restrict the range of a complex to be decomposed into highest weight modules.
Set this argument to {lo,hi} to restrict to homological dimensions from lo to
hi.

Caveat
======

This argument is not used when decomposing rings, ideals or modules but only
with complexes.

See also
========

  * highestWeightsDecomposition, --
    irreducible decomposition of a complex, ring, ideal or module

Functions with optional argument named Range :
==============================================

  * highestWeightsDecomposition(...,Range=>...)
    -- decompose
    only part of a complex

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

The object Range, is a symbol (Macaulay2Doc).

setWeights -- attach (Lie theoretic) weights to the variables of a ring
***********************************************************************

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

Use this method to assign weights to the variables of a polynomial ring.

See also
========

  * getWeights -- retrieve the (Lie theoretic) weight of a
    monomial

Ways to use setWeights :
========================

  * setWeights(PolynomialRing,DynkinType,List)
    -- attach (Lie
    theoretic) weights to the variables of a ring

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

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

setWeights(PolynomialRing,DynkinType,List) -- attach (Lie theoretic) weights to the variables of a ring
*******************************************************************************************************

Synopsis
========

  * Function: setWeights,
  * Usage:
        T = setWeights(R,D,L)
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc),
      * D, an instance of the type DynkinType (WeylGroups),
      * L, a list (Macaulay2Doc), a table of weights given as lists
        of integers
  * Outputs:
      * T, a tally (Macaulay2Doc), the highest weights
        decomposition of L
  * Consequences:
      * Two keys are created in the hashTable of R: LieWeights, with value a
        matrix whose rows are the weights in the list L; GroupActing, with
        value the DynkinType D.

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

Let $G$ be a semisimple Lie group of Dynkin type D which acts on R compatibly
with the grading. Let $T\subset G$ be a maximal torus and assume the variables
in R are weight vectors for the action of $T$. This function is used to assign
a weight to each  variable of R. Knowing these weights allows Macaulay2 to
return the weight of monomials of R upon request.

For more information on inputting the Dynkin type of the group the user should
consult the documentation of the WeylGroups package.

Weights are expressed with respect to the basis of fundamental weights in the
weight lattice associated to the root system of the given type D. In this
package, each weight $w$ is represented by a list of integers, namely the
coefficients of $w$ in the basis of fundamental weights.

In the following example, the polynomial ring R is the symmetric algebra over
$V$, where $V=\mathbb{C}^4$ and is acted upon by the group $SL_4 (\mathbb{C})$.

+----------------------------------------------------+
|i1 : R=QQ[x_1..x_4]                                 |
|                                                    |
|o1 = R                                              |
|                                                    |
|o1 : PolynomialRing                                 |
+----------------------------------------------------+
|i2 : D=dynkinType{{"A",3}}                          |
|                                                    |
|o2 = DynkinType{{A, 3}}                             |
|                                                    |
|o2 : DynkinType                                     |
+----------------------------------------------------+
|i3 : W={{1,0,0},{-1,1,0},{0,-1,1},{0,0,-1}}         |
|                                                    |
|o3 = {{1, 0, 0}, {-1, 1, 0}, {0, -1, 1}, {0, 0, -1}}|
|                                                    |
|o3 : List                                           |
+----------------------------------------------------+
|i4 : setWeights(R,D,W)                              |
|                                                    |
|o4 = Tally{{1, 0, 0} => 1}                          |
|                                                    |
|o4 : Tally                                          |
+----------------------------------------------------+

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

  * setWeights(PolynomialRing,DynkinType,List)
    -- attach (Lie
    theoretic) weights to the variables of a ring