Karim Belabas on Tue, 16 Jun 2009 00:44:36 +0200


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

Re: idealadd() details


* Jeroen Demeyer [2009-06-15 16:53]:
> I have a question about idealadd().  Either I'm misunderstanding something, 
> or the implementation is wrong, or the documentation is wrong.
>
> Consider the following:
> gp> idealadd(nfinit(t^2+1), [1,0;0,2], [1,0;0,2])
> %20 =
> [1 0]
>
> [0 1]
>
> Here I expected to get [1,0;0,2] as a result, since the documentation 
> states it just adds Z-modules.  Of course, as ideals, the answer is 
> correct.

The documentation is wrong. The following sentence should be deleted :

"When x and y are given by  Z-bases,   this does not depend on nf and can be
used to compute the sum of any two Z-modules. The result is given in HNF."

N.B. A long time ago, "arbitrary" Z-modules could be input as ideals.
PARI routines were supposed to first replace them by the O_K-module they
generated. A few actually did that (in an incorrect way, iff the input matrix
wasn't square), most broke in silly ways. The current documentation now
imposes an HNF matrix (see section 3.6.2).


Use mathnf(concat(A,B)) to compute the direct sum of (free) Z-modules.

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`