Allan Adler writes:
> (1) compute a fundamental unit for a real quadratic field K.
See `qunit'. The description in the manual is not quite correct. I
think, for a square-free d > 1, qunit(d), together with -1, generates
the group of units of O = Z+sqrt(d) Z. Recall that for d = 1 mod 4,
this is strictly smaller than O_K = Z + (1+sqrt(d))/2 Z, which is the
ring of all algebraic integers in K.
In the latter case, O^* = <-1,qunit(d)> may be strictly smaller than
O_K^* (e.g., d = 5) but it needn't be (e.g., d = 37).
I found it interesting to work out how to compute a fundamental unit
for K from qunit(d), see
http://members.inode.at/wjenkner/maxima/qunit1.mac
> (2) compute the continued fraction expansion of a number from K and
> identify its repeating and nonrepeating parts.
See `cf'. Seems to be slightly broken with respect to identifying the
period.
> (3) compute the class number of K.
No, but there's `jacobi' and so it's easy to express the primitive
real character belonging to K. So together with (1), the class number
can be computed.
Wolfgang