Skip to content

Ideals

(Integral) ideals in orders are always free -module of the same rank as the order, hence have a representation via a -basis. This can be made unique by normalising the corresponding matrix to be in reduced row echelon form (HNF).

For ideals in maximal orders , we also have a second presentation coming from the module structure and the fact that is a Dedekind ring: ideals can be generated by 2 elements, one of which can be any non-zero element in the ideal.

For efficiency, we will choose the 1st generator to be an integer.

Ideals here are of type NfAbsOrdIdl, which is, similar to the elements above, also indexed by the type of the field and their elements: NfAbsOrdIdl{AnticNumberField,nf_elem} for ideals in simple absolute fields.

Different to elements, the parentof an ideal is teh set of all ideals in the ring, of type NfAbsOrdIdlSet.

Creation

# ideal — Method.

ideal(O::NfOrd, a::fmpz) -> NfAbsOrdIdl
ideal(O::NfOrd, a::Integer) -> NfAbsOrdIdl

Returns the ideal of which is generated by .

source

# ideal — Method.

ideal(O::NfOrd, x::fmpz_mat, check::Bool = false, x_in_hnf::Bool = false) -> NfAbsOrdIdl

Creates the ideal of with basis matrix . If check is set, then it is checked whether defines an ideal (expensive). If x_in_hnf is set, then it is assumed that is already in lower left HNF.

source

# ideal — Method.

ideal(O::NfOrd, x::NfOrdElem) -> NfAbsOrdIdl

Creates the principal ideal of .

source

# ideal — Method.

ideal(O::NfOrd, x::fmpz, y::NfOrdElem) -> NfAbsOrdIdl
ideal(O::NfOrd, x::Integer, y::NfOrdElem) -> NfAbsOrdIdl

Creates the ideal of .

source

# ideal — Method.

ideal(O::NfOrd, x::fmpz, y::NfOrdElem) -> NfAbsOrdIdl
ideal(O::NfOrd, x::Integer, y::NfOrdElem) -> NfAbsOrdIdl

Creates the ideal of .

source

# ideal — Method.

ideal(O::NfOrd, a::fmpz) -> NfAbsOrdIdl
ideal(O::NfOrd, a::Integer) -> NfAbsOrdIdl

Returns the ideal of which is generated by .

source

# ideal — Method.

ideal(O::NfOrd, x::NfOrdElem) -> NfAbsOrdIdl

Creates the principal ideal of .

source

# * — Method.

*(O::NfOrd, x::NfOrdElem) -> NfAbsOrdIdl
*(x::NfAbsOrdElem, O::NfAbsOrd) -> NfAbsOrdIdl

Returns the principal ideal of .

source

# factor — Method.

factor(A::NfOrdIdl) -> Dict{NfOrdIdl, Int}

Computes the prime ideal factorization as a dictionary, the keys being the prime ideal divisors: If lp = factor_dict(A), then keys(lp) are the prime ideal divisors of and lp[P] is the -adic valuation of for all in keys(lp).

source

# factor — Method.

factor(a::nf_elem, I::NfOrdIdlSet) -> Dict{NfOrdIdl, fmpz}

Factors the principal ideal generated by .

source

# coprime_base — Method.

coprime_base(A::Vector{NfOrdIdl}) -> Vector{NfOrdIdl}
coprime_base(A::Vector{NfOrdElem}) -> Vector{NfOrdIdl}

A coprime base for the (principal) ideals in , i.e. the returned array generated multiplicatively the same ideals as the input and are pairwise coprime.

source

Arithmetic

All the usual operations are supported:

  • ==, +, *
  • divexact, divides
  • lcm, gcd
  • in

# intersect — Method.

intersect(x::NfOrdIdl, y::NfOrdIdl) -> NfOrdIdl

Returns .

source

# colon — Method.

colon(a::NfAbsOrdIdl, b::NfAbsOrdIdl) -> NfOrdFracIdl

The ideal where is the number field.

source

# in — Method.

in(x::NumFieldOrdElem, y::NumFieldOrdIdl)
in(x::NumFieldElem, y::NumFieldOrdIdl)
in(x::fmpz, y::NumFieldOrdIdl)

Returns whether is contained in .

