Function: quadclassunit
Section: number_theoretical
C-Name: quadclassunit0
Prototype: GD0,L,DGp
Help: quadclassunit(D,{flag=0},{tech=[]}): compute the structure of the
 class group and the regulator of the quadratic field of discriminant D.
 See manual for the optional technical parameters.
Doc: \idx{Buchmann-McCurley}'s sub-exponential algorithm for computing the
 class group of a quadratic order of discriminant $D$. By default, the
 results are conditional on the GRH.

 This function should be used instead of \tet{qfbclassno} or
 \tet{quadregulator}
 when $D<-10^{25}$, $D>10^{10}$, or when the \emph{structure} is wanted. It
 is a special case of \tet{bnfinit}, which is slower, but more robust.

 The result is a vector $v$ whose components should be accessed using
 member functions:

 \item \kbd{$v$.no}: the class number

 \item \kbd{$v$.cyc}: a vector giving the structure of the class group as a
 product of cyclic groups;

 \item \kbd{$v$.gen}: a vector giving generators of those cyclic groups (as
 binary quadratic forms).

 \item \kbd{$v$.reg}: the regulator, computed to an accuracy which is the
 maximum of an internal accuracy determined by the program and the current
 default (note that once the regulator is known to a small accuracy it is
 trivial to compute it to very high accuracy, see the tutorial).

 \item \kbd{$v$.normfu} (for positive $D$ only) return the norm of the
 fundamental unit, either $1$ or $-1$. Note that a result of $-1$ is
 unconditional and no longer depends on the GRH.

 The $\fl$ is obsolete and should be left alone. In older versions,
 it supposedly computed the narrow class group when $D>0$, but this did not
 work at all; use the general function \tet{bnfnarrow}.

 Optional parameter \var{tech} is a row vector of the form $[c_{1}, c_{2}]$,
 where $c_{1} \leq c_{2}$ are nonnegative real numbers which control the execution
 time and the stack size, see \ref{se:GRHbnf}. The parameter is used as a
 threshold to balance the relation finding phase against the final linear
 algebra. Increasing the default $c_{1}$ means that relations are easier
 to find, but more relations are needed and the linear algebra will be
 harder. The default value for $c_{1}$ is $0$ and means that it is taken equal
 to $c_{2}$. The parameter $c_{2}$ is mostly obsolete and should not be changed,
 but we still document it for completeness: we compute a tentative class
 group by generators and relations using a factorbase of prime ideals
 $\leq c_{1} (\log |D|)^{2}$, then prove that ideals of norm
 $\leq c_{2} (\log |D|)^{2}$ do
 not generate a larger group. By default an optimal $c_{2}$ is chosen, so that
 the result is provably correct under the GRH --- a result of Greni\'e
 and Molteni states that $c_{2} = 23/6 \approx 3.83$ is fine (and even
 $c_{2} = 15/4 \approx 3.75$ for large $|D| > 2.41 E8$). But it is possible
 to improve on this algorithmically. You may provide a smaller $c_{2}$, it will
 be ignored (we use the provably correct one); you may provide a larger $c_{2}$
 than the default value, which results in longer computing times for equally
 correct outputs (under GRH).
Variant: If you really need to experiment with the \var{tech} parameter,
 it will be more convenient to use
 \fun{GEN}{Buchquad}{GEN D, double c1, double c2, long prec}.
