4.1.1.26 NumberFields Objects

class NumberFields
The category of number fields.

We create the category of number fields.

sage: C = NumberFields()
sage: C
Category of number fields

Notice that the rational numbers $ \mathbf{Q}$ are not considered as an object in this category.

sage: RationalField() in C
False

However, we can define a degree 1 extension of $ \mathbf{Q}$ , which is in this category.

sage: x = PolynomialRing(RationalField()).gen()
sage: K = NumberField(x - 1); K
Number Field in x with defining polynomial x - 1
sage: K in C
True

We can also coerce $ \mathbf{Q}$ into the category of number fields.

sage: C(RationalField())
Number Field in x with defining polynomial x - 1

Number fields all lie in this category, irregardless of the name of the variable.

sage: K = NumberField(x**2 - 1, name='a')
sage: K in C
True
Instances of class NumberFields also have the following special methods:

__call__,$  $ __contains__

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