Gerhard Niklasch on Wed, 30 Dec 1998 22:40:39 +0100 (MET)

 Re: bnf bug

```In response to
> Message-Id: <19981230110645.L12436@deimos.txc.com>
> From: Igor Schein <igor@txc.com>
[...]
> Seeing 4 different outputs for the same input, the only conclusion I
> can make is that bnfclassunit().clgp.gen is not quite reliable yet.

This isn't a bug.

The bnf* family of functions is probabilistic in nature - if you seed
the random number generator to the same value each time before you call
one of them, you'll get the same answer each time.  Except for possible
effects of rounding errors in the computation of the zeta function
(about which you will receive a warning),  the class number and the
structure of the class group computed will always be the same for the
same field in any case.

However, a class group with more than 2 elements always has many possible
systems of generators, and it is unpredictable which one of them will be
returned.  Going back to your first example, f(522) sometimes finds the
simple result  (lines broken for legibility)

[468, [78, 6],
[[1147, 341, 326; 0, 31, 7; 0, 0, 1],
[15303, 5162, 11582; 0, 1, 0; 0, 0, 1]]]

where the first component 468 is the class number, the second gives
the structure of the class group as a product of cyclic groups of
orders 78 and 6, and the third is a vector of two ideals, the first
representing an ideal class of order 78 in the class group and the
second an ideal class generating one of the complementary cyclic
subgroups of order 6.  But when you call f(522) repeatedly, you
may often see a rather nastier pair of generators, with
[25617, 19847, 9200; 0, 1, 0; 0, 0, 1]
for the first component.

Similarly, f(521) might return
[1425, [285, 5],
[[11, 10, 10; 0, 1, 0; 0, 0, 1],
[125, 70, 93; 0, 5, 1; 0, 0, 1]]]
on one occasion and
[1425, [285, 5],
[[55, 50, 53; 0, 5, 1; 0, 0, 1],
[125, 123, 121; 0, 1, 0; 0, 0, 1]]]
on another, and yet other results when you run it repeatedly.

This is essentially unavoidable  (although it might be nice if there was
an easy-to-use method for changing generators to a set which is `reduced'
in one sense or another - and the same goes for systems of fundamental
units...)

Cheers, and Happy New Year all around,
Gerhard
```