David R. Kohel on Sat, 21 Aug 1999 16:19:17 +1000

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

Re: bnfclgp bug

> ??quadclassunit
> quadclassunit(D,{flag = 0},{tech = []}):
>    Buchmann-McCurley's  sub-exponential  algorithm  for computing the
> class group of a quadratic field of discriminant  D.   If D is not
> fundamental,  the result is undefined,  but usually correct  (a
> warning is issued). The more general function bnrinit should be used
> to compute the class group of an order. 
> So the result is undefined for non-fundamental discriminants, and
> that's why you're hitting infinite loop.
> I usually do it something like this:
> for(k=2,N,if(isfundamental(k),print(k," ",quadclassunit(k)),))
> Igor

But that throws away the interesting nonfundamental discriminants!  

I'm not sure what is meant by "the result is undefined" -- I'd 
call that a bug in the documentation.  It should read something 
   "the funciion may or may not be defined, but usually is, and 
   often gives the right answer".  

In the case D = -288, the function is obviously not defined.  
The fact that it doesn't recognize that it isn't defined should 
be considered a bug.  I believe there are small examples where 
the wrong answer is reported.  

In this particular case, the class number is four and the reduced 
forms are: 

   [ <1, 0, 72>, <4, 4, 19>, <8, 0, 9>, <8, 8, 11> ].

The class group structure is indeed Z/2Z x Z/2Z and gives an 
example of the behavior Kevin was checking.