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$.