4.6.1.4 QuadraticField Objects

class QuadraticField
Create a quadratic extension of the rational field.

The command QuadraticExtension(a) creates the field Q(sqrt(a)).

sage: QuadraticField(3)
Number Field with defining polynomial x^2 - 3
sage: QuadraticField(-4)
Number Field with defining polynomial x^2 + 4
QuadraticField( f, [variable=True], [check=a])

Instances of class QuadraticField have the following methods (in addition to inherited methods and special methods):

class_number

These methods are defined as follows:

class_number( [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.

See About this document... for information on suggesting changes.