source

# is_power — Method.

is_power(A::NfAbsOrdIdl, n::Int) -> Bool, NfAbsOrdIdl
is_power(A::NfOrdFracIdl, n::Int) -> Bool, NfOrdFracIdl

Computes, if possible, an ideal s.th. holds. In this case, true and are returned.

source

# is_power — Method.

is_power(I::NfAbsOrdIdl) -> Int, NfAbsOrdIdl
is_power(a::NfOrdFracIdl) -> Int, NfOrdFracIdl

Writes with maximal. Note: .

source

# is_invertible — Method.

is_invertible(A::NfAbsOrdIdl) -> Bool, NfOrdFracIdl

Returns true and an inverse of or false and an ideal such that , if is not invertible.

source

# isone — Method.

isone(A::NfAbsOrdIdl) -> Bool
is_unit(A::NfAbsOrdIdl) -> Bool

Tests if is the trivial ideal generated by .

source

Class Group

The group of invertable ideals in any order forms a group and the principal ideals a subgroup. The finite quotient is called class group for maximal orders and Picard group or ring class group in general.

# class_group — Method.

class_group(O::NfOrd; bound = -1, method = 3, redo = false, large = 1000) -> GrpAbFinGen, Map

Returns a group and a map from to the set of ideals of . The inverse of the map is the projection onto the group of ideals modulo the group of principal ideals. redo allows to trigger a re-computation, thus avoiding the cache. bound, when given, is the bound for the factor base.

source

# narrow_class_group — Method.

narrow_class_group(O::NfOrd) -> GrpAbFinGen, Map

Computes the narrow (or strict) class group of , ie. the group of invertable ideals modulo principal ideals generated by elements that are positive at all real places.

source

# picard_group — Method.

picard_group(O::NfOrd) -> GrpAbFinGen, MapClassGrp

Returns the Picard group of and a map from the group in the set of (invertible) ideals of .

source

# ring_class_group — Method.

ring_class_group(O::NfAbsOrd)

The ring class group (Picard group) of .

source

julia> k, a = wildanger_field(3, 13);


julia> zk = maximal_order(k);


