Base class of number fields

AUTHORS:

  • William Stein (2007-09-04): initial version

class sage.rings.number_field.number_field_base.NumberField[source]

Bases: Field

Base class for all number fields.

OK(*args, **kwds)[source]

Synonym for maximal_order().

EXAMPLES:

sage: x = polygen(ZZ)
sage: NumberField(x^3 - 2,'a').OK()
Maximal Order generated by a in Number Field in a with defining polynomial x^3 - 2
>>> from sage.all import *
>>> x = polygen(ZZ)
>>> NumberField(x**Integer(3) - Integer(2),'a').OK()
Maximal Order generated by a in Number Field in a with defining polynomial x^3 - 2
x = polygen(ZZ)
NumberField(x^3 - 2,'a').OK()
bach_bound()[source]

Return the Bach bound associated to this number field.

Assuming the General Riemann Hypothesis, this is a bound \(B\) so that every integral ideal is equivalent modulo principal fractional ideals to an integral ideal of norm at most \(B\).

OUTPUT: symbolic expression or the Integer 1

EXAMPLES:

We compute both the Minkowski and Bach bounds for a quadratic field, where the Minkowski bound is much better:

sage: # needs sage.symbolic
sage: K = QQ[sqrt(5)]
sage: K.minkowski_bound()
1/2*sqrt(5)
sage: K.minkowski_bound().n()
1.11803398874989
sage: K.bach_bound()
12*log(5)^2
sage: K.bach_bound().n()
31.0834847277628
>>> from sage.all import *
>>> # needs sage.symbolic
>>> K = QQ[sqrt(Integer(5))]
>>> K.minkowski_bound()
1/2*sqrt(5)
>>> K.minkowski_bound().n()
1.11803398874989
>>> K.bach_bound()
12*log(5)^2
>>> K.bach_bound().n()
31.0834847277628
# needs sage.symbolic
K = QQ[sqrt(5)]
K.minkowski_bound()
K.minkowski_bound().n()
K.bach_bound()
K.bach_bound().n()

We compute both the Minkowski and Bach bounds for a bigger degree field, where the Bach bound is much better:

sage: # needs sage.symbolic
sage: K = CyclotomicField(37)
sage: K.minkowski_bound().n()
7.50857335698544e14
sage: K.bach_bound().n()
191669.304126267
>>> from sage.all import *
>>> # needs sage.symbolic
>>> K = CyclotomicField(Integer(37))
>>> K.minkowski_bound().n()
7.50857335698544e14
>>> K.bach_bound().n()
191669.304126267
# needs sage.symbolic
K = CyclotomicField(37)
K.minkowski_bound().n()
K.bach_bound().n()

The bound of course also works for the rational numbers:

sage: QQ.bach_bound()                                                       # needs sage.symbolic
1
>>> from sage.all import *
>>> QQ.bach_bound()                                                       # needs sage.symbolic
1
QQ.bach_bound()                                                       # needs sage.symbolic
degree()[source]

Return the degree of this number field.

EXAMPLES:

sage: x = polygen(ZZ)
sage: NumberField(x^3 + 9, 'a').degree()
3
>>> from sage.all import *
>>> x = polygen(ZZ)
>>> NumberField(x**Integer(3) + Integer(9), 'a').degree()
3
x = polygen(ZZ)
NumberField(x^3 + 9, 'a').degree()
discriminant()[source]

Return the discriminant of this number field.

EXAMPLES:

sage: x = polygen(ZZ)
sage: NumberField(x^3 + 9, 'a').discriminant()
-243
>>> from sage.all import *
>>> x = polygen(ZZ)
>>> NumberField(x**Integer(3) + Integer(9), 'a').discriminant()
-243
x = polygen(ZZ)
NumberField(x^3 + 9, 'a').discriminant()
is_absolute()[source]

Return True if self is viewed as a single extension over \(\QQ\).

EXAMPLES:

