# Ideals

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

For ideals in maximal orders $Z_K$, we also have a second presentation coming from the $Z_K$ module structure and the fact that $Z_K$ 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

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

Returns the ideal of $\mathcal O$ which is generated by $a$.

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

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

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

Creates the principal ideal $(x)$ of $\mathcal O$.

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

Creates the ideal $(x, y)$ of $\mathcal O$.

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

Creates the ideal $(x, y)$ of $\mathcal O$.

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

Returns the ideal of $\mathcal O$ which is generated by $a$.

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

Creates the principal ideal $(x)$ of $\mathcal O$.

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

Returns the principal ideal $(x)$ of $\mathcal O$.

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

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

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

Factors the principal ideal generated by $a$.

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

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

## Arithmetic

All the usual operations are supported:

• ==, +, *
• divexact, divides
• lcm, gcd
• in
intersectMethod
intersect(x::NfOrdIdl, y::NfOrdIdl) -> NfOrdIdl

Returns $x \cap y$.

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

The ideal $(a:b) = \{x \in K | xb \subseteq a\} = \hom(b, a)$ where $K$ is the number field.

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

Returns whether $x$ is contained in $y$.

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

Computes, if possible, an ideal $B$ s.th. $B^n==A$ holds. In this case, true and $B$ are returned.

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

Writes $a = r^e$ with $e$ maximal. Note: $1 = 1^0$.

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

Returns true and an inverse of $A$ or false and an ideal $B$ such that $A*B \subsetneq order(A)$, if $A$ is not invertible.

isoneMethod
isone(I::PBWAlgIdeal{D}) where D

Return true if I is generated by 1, false otherwise.

Examples

julia> D, (x, y, dx, dy) = weyl_algebra(QQ, ["x", "y"])
(PBW-algebra over Rational Field in x, y, dx, dy with relations y*x = x*y, dx*x = x*dx + 1, dy*x = x*dy, dx*y = y*dx, dy*y = y*dy + 1, dy*dx = dx*dy, PBWAlgElem{fmpq, Singular.n_Q}[x, y, dx, dy])

julia> I = left_ideal(D, [x, dx])
left_ideal(x, dx)

julia> isone(I)
true

julia> J = left_ideal(D, [y*x])
left_ideal(x*y)

julia> isone(J)
false

julia> K = two_sided_ideal(D, [y*x])
two_sided_ideal(x*y)

julia> isone(K)
true
julia> D, (x, y, dx, dy) = weyl_algebra(GF(3), ["x", "y"]);

julia> I = two_sided_ideal(D, [x^3])
two_sided_ideal(x^3)

julia> isone(I)
false
source
isone(A::NfAbsOrdIdl) -> Bool
is_unit(A::NfAbsOrdIdl) -> Bool

Tests if $A$ is the trivial ideal generated by $1$.

## 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_groupMethod
class_group(O::NfOrd; bound = -1, method = 3, redo = false, large = 1000) -> GrpAbFinGen, Map

Returns a group $A$ and a map $f$ from $A$ to the set of ideals of $O$. 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.

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

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

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

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

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 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components 
Element of
GrpAb: Z/9
with components julia> mc(c)<2, 5//2*_$^2 + 2*_$ + 5//2>
Norm: 2
Minimum: 2
two normal wrt: 2julia> order(c)9julia> mc(c)^Int(order(c))<32, 2918123142641433227771//2*_$^2 - 1448105415396508423111*_$ + 3159323113463603298773//2>
Norm: 512
Minimum: 32
two normal wrt: 2julia> mc \ ansElement of
GrpAb: Z/9
with components 

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_principalMethod
is_principal(A::NfOrdIdl) -> Bool, NfOrdElem
is_principal(A::NfOrdFracIdl) -> Bool, NfOrdElem

Tests if $A$ is principal and returns $(\mathtt{true}, \alpha)$ if $A = \langle \alpha\rangle$ or $(\mathtt{false}, 1)$ otherwise.

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

Tests if $A$ is principal and returns $(\mathtt{true}, \alpha)$ if $A = \langle \alpha\rangle$ or $(\mathtt{false}, 1)$ otherwise. The generator will be in factored form.

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

Computes a (small) ideal in the same class as $A^e$.

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

Computes a (small) ideal in the same class as $\prod A_i^{e_i}$.

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

