Karim Belabas on Sun, 15 Nov 2009 03:09:38 +0100

 Re: Difference between libpari and gp for idealprimedec

> I consider the field Q(a) where a is a root of x^+x+1.
> I try to find the composition of 11 in the ring of integers de Q(a).
>
> With gp, I obtain two prime ideals above 11:
> ? field=nfinit(x^3+x+1)
> %1 = [x^3 + x + 1, [1, 1], -31, 1, [[1,
> 1.465571231876768026656731225, -0.6823278038280193273694837397; 1,
> -0.2327856159383840133283656126 + 0.7925519925154478483258983007*I,
> 0.3411639019140096636847418699 + 1.161541399997251936087917687*I],
> [1, 1.465571231876768026656731225, -0.6823278038280193273694837397;
> 1, 0.5597663765770638349975326880, 1.502705301911261599772659557; 1,
> -1.025337608453831861654263913, -0.8203774980832422724031758174], 0,
> [3, 1, 0; 1, 1, -3; 0, -3, -2], [31, 20, 17; 0, 1, 0; 0, 0, 1], [11,
> -2, 3; -2, 6, -9; 3, -9, -2], [31, [14, -1, 10; -11, 3, 1; 1, 11,
> 14]]], [-0.6823278038280193273694837397,
> 0.3411639019140096636847418699 + 1.161541399997251936087917687*I],
> [1, x^2 + 1, x], [1, 0, -1; 0, 0, 1; 0, 1, 0], [1, 0, 0, 0, 0, -1,
> 0, -1, -1; 0, 1, 0, 1, 1, 0, 0, 0, 1; 0, 0, 1, 0, -1, 0, 1, 0, 0]]
> ? idealprimedec(field, 11)
> %2 = [[11, [-2, 0, 1]~, 1, 1, [4, 1, 2]~], [11, [4, 1, 2]~, 1, 2,
> [-2, 0, 1]~]]
> ?
>
> With libpari, I obtain only one prime ideal above 11:
> ideal = [[11, [11, 0]~, 1, 2, [1, 0]~]]
>
> I used the following code made by myself.
> #include <pari/pari.h>
>
> int main()
> {
>  GEN a, pol, field;
>
>
>  pari_init(500000, 500000);
>  pol = mkpoln(3, stoi(1), stoi(0), stoi(1), stoi(1));
>  field = nfinit0(pol, 0, DEFAULTPREC);
>
>  a = primedec(field, stoi(11));
>  pariprintf("ideal = %Z\n",a);
>
>  return 0;
> }
>
> Can anyone explain the difference?

mkpoln's first argument gives the number of coefficients (that follow),
not the degree. Replace

pol = mkpoln(3, stoi(1), stoi(0), stoi(1), stoi(1));

by

pol = mkpoln(4, stoi(1), stoi(0), stoi(1), stoi(1));

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-bordeaux.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`