sage: x = polygen(ZZ)
sage: K.<a> = NumberField(x^3 + 2)
sage: K.is_absolute()
True
sage: y = polygen(K)
sage: L.<b> = NumberField(y^2 + 1)
sage: L.is_absolute()
False
sage: QQ.is_absolute()
True
>>> from sage.all import *
>>> x = polygen(ZZ)
>>> K = NumberField(x**Integer(3) + Integer(2), names=('a',)); (a,) = K._first_ngens(1)
>>> K.is_absolute()
True
>>> y = polygen(K)
>>> L = NumberField(y**Integer(2) + Integer(1), names=('b',)); (b,) = L._first_ngens(1)
>>> L.is_absolute()
False
>>> QQ.is_absolute()
True
x = polygen(ZZ)
K.<a> = NumberField(x^3 + 2)
K.is_absolute()
y = polygen(K)
L.<b> = NumberField(y^2 + 1)
L.is_absolute()
QQ.is_absolute()
maximal_order()[source]

Return the maximal order, i.e., the ring of integers of this number field.

EXAMPLES:

sage: x = polygen(ZZ)
sage: NumberField(x^3 - 2,'b').maximal_order()
Maximal Order generated by b in Number Field in b with defining polynomial x^3 - 2
>>> from sage.all import *
>>> x = polygen(ZZ)
>>> NumberField(x**Integer(3) - Integer(2),'b').maximal_order()
Maximal Order generated by b in Number Field in b with defining polynomial x^3 - 2
x = polygen(ZZ)
NumberField(x^3 - 2,'b').maximal_order()
minkowski_bound()[source]

Return the Minkowski bound associated to this number field.

This is a bound \(B\) so that every integral ideal is equivalent modulo principal fractional ideals to an integral ideal of norm at most \(B\).

See also

bach_bound()

OUTPUT: symbolic expression or Rational

EXAMPLES:

The Minkowski bound for \(\QQ[i]\) tells us that the class number is 1:

sage: # needs sage.symbolic
sage: K = QQ[I]
sage: B = K.minkowski_bound(); B
4/pi
sage: B.n()
1.27323954473516
>>> from sage.all import *
>>> # needs sage.symbolic
>>> K = QQ[I]
>>> B = K.minkowski_bound(); B
4/pi
>>> B.n()
1.27323954473516
# needs sage.symbolic
K = QQ[I]
B = K.minkowski_bound(); B
B.n()

We compute the Minkowski bound for \(\QQ[\sqrt[3]{2}]\):

sage: # needs sage.symbolic
sage: K = QQ[2^(1/3)]
sage: B = K.minkowski_bound(); B
16/3*sqrt(3)/pi
sage: B.n()
2.94042077558289
sage: int(B)
2
>>> from sage.all import *
>>> # needs sage.symbolic
>>> K = QQ[Integer(2)**(Integer(1)/Integer(3))]
>>> B = K.minkowski_bound(); B
16/3*sqrt(3)/pi
>>> B.n()
2.94042077558289
>>> int(B)
2
# needs sage.symbolic
K = QQ[2^(1/3)]
B = K.minkowski_bound(); B
B.n()
int(B)

We compute the Minkowski bound for \(\QQ[\sqrt{10}]\), which has class number 2:

sage: # needs sage.symbolic
sage: K = QQ[sqrt(10)]
sage: B = K.minkowski_bound(); B
sqrt(10)
sage: int(B)
3
sage: K.class_number()
2
>>> from sage.all import *
>>> # needs sage.symbolic
>>> K = QQ[sqrt(Integer(10))]
>>> B = K.minkowski_bound(); B
sqrt(10)
>>> int(B)
3
>>> K.class_number()
2
# needs sage.symbolic
K = QQ[sqrt(10)]
B = K.minkowski_bound(); B
int(B)
K.class_number()

We compute the Minkowski bound for \(\QQ[\sqrt{2}+\sqrt{3}]\):

