Paul van Wamelen on Sun, 21 Feb 99 15:32:00 -0600


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

idealval bug?


Dear Pari Developers,

I believe the following reveals a bug in 2.0.13:

Do:
  bnf = nfinit(polcyclo(3));
  PPs = idealprimedec(bnf,883);
  P = PPs[1]; /* [883, [-337, 1]~, 1, 1, [338, 1]~] */
  a = Mod(-540*(x-1),bnf.pol);
  d = a^((883-1)/2);
then both
  idealval(bnf,d-Mod(1,bnf.pol),P)
and
  idealval(bnf,d-Mod(-1,bnf.pol),P)
give 0. One (and only one) should be > 0, because either a is a square
mod P or not.

Doing
  PPs = idealprimedec(bnf,751);
  a = Mod(-216*(x-1),bnf.pol);
also give two 0 idealvals. Many other examples work fine.

This occurs in
                   GP/PARI CALCULATOR Version 2.0.13 (alpha)
           Sparc running nextstep (C portable kernel) 32-bit version
and
                   GP/PARI CALCULATOR Version 2.0.13 (alpha)
                 UltraSparc (MicroSparc kernel) 32-bit version

but not in 2.0.9 or 2.0.11 (where idealval(bnf,d-Mod(-1,bnf.pol),P)
gives 1 in the first example). Also in these older versions PPs[1] and
PPs[2] are reversed so in fact P should be PPs[2].

By the way, the more intelligent:
  bnf = nfinit(polcyclo(3));
  PPs = idealprimedec(bnf,883);
  P = PPs[1];
  a = Mod(-540*(x-1),bnf.pol);
  d = lift(lift((Mod(1,883)*a)^((883-1)/2)));
  d = Mod(d,bnf.pol);
does work:
  idealval(bnf,d-Mod(-1,bnf.pol),P)
gives 1 and
  idealval(bnf,d-Mod(1,bnf.pol),P)
gives 0.

Keep up the good work!
Paul van Wamelen.