## Creation and basic properties

Order(B::Array{nf_elem, 1}, check::Bool = true) -> NfOrd


Returns the order with $\mathbf Z$-basis $B$. If check is set, it is checked whether $B$ defines an order.

Order(K::AnticNumberField, A::FakeFmpqMat, check::Bool = true) -> NfOrd


Returns the order which has basis matrix $A$ with respect to the power basis of $K$. If check is set, it is checked whether $A$ defines an order.

Order(A::NfOrdFracIdl) -> NfOrd


Returns the fractional ideal $A$ as an order of the ambient number field.

  Order(K::RelativeExtension, M::PMat) -> NfRelOrd


Returns the order which has basis pseudo-matrix $M$ with respect to the power basis of $K$.

EquationOrder(K::AnticNumberField) -> NfOrd


Returns the equation order of the number field $K$.

MaximalOrder(K::AnticNumberField) -> NfOrd


Returns the maximal order of $K$.

Example

julia> Qx, xx = FlintQQ["x"];
julia> K, a = NumberField(x^3 + 2, "a");
julia> O = MaximalOrder(K);


MaximalOrder(K::NfOrd) -> NfOrd


Returns the maximal order of $K$.

maximal_order(K::AnticNumberField) -> NfOrd
ring_of_integers(K::AnticNumberField) -> NfOrd


Returns the maximal order of $K$.

lll(M::NfOrd) -> NfOrd


The same order, but with the basis now being LLL reduced wrt. the Minkowski metric.

By Chistov's fundamental theorem, the computation of the maximal order is basically as hard as the factorisation of the discriminant. In order to help the computer, Hecke also provides the following signatures:

maximal_order(K::AnticNumberField, primes::Array{fmpz, 1}) -> NfOrd
maximal_order(K::AnticNumberField, primes::Array{Integer, 1}) -> NfOrd


Assuming that $primes$ contains all the prime numbers at which the equation order $\mathbf{Z}[\alpha]$ of $K = \mathbf{Q}(\alpha)$ is not maximal (e.g. $primes$ may contain all prime divisors of the discriminant of $\mathbf Z[\alpha]$), this function returns the maximal order of $K$.

ring_of_integers(K::AnticNumberField, primes::Array{fmpz, 1}) -> NfOrd
ring_of_integers(K::AnticNumberField, primes::Array{Integer, 1}) -> NfOrd


Assuming that $primes$ contains all the prime numbers at which the equation order $\mathbf{Z}[\alpha]$ of $K = \mathbf{Q}(\alpha)$ is not maximal, this function returns the maximal order of $K$.

It is also possible the execute the steps individually:

pradical(O::NfOrd, p::fmpz) -> NfOrdIdl


Given a prime number $p$, this function returns the $p$-radical $\sqrt{p\mathcal O}$ of $\mathcal O$, which is just $\{ x \in \mathcal O \mid \exists k \in \mathbf Z_{\geq 0} \colon x^k \in p\mathcal O \}$. It is not checked that $p$ is prime.

ring_of_multipliers(I::NfOrdIdl) -> NfOrd


Computes the order $(I : I)$, which is the set of all $x \in K$ with $xI \subseteq I$.

### Example

julia> Qx, x = PolynomialRing(FlintQQ, "x");

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

julia> O = EquationOrder(K)
Order of Number field over Rational Field with defining polynomial x^2-2
with Z-basis Hecke.NfOrdElem[1, a]

parent(::NfOrd)
isequation_order(::NfOrd)
signature(::NfOrd)
nf(::NfOrd)
degree(::NfOrd)
basis(::NfOrd)
basis(::NfOrd, ::AnticNumberField)
basis_mat(::NfOrd)
basis_mat_inv(::NfOrd)
discriminant(::NfOrd)
gen_index(::NfOrd)
index(::NfOrd)
isindex_divisor(::NfOrd, ::fmpz)
minkowski_mat(::NfOrd, ::Int)
in(::nf_elem, ::NfOrd)
denominator(::nf_elem, ::NfOrd)
norm_change_const(::NfOrd)
trace_matrix(::NfOrd)
+(::NfOrd, ::NfOrd)
poverorder(::NfOrd, ::fmpz)
pmaximal_overorder(::NfOrd, ::fmpz)
parent(::NfOrd)
deepcopy(::NfOrd)


