# Elements

Elements in orders have two representations: they can be viewed as elements in the $\mathbf Z^n$ giving the coefficients wrt to the order basis where they are elements in. On the other hand, as every order is in a field, they also have a representation as number field elements. Since, asymptotically, operations are more efficient in the field (due to fast polynomial arithmetic) than in the order, the primary representation is that as a field element.

## Creation

Elements are constructed either as linear combinations of basis elements or via explicit coercion. Elements will be of type NfAbsOrdElem, the type if actually parametrized by the type of the surrounding field and the type of the field elements. E.g. the type of any element in any order of an absolute simple field will be NfAbsOrdElem{AnticNumberField,nf_elem}

NfAbsOrdType
  (O::NumFieldOrd)(a::IntegerUnion) -> NumFieldOrdElem

Given an element $a$ of type fmpz or Integer, this function coerces the element into $\mathcal O$.

  (O::NfAbsOrd)(arr::Vector{fmpz})

Returns the element of $\mathcal O$ with coefficient vector arr.

## Basic properties

parentMethod
parent(a::NumFieldOrdElem) -> NumFieldOrd

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

parent(a::AbstractAlgebra.MatElem{T}, cached::Bool = true) where T <: NCRingElement

Return the parent object of the given matrix.

parent(a::MatAlgElem{T}, cached::Bool = true) where T <: NCRingElement

Return the parent object of the given matrix.

elem_in_nfMethod
elem_in_nf(a::NumFieldOrdElem) -> NumFieldElem

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

coordinatesMethod
coordinates(a::NfAbsOrdElem) -> Vector{fmpz}

Returns the coefficient vector of $a$ with respect to the basis of the order.

discriminantMethod
discriminant(B::Vector{NumFieldOrdElem})

Returns the discriminant of the family $B$ of algebraic numbers, i.e. $det((tr(B[i]*B[j]))_{i, j})^2$.

discriminant(E::EllCrv{T}) -> T

Compute the discriminant of $E$.

discriminant(C::HypellCrv{T}) -> T

Compute the discriminant of $C$.

discriminant(O::AlgssRelOrd)

Returns the discriminant of $O$.

discriminant(g::Vector)

Compute the product of all differences of distinct elements in the array.

source
==Method
==(x::NumFieldOrdElem, y::NumFieldOrdElem) -> Bool

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

## Arithmetic

All the usual arithmetic operatinos are defined:

• -(::NUmFieldOrdElem)
• +(::NumFieldOrdElem, ::NumFieldOrdElem)
• -(::NumFieldOrdElem, ::NumFieldOrdElem)
• *(::NumFieldOrdElem, ::NumFieldOrdElem)
• ^(::NumFieldOrdElem, ::Int)
• mod(::NfAbsOrdElem, ::Int)
• mod_sym(::NumFieldOrdElem, ::fmpz)
• powermod(::NfAbsOrdElem, ::fmpz, ::Int)

## Miscellaneous

representation_matrixMethod
representation_matrix(a::NfAbsOrdElem) -> fmpz_mat

Returns the representation matrix of the element $a$.

representation_matrixMethod
representation_matrix(a::NfAbsOrdElem, 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$.

trMethod
tr(a::NumFieldOrdElem)

Returns the trace of $a$ as an element of the base ring.

normMethod
norm(a::NumFieldOrdElem)

Returns the norm of $a$ as an element in the base ring.

absolute_normMethod
absolute_norm(a::NumFieldOrdElem) -> fmpz

Return the absolute norm as an integer.

absolute_trMethod
absolute_tr(a::NumFieldOrdElem) -> fmpz

Return the absolute trace as an integer.

randMethod
rand(O::NfOrd, n::IntegerUnion) -> NfAbsOrdElem

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_mapMethod
minkowski_map(a::NumFieldOrdElem, abs_tol::Int) -> Vector{arb}

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_arbMethod
conjugates_arb(x::NumFieldOrdElem, abs_tol::Int) -> Vector{acb}

Compute 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_logMethod
conjugates_arb_log(x::NumFieldOrdElem, abs_tol::Int) -> Vector{arb}

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.

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

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

minpolyMethod
minpoly(a::NfAbsOrdElem) -> fmpz_poly

The minimal polynomial of $a$.

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

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

Examples

julia> R = GF(13)
Finite field F_13

julia> T, y = PolynomialRing(R, "y")
(Univariate Polynomial Ring in y over Finite field F_13, y)

julia> M = R[7 6 1;
7 7 5;
8 12 5]
[7    6   1]
[7    7   5]
[8   12   5]

julia> A = minpoly(T, M)
y^2 + 10*y

minpoly(S::Ring, M::MatAlgElem{T}, charpoly_only::Bool = false) where {T <: RingElement}

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

charpolyMethod
charpoly(a::NfAbsOrdElem) -> fmpz_poly
charpoly(a::NfAbsOrdElem, FlintZZ) -> fmpz_poly

The characteristic polynomial of $a$.

charpoly(V::Ring, Y::MatrixElem{T}) where {T <: RingElement}

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

Examples

julia> R = ResidueRing(ZZ, 7)
Residue ring of Integers modulo 7

julia> S = MatrixSpace(R, 4, 4)
Matrix Space of 4 rows and 4 columns over Residue ring of Integers modulo 7

julia> T, x = PolynomialRing(R, "x")
(Univariate Polynomial Ring in x over Residue ring of Integers modulo 7, x)

julia> M = S([R(1) R(2) R(4) R(3); R(2) R(5) R(1) R(0);
R(6) R(1) R(3) R(2); R(1) R(1) R(3) R(5)])
[1   2   4   3]
[2   5   1   0]
[6   1   3   2]
[1   1   3   5]

julia> A = charpoly(T, M)
x^4 + 2*x^2 + 6*x + 2

factorMethod
factor(a::NfOrdElem) -> Fac{NfOrdElem}

Computes a factorization of $a$ into irreducible elements. The return value is a factorization fac, which satisfies a = unit(fac) * prod(p^e for (p, e) in fac).

The function requires that $a$ is non-zero and that all prime ideals containing $a$ are principal, which is for example satisfied if class group of the order of $a$ is trivial.

denominatorMethod
denominator(a::NumFieldElem, O::NfOrd) -> fmpz

Returns the smallest positive integer $k$ such that $k \cdot a$ is contained in $\mathcal O$.

discriminantMethod
discriminant(B::Vector{NumFieldOrdElem})

Returns the discriminant of the family $B$ of algebraic numbers, i.e. $det((tr(B[i]*B[j]))_{i, j})^2$.

discriminant(E::EllCrv{T}) -> T

Compute the discriminant of $E$.

discriminant(C::HypellCrv{T}) -> T

Compute the discriminant of $C$.

discriminant(O::AlgssRelOrd)

Returns the discriminant of $O$.

discriminant(g::Vector)

Compute the product of all differences of distinct elements in the array.

source