4.12.1.3 NumberField Objects

class NumberField
NumberField( poly, [variable=True], [check=a])

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

class_group,$  $ composite_fields,$  $ disc,$  $ discriminant,$  $ factor_integer,$  $ integral_basis,$  $ pari_bnf,$  $ pari_nf,$  $ pari_polynomial,$  $ trace_pairing,$  $ variable

These methods are defined as follows:

class_group( )

WARNING: Assume GRH, etc. !! TODO: Change to use bnf_certify, unless user requests not to.

composite_fields( other)

List of all possible composite fields formed from self and other.

disc( [v=None])

Returns the discriminant of the ring of integers of the number field, or if v is specified, the determinant of the trace pairing on the elements of the list v.

INPUT:
    v (optional) -- list of element of this number field
OUTPUT:
    Integer if v is omitted, and Rational otherwise.

discriminant( [v=None])

Returns the discriminant of the ring of integers of the number field, or if v is specified, the determinant of the trace pairing on the elements of the list v.

INPUT:
    v (optional) -- list of element of this number field
OUTPUT:
    Integer if v is omitted, and Rational otherwise.

factor_integer( n)

Ideal factorization of the principal ideal of the ring of integers generated by n.

integral_basis( )

Return a list of elements of this number field that are a basis for the full ring of integers.

sage: x = PolynomialRing(QQ).gen()
sage: K = NumberField(x**5+10*x+1)
sage: K.integral_basis()
[1, a, a^2, a^3, a^4]

Next we compute the ring of integers of a cubic field in which 2 is an "essential discriminant divisor", so the ring of integers is not generated by a single element.

sage: K = NumberField(x**3 + x**2 - 2*x + 8)
sage: K.integral_basis()
[1, a, 1/2*a^2 + 1/2*a]

pari_bnf( )

PARI big number field corresponding to this field.

pari_nf( )

PARI number field corresponding to this field.

pari_polynomial( )

PARI polynomial corresponding to polynomial that defines this field.

trace_pairing( v)

Returns the trace pairing on the elements of the list v.

variable( [new_var=None])

Returns or sets the name of the generator of the number field.

If the optional string argument new_var is given, then the name of the number field generator is set to new_var. If it is not given, this function returns the current name of the generator.

INPUT:
    new_value -- optional str
OUTPUT:
    str -- the name of the generator

Instances of class NumberField also have the following special methods:

__call__( x)

Coerce x into this number field.

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