## Elements

### Basic properties

parent(a::NfOrdElem) -> NfOrd


Returns the order of which $a$ is an element.

elem_in_nf(a::NfOrdElem) -> nf_elem


Returns the element $a$ considered as an element of the ambient number field.

elem_in_basis(a::NfOrdElem) -> Array{fmpz, 1}


Returns the coefficient vector of $a$.

  elem_in_basis(a::NfRelOrdElem{T}) -> Vector{T}


Returns the coefficient vector of $a$.

discriminant(B::Array{NfOrdElem, 1}) -> fmpz


Returns the discriminant of the family $B$.

==(x::NfOrdElem, y::NfOrdElem) -> Bool


Returns whether $x$ and $y$ are equal.

zero(O::NfOrd) -> NfOrdElem


Returns the zero element of $\mathcal O$.

one(O::NfOrd) -> NfOrdElem


Returns the one element of $\mathcal O$.

iszero(a::NfOrd) -> Bool


Tests if $a$ is zero.

isone(a::NfOrd) -> Bool


Tests if $a$ is one.

### Arithmetic

-(x::NfOrdElem) -> NfOrdElem


Returns the additive inverse of $x$.

+(x::NfOrdElem, y::NfOrdElem) -> NfOrdElem


Returns $x + y$.

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


Returns $x - y$.

*(x::NfOrdElem, y::NfOrdElem) -> NfOrdElem


Returns $x \cdot y$.

^(x::NfOrdElem, y::Union{fmpz, Int})


Returns $x^y$.

mod(a::NfOrdElem, m::Union{fmpz, Int}) -> NfOrdElem


Reduces the coefficient vector of $a$ modulo $m$ and returns the corresponding element. The coefficient vector of the result will have entries $x$ with $0 \leq x \leq m$.

powermod(a::NfOrdElem, i::fmpz, m::Integer) -> NfOrdElem


Returns the element $a^i$ modulo $m$.

### Miscallenous

representation_mat(a::NfOrdElem) -> fmpz_mat


Returns the representation matrix of the element $a$.

representation_mat(a::NfOrdElem, K::AnticNumberField) -> FakeFmpqMat


Returns the representation matrix of the element $a$ considered as an element of the ambient number field $K$. It is assumed that $K$ is the ambient number field of the order of $a$.

trace(a::NfOrdElem) -> fmpz


Returns the trace of $a$.

norm(a::NfOrdElem) -> fmpz


Returns the norm of $a$.

rand(O::NfOrd, n::Union{Integer, fmpz}) -> NfOrdElem


Computes a coefficient vector with entries uniformly distributed in $\{-n,\dotsc,-1,0,1,\dotsc,n\}$ and returns the corresponding element of the order $\mathcal O$.

minkowski_map(a::NfOrdElem, abs_tol::Int) -> Array{arb, 1}


Returns the image of $a$ under the Minkowski embedding. Every entry of the array returned is of type arb with radius less then 2^-abs_tol.

conjugates_arb(x::NfOrdElem, abs_tol::Int) -> Array{acb, 1}


Compute the the conjugates of x as elements of type acb. Recall that we order the complex conjugates $\sigma_{r+1}(x),...,\sigma_{r+2s}(x)$ such that $\sigma_{i}(x) = \overline{\sigma_{i + s}(x)}$ for $r + 2 \leq i \leq r + s$.

Every entry y of the array returned satisfies radius(real(y)) < 2^-abs_tol, radius(imag(y)) < 2^-abs_tol respectively.

conjugates_arb_log(x::NfOrdElem, abs_tol::Int) -> Array{arb, 1}


Returns the elements $(\log(\lvert \sigma_1(x) \rvert),\dotsc,\log(\lvert\sigma_r(x) \rvert), \dotsc,2\log(\lvert \sigma_{r+1}(x) \rvert),\dotsc, 2\log(\lvert \sigma_{r+s}(x)\rvert))$ as elements of type arb radius less then 2^-abs_tol.