julia> c, mc = class_group(zk)
(GrpAb: Z/9, ClassGroup map of
Set of ideals of Maximal order of Number field over Rational Field with defining polynomial x^3 - 13*x^2 + 13*x - 13
with basis nf_elem[1, _$, 1//2*_$^2 + 1//2]
)

julia> lp = prime_ideals_up_to(zk, 20);


julia> [ mc \ I for I = lp]
10-element Vector{GrpAbFinGenElem}:
 Element of
GrpAb: Z/9
with components [4]
 Element of
GrpAb: Z/9
with components [1]
 Element of
GrpAb: Z/9
with components [4]
 Element of
GrpAb: Z/9
with components [5]
 Element of
GrpAb: Z/9
with components [3]
 Element of
GrpAb: Z/9
with components [2]
 Element of
GrpAb: Z/9
with components [7]
 Element of
GrpAb: Z/9
with components [1]
 Element of
GrpAb: Z/9
with components [0]
 Element of
GrpAb: Z/9
with components [2]

julia> mc(c[1])
<2, 7//2*_$^2 + _$ + 7//2>
Norm: 2
Minimum: 2
two normal wrt: 2

julia> order(c[1])
9

julia> mc(c[1])^Int(order(c[1]))
<512, 41794786087639248563497//2*_$^2 - 20740473623078307949289*_$ + 45249369973270754110597//2>
Norm: 512
Minimum: 512
two normal wrt: 2

julia> mc \ ans
Element of
GrpAb: Z/9
with components [0]

The class group, or more precisely the information used to compute it also allows for principal ideal testing and related tasks. In general, due to the size of the objetcs, the fac_elem versions are more effcient.

# is_principal — Method.

is_principal(A::NfOrdIdl) -> Bool, NfOrdElem
is_principal(A::NfOrdFracIdl) -> Bool, NfOrdElem

Tests if is principal and returns if or otherwise.

source

# is_principal_fac_elem — Method.

is_principal_fac_elem(A::NfOrdIdl) -> Bool, FacElem{nf_elem, NumberField}

Tests if is principal and returns if or otherwise. The generator will be in factored form.

source

# power_class — Method.

power_class(A::NfOrdIdl, e::fmpz) -> NfOrdIdl

Computes a (small) ideal in the same class as .

source

# power_product_class — Method.

power_product_class(A::Vector{NfOrdIdl}, e::Vector{fmpz}) -> NfOrdIdl

Computes a (small) ideal in the same class as .

source

# power_reduce — Method.

power_reduce(A::NfOrdIdl, e::fmpz) -> NfOrdIdl, FacElem{nf_elem}

Computes and in factored form, such that has small norm.

source

# class_group_ideal_relation — Method.

class_group_ideal_relation(I::NfOrdIdl, c::ClassGrpCtx) -> nf_elem, SRow{fmpz}

Finds a number field element such that factors over the factor base in .

source

# factor_base_bound_grh — Method.

factor_base_bound_grh(O::NfOrd) -> Int

Returns an integer , such that under GRH the ideal class group of is generated by the prime ideals of norm bounded by .

source

# factor_base_bound_bach — Method.

factor_base_bound_bach(O::NfOrd) -> Int

Use the theorem of Bach to find such that under GRH the ideal class group of is generated by the prime ideals of norm bounded by .

source

# prime_ideals_up_to — Function.

prime_ideals_up_to(O::NfOrd,
                   B::Int;
                   degree_limit::Int = 0, index_divisors::Bool = true) -> Vector{NfOrdIdl}

Computes the prime ideals with norm up to .

If degree_limit is a nonzero integer , then prime ideals with will be discarded. If 'index_divisors' is set to false, only primes not dividing the index of the order will be computed.

source

prime_ideals_up_to(O::NfOrd,
                   B::Int;
                   complete::Bool = false,
                   degree_limit::Int = 0,
                   F::Function,
                   bad::fmpz)

Computes the prime ideals with norm up to .

If degree_limit is a nonzero integer , then prime ideals with will be discarded.

The function must be a function on prime numbers not dividing bad such that for all prime ideals lying above .

source

julia> I = mc(c[1])
<2, 7//2*_$^2 + _$ + 7//2>
Norm: 2
Minimum: 2
two normal wrt: 2

julia> Hecke.is_principal(I)
(false, 1)

julia> I = I^Int(order(c[1]))
<512, 41794786087639248563497//2*_$^2 - 20740473623078307949289*_$ + 45249369973270754110597//2>
Norm: 512
Minimum: 512
two normal wrt: 2

julia> Hecke.is_principal(I)
(true, 1//2*_$^2 - 3*_$ + 9//2)

julia> Hecke.is_principal_fac_elem(I)
(true, Factored element with data
Dict{nf_elem, fmpz}(1//2*_$^2 - 3*_$ + 9//2 => 1))

The computation of -units is also tied to the class group:

# torsion_units — Method.

torsion_units(O::NfOrd) -> Vector{NfOrdElem}

Given an order , compute the torsion units of .

source

# torsion_unit_group — Method.

torsion_unit_group(O::NfOrd) -> GrpAb, Map

Given an order , returns the torsion units as an abelian group together with a map .

source

# torsion_units_generator — Method.

torsion_units_generator(O::NfOrd) -> NfOrdElem

Given an order , compute a generator of the torsion units of .

source

# torsion_units_gen_order — Method.

torsion_units_gen_order(O::NfOrd) -> NfOrdElem

Given an order , compute a generator of the torsion units of as well as its order.

source

# unit_group — Method.

unit_group(O::NfOrd) -> GrpAbFinGen, Map

Returns a group and an isomorphism map . A set of fundamental units of can be obtained via [ f(U[1+i]) for i in 1:unit_group_rank(O) ]. f(U[1]) will give a generator for the torsion subgroup.

source

# unit_group_fac_elem — Method.

unit_group_fac_elem(O::NfOrd) -> GrpAbFinGen, Map

Returns a group and an isomorphism map . A set of fundamental units of can be obtained via [ f(U[1+i]) for i in 1:unit_group_rank(O) ]. f(U[1]) will give a generator for the torsion subgroup. All elements will be returned in factored form.

source

# sunit_group — Method.

sunit_group(I::Vector{NfOrdIdl}) -> GrpAb, Map

For an array of (coprime prime) ideals, find the -unit group defined by , ie. the group of non-zero field elements which are only divisible by ideals in .

source

# sunit_group_fac_elem — Method.

sunit_group_fac_elem(I::Vector{NfOrdIdl}) -> GrpAb, Map

For an array of (coprime prime) ideals, find the -unit group defined by , ie. the group of non-zero field elements which are only divisible by ideals in . The map will return elements in factored form.

source

# sunit_mod_units_group_fac_elem — Method.

sunit_mod_units_group_fac_elem(I::Vector{NfOrdIdl}) -> GrpAb, Map

For an array of (coprime prime) ideals, find the -unit group defined by , ie. the group of non-zero field elements which are only divisible by ideals in modulo the units of the field. The map will return elements in factored form.

source

julia> u, mu = unit_group(zk)
(GrpAb: Z/2 x Z, UnitGroup map of Maximal order of Number field over Rational Field with defining polynomial x^3 - 13*x^2 + 13*x - 13
with basis nf_elem[1, _$, 1//2*_$^2 + 1//2]
)

julia> mu(u[2])
-_$ + 12

julia> u, mu = unit_group_fac_elem(zk)
(GrpAb: Z/2 x Z, UnitGroup map of Factored elements over Number field over Rational Field with defining polynomial x^3 - 13*x^2 + 13*x - 13
)

julia> mu(u[2])
Factored element with data
Dict{nf_elem, fmpz}(-1//2*_$^2 + 6*_$ - 3//2 => 1, 5 => 1, _$^2 + _$ + 2 => -1, -5*_$^2 + 34*_$ + 299 => 1, -5//2*_$^2 + 17*_$ + 299//2 => -1, _$ + 1 => -1)

julia> evaluate(ans)
-_$ + 12

julia> lp = factor(6*zk)
Dict{NfOrdIdl, Int64} with 4 entries:
  <3, _$ + 5>                => 1
  <3, _$^2 + 1>              => 1
  <2, 7//2*_$^2 + 7//2>      => 2
  <2, 3//2*_$^2 + _$ + 3//2> => 1

julia> s, ms = Hecke.sunit_group(collect(keys(lp)))
(GrpAb: Z/2 x Z^(5), SUnits  map of Number field over Rational Field with defining polynomial x^3 - 13*x^2 + 13*x - 13 for NfOrdIdl[<3, _$ + 5>
Norm: 3
Minimum: 3
basis_matrix
[3 0 0; 2 1 0; 2 0 1]
two normal wrt: 3, <3, _$^2 + 1>
Norm: 9
Minimum: 3
basis_matrix
[3 0 0; 0 3 0; 0 0 1]
two normal wrt: 3, <2, 7//2*_$^2 + 7//2>
Norm: 2
Minimum: 2
basis_matrix
[2 0 0; 1 1 0; 0 0 1]
two normal wrt: 2, <2, 3//2*_$^2 + _$ + 3//2>
Norm: 2
Minimum: 2
basis_matrix
[2 0 0; 1 1 0; 1 0 1]
two normal wrt: 2]
)

julia> ms(s[4])
1//2*_$^2 - 6*_$ - 5//2

julia> norm(ans)
-144

julia> factor(numerator(ans))
-1 * 2^4 * 3^2

Miscaellenous

# order — Method.

order(I::NumFieldOrdIdl) -> NfOrd

Returns the order of .

source

# order — Method.

order(a::NfAbsOrdFracIdl) -> NfAbsOrd

The order that was used to define the ideal .

source

# order — Method.

order(I::NumFieldOrdIdl) -> NfOrd

Returns the order of .

source

# order — Method.

order(a::NfRelOrdFracIdl) -> NfRelOrd

Returns the order of .

source

# nf — Method.

nf(x::NumFieldOrdIdl) -> AnticNumberField

Returns the number field, of which is an integral ideal.

source

# basis — Method.

basis(A::NfAbsOrdIdl) -> Vector{NfOrdElem}

Returns the basis of .

source

basis(I::NfAbsOrdFracIdl) -> Vector{nf_elem}

Returns the -basis of .

source

# lll_basis — Method.

lll_basis(I::NumFieldOrdIdl) -> Vector{NumFieldElem}

A basis for that is reduced using the LLL algorithm for the Minkowski metric.

source

# basis_matrix — Method.

basis_matrix(A::NfAbsOrdIdl) -> fmpz_mat

Returns the basis matrix of .

source

# basis_mat_inv — Method.

basis_mat_inv(A::NfAbsOrdIdl) -> fmpz_mat

Returns the inverse basis matrix of .

source

basis_mat_inv(A::GenOrdIdl) -> FakeFracFldMat

Return the inverse of the basis matrix of .

source

# assure_has_basis_mat_inv — Method.

basis_mat_inv(A::NfAbsOrdIdl) -> FakeFmpqMat

Returns the inverse of the basis matrix of .

source

# has_basis — Method.

has_basis(A::NfAbsOrdIdl) -> Bool

Returns whether has a basis already computed.

source

# has_basis_matrix — Method.

has_basis_matrix(A::NfAbsOrdIdl) -> Bool

Returns whether knows its basis matrix.

source

# has_2_elem — Method.

has_2_elem(A::NfAbsOrdIdl) -> Bool

Returns whether is generated by two elements.

source

# has_2_elem_normal — Method.

has_2_elem_normal(A::NfAbsOrdIdl) -> Bool

Returns whether has normal two element generators.

source

# has_weakly_normal — Method.

has_weakly_normal(A::NfAbsOrdIdl) -> Bool

Returns whether has weakly normal two element generators.

source

# has_princ_gen_special — Method.

has_princ_gen_special(A::NfAbsOrdIdl) -> Bool

Returns whether knows if it is generated by a rational integer.

source

# principal_generator — Method.

principal_generator(A::NfOrdIdl) -> NfOrdElem

For a principal ideal , find a generator.

source

# principal_generator_fac_elem — Method.

principal_generator_fac_elem(A::NfOrdIdl) -> FacElem{nf_elem, NumberField}

For a principal ideal , find a generator in factored form.

source

# minimum — Method.

minimum(A::NfAbsOrdIdl) -> fmpz

Returns the smallest nonnegative element in .

source

  minimum(A::NfRelOrdIdl) -> NfOrdIdl
  minimum(A::NfRelOrdIdl) -> NfRelOrdIdl

Returns the ideal where is the maximal order of the coefficient ideals of .

source

# minimum — Method.

  minimum(A::NfRelOrdIdl) -> NfOrdIdl
  minimum(A::NfRelOrdIdl) -> NfRelOrdIdl

Returns the ideal where is the maximal order of the coefficient ideals of .

source

# minimum — Method.

minimum(A::NfAbsOrdIdl) -> fmpz

Returns the smallest nonnegative element in .

source

# has_minimum — Method.

has_minimum(A::NfAbsOrdIdl) -> Bool

Returns whether knows its mininum.

source

# norm — Method.

norm(A::NfAbsOrdIdl) -> fmpz

Returns the norm of , that is, the cardinality of , where is the order of .

source

norm(a::NfRelOrdIdl) -> NfOrdIdl

Returns the norm of .

source

norm(a::NfRelOrdFracIdl{T, S}) -> S

Returns the norm of .

source

norm(a::AlgAssAbsOrdIdl, O::AlgAssAbsOrd; copy::Bool = true) -> fmpq

Returns the norm of considered as an (possibly fractional) ideal of .

source

norm(a::AlgAssRelOrdIdl{S, T, U}, O::AlgAssRelOrd{S, T, U}; copy::Bool = true)
  where { S, T, U } -> T

Returns the norm of considered as an (possibly fractional) ideal of .

source

# has_norm — Method.

has_norm(A::NfAbsOrdIdl) -> Bool

Returns whether knows its norm.

source

# idempotents — Method.

idempotents(x::NfOrdIdl, y::NfOrdIdl) -> NfOrdElem, NfOrdElem

Returns a tuple (e, f) consisting of elements e in x, f in y such that 1 = e + f.

If the ideals are not coprime, an error is raised.

source

# is_prime — Method.

is_prime(A::NfOrdIdl) -> Bool

Returns whether is a prime ideal.

source

# is_prime_known — Method.

is_prime_known(A::NfOrdIdl) -> Bool

Returns whether knows if it is prime.

source

# is_ramified — Method.

is_ramified(O::NfOrd, p::Int) -> Bool

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

source

# ramification_index — Method.

ramification_index(P::NfOrdIdl) -> Int

The ramification index of the prime-ideal .

source

# degree — Method.

degree(P::NfOrdIdl) -> Int

The inertia degree of the prime-ideal .

source

# valuation — Method.

valuation(a::NumFieldElem, p::NfOrdIdl) -> fmpz

Computes the -adic valuation of , that is, the largest such that is contained in .

source

# valuation — Method.

valuation(a::nf_elem, p::NfOrdIdl) -> fmpz
valuation(a::NfOrdElem, p::NfOrdIdl) -> fmpz
valuation(a::fmpz, p::NfOrdIdl) -> fmpz

Computes the -adic valuation of , that is, the largest such that is contained in .

source

# valuation — Method.

valuation(A::NfOrdIdl, p::NfOrdIdl) -> fmpz

Computes the -adic valuation of , that is, the largest such that is contained in .

source

# valuation — Method.

valuation(a::Integer, p::NfOrdIdl) -> fmpz

Computes the -adic valuation of , that is, the largest such that is contained in .

source

# valuation — Method.

valuation(a::nf_elem, p::NfOrdIdl) -> fmpz
valuation(a::NfOrdElem, p::NfOrdIdl) -> fmpz
valuation(a::fmpz, p::NfOrdIdl) -> fmpz

Computes the -adic valuation of , that is, the largest such that is contained in .

source

# valuation — Method.

valuation(A::NfAbsOrdFracIdl, p::NfAbsOrdIdl)

The valuation of at .

source

# idempotents — Method.

idempotents(x::NfOrdIdl, y::NfOrdIdl) -> NfOrdElem, NfOrdElem

Returns a tuple (e, f) consisting of elements e in x, f in y such that 1 = e + f.

If the ideals are not coprime, an error is raised.

source

Quotient Rings

# quo — Method.

quo(O::NfOrd, I::NfOrdIdl) -> NfOrdQuoRing, Map
quo(O::AlgAssAbsOrd, I::AlgAssAbsOrdIdl) -> AbsOrdQuoRing, Map

The quotient ring as a ring together with the section . The pointwise inverse of is the canonical projection .

source

# ResidueRing — Method.

ResidueRing(O::NfOrd, I::NfOrdIdl) -> NfOrdQuoRing
ResidueRing(O::AlgAssAbsOrd, I::AlgAssAbsOrdIdl) -> AbsOrdQuoRing

The quotient ring modulo as a new ring.

source

# ResidueField — Method.

ResidueField(O::NfOrd, P::NfOrdIdl, check::Bool = true) -> Field, Map

Returns the residue field of the prime ideal together with the projection map. If check is true, the ideal is checked for being prime.

source

# mod — Method.

mod(x::NfOrdElem, I::NfAbsOrdIdl)

Returns the unique element of the ambient order of with and the following property: If are the diagonal entries of the unique HNF basis matrix of and is the coefficient vector of , then for .

source

# crt — Method.

crt(r1::NfOrdElem, i1::NfOrdIdl, r2::NfOrdElem, i2::NfOrdIdl) -> NfOrdElem

Find such that and using idempotents.

source

# euler_phi — Method.

euler_phi(A::NfOrdIdl) -> fmpz

The ideal version of the totient function returns the size of the unit group of the residue ring modulo the ideal.

source

# multiplicative_group — Method.

multiplicative_group(Q::NfOrdQuoRing) -> GrpAbFinGen, Map{GrpAbFinGen, NfOrdQuoRing}
unit_group(Q::NfOrdQuoRing) -> GrpAbFinGen, Map{GrpAbFinGen, NfOrdQuoRing}

Returns the unit group of as an abstract group and an isomorphism map .

source

# multiplicative_group_generators — Method.

multiplicative_group_generators(Q::NfOrdQuoRing) -> Vector{NfOrdQuoRingElem}

Return a set of generators for .

source