| Karim BELABAS on Fri, 19 Nov 1999 16:02:31 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: relative number fields |
[Annegret Weng:]
> I am using the Pari-Library and I would like to create a relative number
> field by using the function rnfinitalg. But I always get a run time error.
>
> First I created a number field nf with the function nfinit0 and with a
> polynomial in # (say for example #^2+5). Then I created an object of type
> polmod (e.g. 3*#+2). Finally I called rnfinitalg with the parameters nf,
> a polynomial in x having as coefficients objects of type polmod and
> prec=3. At the end I got the error message "type mod I forbidden in gmod".
> What did I do wrong?
MAXVARN (#) is better left to PARI internals [ this should be stressed in the
manual, and checked in the library functions ].
long prec = DEFAULTPREC;
long vx = 0;
long vy = fetch_user_var("y"); /* > vx */
GEN x = polx[vx];
GEN y = polx[vy];
GEN pol = gaddsg(5, gsqr(y));
GEN nf = nfinit0(pol, 0, prec);
GEN a = gmodulcp( gaddsg(2, gmulsg(3,y)), pol );
GEN polrel = gsub(gsqr(x), a); /* for instance... */
GEN relnf = rnfinitalg(nf, polrel, prec);
[ if you need temporary variables, it's safer to use fetch_var()/delete_var() ]
Cheers,
Karim.
__
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://hasse.mathematik.tu-muenchen.de/ntsw/pari/