# 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 AbsNumFieldOrderElem, 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 AbsSimpleNumFieldOrderElem

AbsNumFieldOrderType
  (O::NumFieldOrder)(a::NumFieldElem, check::Bool = true) -> NumFieldOrderElem

Given an element $a$ of the ambient number field of $\mathcal O$, this function coerces the element into $\mathcal O$. It will be checked that $a$ is contained in $\mathcal O$ if and only if check is true.

source
  (O::NumFieldOrder)(a::NumFieldOrderElem, check::Bool = true) -> NumFieldOrderElem

Given an element $a$ of some order in the ambient number field of $\mathcal O$, this function coerces the element into $\mathcal O$. It will be checked that $a$ is contained in $\mathcal O$ if and only if check is true.

source
  (O::NumFieldOrder)(a::IntegerUnion) -> NumFieldOrderElem

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

source
  (O::AbsNumFieldOrder)(arr::Vector{ZZRingElem})

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

source
  (O::AbsNumFieldOrder)(arr::Vector{Integer})

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

source

## Basic properties

parentMethod
parent(a::NumFieldOrderElem) -> NumFieldOrder

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

source
parent(a::MatRingElem{T}) where T <: NCRingElement

Return the parent object of the given matrix.

source
elem_in_nfMethod
elem_in_nf(a::NumFieldOrderElem) -> NumFieldElem

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

source
coordinatesMethod
coordinates(a::AbsNumFieldOrderElem) -> Vector{ZZRingElem}

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

source
discriminantMethod
discriminant(B::Vector{NumFieldOrderElem})

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

source
discriminant(E::EllipticCurve) -> FieldElem

Return the discriminant of $E$.

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

Compute the discriminant of $C$.

source
discriminant(O::AlgssRelOrd)

Returns the discriminant of $O$.

source
discriminant(g::Vector)

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

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

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

source

## Arithmetic

All the usual arithmetic operatinos are defined:

• -(::NUmFieldOrdElem)
• +(::NumFieldOrderElem, ::NumFieldOrderElem)
• -(::NumFieldOrderElem, ::NumFieldOrderElem)
• *(::NumFieldOrderElem, ::NumFieldOrderElem)
• ^(::NumFieldOrderElem, ::Int)
• mod(::AbsNumFieldOrderElem, ::Int)
• mod_sym(::NumFieldOrderElem, ::ZZRingElem)
• powermod(::AbsNumFieldOrderElem, ::ZZRingElem, ::Int)

## Miscellaneous

representation_matrixMethod
representation_matrix(a::AbsNumFieldOrderElem, K::AbsSimpleNumField) -> 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$.

source
trMethod
tr(a::NumFieldOrderElem)

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

source
normMethod
norm(a::NumFieldOrderElem)

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

source
absolute_trMethod
absolute_tr(a::NumFieldOrderElem) -> ZZRingElem

Return the absolute trace as an integer.

source
randMethod
rand(O::AbsSimpleNumFieldOrder, n::IntegerUnion) -> AbsNumFieldOrderElem

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

source
minkowski_mapMethod
minkowski_map(a::NumFieldOrderElem, abs_tol::Int) -> Vector{ArbFieldElem}

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

source
conjugates_arbMethod
conjugates_arb(x::NumFieldOrderElem, abs_tol::Int) -> Vector{AcbFieldElem}

Compute the conjugates of $x$ as elements of type AcbFieldElem. 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.

source
conjugates_arb_logMethod
conjugates_arb_log(x::NumFieldOrderElem, abs_tol::Int) -> Vector{ArbFieldElem}

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 ArbFieldElem radius less then 2^-abs_tol.

source
t2Method
t2(x::NumFieldOrderElem, abs_tol::Int = 32) -> ArbFieldElem

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

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

Return the minimal polynomial $p$ of the square matrix $M$. If a polynomial ring $S$ over the same base ring as $Y$ is supplied, the resulting polynomial is an element of it.

Examples

julia> R = GF(13)
Finite field F_13

julia> S, y = polynomial_ring(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(S, M)
y^2 + 10*y

julia> A = minpoly(M)
x^2 + 10*x

source
minpoly(a::AbsNumFieldOrderElem) -> ZZPolyRingElem

The minimal polynomial of $a$.

source
minpoly(S::Ring, M::MatRingElem{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.

source
charpolyMethod
charpoly(Y::MatrixElem{T}) where {T <: RingElement}
charpoly(S::PolyRing{T}, Y::MatrixElem{T}) where {T <: RingElement}

Return the characteristic polynomial $p$ of the square matrix $Y$. If a polynomial ring $S$ over the same base ring as $Y$ is supplied, the resulting polynomial is an element of it.

Examples

julia> R, = residue_ring(ZZ, 7);

julia> S = matrix_space(R, 4, 4)
Matrix space of 4 rows and 4 columns
over residue ring of integers modulo 7

julia> T, y = polynomial_ring(R, "y")
(Univariate polynomial ring in y over residue ring, y)

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)
y^4 + 2*y^2 + 6*y + 2

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

source
charpoly(a::AbsNumFieldOrderElem) -> ZZPolyRingElem
charpoly(a::AbsNumFieldOrderElem, FlintZZ) -> ZZPolyRingElem

The characteristic polynomial of $a$.

source
factorMethod
factor(a::AbsSimpleNumFieldOrderElem) -> Fac{AbsSimpleNumFieldOrderElem}

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.

source
denominatorMethod
denominator(a::NumFieldElem, O::AbsSimpleNumFieldOrder) -> ZZRingElem

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

source
discriminantMethod
discriminant(B::Vector{NumFieldOrderElem})

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

source
discriminant(E::EllipticCurve) -> FieldElem

Return the discriminant of $E$.

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

Compute the discriminant of $C$.

source
discriminant(O::AlgssRelOrd)

Returns the discriminant of $O$.

source
discriminant(g::Vector)

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

source