Max Alekseyev on Wed, 07 Aug 2024 23:01:07 +0200


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

Re: bnfisintnorm/bnfisnorm and availability of units


Hi Karim,

Thank you for the explanation. The question was really for my understanding of the differences between these two functions.
Performance of bnfisintnorm() in some cases is unsatisfactory as it requires too much memory (I raised this issue in another topic earlier this year). 
Are there cases when bnfisnorm() has better chances to succeed? 

Regards,
Max


On Wed, Aug 7, 2024 at 10:25 AM Karim Belabas <Karim.Belabas@math.u-bordeaux.fr> wrote:
* Max Alekseyev [2024-08-06 19:06]:
> Hello,
>
> I'm puzzled by the code example quoted below. Why does bnfisintnorm()
> run fine, but bnfisnorm() complains about missing units?
> I'd assume that units are a prerequisite for both these functions, but it
> turns out not to be the case.

Indeed (and as the error message indicates): in the generic case,
- units are *not* a prerequisite for bnfisintnorm().
- units *are* a prerequisite for bnfisnorm().

> Do I miss something here?

Why not use

  b = bnfinit(x^2 - s, 1);

? The construction bnfinit(,1) may be slower in general; but it's much safer.

In any case, when you run into an error anyway, there are two options
1) try it :-), or 2) increase the working precision. Both methods have
pros and cons.

Cheers,

    K.B.

>
> Regards,
> Max
>
> ===
> ? s=216145205;
> ? b=bnfinit(x^2-s);
> ? bnfisintnorm(b,s-1)
> %4 = [-411706627786612628571*x - 6052860449312256784985647,
> -411706627786612628571*x + 6052860449312256784985647]
> ? bnfisnorm(b,s-1)
>   ***   at top-level: bnfisnorm(b,s-1)
>   ***                 ^----------------
>   *** bnfisnorm: precision too low in makeunits [cannot get units, use
> bnfinit(,1)].
>   ***   Break loop: type 'break' to go back to GP prompt
> break>
--
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/