Karim Belabas on Mon, 01 Mar 2004 22:21:59 +0100

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

Re: bnfsunit

[ following-up to the list after a private discussion with Olivier ]

* Olivier Wittenberg [2004-03-01 15:36]:
>> bnfsunit's first argument is a bnf. When you get this message, just make sure
>> that this bnf contains fundamental units. E.g
>>   bnf = bnfinit(pol, 1);
>>   bnfsunit(bnf, S)

[ Olivier sent me this simple example (slightly edited), which does not work:]

> ------------------------------------------------------------
> g = x^5 + 1291*x^4 + 5*x^3 - 1723*x^2 - 3894*x + 13824;
> foo(s) =
> {
>   local(sp, k, t);
>   k = bnfinit(g, 1);
>   sp = [];
>   for (i = 1, length(s),
>     t = idealprimedec(k, s[i]);
>     sp = concat(sp, t));
>   bnfsunit(k, sp)[1];
> }
> foo([2]);
> ------------------------------------------------------------

OK, this is a bug according to the documentation. It is impossible to compute
fundamental units in this example: k.reg ~ 1.1e13. This is the determinant 
of the matrix of logarithmic embeddings, and one must compute the
exponentials of its entries (then do exact computations with about that
accuracy...). Unfeasible.

So bnfinit(,1) can't work in this example. Instead of entering an infinite
loop (as the stable version would), it returns without the requested units.

I have changed this in CVS so that bnfinit(,1) raises an explicit error

  ***   bnfinit: fundamental units too large.

An idea that _might_ work in other examples (in this one, it doesn't): you
can't increase the precision but you may compute the initial bnf at a higher
accuracy, and it might be enough.

Check out the behaviour at \g2 or higher. You'll get to see something like

  ***   Warning: precision too low for generators, e = 620323.

e is more or less the _extra_ bit accuracy required to get a result. (No hope
in this case.) You want to try it at a few different accuracies, just in case
you get a bogus indication the first time because of catastrophic loss of
accuracy (it shouldn't happen, but...).


P.S: Btw, you may write the loop building sp as

  sp = concat( vector(#s, i, idealprimedec(k, s[i])) );
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425   Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud              http://www.math.u-psud.fr/~belabas/ 
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]