Computes $B$ and $\alpha$ in factored form, such that $\alpha B = A^e$ $B$ has small norm.

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

Finds a number field element $\alpha$ such that $\alpha I$ factors over the factor base in $c$.

factor_base_bound_grhMethod
factor_base_bound_grh(O::NfOrd) -> Int

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

factor_base_bound_bachMethod
factor_base_bound_bach(O::NfOrd) -> Int

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

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

Computes the prime ideals $\mathcal O$ with norm up to $B$.

If degree_limit is a nonzero integer $k$, then prime ideals $\mathfrak p$ with $\deg(\mathfrak p) > k$ will be discarded. If 'index_divisors' is set to false, only primes not dividing the index of the order will be computed.

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

Computes the prime ideals $\mathcal O$ with norm up to $B$.

If degree_limit is a nonzero integer $k$, then prime ideals $\mathfrak p$ with $\deg(\mathfrak p) > k$ will be discarded.

The function $F$ must be a function on prime numbers not dividing bad such that $F(p) = \deg(\mathfrak p)$ for all prime ideals $\mathfrak p$ lying above $p$.

julia> I = mc(c)<2, 5//2*_$^2 + 2*_$ + 5//2>
Norm: 2
Minimum: 2
two normal wrt: 2julia> Hecke.is_principal(I)(false, 1)julia> I = I^Int(order(c))<32, 2918123142641433227771//2*_$^2 - 1448105415396508423111*_$ + 3159323113463603298773//2>
Norm: 512
Minimum: 32
two normal wrt: 2julia> Hecke.is_principal(I)(true, 1//2*_$^2 - 5*_$ - 17//2)julia> Hecke.is_principal_fac_elem(I)(true, Factored element with data
Dict{nf_elem, fmpz}(1//2*_$^2 - 5*_$ - 17//2 => 1))

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

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

Given an order $O$, compute the torsion units of $O$.

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

Given an order $\mathcal O$, returns the torsion units as an abelian group $G$ together with a map $G \to \mathcal O^\times$.

torsion_units_generatorMethod
torsion_units_generator(O::NfOrd) -> NfOrdElem

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

torsion_units_gen_orderMethod
torsion_units_gen_order(O::NfOrd) -> NfOrdElem

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

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

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

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

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

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

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

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

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

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

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

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 + _$ - 1julia> 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)Factored element with data
Dict{nf_elem, fmpz}(-1//2*_$^2 + 6*_$ - 3//2 => -1, -2*_$^2 + 21*_$ + 65 => -1, 5 => -1, _$^2 + _$ + 2 => 1, -7//2*_$^2 + 56*_$ + 39//2 => 1)julia> evaluate(ans)-_$^2 + _$ - 1julia> lp = factor(6*zk)Dict{NfOrdIdl, Int64} with 4 entries:
<3, _$+ 5> => 1 <3, _$^2 + 1>                => 1
<2, 3//2*_$^2 + 7//2> => 2 <2, 3//2*_$^2 + 3*_$+ 7//2> => 1julia> 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, 3//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*_$ + 7//2>
Norm: 2
Minimum: 2
basis_matrix
[2 0 0; 1 1 0; 1 0 1]
two normal wrt: 2]
)julia> ms(s)1//2*_$^2 - 6*_$ - 5//2julia> norm(ans)-144julia> factor(numerator(ans))-1 * 2^4 * 3^2

## Miscaellenous

orderMethod
order(I::NumFieldOrdIdl) -> NfOrd

Returns the order of $I$.

orderMethod
order(a::NfAbsOrdFracIdl) -> NfAbsOrd

The order that was used to define the ideal $a$.

orderMethod
order(I::NumFieldOrdIdl) -> NfOrd

Returns the order of $I$.

orderMethod
order(a::NfRelOrdFracIdl) -> NfRelOrd

Returns the order of $a$.

nfMethod
nf(x::NumFieldOrdIdl) -> AnticNumberField

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

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

Returns the basis of $A$.

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

Returns the $\mathbf Z$-basis of $I$.

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

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

basis_matrixMethod
basis_matrix(A::NfAbsOrdIdl) -> fmpz_mat

Returns the basis matrix of $A$.

basis_mat_invMethod
basis_mat_inv(A::NfAbsOrdIdl) -> fmpz_mat

Returns the inverse basis matrix of $A$.

basis_mat_inv(A::GenOrdIdl) -> FakeFracFldMat