t2(x::NfOrdElem, abs_tol::Int = 32) -> arb


Return the $T_2$-norm of $x$. The radius of the result will be less than 2^-abs_tol.

minpoly{T <: RingElement}(S::Ring, M::AbstractAlgebra.MatElem{T}, charpoly_only = false)


Returns the minimal polynomial $p$ of the matrix $M$. The polynomial ring $R$ of the resulting polynomial must be supplied and the matrix must be square.

charpoly{T <: RingElement}(V::Ring, Y::AbstractAlgebra.MatElem{T})


Returns the characteristic polynomial $p$ of the matrix $M$. The polynomial ring $R$ of the resulting polynomial must be supplied and the matrix is assumed to be square.

## Ideals

### Creation

ideal(::NfOrd, ::Int)
ideal(::NfOrd, ::Integer)
ideal(::NfOrd, ::fmpz)
ideal(::NfOrd, ::fmpz_mat)
ideal(::NfOrd, ::NfOrdElem)
ideal(::NfOrd, ::Integer, ::NfOrdElem)
ideal(::NfOrd, ::fmpz, ::NfOrdElem)
*(::NfOrd, ::NfOrdElem)
prime_decomposition(::NfOrd, ::Integer)
prime_decomposition(::NfOrd, ::fmpz)


### Arithmetic

==(x::NfOrdIdl, y::NfOrdIdl)


Returns whether $x$ and $y$ are equal.

+(x::NfOrdIdl, y::NfOrdIdl)


Returns $x + y$.

*(x::NfOrdIdl, y::NfOrdIdl)


Returns $x \cdot y$.

intersection(x::NfOrdIdl, y::NfOrdIdl) -> NfOrdIdl
lcm(x::NfOrdIdl, y::NfOrdIdl) -> NfOrdIdl


Returns $x \cap y$.

### Miscaellenous

order(::NfOrdIdl)
basis(::NfOrdIdl)
basis_mat(::NfOrdIdl)
basis_mat_inv(::NfOrdIdl)
minimum(::NfOrdIdl)
norm(::NfOrdIdl)
in(::NfOrdElem, ::NfOrdIdl)
idempotents(::NfOrdIdl, ::NfOrdIdl)
mod(::NfOrdElem, ::NfOrdIdl)
isprime(::NfOrdIdl)
valuation(::nf_elem, ::NfOrdIdl)
valuation(::NfOrdElem, ::NfOrdIdl)
valuation(::NfOrdIdl, ::NfOrdIdl)
valuation(::Integer, ::NfOrdIdl)
valuation(::fmpz, ::NfOrdIdl)
valuation(::NfOrdFracIdl, ::NfOrdIdl)


## Fractional ideals

### Creation

frac_ideal(::NfOrd, ::fmpz_mat)
frac_ideal(::NfOrd, ::fmpz_mat, ::fmpz)
frac_ideal(::NfOrd, ::FakeFmpqMat)
frac_ideal(::NfOrd, ::NfOrdIdl)
frac_ideal(::NfOrd, ::NfOrdIdl, ::fmpz)
frac_ideal(::NfOrd, ::nf_elem)
frac_ideal(::NfOrd, ::NfOrdElem)


### Arithmetic

==(x::NfOrdFracIdl, y::NfOrdFracIdl) -> Bool


Returns whether $x$ and $y$ are equal.

inv(A::NfOrdFracIdl) -> NfOrdFracIdl


Returns the fractional ideal $B$ such that $AB = \mathcal O$.

integral_split(A::NfOrdFracIdl) -> NfOrdIdl, NfOrdIdl


Computes the unique coprime integral ideals $N$ and $D$ s.th. $A = ND^{-1}$

### Miscaellenous

order(::NfOrdFracIdl)
basis_mat(::NfOrdFracIdl)
basis_mat_inv(::NfOrdFracIdl)
basis(::NfOrdFracIdl)
norm(::NfOrdFracIdl)