Number fields¶
- class sage.categories.number_fields.NumberFields[source]¶
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
>>> from sage.all import * >>> C = NumberFields() >>> C Category of number fields
By definition, it is infinite:
sage: NumberFields().Infinite() is NumberFields() True
>>> from sage.all import * >>> NumberFields().Infinite() is NumberFields() True
Notice that the rational numbers \(\QQ\) are considered as an object in this category:
sage: RationalField() in C True
>>> from sage.all import * >>> 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
>>> from sage.all import * >>> x = PolynomialRing(RationalField(), 'x').gen() >>> K = NumberField(x - Integer(1), 'a'); K # needs sage.rings.number_field Number Field in a with defining polynomial x - 1 >>> 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
>>> from sage.all import * >>> K = NumberField(x**Integer(2) + Integer(1), 'a') # needs sage.rings.number_field >>> K in C # needs sage.rings.number_field True
- class ParentMethods[source]¶
Bases:
object
- zeta_function(prec=53, max_imaginary_part=0, max_asymp_coeffs=40, algorithm='pari')[source]¶
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
– integer (default: 53); bits of precisionmax_imaginary_part
– real (default: 0)max_asymp_coeffs
– integer (default: 40)algorithm
– (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
>>> from sage.all import * >>> K = NumberField(ZZ['x'].gen(0)**Integer(2) + ZZ['x'].gen(0) - Integer(1), names=('a',)); (a,) = K._first_ngens(1)# needs sage.rings.number_field >>> 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 >>> Z(-Integer(1)) # needs sage.rings.number_field sage.symbolic 0.0333333333333333 >>> x = polygen(QQ, 'x') >>> L = NumberField([x**Integer(2) - Integer(5), x**Integer(2) + Integer(3), x**Integer(2) + Integer(1)], names=('a', 'b', 'c',)); (a, b, c,) = L._first_ngens(3)# needs sage.rings.number_field >>> Z = L.zeta_function() # needs sage.rings.number_field sage.symbolic >>> Z(Integer(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
>>> from sage.all import * >>> K = NumberField(ZZ['x'].gen(0)**Integer(2) + ZZ['x'].gen(0) - Integer(1), names=('a',)); (a,) = K._first_ngens(1)# needs sage.rings.number_field >>> Z = K.zeta_function(algorithm='pari') # needs sage.rings.number_field sage.symbolic >>> Z(-Integer(1)) # needs sage.rings.number_field sage.symbolic 0.0333333333333333 >>> x = polygen(QQ, 'x') >>> L = NumberField([x**Integer(2) - Integer(5), x**Integer(2) + Integer(3), x**Integer(2) + Integer(1)], names=('a', 'b', 'c',)); (a, b, c,) = L._first_ngens(3)# needs sage.rings.number_field >>> Z = L.zeta_function(algorithm='pari') # needs sage.rings.number_field sage.symbolic >>> Z(Integer(5)) # needs sage.rings.number_field sage.symbolic 1.00199015670185