Skip to content

Number field operations

Creation of number fields

General number fields can be created using the function NumberField, of which number_field is an alias. To create a simple number field given by a defining polynomial or a non-simple number field given by defining polynomials, the following functions can be used.

# NumberField — Method.

NumberField(f::Poly{NumFieldElem}, s::String;
            cached::Bool = false, check::Bool = false) -> NumField, NumFieldElem

Given an irreducible polynomial over some number field , this function creates the simple number field and returns , where is the class of in . The string s is used only for printing the primitive element .

  • check: Controls whether irreducibility of is checked.
  • cached: Controls whether the result is cached.

Examples

julia> K, a = quadratic_field(5);

julia> Kt, t = K["t"];

julia> L, b = NumberField(t^3 - 3, "b");

source

# NumberField — Method.

NumberField(f::Vector{PolyElem{<:NumFieldElem}}, s::String="_\$", check = true)
                                          -> NumField, Vector{NumFieldElem}

Given a list of univariate polynomials in over some number field , constructs the extension .

Examples

julia> Qx, x = QQ["x"];

julia> K, a = NumberField([x^2 - 2, x^2 - 3], "a")
(Non-simple number field with defining polynomials fmpq_mpoly[x1^2 - 2, x2^2 - 3], NfAbsNSElem[a1, a2])

source

Tip

Many of the constructors have arguments of type Symbol or AbstractString. If used, they define the appearance in printing, and printing only. The named parameter check can be true or false, the default being true. This parameter controls whether the polynomials defining the number field are tested for irreducibility or not. Given that this can be potentially very time consuming if the degree if large, one can disable this test. Note however, that the behaviour of Hecke is undefined if a reducible polynomial is used to define a field.

The named boolean parameter cached can be used to disable caching. Two number fields defined using the same polynomial from the identical polynomial ring and the same (identical) symbol/string will be identical if cached == true and different if cached == false.

For frequently used number fields like quadratic fields, cyclotomic fields or radical extensions, the following functions are provided:

# cyclotomic_field — Method.

cyclotomic_field(n::Int) -> AnticNumberField, nf_elem

The cyclotomic field defined by the -th cyclotomic polynomial.

Examples

julia> cyclotomic_field(10)
(Cyclotomic field of order 10, z_10)

source

# quadratic_field — Method.

quadratic_field(d::IntegerUnion) -> AnticNumberField, nf_elem

Returns the field with defining polynomial .

Examples

julia> quadratic_field(5)
(Real quadratic field defined by x^2 - 5, sqrt(5))

source

# wildanger_field — Method.

wildanger_field(n::Int, B::fmpz) -> AnticNumberField, nf_elem

Returns the field with defining polynomial . These fields tend to have non-trivial class groups.

Examples

julia> wildanger_field(3, ZZ(10), "a")
(Number field over Rational Field with defining polynomial x^3 - 10*x^2 + 10*x - 10, a)

source

# radical_extension — Method.

radical_extension(n::Int, a::NumFieldElem, s = "_$";
               check = true, cached = true) -> NumField, NumFieldElem

Given an element of a number field and an integer , create the simple extension of with the defining polynomial .

Examples

julia> radical_extension(5, QQ(2), "a")
(Number field over Rational Field with defining polynomial x^5 - 2, a)

source

# rationals_as_number_field — Method.

rationals_as_number_field() -> AnticNumberField, nf_elem

Returns the rational numbers as the number field defined by .

Examples

julia> rationals_as_number_field()
(Number field over Rational Field with defining polynomial x - 1, 1)

source

Basic properties

# basis — Method.

basis(L::SimpleNumField) -> Vector{NumFieldElem}

Return the canonical basis of a simple extension , that is, the elements , where is the degree of and the primitive element.

Examples

julia> Qx, x = QQ["x"];

julia> K, a = NumberField(x^2 - 2, "a");

julia> basis(K)
2-element Vector{nf_elem}:
 1
 a

source

# basis — Method.

basis(L::NonSimpleNumField) -> Vector{NumFieldElem}

Returns the canonical basis of a non-simple extension . If where each has degree , then the basis will be with for .

Examples

julia> Qx, x = QQ["x"];

julia> K, (a1, a2) = NumberField([x^2 - 2, x^2 - 3], "a");

