The command QuadraticExtension(a) creates the field Q(sqrt(a)).
sage: QuadraticField(3, 'a') Number Field in a with defining polynomial x^2 - 3 sage: QuadraticField(-4) Number Field in x with defining polynomial x^2 + 4
polynomial, [name=True], [check=None]) |
class_number
Further documentation:
[proof=True]) |
Return the size of the class group of self.
If proof = False (not the default) and the discriminant of the field is negative, then the following warning from the PARI manual applies: IMPORTANT WARNING: For D<0, this function may give incorrect results when the class group has a low exponent (has many cyclic factors), because implementing Shank's method in full generality slows it down immensely.