weights D
Use this function to recover the weight matrix of a diagonal action on a polynomial ring. For a diagonal action on a polynomial ring $k[x_1, \dots, x_n]$ , the $j$ th column of the weight matrix is the weight of the variable $x_j$ .
The following example defines an action of a twodimensional torus on a polynomial ring in four variables.




Here is an example of a product of two cyclic groups of order 3 acting on a polynomial ring in 3 variables.





The object weights is a method function.