The ClassGroup routine and related functions are described in Section Ideal Class Groups. The routines for computing units in maximal orders of number fields are described in Section Unit Groups.
> R<x> := PolynomialRing(Integers()); > f := x^4 - 420*x^2 + 40000; > K<y> := NumberField(f); > C := ClassGroup(K); > C; Abelian Group of order 1 > U := UnitGroup(K); > U; Abelian Group isomorphic to Z/2 + Z + Z + Z Defined on 4 generators Relations: 2*U.1 = 0 > T := TorsionUnitGroup(K); > T; Abelian Group isomorphic to Z/2 Defined on 1 generator Relations: 2*T.1 = 0