Element operations
Creation
We can return the generator $\alpha$ of a simple extension $K(\alpha)/K$ and the vector of generators $\alpha_1, ..., \alpha_n$ of a nonsimple extension $K(\alpha_1, ..., \alpha_n)/K$ with the following.
Elements can also be created by specifying the coordinates with respect to the basis of the number field:
(L::number_field)(c::Vector{NumFieldElem}) -> NumFieldElemGiven a number field $L/K$ of degree $d$ and a vector c of elements from $K$ of length $d$, the above method constructs the element a with coordinates(a) == c.
julia> Qx, x = QQ["x"];
julia> K, a = number_field(x^2 - 2, "a");
julia> basis(K)
2-element Vector{AbsSimpleNumFieldElem}:
1
a
julia> K([1, 2])
2*a + 1
julia> L, b = radical_extension(3, a, "b")
(Relative number field of degree 3 over K, b)
julia> basis(L)
3-element Vector{Hecke.RelSimpleNumFieldElem{AbsSimpleNumFieldElem}}:
1
b
b^2
julia> L([a, 1, 1//2])
1//2*b^2 + b + aConversely, given an element $x$ of a number field $K$, we can extract the coordinates of $x$ under various bases.
coordinates — Method
coordinates(x::NumFieldElem{T}) -> Vector{T}Given an element $x$ in a number field $K$, this function returns the coordinates of $x$ with respect to the basis of $K$ (the output of the 'basis' function).
absolute_coordinates — Method
absolute_coordinates(x::NumFieldElem{T}) -> Vector{T}Given an element $x$ in a number field $K$, this function returns the coordinates of $x$ with respect to the basis of $K$ over the rationals (the output of the absolute_basis function).
coefficients — Method
coefficients(a::SimpleNumFieldElem) -> Vector{FieldElem}Given a number field element a of a simple number field extension L/K, this function returns the coefficients of a, when expanded in the canonical power basis of L.
Functions on elements
The following collections of functions all take as input an element of a number field, or a vector of such elements, possibly with some additional data.
Basis Dependent
Functions that depend on a basis:
representation_matrix — Method
representation_matrix(a::NumFieldElem) -> MatElemReturns the representation matrix of $a$, that is, the matrix representing multiplication with $a$ with respect to the canonical basis of the parent of $a$.
basis_matrix — Method
basis_matrix(v::Vector{NumFieldElem}) -> MatGiven a vector $v$ of $n$ elements of a number field $K$ of degree $d$, this function returns an $n \times d$ matrix with entries in the base field of $K$, where row $i$ contains the coefficients of $v[i]$ with respect of the canonical basis of $K$.
Invariants
Common invariants of an element:
absolute_norm — Method
absolute_norm(a::NumFieldElem) -> QQFieldElemGiven a number field element $a$, returns the absolute norm of $a$.
absolute_tr — Method
absolute_tr(a::NumFieldElem) -> QQFieldElemGiven a number field element $a$, returns the absolute trace of $a$.
absolute_minpoly — Method
absolute_minpoly(a::NumFieldElem) -> PolyRingElemGiven a number field element $a$ of a number field $K$, this function returns the minimal polynomial of $a$ over the rationals $\mathbf{Q}$.
absolute_charpoly — Method
absolute_charpoly(a::NumFieldElem) -> PolyRingElemGiven a number field element $a$ of a number field $K$, this function returns the characteristic polynomial of $a$ over the rationals $\mathbf{Q}$.
Predicates
is_integral — Method
is_integral(a::NumFieldElem) -> BoolReturns whether $a$ is integral, that is, whether the minimal polynomial of $a$ has integral coefficients.
is_torsion_unit — Method
is_torsion_unit(x::AbsSimpleNumFieldElem, checkisunit::Bool = false) -> BoolReturns whether $x$ is a torsion unit, that is, whether there exists $n$ such that $x^n = 1$.
If checkisunit is true, it is first checked whether $x$ is a unit of the maximal order of the number field $x$ is lying in.
is_local_norm — Method
is_local_norm(L::NumField, a::NumFieldElem, P)Given a number field $L/K$, an element $a \in K$ and a prime ideal $P$ of $K$, returns whether $a$ is a local norm at $P$.
The number field $L/K$ must be a simple extension of degree 2.
is_norm_divisible — Method
is_norm_divisible(a::AbsSimpleNumFieldElem, n::ZZRingElem) -> BoolChecks if the norm of $a$ is divisible by $n$, assuming that the norm of $a$ is an integer.
Conjugates
Given an absolute simple number field $K$, the signature of $K$ is a pair of integers $(r,s)$ such that $K$ has $r$ real embeddings $\sigma_i \colon K \to \mathbf{R}$, $1 \leq i \leq r$, and $2s$ complex embeddings $\sigma_{r+i} \colon K \to \mathbf{C}$, $1 \leq i \leq 2s$. In Hecke the complex embeddings are always ordered such that $\sigma_i = \overline{\sigma_{i+s}}$ for $r + 1 \leq i \leq r + s$.
conjugates — Method
conjugates(x::AbsSimpleNumFieldElem, C::AcbField) -> 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 + 1 \leq i \leq r + s$.
Let p be the precision of C, then every entry $y$ of the vector returned satisfies radius(real(y)) < 2^-p and radius(imag(y)) < 2^-p respectively.
conjugates — Method
conjugates(x::AbsSimpleNumFieldElem, 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 + 1 \leq i \leq r + s$.
Every entry $y$ of the vector returned satisfies radius(real(y)) < 2^-abs_tol and radius(imag(y)) < 2^-abs_tol respectively.
conjugates_log — Method
conjugates_arb_log(x::AbsSimpleNumFieldElem, 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 with radius less then 2^-abs_tol.
conjugates_real — Method
conjugates_arb_real(x::AbsSimpleNumFieldElem, abs_tol::Int) -> Vector{ArbFieldElem}Compute the real conjugates of $x$ as elements of type ArbFieldElem.
Every entry $y$ of the array returned satisfies radius(y) < 2^-abs_tol.
conjugates_complex — Method
conjugates_complex(x::AbsSimpleNumFieldElem, abs_tol::Int) -> Vector{AcbFieldElem}Compute the complex 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 + 1 \leq i \leq r + s$.
Every entry $y$ of the array returned satisfies radius(real(y)) < 2^-abs_tol and radius(imag(y)) < 2^-abs_tol.
conjugates_arb_log_normalise — Method
conjugates_arb_log_normalise(x::AbsSimpleNumFieldElem, p::Int = 10)
conjugates_arb_log_normalise(x::FacElem{AbsSimpleNumFieldElem, AbsSimpleNumField}, p::Int = 10)The "normalised" logarithms, i.e. the array $c_i\log |x^{(i)}| - 1/n\log|N(x)|$, so the (weighted) sum adds up to zero.
The $\mathbf{Q}$-linear function
\[\begin{gather*} K \longrightarrow \mathbf R^{d} \\ \alpha \longmapsto \Bigl( \sigma_1(\alpha), \dotsc, \sigma_r(\alpha), \sqrt{2}\operatorname{Re}\bigl(\sigma_{r+1}(\alpha)\bigr), \sqrt{2}\operatorname{Im}\bigl(\sigma_{r+1}(\alpha)\bigr), \dotsc, \sqrt{2}\operatorname{Re}\bigl(\sigma_{r+s}(\alpha)\bigr), \sqrt{2}\operatorname{Im}\bigl(\sigma_{r+s}(\alpha)\bigr) \Bigr) \end{gather*}\]
is called the Minkowski map (or Minkowski embedding). We provide a function that returns the image of an element under the Minkowski map.
minkowski_map — Method
minkowski_map(a::AbsSimpleNumFieldElem, 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).
Miscellaneous
quadratic_defect — Method
quadratic_defect(a::Union{NumFieldElem,Rational,QQFieldElem}, p) -> Union{Inf, PosInf}Returns the valuation of the quadratic defect of the element $a$ at $p$, which can either be prime object or an infinite place of the parent of $a$.
hilbert_symbol — Method
hilbert_symbol(a::NumFieldElem, b::NumFieldElem, p::AbsNumFieldOrderIdeal{AbsSimpleNumField, AbsSimpleNumFieldElem}) -> IntReturns the local Hilbert symbol $(a,b)_p$.
torsion_unit_order — Method
torsion_unit_order(x::AbsSimpleNumFieldElem, n::Int)Given a torsion unit $x$ together with a multiple $n$ of its order, compute the order of $x$, that is, the smallest $k \in \mathbb Z_{\geq 1}$ such that $x^k = 1$.
It is not checked whether $x$ is a torsion unit.
algebraic_split — Method
algebraic_split(a::AbsSimpleNumFieldElem) -> AbsSimpleNumFieldElem, AbsSimpleNumFieldElemWrites the input as a quotient of two "small" algebraic integers.