Karim Belabas on Fri, 23 Aug 2019 21:02:12 +0200

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

 Re: nfinit misleading documentation

```* Robert Harron [2019-08-22 23:33]:
> The online documentation for nfinit says that the 7th component is an
> integral basis for Z_K and that the first element is guaranteed to be 1.
> However, if you run
>
> ? nfinit(x^4 - 66*x^2 - 172*x + 54)[7]
> %1 = [5, 5*x, x^3 - 2*x^2 - 57*x - 63, -x^3 + 7*x^2 + 37*x - 102]
>
> the first element is a 5. Now, if you divide every entry by 5, you get an
> integral basis. The documentation implies that nf.zk is an alias for getting
> the 7th component, however:
>
> nfinit(x^4 - 66*x^2 - 172*x + 54).zk
> %2 = [1, x, 1/5*x^3 - 2/5*x^2 - 57/5*x - 63/5, -1/5*x^3 + 7/5*x^2 + 37/5*x -
> 102/5]
>
> So, nf.zk is an integral basis where 1 is (or at least seems to be) the
> first element. I.e. nf.zk does what the documentation says it should, but
> that's not what the 7th component of a call to nfinit is. Could this be
> clarified in the documentation?

Indeed, this changed some time ago, in version 2.10. The content of nf[7] is
now a Z-basis for d * Z_K, where d = [Z_K : Z[theta]].

This ensures that all polynomials in nf[7] have integral coefficients and its
first coefficient is d; nf.zk is nf[7] / d.

I have fixed the documentation in the master branch (and the online version
http://pari.math.u-bordeaux.fr/dochtml/html/)

Thanks for your report !

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

```