julia> basis(K)
4-element Vector{NfAbsNSElem}:
 1
 a1
 a2
 a1*a2

source

# absolute_basis — Method.

absolute_basis(K::NumField) -> Vector{NumFieldElem}

Returns an array of elements that form a basis of (as a vector space) over the rationals.

source

# defining_polynomial — Method.

defining_polynomial(L::SimpleNumField) -> PolyElem

Given a simple number field , constructed as , this function returns .

source

# defining_polynomials — Method.

defining_polynomials(L::NonSimpleNumField) -> Vector{PolyElem}

Given a non-simple number field , constructed as , return the vector containing the 's.

source

# absolute_primitive_element — Method.

absolute_primitive_element(K::NumField) -> NumFieldElem

Given a number field , this function returns an element such that .

source

# component — Method.

component(L::NonSimpleNumField, i::Int) -> SimpleNumField, Map

Given a non-simple extension , this function returns the simple number field corresponding to the -th component of together with its embedding.

source

# base_field — Method.

base_field(L::NumField) -> NumField

Given a number field this function returns the base field . For absolute extensions this returns .

source

Invariants

# degree — Method.

degree(L::NumField) -> Int

Given a number field , this function returns the degree of over .

Examples

julia> Qx, x = QQ["x"];

julia> K, a = NumberField(x^2 - 2, "a");

julia> degree(K)
2

source

# absolute_degree — Method.

absolute_degree(L::NumField) -> Int

Given a number field , this function returns the degree of over .

source

# signature — Method.

signature(K::NumField)

Return the signature of the number field of .

Examples

julia> Qx, x = QQ["x"];

julia> K, a = NumberField(x^2 - 2, "a");

julia> signature(K)
(2, 0)

source

# unit_group_rank — Method.

unit_group_rank(K::NumField) -> Int

Return the rank of the unit group of any order of .

source

# class_number — Method.

class_number(K::AnticNumberField) -> fmpz

Returns the class number of .

source

# relative_class_number — Method.

relative_class_number(K::AnticNumberField) -> fmpz

Returns the relative class number of . The field must be a CM-field.

source

# regulator — Method.

regulator(K::AnticNumberField)

Computes the regulator of , i.e. the discriminant of the unit lattice for the maximal order of .

source

# discriminant — Method.

discriminant(L::SimpleNumField) -> NumFieldElem

The discriminant of the defining polynomial of , not the discriminant of the maximal order of .

source

# absolute_discriminant — Method.

absolute_discriminant(L::SimpleNumField, QQ) -> fmpq

The absolute discriminant of the defining polynomial of , not the discriminant of the maximal order of . This is the norm of the discriminant times the -th power of the discriminant of the base field, where is the degree of .

source

Predicates

# is_simple — Method.

is_simple(L::NumField) -> Bool

Given a number field this function returns whether is simple, that is, whether is defined by a univariate polynomial.

source

# is_absolute — Method.

is_absolute(L::NumField) -> Bool

Returns whether is an absolute extension, that is, whether the base field of is .

source

# is_totally_real — Method.

is_totally_real(K::NumberField) -> Bool

Returns true if and only if is totally real, that is, if all roots of the defining polynomial are real.

source

# is_totally_complex — Method.

is_totally_complex(K::AnticNumberField) -> Bool

Returns true if and only if is totally complex, that is, if all roots of the defining polynomial are not real.

source

# is_cm_field — Method.

is_cm_field(K::AnticNumberField) -> Bool, NfToNfMor

Given a number field , this function returns true and the complex conjugation if the field is CM, false and the identity otherwise.

source

# is_kummer_extension — Method.

is_kummer_extension(L::SimpleNumField) -> Bool

Tests if is a Kummer extension, that is, if the defining polynomial is of the form for some and if contains the -th roots of unity.

source

# is_radical_extension — Method.

is_radical_extension(L::SimpleNumField) -> Bool

Tests if is pure, that is, if the defining polynomial is of the form for some .

source

# is_linearly_disjoint — Method.

is_linearly_disjoint(K::SimpleNumField, L::SimpleNumField) -> Bool

Given two number fields and with the same base field , this function returns whether and are linear disjoint over .

source

# is_weakly_ramified — Method.

