How to get the coefficient of the constant part of a multivariate polynomial in MAGMA?

206 Views Asked by At

In the MAGMA software package, given a multivariate polynomial $f$ in some polynomial ring , how do we get its constant part?

For univariate polynomials the method ConstantCoefficient(f) returns (you guessed it) the constant coefficient. But this method does not exist for multivariate polynomials.

I can use the Evaluate method to find the constant part of the polynomial, but this seems wastefull.

Needless to say, I am very new to the MAGMA Software, any help is appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

You can write your own function to do this; try

function CCoeff(f)
    return (f eq 0) select 0 else ((TrailingTerm(f) in R) select TrailingTerm(f) else 0);
end function;