Return the inverse of the basis matrix of $A$.

has_basisMethod
has_basis(A::NfAbsOrdIdl) -> Bool

Returns whether $A$ has a basis already computed.

has_basis_matrixMethod
has_basis_matrix(A::NfAbsOrdIdl) -> Bool

Returns whether $A$ knows its basis matrix.

has_2_elemMethod
has_2_elem(A::NfAbsOrdIdl) -> Bool

Returns whether $A$ is generated by two elements.

has_2_elem_normalMethod
has_2_elem_normal(A::NfAbsOrdIdl) -> Bool

Returns whether $A$ has normal two element generators.

has_weakly_normalMethod
has_weakly_normal(A::NfAbsOrdIdl) -> Bool

Returns whether $A$ has weakly normal two element generators.

has_princ_gen_specialMethod
has_princ_gen_special(A::NfAbsOrdIdl) -> Bool

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

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

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

minimumMethod
minimum(A::NfAbsOrdIdl) -> fmpz

Returns the smallest nonnegative element in $A \cap \mathbf Z$.

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

Returns the ideal $A \cap O$ where $O$ is the maximal order of the coefficient ideals of $A$.

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

Returns the ideal $A \cap O$ where $O$ is the maximal order of the coefficient ideals of $A$.

minimumMethod
minimum(A::NfAbsOrdIdl) -> fmpz

Returns the smallest nonnegative element in $A \cap \mathbf Z$.

has_minimumMethod
has_minimum(A::NfAbsOrdIdl) -> Bool

Returns whether $A$ knows its mininum.

normMethod
norm(A::NfAbsOrdIdl) -> fmpz

Returns the norm of $A$, that is, the cardinality of $\mathcal O/A$, where $\mathcal O$ is the order of $A$.

norm(a::NfRelOrdIdl) -> NfOrdIdl

Returns the norm of $a$.

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

Returns the norm of $a$.

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

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

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

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

has_normMethod
has_norm(A::NfAbsOrdIdl) -> Bool

Returns whether $A$ knows its norm.

idempotentsMethod
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.

is_primeMethod
is_prime(A::NfOrdIdl) -> Bool

Returns whether $A$ is a prime ideal.

is_prime_knownMethod
is_prime_known(A::NfOrdIdl) -> Bool

Returns whether $A$ knows if it is prime.

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

Returns whether the integer $p$ is ramified in $\mathcal O$. It is assumed that $p$ is prime.

degreeMethod
degree(P::NfOrdIdl) -> Int

The inertia degree of the prime-ideal $P$.

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

Computes the $\mathfrak p$-adic valuation of $a$, that is, the largest $i$ such that $a$ is contained in $\mathfrak p^i$.

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

Computes the $\mathfrak p$-adic valuation of $a$, that is, the largest $i$ such that $a$ is contained in $\mathfrak p^i$.

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

Computes the $\mathfrak p$-adic valuation of $A$, that is, the largest $i$ such that $A$ is contained in $\mathfrak p^i$.

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

Computes the $\mathfrak p$-adic valuation of $a$, that is, the largest $i$ such that $a$ is contained in $\mathfrak p^i$.

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

Computes the $\mathfrak p$-adic valuation of $a$, that is, the largest $i$ such that $a$ is contained in $\mathfrak p^i$.

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

The valuation of $A$ at $p$.

idempotentsMethod
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.

## Quotient Rings

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

The quotient ring $O/I$ as a ring together with the section $M: O/I \to O$. The pointwise inverse of $M$ is the canonical projection $O\to O/I$.

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

The quotient ring $O$ modulo $I$ as a new ring.

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

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

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

Returns the unique element $y$ of the ambient order of $x$ with $x \equiv y \bmod I$ and the following property: If $a_1,\dotsc,a_d \in \mathbf{Z}_{\geq 1}$ are the diagonal entries of the unique HNF basis matrix of $I$ and $(b_1,\dotsc,b_d)$ is the coefficient vector of $y$, then $0 \leq b_i < a_i$ for $1 \leq i \leq d$.

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

Find $x$ such that $x \equiv r_1 \bmod i_1$ and $x \equiv r_2 \bmod i_2$ using idempotents.

euler_phiMethod
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.

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

Returns the unit group of $Q$ as an abstract group $A$ and an isomorphism map $f \colon A \to Q^\times$.