[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Element Operations

Subsections

Parent and Category

Parent(a) : FldAlgElt -> FldAlg
Parent(w) : RngOrdElt -> RngOrd
Category(a) : FldAlgElt -> Cat
Category(w) : RngOrdElt -> Cat

Arithmetic

The table below lists the generic arithmetic functions on algebraic field and order elements. Note that automatic coercion ensures that the binary operations +, -, *, and / may be applied to an element of an algebraic field and an element of one of its orders; the result will be an algebraic field element. Since division of order elements does not generally result in an order element, the operation / applied to two elements of an order returns an element in the field of fractions of the order; similarly if the exponent k in a^k is negative.

For finding the value of an element mod an ideal or the inverse of an element mod an ideal see Section Ideal Arithmetic.

+ a : FldAlgElt -> FldAlgElt
+ w : RngOrdElt -> RngOrdElt
- a : FldAlgElt -> FldAlgElt
- w : RngOrdElt -> RngOrdElt

a + b : FldAlgElt, FldAlgElt -> FldAlgElt
w + v : RngOrdElt, RngOrdElt -> RngOrdElt
a - b : FldAlgElt, FldAlgElt -> FldAlgElt
w - v : RngOrdElt, RngOrdElt -> RngOrdElt
a * b : FldAlgElt, FldAlgElt -> FldAlgElt
w * v : RngOrdElt, RngOrdElt -> RngOrdElt
a / b : FldAlgElt, FldAlgElt -> FldAlgElt
w / v : RngOrdElt, RngOrdElt -> FldOrdElt
a ^ k : FldAlgElt, RngIntElt -> FldAlgElt
w ^ k : RngOrdElt, RngIntElt -> RngOrdElt

w div v : RngOrdElt, RngOrdElt -> RngOrdElt
The quotient of the order element w by the order element v; v must divide w exactly, (v and w must be elements of the same order.)
Modexp(a, n, m) : RngOrdElt, RngIntElt, RngIntElt -> RngOrdElt
Given a non-negative integer n and an integer m greater than 1, this function returns the modular power an mod m of the order element a.
Sqrt(a) : RngOrdElt -> RngOrdElt
Sqrt(a) : FldAlgElt -> FldAlgElt
SquareRoot(a) : RngOrdElt -> RngOrdElt
SquareRoot(a) : FldAlgElt -> FldAlgElt
Returns the square root of the element a if it exists in the order or field containing a.
Root(a, n) : RngOrdElt, RngIntElt -> RngOrdElt
Root(a, n) : FldAlgElt, RngIntElt -> FldAlgElt
Returns the n-th root of the element a if it exists in the order or field containing a.
IsPower(a, k) : FldAlgElt, RngIntElt -> BoolElt, FldAlgElt
IsPower(a, k) : RngOrdElt, RngIntElt -> BoolElt, RngOrdElt
IsSquare(a) : FldAlgElt -> BoolElt, FldAlgElt
IsSquare(a) : RngOrdElt -> BoolElt, RngOrdElt
Return true if the element a is a kth power, (respectively square) and the root in the order or field containing a if so.
Denominator(a) : FldAlgElt -> RngIntElt
Denominator(a) : RngOrdElt -> RngIntElt
Returns the denominator of the element a, that is the least common multiple of the denominators of the coefficients of a.
Numerator(a) : FldAlgElt -> RngIntElt
Returns the numerator of the element a, that is the element multiplied by its denominator.
Qround(E, M): FldAlgElt, RngIntElt -> FldAlgElt
    ContFrac: BoolElt                   Default: true
Finds an approximation of the 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.

Equality and Membership

Elements may also be tested for whether they lie in an ideal of an order. See Section Predicates on Ideals.

a eq b : FldAlgElt, FldAlgElt -> BoolElt
w eq v : RngOrdElt, RngOrdElt -> BoolElt
a ne b : FldAlgElt, FldAlgElt -> BoolElt
w ne v : RngOrdElt, RngOrdElt -> BoolElt

a in F : FldAlgElt, FldAlg -> BoolElt
w in O : RngOrdElt, RngOrd -> BoolElt

Predicates on Elements

In addition to the generic predicates IsMinusOne, IsZero and IsOne, the predicates IsIntegral and IsPrimitive are defined on elements of algebraic fields and orders.

IsZero(a) : FldAlgElt -> BoolElt
IsZero(w) : RngOrdElt -> BoolElt
IsOne(a) : FldAlgElt -> BoolElt
IsOne(w) : RngOrdElt -> BoolElt

IsMinusOne(a) : FldAlgElt -> BoolElt
IsMinusOne(w) : RngOrdElt -> BoolElt
IsUnit(a) : FldAlgElt -> BoolElt
IsUnit(w) : RngOrdElt -> BoolElt

IsNilpotent(a) : FldAlgElt -> BoolElt
IsNilpotent(a) : RngOrdElt -> BoolElt
IsIdempotent(a) : FldAlgElt -> BoolElt
IsIdempotent(a) : RngOrdElt -> BoolElt

IsZeroDivisor(a) : FldAlgElt -> BoolElt
IsZeroDivisor(a) : RngOrdElt -> BoolElt
IsRegular(a) : FldAlgElt -> BoolElt
IsRegular(a) : RngOrdElt -> BoolElt

IsIrreducible(a) : FldAlgElt -> BoolElt
IsIrreducible(a) : RngOrdElt -> BoolElt
IsPrime(a) : FldAlgElt -> BoolElt
IsPrime(a) : RngOrdElt -> BoolElt

IsIntegral(a) : FldAlgElt -> BoolElt
IsIntegral(a) : RngOrdElt -> BoolElt
Returns true if the element a of an algebraic field F or of an order in F is contained in the ring of integers of F, false otherwise. This is vacuously true for order elements. 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. When a is a field element a denominator d such that d * a is integral is also returned on request.
IsPrimitive(a) : FldAlgElt -> BoolElt
IsPrimitive(a) : RngOrdElt -> BoolElt
Returns true if the element a of the algebraic field F or one of its orders O generates F.
IsTorsionUnit(w) : RngOrdElt -> BoolElt
Returns true if and only if the order element w is a unit of finite order.
IsPower(w, n) : RngOrdElt, RngIntElt -> BoolElt, RngOrdElt
Given an element w in an order O and an integer n>1, this function returns true if and only if there exists an element v∈O such that w=vn; if true, such an element v is returned as well.
IsTotallyPositive(a) : RngOrdElt -> BoolElt
IsTotallyPositive(a) : FldAlgElt -> BoolElt
Returnes true iff all real embeddings of the element a are positive. For elements in absolute fields this is equivalent to all real conjugates being positive.

Finding Special Elements

Generators of fields can be retrieved.

K . 1 : FldNum -> FldNumElt
Return the image αof x in G[x]/f where f is the first defining polynomial of K and G is the base field of K.

In case of simple extensions this will be a primitive element.

PrimitiveElement(K) : FldNum -> FldNumElt
PrimitiveElement(F) : FldOrd -> FldOrdElt
Returns a primitive element for the simple algebraic field, that is an element whose minimal polynomial has the same degree as the field. For a number field K this is K.1 but for a field of fractions this is F!K.1 where K is the number field of F.

For non-simple fields, a random element is returned.

Generators(K): FldAlg -> [FldAlgElt]
The list of generators of K over its coefficient field, that is a sequence containing a root of each defining polynomial is returned.
Generators(K, k) : FldAlg, FldAlg -> [FldAlgElt]
Generators(K, Q) : FldAlg, FldRat -> [FldAlgElt]
A list of generators of 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.
PrimitiveElement(O) : RngOrd -> RngOrdElt
Returns a primitive element for the field of fractions of the order O, that is an element whose minimal polynomial has the same degree as the field.

Real and Complex Valued Functions

The functions here return (sequences of) real or complex numbers. The precision of these numbers is governed by the appropriate order's or field's internal precision. See Section Special Options for more information.

AbsoluteValues(a) : FldAlgElt -> [FldPrElt]
AbsoluteValues(a) : RngOrdElt -> [FldPrElt]
Return a sequence of length r1 + r2 of the real absolute values of the conjugates of the element a. The first r1 values are the absolute values of the real embeddings of the element, the next r2 are the lengths of the complex embeddings with their weight factors. That is, if the real conjugates of a are wi, for 1≤i≤r1, and the complex conjugates of a are xi+- i yi (for 1≤i≤r2), then AbsoluteValues returns [|w1|, ..., |wr1|, Sqrt(x_(r1 + 1)2 + yr1 + 12/2), ... Sqrt(x_(r1 + r2)2 + yr1 + r22/2)].
AbsoluteLogarithmicHeight(a) : FldAlgElt -> FldPrElt
AbsoluteLogarithmicHeight(a) : RngOrdElt -> FldPrElt
Let P be the minimal polynomial of the element a over Z, with leading coefficient a0 and roots α1, ..., αn. Then the absolute logarithmic height is defined to be h(α) = (1/n) log(a0j=1n max(1, |αj|)).

Conjugates(a) : FldAlgElt -> [ FldComElt ]
Conjugates(a) : RngOrdElt -> [ FldComElt ]
The real and complex conjugates of the given algebraic number a, as a sequence of n complex numbers. The r1 real conjugates appear first, and are followed by r2 pairs of complex conjugates. The field should be an absolute extension. The ordering of the conjugates is consistent for elements of the same field (or even for elements of different fields that have the same defining polynomial).
Conjugate(a, k) : FldAlgElt, RngIntElt -> FldPrElt
Conjugate(a, k) : RngOrdElt, RngIntElt -> FldPrElt
Equivalent to Conjugates(a)[k].
Conjugate(a, l) : FldAlgElt, [RngIntElt] -> FldReElt
Let l := [l1, ..., ln] be a sequence of positive integers and assume that the field K, the parent of a is given as a tower with n steps, Q⊆K1⊆ ... ⊆Kn = K. This function computes the image of a in C or R under the embedding determined by l, that is under embedding obtained by extending the l1 embedding of K1 to K2, then extending the l2nd of those embeddings to K3, ...
Length(a) : FldAlgElt -> FldPrElt
Length(a) : RngOrdElt -> FldPrElt
Return the T2-norm of the element a, which is a real number. This equals the sum of the (complex) norms of the conjugates of a.
Logs(a) : FldAlgElt -> [FldPrElt]
Logs(a) : RngOrdElt -> [FldPrElt]
Return the sequence of length r1 + r2 of logarithms of the absolute values of the conjugates of a number field or order element a != 0.
CoefficientHeight(E) : RngOrdElt -> RngIntElt
CoefficientHeight(E) : FldAlgElt -> RngIntElt
Computes the coefficient height of the element E, that is for an element of an absolute field it returns the maximum of the denominator and the largest coefficient wrt. to the basis of the parent. For elements in relative extensions, it returns the maximal coefficient height of all the coefficients wrt. the basis of the parent.

This function indicates in some way the difficulty of operations involving this element.

CoefficientLength(E) : RngOrdElt -> RngIntElt
CoefficientLength(E) : FldAlgElt -> RngIntElt
Computes the coefficient length of the element E, that is for an element of an absolute field it returns the sum of the denominator and the absolute values of all coefficients wrt. to the basis of the parent. For elements in relative extensions, it returns the sum of the coefficient length of all the coefficients wrt. the basis of the parent.

This function gives an indication on the amount of memory occupied by this element.


Example RngOrd_Discriminant (H37E16)

Using the functions Conjugates and Basis, it is easy to write an alternative discriminant function.

> disc := func< O | Determinant( MatrixAlgebra(ComplexField(20), Degree(O) )
>        ! [ Conjugates(Basis(O)[i])[j] : i, j in [1 .. Degree(O)] ] )^2 >;
> R<x> := PolynomialRing(Integers());
> O := MaximalOrder(NumberField(x^4 - 420*x^2 + 40000));
> disc(O);
42025
> Discriminant(O);
42025
Thus, the new discriminant function returns a complex approximation to the built-in function Discriminant, giving the above result for the maximal order O of the previous example.

Here is an alternative way of getting the T2 norm returned by Length, using the complex Norm function, together with the Conjugates function.

> norm := func< a | &+[ Norm(Conjugates(a)[i]) : \
>                      i in [1 .. Degree(Parent(a))] ] >;

Norm, Trace, and Minimal Polynomial

The norm, trace and minimal polynomial of order and algebraic field elements can be calculated both with respect to the coefficient ring and to Z or Q.

Norm(a) : FldAlgElt -> FldAlgElt
Norm(a) : FldAlgElt -> FldRatElt
Norm(a, R) : FldAlgElt, Rng -> RngElt
Norm(a) : RngOrdElt -> RngOrdElt
Norm(a) : RngOrdElt -> RngIntElt
Norm(a, R) : RngOrdElt, Rng -> RngElt
Norm(a, R) : RngIntElt, Rng -> RngElt
Norm(a, R) : FldRatElt, Rng -> RngElt
The relative norm NL/F(a) over F of the element a of L where F is the field or order 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.
AbsoluteNorm(a) : FldAlgElt -> FldRatElt
NormAbs(a) : FldAlgElt -> FldRatElt
AbsoluteNorm(a) : RngOrdElt -> FldRatElt
NormAbs(a) : RngOrdElt -> FldRatElt
The absolute norm NL/Q(a) over Q of the element a of L (or one of its orders).
Trace(a) : FldAlgElt -> FldAlgElt
Trace(a) : FldAlgElt -> FldRatElt
Trace(a, R) : FldAlgElt, Rng -> RngElt
Trace(a) : RngOrdElt -> RngOrdElt
Trace(a) : RngOrdElt -> RngIntElt
Trace(a, R) : RngOrdElt, Rng -> RngElt
The relative trace TrL/F(a) over F of the element a of L where F is the field or order 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.
AbsoluteTrace(a) : FldAlgElt -> FldRatElt
TraceAbs(a) : FldAlgElt -> FldRatElt
AbsoluteTrace(a) : RngOrdElt -> FldRatElt
TraceAbs(a) : RngOrdElt -> FldRatElt
The absolute trace TrL/Q(a) over Q of the element a of L (or one of its orders).
CharacteristicPolynomial(a) : FldAlgElt -> RngUPolElt
CharacteristicPolynomial(a, R) : FldAlgElt, Rng -> RngUPolElt
CharacteristicPolynomial(a) : RngOrdElt -> RngUPolElt
CharacteristicPolynomial(a, R) : RngOrdElt, Rng -> RngUPolElt
Given an element a from an algebraic field or order L, returns the characteristic polynomial of the element over R if given or the subfield or suborder F otherwise where F is the field or order over which L is defined as an extension.
AbsoluteCharacteristicPolynomial(a) : FldAlgElt -> RngUPolElt
AbsoluteCharacteristicPolynomial(a) : RngOrdElt -> RngUPolElt
Given an element a from an algebraic field or one of its orders, this function returns the characteristic polynomial of the element. For field elements the polynomial will have coefficients in the rational field, for order elements the coefficients will be in the ring of integers.
MinimalPolynomial(a) : FldAlgElt -> RngUPolElt
MinimalPolynomial(a, R) : FldAlgElt, Rng -> RngUPolElt
MinimalPolynomial(a) : RngOrdElt -> RngUPolElt
MinimalPolynomial(a, R) : RngOrdElt, Rng -> RngUPolElt
Given an element a from an algebraic field or order L, returns the minimal polynomial of the element over R if given otherwise the subfield or suborder F where F is the field or order over which L is defined as an extension.
AbsoluteMinimalPolynomial(a) : FldAlgElt -> RngUPolElt
AbsoluteMinimalPolynomial(a) : RngOrdElt -> RngUPolElt
Given an element a from an algebraic field or one of its orders, this function returns the minimal polynomial of the element. For field elements the polynomial will have coefficients in the rational field, for order elements the coefficients will be in the ring of integers.
RepresentationMatrix(a) : FldAlgElt -> AlgMatElt
RepresentationMatrix(a, R) : FldAlgElt, Rng -> AlgMatElt
RepresentationMatrix(a) : RngOrdElt -> AlgMatElt
RepresentationMatrix(a, R) : RngOrdElt, Rng -> AlgMatElt
Return the representation matrix of a, that is, the matrix which represents the linear map given by multiplication by a. If a is an order element, this matrix is with respect to the basis for the order; if a is an algebraic field element, the basis for the field is used. 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.

AbsoluteRepresentationMatrix(a) : FldAlgElt -> AlgMatElt
AbsoluteRepresentationMatrix(a) : RngOrdElt -> AlgMatElt
Return the representation matrix of 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.


Example RngOrd_NormsEtc (H37E17)

We create the norm, trace, minimal polynomial and representation matrix of the element α/2 in the quartic field Q(α).

> R<x> := PolynomialRing(Integers());
> K<y> := NumberField(x^4-420*x^2+40000);
> z := y/2;
> Norm(z), Trace(z);
2500 0
> MinimalPolynomial(z);
ext<Q|>.1^4 - 105*ext<Q|>.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

Other Functions

Elements can be represented by sequences and matrices. Valuation can also be calculated.

ElementToSequence(a) : FldAlgElt -> [ FldAlgElt ]
Eltseq(a) : FldAlgElt -> [ FldAlgElt ]
ElementToSequence(a) : RngOrdElt -> [ FldOrdElt ]
Eltseq(a) : RngOrdElt -> [ FldOrdElt ]
For an element a of an algebraic field F, a sequence of coefficients of length degree of F with respect to the basis is returned. For an element of an order O, the sequence of coefficients of the element with respect to the basis of O are returned.

Note however that the universe of the sequence if always a field since in general in relative extensions integral coefficients cannot be achieved.

Eltseq(E, k) : FldAlgElt, FldAlg -> [RngElt]
Eltseq(E, k) : FldAlgElt, Rng -> [RngElt]
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.
Flat(e) : FldAlgElt -> [ FldRatElt]
The coefficients of the algebraic field element e wrt. to the canonical Q basis for its field. This is performed by iterating Eltseq until the coefficients are rational numbers. For number field elements the coefficients obtained match the coefficients wrt. to AbsoluteBasis.
a[i] : FldAlgElt, RngIntElt -> FldRatElt
a[i] : FldAlgElt, RngIntElt -> FldAlgElt
a[i] : RngOrdElt, RngIntElt -> FldRatElt
a[i] : RngOrdElt, RngIntElt -> FldOrdElt
The coefficient of the ith basis element in the algebraic field or order element a.
ProductRepresentation(a) : RngOrdElt -> [ RngOrdElt ], [ RngIntElt ]
ProductRepresentation(a) : FldAlgElt -> [ FldAlgElt ], [ RngIntElt ]
Return sequences P and E such that the product of elements in P to the corresponding exponents in E is the algebraic number a.
ProductRepresentation(P, E) : [ FldAlgElt ], [ RngIntElt ] -> FldAlgElt
PowerProduct(P, E) : [FldAlgElt], [RngIntElt] -> FldAlgElt
Return the 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.
Valuation(w, I) : RngOrdElt, RngOrdIdl -> RngIntElt
Valuation(w, I) : FldAlgElt, RngOrdIdl -> RngIntElt
Given a prime ideal I and an element w of an order or algebraic field, this function returns the valuation vI(w) of w with respect to I; this valuation will be a non-negative integer. Ideals are discussed in Section Ideals and Quotients.
Decomposition(a) : RngOrdElt -> SeqEnum[<RngOrdIdl, RngIntElt>]
Decomposition(a) : FldOrdElt -> SeqEnum[<RngOrdIdl, RngIntElt>]
The factorization of the order or algebraic field element a into prime ideals.
Divisors(a) : RngOrdElt -> SeqEnum[RngOrdElt]
For an element a in a maximal order return a sequence containing (up to units) all the elements which divide a. The elements of the sequence will be generators for all principal ideals returned by Divisors(Parent(a)*a).
Index(a) : RngOrdElt -> RngIntElt
The index of the module Z[a] in O where a lies in O, an order over Z. If a is not a primitive element the index is infinite.
Different(a) : RngOrdElt -> RngOrdElt
The different of the element a of an order of a number field.
 [Next][Prev] [Right] [Left] [Up] [Index] [Root]

Version: V2.19 of Mon Dec 17 14:40:36 EST 2012