This finds the degree of each vector field. When given a Matrix, the function checks the degree of each column. When given a Module, the function checks the degree of each generator.
In a coordinate system x1,...,xn with xi having degree ki, each ∂xi has degree -ki. Hence, a non-zero vector field ∑i fi∂xi has degree d if and only if for each i, fi is either 0 or weighted homogeneous of degree d+ki. The zero vector field has degree -∞.
i1 : R=QQ[x,y]; |
i2 : M=matrix {{x^2,1,0,x^2,x*y},{y^2,0,0,y^4,y^2}}
o2 = | x2 1 0 x2 xy |
| y2 0 0 y4 y2 |
2 5
o2 : Matrix R <--- R
|
i3 : homogeneousVectorFieldDegree(M)
o3 = {{1}, {-1}, -infinity, false, {1}}
o3 : List
|
i4 : homogeneousVectorFieldDegree(image M)
o4 = {{1}, {-1}, -infinity, false, {1}}
o4 : List
|
We also handle non-standard degrees:
i5 : R=QQ[x,y,Degrees=>{{3},{1}}];
|
i6 : M=matrix {{x^2,1,0,x^2,x*y},{y^2,0,0,y^4,y^2}}
o6 = | x2 1 0 x2 xy |
| y2 0 0 y4 y2 |
2 5
o6 : Matrix R <--- R
|
i7 : homogeneousVectorFieldDegree(M)
o7 = {false, {-3}, -infinity, {3}, {1}}
o7 : List
|
and multidegrees:
i8 : R=QQ[x,y,Degrees=>{{3,1},{1,1}}];
|
i9 : M=matrix {{x^2,1,0,x^2,x*y},{y^2,0,0,y^4,y^2}}
o9 = | x2 1 0 x2 xy |
| y2 0 0 y4 y2 |
2 5
o9 : Matrix R <--- R
|
i10 : homogeneousVectorFieldDegree(M)
o10 = {false, {-3, -1}, -infinity, false, {1, 1}}
o10 : List
|