diagonalAction(W, R), diagonalAction(W, d, R), diagonalAction(W1, W2, d, R)
Use this function to set up a diagonal action of a group $(k^*)^r \times \mathbb{Z}/d_1 \times \cdots \times \mathbb{Z}/d_g$ on a polynomial ring $R = k[x_1,\ldots,x_n]$ over a field. Saying the action is diagonal means that $(t_1,\ldots,t_r) \in (k^*)^r$ acts by $$(t_1,\ldots,t_r) \cdot x_j = t_1^{w_{1,j}}\cdots t_r^{w_{r,j}} x_j$$ for some integers $w_{i,j}$ and the generators $u_1, \dots, u_g$ of the cyclic abelian factors act by $$u_i \cdot x_j = \zeta_i^{w_{r+i,j}} x_j$$ for $\zeta_i$ a primitive $d_i$th root of unity. The integers $w_{i,j}$ comprise the weight matrix W. In other words, the $j$ th column of W is the weight vector of $x_j$.
The following example defines an action of a twodimensional torus on a fourdimensional vector space with a basis of weight vectors whose weights are the columns of the input matrix.



Here is an example of a product of two cyclic groups of order 3 acting on a threedimensional vector space:




The object diagonalAction is a method function.