up previous next
IsHomog

test whether given polynomials are homogeneous

Syntax
IsHomog(F: RINGELEM|MODULEELEM): BOOL
IsHomog(L: LIST): BOOL
IsHomog(I: IDEAL|MODULE): BOOL

Description
The first form of this function returns True if F is homogeneous. The second form returns True if every element of L is homogeneous. Otherwise, they return False. The third form returns True if the ideal/module can be generated by homogeneous elements, and False if not. Homogeneity is with respect to the first row of the weights matrix.

NOTE: when the grading dimension is 0 everything is trivially true. For safety reasons (from version 5.0.3) IsHomog throws an error in this case, e.g. IsHomog(x-1) gives error instead of a possibly misleading true .

Example
/**/  Use R ::= QQ[x,y];
/**/  IsHomog(x^2-x*y);
true

/**/  IsHomog(x-y^2);
false

/**/  IsHomog([x^2-x*y, x-y^2]);
false

/**/  R := NewPolyRing(QQ, "x,y", mat([[2,3],[1,2]]), 1);
/**/  Use R;
/**/  IsHomog(x^3*y^2+y^4);
true

/**/  R := NewPolyRing(QQ, "x,y", mat([[2,3],[1,2]]), 2);
/**/  Use R;
/**/  IsHomog(x^3*y^2+y^4);
false

/**/  Use R ::= QQ[x,y];
/**/  IsHomog(ideal(x^2+y,y));
true

/**/  Use R ::= QQ[x,y], Lex;  -- note: GradingDim = 0
-- /**/  IsHomog(x-1); -- !!! ERROR !!! instead of "true"

See Also