Bill Allombert on Sat, 31 Aug 2002 10:25:21 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: multivariable polynomials |
On Tue, Aug 20, 2002 at 06:30:52PM -0400, Siman Wong wrote: > Hi, > > I'm using pari-2.1.4 to work with two-variable polynomials, and I got a > strange result: > > ? f = x^5 - y^234*x^2 - 3*y^7 > %1 = x^5 - y^234*x^2 - 3*y^7 > ? f % (x^3-1) > %2 = (-y^234 + 1)*x^2 - 3*y^7 > ? f % (y^3-1) > %3 = 0 > > In order words, I cannot "mod y" ! Is that because pari can only hand > polynomials with x as the variable? GP knows only Euclidean division for polynomial over a field. Since y has lower priority than x, GP make the computation in the field Q(y)[x], in which (y^3-1) is a unit, so f % (y^3-1) is 0. If you want to work in the field Q(x)[y] instead, you can replace x with a variable having higher priority than y, say z. ? subst(f,x,z)%(y^3-1) %4 = -3*y + (z^5 - z^2) To explicitly state that you want to apply '%(y^3-1)' to all coefficients of f as a polynomial in x, do: ? lift(f*Mod(1,y^3-1)) %5 = x^5 - x^2 - 3*y which work independently of the priorities of x and y. Note that it is very different from ? lift(Mod(f,y^3-1)) %6 = 0 Please see ??"Multivariate objects"@4 The documentation has been extended in the development version GP 2.2.4. Cheers, Bill.