Number fields#

class sage.categories.number_fields.NumberFields#

Bases: Category_singleton

The category of number fields.

EXAMPLES:

We create the category of number fields:

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

By definition, it is infinite:

sage: NumberFields().Infinite() is NumberFields()
True

Notice that the rational numbers \(\QQ\) are considered as an object in this category:

sage: RationalField() in C
True

However, we can define a degree 1 extension of \(\QQ\), which is of course also in this category:

sage: x = PolynomialRing(RationalField(), 'x').gen()
sage: K = NumberField(x - 1, 'a'); K                                            # needs sage.rings.number_field
Number Field in a with defining polynomial x - 1
sage: K in C                                                                    # needs sage.rings.number_field
True

Number fields all lie in this category, regardless of the name of the variable:

sage: K = NumberField(x^2 + 1, 'a')                                             # needs sage.rings.number_field
sage: K in C                                                                    # needs sage.rings.number_field
True
class ElementMethods#

Bases: object

class ParentMethods#

Bases: object

zeta_function(prec=53, max_imaginary_part=0, max_asymp_coeffs=40, algorithm='pari')#

Return the Dedekind zeta function of this number field.

Actually, this returns an interface for computing with the Dedekind zeta function \(\zeta_F(s)\) of the number field \(F\).

INPUT:

  • prec – optional integer (default 53) bits precision

  • max_imaginary_part – optional real number (default 0)

  • max_asymp_coeffs – optional integer (default 40)

  • algorithm – optional (default “pari”) either “gp” or “pari”

OUTPUT: The zeta function of this number field.

If algorithm is “gp”, this returns an interface to Tim Dokchitser’s gp script for computing with L-functions.

If algorithm is “pari”, this returns instead an interface to Pari’s own general implementation of L-functions.

EXAMPLES:

sage: K.<a> = NumberField(ZZ['x'].0^2 + ZZ['x'].0 - 1)                  # needs sage.rings.number_field
sage: Z = K.zeta_function(); Z                                          # needs sage.rings.number_field sage.symbolic
PARI zeta function associated to Number Field in a
 with defining polynomial x^2 + x - 1
sage: Z(-1)                                                             # needs sage.rings.number_field sage.symbolic
0.0333333333333333

sage: x = polygen(QQ, 'x')
sage: L.<a, b, c> = NumberField([x^2 - 5, x^2 + 3, x^2 + 1])            # needs sage.rings.number_field
sage: Z = L.zeta_function()                                             # needs sage.rings.number_field sage.symbolic
sage: Z(5)                                                              # needs sage.rings.number_field sage.symbolic
1.00199015670185

Using the algorithm “pari”:

sage: K.<a> = NumberField(ZZ['x'].0^2 + ZZ['x'].0 - 1)                  # needs sage.rings.number_field
sage: Z = K.zeta_function(algorithm="pari")                             # needs sage.rings.number_field sage.symbolic
sage: Z(-1)                                                             # needs sage.rings.number_field sage.symbolic
0.0333333333333333

sage: x = polygen(QQ, 'x')
sage: L.<a, b, c> = NumberField([x^2 - 5, x^2 + 3, x^2 + 1])            # needs sage.rings.number_field
sage: Z = L.zeta_function(algorithm="pari")                             # needs sage.rings.number_field sage.symbolic
sage: Z(5)                                                              # needs sage.rings.number_field sage.symbolic
1.00199015670185
super_categories()#

EXAMPLES:

sage: NumberFields().super_categories()
[Category of infinite fields]