# Maximal Orders

## Ideals

inv(A::NfMaxOrdIdl) -> NfMaxOrdFracIdl

Computes the inverse of A, that is, the fractional ideal such that .

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

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

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

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

isramified(O::NfMaxOrd, p::Int) -> Bool

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

prime_decomposition(O::NfMaxOrd, p::Integer, degree_limit::Int = 0, lower_limit::Int = 0) -> Array{Tuple{NfMaxOrdIdl, Int}, 1}

Returns an array of tuples such that is the product of the and for .

If

`degree_limit`

is a nonzero integer , then only those prime ideals with will be returned. Similarly if`\lower_limit`

is a nonzero integer , then only those prime ideals with will be returned. Note that in this case it may happen that is not the product of the .

prime_ideals_up_to(O::NfMaxOrd, B::Int; degree_limit::Int = 0) -> Array{NfMaxOrdIdl, 1}

Computes the prime ideals with norm up to .

If

`degree_limit`

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

factor(A::NfMaxOrdIdl) -> Dict{NfMaxOrdIdl, 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 A and`lp[P]`

is the`P`

-adic valuation of`A`

for all`P`

in`keys(lp)`

.

divexact(A::NfMaxOrdIdl, y::fmpz) -> NfMaxOrdIdl

Returns assuming that is again an integral ideal.

divexact(A::NfMaxOrdIdl, B::NfMaxOrdIdl) -> NfMaxOrdIdl

Returns assuming that is again an integral ideal.

## Fractional ideals

*(I::NfMaxOrdFracIdl, J::NfMaxOrdFracIdl) -> NfMaxOrdFracIdl

Returns .

inv(A::NfMaxOrdFracIdl) -> NfMaxOrdFracIdl

Returns the fractional ideal such that .

## Class and unit group

unit_rank(O::NfOrd) -> Int

Returns the unit rank of , that is, the rank of the unit group .

is_unit(x::NfOrdElem) -> Bool

Returns whether is invertible or not.

is_torsion_unit(x::NfOrdElem, checkisunit::Bool = false) -> Bool

Returns whether is a torsion unit, that is, whether there exists such that .

If

`checkisunit`

is`true`

, it is first checked whether is a unit of the maximal order of the number field is lying in.

torsion_units(O::NfOrd) -> Array{NfOrdElem, 1}

Given an order , compute the torsion units of .

torsion_units(O::NfOrd) -> NfOrdElem

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

unit_group(O::NfMaxOrd) -> Map

Returns an isomorphism map . Let

`A = domain(f)`

. Then a set of fundamental units of can be obtained via`[ f(A[i]) for i in 1:unit_rank(O) ]`

.