Karim BELABAS on Mon, 16 Nov 1998 13:58:44 +0100 (MET)


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

Re: idealred returns ideal with different norm


[Peter-Lawrence Montgomery:]
> /*
>          A monic polynomial with (otherwise) big coefficients is passed 
> to nfinit.  We raise a prime ideal of norm 2 to a power around 500, 
> expecting a matrix with all entries below 2^500.  
> Instead the Pari stack overflows if I use idealpow with last
> argument 0 (no reduction, default).  
> If I pass last argument 1 (reduction), it reduces the ideal in the class group.
> How do I tell idealpow to do Hermite reduction after each squaring?
> */

I guess this qualifies as a bug. After the following patch (reduce immediately
modulo the ideal norm, don't wait for HNF to do it for you), everything works
with the default stack (and default arguments to idealpow).

Karim.

*** src/basemath/alglin2.c.orig Fri Nov  6 16:07:58 1998
--- src/basemath/alglin2.c      Mon Nov 16 13:50:13 1998
***************
*** 1164,1169 ****
--- 1164,1170 ----
    {
      /* concatenate dm * Id to x */
      x = concatsp(x, idmat_intern(li-1,dm,gzero));
+     for (i=1; i<co; i++) x[i] = lmod((GEN)x[i], dm);
      co += li-1;
    }
    def=co-1; ldef=0;

--
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://pari.home.ml.org