is_weakly_ramified(K::AnticNumberField, P::NfOrdIdl) -> Bool

Given a prime ideal of a number field , return whether is weakly ramified, that is, whether the second ramification group is trivial.

source

# is_tamely_ramified — Method.

is_tamely_ramified(K::AnticNumberField) -> Bool

Returns whether the number field is tamely ramified.

source

# is_tamely_ramified — Method.

is_tamely_ramified(O::NfOrd, p::Union{Int, fmpz}) -> Bool

Returns whether the integer is tamely ramified in . It is assumed that is prime.

source

# is_abelian — Method.

is_abelian(L::NumField) -> Bool

Check if the number field is abelian over . The function is probabilistic and assumes GRH.

source

Subfields

# is_subfield — Method.

is_subfield(K::SimpleNumField, L::SimpleNumField) -> Bool, Map

Return true and an injection from to if is a subfield of . Otherwise the function returns false and a morphism mapping everything to .

source

# subfields — Method.

subfields(L::SimpleNumField) -> Vector{Tuple{NumField, Map}}

Given a simple extension , returns all subfields of containing as tuples consisting of a simple extension and an embedding .

source

# principal_subfields — Method.

principal_subfields(L::SimpleNumField) -> Vector{Tuple{NumField, Map}}

Return the principal subfields of as pairs consisting of a subfield and an embedding .

source

# compositum — Method.

compositum(K::AnticNumberField, L::AnticNumberField) -> AnticNumberField, Map, Map

Assuming is normal (which is not checked), compute the compositum of the 2 fields together with the embedding of and .

source

# embedding — Method.

embedding(k::NumField, K::NumField) -> Map

Assuming is known to be a subfield of , return the embedding map.

source

# normal_closure — Method.

normal_closure(K::AnticNumberField) -> AnticNumberField, NfToNfMor

The normal closure of together with the embedding map.

source

# relative_simple_extension — Method.

relative_simple_extension(K::NumField, k::NumField) -> NfRel

Given two fields , it returns as a simple relative extension of and an isomorphism .

source

# is_subfield_normal — Method.

  is_subfield_normal(K::AnticNumberField, L::AnticNumberField) -> Bool, NfToNfMor

Returns true and an injection from to if is a subfield of . Otherwise the function returns "false" and a morphism mapping everything to 0.

This function assumes that is normal.

source

Conversion

# simplify — Method.

simplify(K::AnticNumberField; canonical::Bool = false) -> AnticNumberField, NfToNfMor

Tries to find an isomorphic field given by a "simpler" defining polynomial. By default, "simple" is defined to be of smaller index, testing is done only using a LLL-basis of the maximal order.

If canonical is set to true, then a canonical defining polynomial is found, where canonical is using the definition of PARI's polredabs, which is described in http://beta.lmfdb.org/knowledge/show/nf.polredabs.

Both versions require a LLL reduced basis for the maximal order.

source

# absolute_simple_field — Method.

absolute_simple_field(K::NumField) -> NumField, Map

Given a number field , this function returns an absolute simple number field together with a -linear isomorphism .

source

# simple_extension — Method.

simple_extension(L::NonSimpleNumField) -> SimpleNumField, Map

Given a non-simple extension , this function computes a simple extension and a -linear isomorphism .

source

# simplified_simple_extension — Method.

simplified_simple_extension(L::NonSimpleNumField) -> SimpleNumField, Map

Given a non-simple extension , this function returns an isomorphic simple number field with a "small" defining equation together with the isomorphism.

source

Morphisms

# is_isomorphic — Method.

is_isomorphic(K::SimpleNumField, L::SimpleNumField) -> Bool

Return true if and are isomorphic, otherwise false.

source

# is_isomorphic_with_map — Method.

is_isomorphic_with_map(K::SimpleNumField, L::SimpleNumField) -> Bool, Map

Return true and an isomorphism from to if and are isomorphic. Otherwise the function returns false and a morphism mapping everything to .

source

# is_involution — Method.

is_involution(f::NfToNfMor) -> Bool

Returns true if is an involution, i.e. if is the identity, false otherwise.

source

# fixed_field — Method.

fixed_field(K::SimpleNumField,
            sigma::Map;
            simplify::Bool = true) -> NumberField, NfToNfMor

