The table below lists the generic arithmetic functions on number field elements. Note that automatic coercion ensures that the binary operations +, -, *, and / may be applied to an element of a number field and an element of one of its orders; the result will be a number field element.
Returns the square root of the number field element a if it exists in the field containing a.
Returns the n-th root of the number field element a if it exists in the field containing a.
Return true if the number field element a is a kth power, (respectively square) and the root if so.
Returns the denominator of the number field element a, that is the least common multiple of the denominators of the coefficients of a.
Returns the numerator of the number field element a, that is the element multiplied by its denominator.
ContFrac: BoolElt Default: true
Finds an approximation of the number field element E where the denominator is bounded by the integer M. If ContFrac is true, the approximation is computed by applying the continued fraction algorithm to the coefficients of E viewed over Q.
Elements may also be tested for whether they lie in an ideal of an order. See Section Predicates on Ideals.
In addition to the generic predicates IsMinusOne, IsZero and IsOne, the predicates IsIntegral and IsPrimitive are defined on elements of number fields.
Returns true if the element a of a number field F is contained in the ring of integers of F, false otherwise. We use the minimal polynomial to determine the answer, which means that the calculation of the maximal order is not triggered if it is not known yet. A denominator d such that d * a is integral is also returned on request.
Returns true if the element a of the number field F generates F over its coefficient field.
Returnes true iff all real embeddings of the number field element a are positive. For elements in absolute fields this is equivalent to all real conjugates being positive.
Return the image α of x in G[x]/f where f is the first defining polynomial of the number field K and G is the base field of K.In case of simple extensions this will be a primitive element.
Returns a primitive element for the simple number field K, that is an element whose minimal polynomial has the same degree as the field. For a simple number field K this is K.1 , while for non-simple fields a random element with this property is returned.
The set of generators of the number field K over its coefficient field, that is a set containing a root of each defining polynomial is returned.
A set of generators of the number field K over Q.
The sequence of generators of the number field K over its coefficient field, that is a sequence containing a root of each defining polynomial is returned.
A sequence of generators of the number field K over Q.
A sequence of generators of the number field K over k is returned. That is a sequence containing a root of each defining polynomial for K and its subfield down to the level of k is returned.
See Chapter NUMBER FIELDS AND ORDERS (on number fields and orders).
See Chapter NUMBER FIELDS AND ORDERS (on number fields and orders).
The norm, trace and minimal polynomial of number field elements can be calculated both with respect to the coefficient ring and to Z or Q.
The relative norm NL/F(a) over F of the element a of the number field L where F is the field over which L is defined as an extension. If R is given the norm is calculated over R. In this case, R must occur as a coefficient ring somewhere in the tower under L.
The absolute norm NL/Q(a) over Q of the element a of the number field L.
The relative trace TrL/F(a) over F of the element a of the number field L where F is the field over which L is defined as an extension. If R is given the trace is computed over R. In this case, R must occur as a coefficient ring somewhere in the tower under L.
The absolute trace TrL/Q(a) over Q of the element a of the number field L.
Given an element a from a number field L, returns the characteristic polynomial of the element over R if given or the subfield F otherwise where F is the field over which L is defined as an extension.
Given an element a from a number field, this function returns the characteristic polynomial of a over Q.
Given an element a from a number field L, returns the minimal polynomial of the element over R if given otherwise the subfield F where F is the field over which L is defined as an extension.
Given an element a from a number field, this function returns the minimal polynomial of the element as a polynomial over Q.
Return the representation matrix of the number field element a, that is, the matrix which represents the linear map wrt to the field basis, given by multiplication by a. The ith row of the representation matrix gives the coefficients of awi with respect to the basis w1, ..., wn.If R is given the matrix is over R and with respect to the basis of the order or field over R.
Return the representation matrix of the number field element a relative to the Q-basis of the field constructed using products of the basis elements, where a is an element of the relative number field L.Let Li := ∑Li - 1 ωi, j, L := Ln and L0 := Q. Then the representation matrix is computed with respect to the Q-basis (∏j ωij, j)i ∈I consisting of products of basis elements of the different levels.
> R<x> := PolynomialRing(Integers()); > K<y> := NumberField(x^4-420*x^2+40000); > z := y/2; > Norm(z), Trace(z); 2500 0 > MinimalPolynomial(z); $.1^4 - 105*$.1^2 + 2500 > RepresentationMatrix(z); [ 0 1/2 0 0] [ 0 0 1/2 0] [ 0 0 0 1/2] [-20000 0 210 0]The awkwardness of the printing of the minimal polynomial above can be overcome by providing a parent for the polynomial, keeping in mind that it is a univariate polynomial over the rationals:
> P<t> := PolynomialRing(RationalField()); > MinimalPolynomial(z); t^4 - 105*t^2 + 2500
Elements can be represented by sequences and have a product representation.
For an element a of a number field F, a sequence of coefficients of length degree of F with respect to the basis is returned.
For an algebraic number E∈K and a ring k which occurs somewhere in the defining tower for K, return the list of coefficients of E over k, that is, apply Eltseq to E and to its coefficients until the list is over k.
The coefficients of the number field element e wrt. to the canonical Q basis for its field. This is performed by iterating Eltseq until the coefficients are rational numbers. The coefficients obtained match the coefficients wrt. to AbsoluteBasis.
The coefficient of the ith basis element in the number field element a.
Return sequences P and E such that the product of elements in P to the corresponding exponents in E is the algebraic number a.
Return the number field element a of the universe of the sequence P such that a is the product of elements of P to the corresponding exponents in the sequence E.