John Cremona on Sat, 02 Feb 2008 10:49:37 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: idealappr() |
Dear Karim, Thanks for the quick reply. [3 days for me to remember that Dan Bernstein's qsecretary response gets put into spam by gmail an find it and reply to it; minutes for your response!] As you know, the number field functionality in Sage is based on the pari library. In Sage, the function uniformizer() uses isappr but was not documented, so I was adding documentation and this led me to the question. I'm not the one who designed the number fields in Sage, so I am not sure when it uses nfinit() and when bnfinit(). I was only in that code because I found a different bug and had to fix it. I think it only uses bnfinit() when a function is called which needs it; but it would be reasonable for uniformizer() to be such a function. Thanks again, John On 01/02/2008, Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr> wrote: > * John Cremona [2008-02-01 22:15]: > > The documentation for idealappr(K,P) implies that in the case that P a > > prime ideal in the number field K, the element returned will be a > > uniformizer for P and integral. > > True. > > [ P.gen[2] is another "simpler" way to get a uniformizer ] > > > Will it always be a generator for P when P is principal (as it might > > then be) > > No. > > > If the latter, would it be relatively expensive to call > > bnfisprincipal() to ensure that we have a generator when it exists? > > It's actually impossible: the argument to idealappr is an nf and > not a bnf, which would be required for bnfisprincipal (idealappr is a > rather trivial function, especially if the input is a prime ideal; it is > *much* simpler than bnfinit + bnfisprincipal !). > > One could check whether the input is in fact a bnf, then test whether P > is principal, and if so compute a generator; but it would complicate a > simple function for a rather limited use. > > What's wrong with calling directly bnfisprincipal ? [ it will actually > produce a "uniformizer" for any ideal, not necessarily a prime; and > bypass a useless idealappr call ] > > What is your specific application ? > > Cheers, > > K.B. > -- > Karim Belabas 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] > ` > -- John Cremona