Given a number field and an automorphism of , this function returns the fixed field of as a pair consisting of a number field and an embedding of into .

By default, the function tries to find a small defining polynomial of . This can be disabled by setting simplify = false.

source

# automorphism_list — Method.

automorphism_list(L::NumField) -> Vector{NumFieldMor}

Given a number field , return a list of all -automorphisms of .

source

# automorphism_group — Method.

automorphism_group(K::NumField) -> GenGrp, GrpGenToNfMorSet

Given a number field , this function returns a group and a map from to the automorphisms of .

source

# complex_conjugation — Method.

complex_conjugation(K::AnticNumberField)

Given a totally complex normal number field, this function returns an automorphism which is the restriction of complex conjugation at one embedding.

source

Galois theory

# normal_basis — Method.

normal_basis(L::NumField) -> NumFieldElem

Given a normal number field , this function returns an element of , such that the orbit of under the Galois group of is an -basis of .

source

# decomposition_group — Method.

decomposition_group(K::AnticNumberField, P::NfOrdIdl, m::Map)
                                              -> Grp, GrpToGrp

Given a prime ideal of a number field and a map m return from automorphism_group(K), return the decompositon group of as a subgroup of the domain of m.

source

# ramification_group — Method.

ramification_group(K::AnticNumberField, P::NfOrdIdl, m::Map) -> Grp, GrpToGrp

Given a prime ideal of a number field and a map m return from automorphism_group(K), return the ramification group of as a subgroup of the domain of m.

source

# inertia_subgroup — Method.

inertia_subgroup(K::AnticNumberField, P::NfOrdIdl, m::Map) -> Grp, GrpToGrp

Given a prime ideal of a number field and a map m return from automorphism_group(K), return the intertia subgroup of as a subgroup of the domain of m.

source

Infinite places

# infinite_places — Method.

infinite_places(K::NumField) -> Vector{InfPlc}

Return all infinite places of the number field.

Examples

julia> K,  = quadratic_field(5);

julia> infinite_places(K)
2-element Vector{InfPlc{AnticNumberField, Hecke.NumFieldEmbNfAbs}}:
 Infinite place corresponding to (Embedding corresponding to ≈ -2.24)
 Infinite place corresponding to (Embedding corresponding to ≈ 2.24)

source

# real_places — Method.

real_places(K::NumField) -> Vector{InfPlc}

Return all infinite real places of the number field.

Examples

julia> K,  = quadratic_field(5);

julia> infinite_places(K)
2-element Vector{InfPlc{AnticNumberField, Hecke.NumFieldEmbNfAbs}}:
 Infinite place corresponding to (Embedding corresponding to ≈ -2.24)
 Infinite place corresponding to (Embedding corresponding to ≈ 2.24)

source

# complex_places — Method.

complex_places(K::NumField) -> Vector{InfPlc}

Return all infinite complex places of .

Examples

julia> K,  = quadratic_field(-5);

julia> complex_places(K)
1-element Vector{InfPlc{AnticNumberField, Hecke.NumFieldEmbNfAbs}}:
 Infinite place corresponding to (Embedding corresponding to ≈ 0.00 + 2.24 * i)

source

# isreal — Method.

isreal(P::Plc)

Return whether the embedding into defined by is real or not.

source

# is_complex — Method.

is_complex(P::Plc) -> Bool

Return whether the embedding into defined by is complex or not.

source

Miscellaneous

# norm_equation — Method.

norm_equation(K::AnticNumerField, a) -> nf_elem

For an integer or rational, try to find s.th. . Raises an error if unsuccessful.

source

# lorenz_module — Method.

lorenz_module(k::AnticNumberField, n::Int) -> NfOrdIdl

Finds an ideal s.th. for all positive units we have that is an -th power. Uses Lorenz, number theory, 9.3.1. If containing is set, it has to be an integral ideal. The resulting ideal will be a multiple of this.

source

# kummer_failure — Method.

kummer_failure(x::nf_elem, M::Int, N::Int) -> Int

Computes the quotient of and , where is the field containing and divides .

source

# is_defining_polynomial_nice — Method.

is_defining_polynomial_nice(K::AnticNumberField)

Tests if the defining polynomial of is integral and monic.

source