6.8.1.4 NumberField_quadratic Objects

class NumberField_quadratic
Create a quadratic extension of the rational field.

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
NumberField_quadratic( polynomial, [name=True], [check=None])

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

class_number,$  $ disc

Further documentation:

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.