sage: # needs sage.symbolic
sage: x = polygen(ZZ)
sage: K.<y,z> = NumberField([x^2 - 2, x^2 - 3])
sage: L.<w> = QQ[sqrt(2) + sqrt(3)]
sage: B = K.minkowski_bound(); B
9/2
sage: int(B)
4
sage: B == L.minkowski_bound()
True
sage: K.class_number()
1
>>> from sage.all import *
>>> # needs sage.symbolic
>>> x = polygen(ZZ)
>>> K = NumberField([x**Integer(2) - Integer(2), x**Integer(2) - Integer(3)], names=('y', 'z',)); (y, z,) = K._first_ngens(2)
>>> L = QQ[sqrt(Integer(2)) + sqrt(Integer(3))]; (w,) = L._first_ngens(1)
>>> B = K.minkowski_bound(); B
9/2
>>> int(B)
4
>>> B == L.minkowski_bound()
True
>>> K.class_number()
1
# needs sage.symbolic
x = polygen(ZZ)
K.<y,z> = NumberField([x^2 - 2, x^2 - 3])
L.<w> = QQ[sqrt(2) + sqrt(3)]
B = K.minkowski_bound(); B
int(B)
B == L.minkowski_bound()
K.class_number()

The bound of course also works for the rational numbers:

sage: QQ.minkowski_bound()
1
>>> from sage.all import *
>>> QQ.minkowski_bound()
1
QQ.minkowski_bound()
ring_of_integers(*args, **kwds)[source]

Synonym for maximal_order().

EXAMPLES:

sage: x = polygen(ZZ)
sage: K.<a> = NumberField(x^2 + 1)
sage: K.ring_of_integers()
Gaussian Integers generated by a in Number Field in a with defining polynomial x^2 + 1
>>> from sage.all import *
>>> x = polygen(ZZ)
>>> K = NumberField(x**Integer(2) + Integer(1), names=('a',)); (a,) = K._first_ngens(1)
>>> K.ring_of_integers()
Gaussian Integers generated by a in Number Field in a with defining polynomial x^2 + 1
x = polygen(ZZ)
K.<a> = NumberField(x^2 + 1)
K.ring_of_integers()
signature()[source]

Return \((r_1, r_2)\), where \(r_1\) and \(r_2\) are the number of real embeddings and pairs of complex embeddings of this field, respectively.

EXAMPLES:

sage: x = polygen(ZZ)
sage: NumberField(x^3 - 2, 'a').signature()
(1, 1)
>>> from sage.all import *
>>> x = polygen(ZZ)
>>> NumberField(x**Integer(3) - Integer(2), 'a').signature()
(1, 1)
x = polygen(ZZ)
NumberField(x^3 - 2, 'a').signature()
sage.rings.number_field.number_field_base.is_NumberField(x)[source]

Return True if x is of number field type.

This function is deprecated.

EXAMPLES:

sage: from sage.rings.number_field.number_field_base import is_NumberField
sage: x = polygen(ZZ)
sage: is_NumberField(NumberField(x^2 + 1, 'a'))
doctest:...: DeprecationWarning: the function is_NumberField is deprecated; use
isinstance(x, sage.rings.number_field.number_field_base.NumberField) instead
See https://github.com/sagemath/sage/issues/35283 for details.
True
sage: is_NumberField(QuadraticField(-97, 'theta'))
True
sage: is_NumberField(CyclotomicField(97))
True
>>> from sage.all import *
>>> from sage.rings.number_field.number_field_base import is_NumberField
>>> x = polygen(ZZ)
>>> is_NumberField(NumberField(x**Integer(2) + Integer(1), 'a'))
doctest:...: DeprecationWarning: the function is_NumberField is deprecated; use
isinstance(x, sage.rings.number_field.number_field_base.NumberField) instead
See https://github.com/sagemath/sage/issues/35283 for details.
True
>>> is_NumberField(QuadraticField(-Integer(97), 'theta'))
True
>>> is_NumberField(CyclotomicField(Integer(97)))
True
from sage.rings.number_field.number_field_base import is_NumberField
x = polygen(ZZ)
is_NumberField(NumberField(x^2 + 1, 'a'))
is_NumberField(QuadraticField(-97, 'theta'))
is_NumberField(CyclotomicField(97))

Note that the rational numbers QQ are a number field.:

sage: is_NumberField(QQ)
True
sage: is_NumberField(ZZ)
False
>>> from sage.all import *
>>> is_NumberField(QQ)
True
>>> is_NumberField(ZZ)
False
is_NumberField(QQ)
is_NumberField(ZZ)