Skip to content

Number field operations

Creation of number fields

General number fields can be created using the function number_field. 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.

number_field Method
julia
number_field(f::Poly{NumFieldElem}, s::VarName;
            cached::Bool = false, check::Bool = false) -> NumField, NumFieldElem

Given an irreducible polynomial fK[x] over some number field K, this function creates the simple number field L=K[x]/(f) and returns (L,b), where b is the class of x in L. The string s is used only for printing the primitive element b.

  • check: Controls whether irreducibility of f is checked.

  • cached: Controls whether the result is cached.

Examples

julia
julia> K, a = quadratic_field(5);

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

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

source

number_field Method
julia
number_field(f::Vector{PolyRingElem{<:NumFieldElem}}, s::VarName="_\$", check = true)
                                          -> NumField, Vector{NumFieldElem}

Given a list f1,,fn of univariate polynomials in K[x] over some number field K, constructs the extension K[x1,,xn]/(f1(x1),,fn(xn)).

Examples

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

julia> K, a = number_field([x^2 - 2, x^2 - 3], "a")
(Non-simple number field of degree 4 over QQ, AbsNonSimpleNumFieldElem[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
julia
cyclotomic_field(n::Int, s::VarName = "z_$n", t = "_\$"; cached::Bool = true)

Return a tuple R,x consisting of the parent object R and generator x of the n-th cyclotomic field, Q(ζn). The supplied string s specifies how the generator of the number field should be printed. If provided, the string t specifies how the generator of the polynomial ring from which the number field is constructed, should be printed. If it is not supplied, a default dollar sign will be used to represent the variable.

source

quadratic_field Method
julia
quadratic_field(d::IntegerUnion) -> AbsSimpleNumField, AbsSimpleNumFieldElem

Returns the field with defining polynomial x2d.

Examples

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

source

wildanger_field Method
julia
wildanger_field(n::Int, B::ZZRingElem) -> AbsSimpleNumField, AbsSimpleNumFieldElem

Returns the field with defining polynomial xn+i=0n1(1)niBxi. These fields tend to have non-trivial class groups.

Examples

julia
julia> wildanger_field(3, ZZ(10), "a")
(Number field of degree 3 over QQ, a)

source

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

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

Examples

julia
julia> radical_extension(5, QQ(2), "a")
(Number field of degree 5 over QQ, a)

source

rationals_as_number_field Method
julia
rationals_as_number_field() -> AbsSimpleNumField, AbsSimpleNumFieldElem

Returns the rational numbers as the number field defined by x1.

Examples

julia
julia> rationals_as_number_field()
(Number field of degree 1 over QQ, 1)

source

Basic properties

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

Return the canonical basis of a simple extension L/K, that is, the elements 1,a,,ad1, where d is the degree of K and a the primitive element.

Examples

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

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

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

source

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

Returns the canonical basis of a non-simple extension L/K. If L=K(a1,,an) where each ai has degree di, then the basis will be a1i1adid with 0ijdj1 for 1jn.

Examples

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

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

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

source

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

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

source

defining_polynomial Method
julia
defining_polynomial(L::SimpleNumField) -> PolyRingElem

Given a simple number field L/K, constructed as L=K[x]/(f), this function returns f.

source

defining_polynomials Method
julia
defining_polynomials(L::NonSimpleNumField) -> Vector{PolyRingElem}

Given a non-simple number field L/K, constructed as L=K[x]/(f1,,fr), return the vector containing the fi's.

source

absolute_primitive_element Method
julia
absolute_primitive_element(K::NumField) -> NumFieldElem

Given a number field K, this function returns an element γK such that K=Q(γ).

source

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

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

source

base_field Method
julia
base_field(L::NumField) -> NumField

Given a number field L/K this function returns the base field K. For absolute extensions this returns Q.

source

Invariants

degree Method
julia
degree(L::NumField) -> Int

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

Examples

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

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

julia> degree(K)
2

source

absolute_degree Method
julia
absolute_degree(L::NumField) -> Int

Given a number field L/K, this function returns the degree of L over Q.

source

signature Method
julia
signature(K::NumField)

Return the signature of the number field of K.

Examples

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

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

julia> signature(K)
(2, 0)

source

unit_group_rank Method
julia
unit_group_rank(K::NumField) -> Int

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

source

class_number Method
julia
class_number(K::AbsSimpleNumField) -> ZZRingElem

Returns the class number of K.

source

relative_class_number Method
julia
relative_class_number(K::AbsSimpleNumField) -> ZZRingElem

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

source

regulator Method
julia
regulator(K::AbsSimpleNumField)

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

source

discriminant Method
julia
discriminant(L::SimpleNumField) -> NumFieldElem

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

source

absolute_discriminant Method
julia
absolute_discriminant(L::SimpleNumField, QQ) -> QQFieldElem

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

source

Predicates

is_simple Method
julia
is_simple(L::NumField) -> Bool

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

source

is_absolute Method
julia
is_absolute(L::NumField) -> Bool

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

source

is_totally_real Method
julia
is_totally_real(K::NumField) -> Bool

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

source

is_totally_complex Method
julia
is_totally_complex(K::NumField) -> Bool

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

source

is_cm_field Method
julia
is_cm_field(K::AbsSimpleNumField) -> Bool, NumFieldHom{AbsSimpleNumField, AbsSimpleNumField}

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

source

is_kummer_extension Method
julia
is_kummer_extension(L::SimpleNumField) -> Bool

Tests if L/K is a Kummer extension, that is, if the defining polynomial is of the form xnb for some bK and if K contains the n-th roots of unity.

source

is_radical_extension Method
julia
is_radical_extension(L::SimpleNumField) -> Bool

Tests if L/K is pure, that is, if the defining polynomial is of the form xnb for some bK.

source

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

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

source

is_weakly_ramified Method
julia
is_weakly_ramified(K::AbsSimpleNumField, P::AbsNumFieldOrderIdeal{AbsSimpleNumField, AbsSimpleNumFieldElem}) -> Bool

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

source

is_tamely_ramified Method
julia
is_tamely_ramified(K::AbsSimpleNumField) -> Bool

Returns whether the number field K is tamely ramified.

source

is_tamely_ramified Method
julia
is_tamely_ramified(O::AbsSimpleNumFieldOrder, p::Union{Int, ZZRingElem}) -> Bool

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

source

is_abelian Method
julia
is_abelian(L::NumField) -> Bool

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

source

Subfields

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

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

source

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

Given a simple extension L/K, returns all subfields of L containing K as tuples (k,ι) consisting of a simple extension k and an embedding ιkK.

source

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

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

Examples

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

julia> K, a = number_field(x^8 - x^4 + 1);

julia> length(principal_subfields(K))
8

source

compositum Method
julia
compositum(K::AbsSimpleNumField, L::AbsSimpleNumField) -> AbsSimpleNumField, Map, Map

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

source

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

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

source

normal_closure Method
julia
normal_closure(K::AbsSimpleNumField) -> AbsSimpleNumField, NumFieldHom{AbsSimpleNumField, AbsSimpleNumField}

The normal closure of K together with the embedding map.

source

relative_simple_extension Method
julia
relative_simple_extension(K::NumField, k::NumField) -> RelSimpleNumField

Given two fields Kk, it returns K as a simple relative extension L of k and an isomorphism LK.

source

is_subfield_normal Method
julia
  is_subfield_normal(K::AbsSimpleNumField, L::AbsSimpleNumField) -> Bool, NumFieldHom{AbsSimpleNumField, AbsSimpleNumField}

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

This function assumes that K is normal.

source

Conversion

simplify Method
julia
simplify(K::AbsSimpleNumField; canonical::Bool = false) -> AbsSimpleNumField, NumFieldHom{AbsSimpleNumField, AbsSimpleNumField}

Tries to find an isomorphic field L 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
julia
absolute_simple_field(K::NumField) -> NumField, Map

Given a number field K, this function returns an absolute simple number field M/Q together with a Q-linear isomorphism MK.

source

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

Given a non-simple extension L/K, this function computes a simple extension M/K and a K-linear isomorphism ML.

source

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

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

source

Morphisms

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

Return true if K and L are isomorphic, otherwise false.

source

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

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

source

is_involution Method
julia
is_involution(f::NumFieldHom{AbsSimpleNumField, AbsSimpleNumField}) -> Bool

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

source

fixed_field Method
julia
fixed_field(K::SimpleNumField,
            sigma::Map;
            simplify::Bool = true) -> number_field, NumFieldHom{AbsSimpleNumField, AbsSimpleNumField}

Given a number field K and an automorphism σ of K, this function returns the fixed field of σ as a pair (L,i) consisting of a number field L and an embedding of L into K.

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

source

automorphism_list Method
julia
automorphism_list(L::NumField) -> Vector{NumFieldHom}

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

source

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

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

source

complex_conjugation Method
julia
complex_conjugation(K::AbsSimpleNumField)

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

source

Galois theory

normal_basis Method
julia
normal_basis(L::NumField) -> NumFieldElem

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

source

decomposition_group Method
julia
decomposition_group(K::AbsSimpleNumField, P::AbsNumFieldOrderIdeal{AbsSimpleNumField, AbsSimpleNumFieldElem}, m::Map)
                                              -> Grp, GrpToGrp

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

source

ramification_group Method
julia
ramification_group(K::AbsSimpleNumField, P::AbsNumFieldOrderIdeal{AbsSimpleNumField, AbsSimpleNumFieldElem}, m::Map) -> Grp, GrpToGrp

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

source

inertia_subgroup Method
julia
inertia_subgroup(K::AbsSimpleNumField, P::AbsNumFieldOrderIdeal{AbsSimpleNumField, AbsSimpleNumFieldElem}, m::Map) -> Grp, GrpToGrp

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

source

Infinite places

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

Return all infinite places of the number field.

Examples

julia
julia> K,  = quadratic_field(5);

julia> infinite_places(K)
2-element Vector{InfPlc{AbsSimpleNumField, AbsSimpleNumFieldEmbedding}}:
 Infinite place corresponding to (Complex embedding corresponding to -2.24 of real quadratic field)
 Infinite place corresponding to (Complex embedding corresponding to 2.24 of real quadratic field)

source

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

Return all infinite real places of the number field.

Examples

julia
julia> K,  = quadratic_field(5);

julia> infinite_places(K)
2-element Vector{InfPlc{AbsSimpleNumField, AbsSimpleNumFieldEmbedding}}:
 Infinite place corresponding to (Complex embedding corresponding to -2.24 of real quadratic field)
 Infinite place corresponding to (Complex embedding corresponding to 2.24 of real quadratic field)

source

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

Return all infinite complex places of K.

Examples

julia
julia> K,  = quadratic_field(-5);

julia> complex_places(K)
1-element Vector{InfPlc{AbsSimpleNumField, AbsSimpleNumFieldEmbedding}}:
 Infinite place corresponding to (Complex embedding corresponding to 0.00 + 2.24 * i of imaginary quadratic field)

source

isreal Method
julia
isreal(P::Plc)

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

source

is_complex Method
julia
is_complex(P::Plc) -> Bool

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

source

Miscellaneous

norm_equation Method
julia
norm_equation(K::AnticNumerField, a) -> AbsSimpleNumFieldElem

For a an integer or rational, try to find TK s.th. N(T)=a. Raises an error if unsuccessful.

source

lorenz_module Method
julia
lorenz_module(k::AbsSimpleNumField, n::Int) -> AbsNumFieldOrderIdeal{AbsSimpleNumField, AbsSimpleNumFieldElem}

Finds an ideal A s.th. for all positive units e=1modA we have that e is an n-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
julia
kummer_failure(x::AbsSimpleNumFieldElem, M::Int, N::Int) -> Int

Computes the quotient of N and [K(ζM,(Nx)):K(ζM)], where K is the field containing x and N divides M.

source

is_defining_polynomial_nice Method
julia
is_defining_polynomial_nice(K::AbsSimpleNumField)

Tests if the defining polynomial of K is integral and monic.

source