[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 w by 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 a^n mod m.
Sqrt(a) : RngOrdElt -> RngOrdElt
Sqrt(a) : FldAlgElt -> FldAlgElt
SquareRoot(a) : RngOrdElt -> RngOrdElt
SquareRoot(a) : FldAlgElt -> FldAlgElt
Returns the square root of a if it exists in the order or field containing a.
Root(a, n) : RngOrdElt -> RngOrdElt
Root(a, n) : FldAlgElt -> FldAlgElt
Returns the n-th root of 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 a is a kth power, (respectively square) and the root if so.
Denominator(a) : FldAlgElt -> RngIntElt
Returns the denominator of a, the least common multiple of the denominators of the coefficients of a.

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.
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 in O such that w=v^n; if true, such an element v is returned as well.

Finding Special Elements

Generators of fields can be retrieved.

K . 1 : FldNum -> FldNumElt
Return the image alpha 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.

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 r_1 + r_2 of the real absolute values of the conjugates of a. The first r_1 values are the absolute values of the real embeddings of the element, the next r_2 are the lengths of the complex embeddings with their weight factors. That is, if the real conjugates of a are w_i, for 1 <= i <= r_1, and the complex conjugates of a are x_i+- y_i i (for 1 <= i <= r_2), then AbsoluteValues returns [|w_1|, ..., |w_(r_1)|, Sqrt(x_(r_1 + 1)^2 + y_(r_1 + 1)^2/2), ... Sqrt(x_(r_1 + r_2)^2 + y_(r_1 + r_2)^2/2)].
AbsoluteLogarithmicHeight(a) : FldAlgElt -> FldPrElt
AbsoluteLogarithmicHeight(a) : RngOrdElt -> FldPrElt
Let P be the minimal polynomial of a over Z, with leading coefficient a_0 and roots alpha_1, ..., alpha_n. Then the absolute logarithmic height is defined to be h(alpha) = (1/n) log(a_0 prod_(j=1)^(n) max(1, |alpha_j|)).

Conjugates(a) : FldAlgElt -> [ FldPrElt ]
Conjugates(a) : RngOrdElt -> [ FldPrElt ]
Returns all conjugates of a as a sequence of length n of complex numbers. The r_1 real conjugates appear first, and are followed by r_2 pairs of complex conjugates.
Conjugate(a, k) : FldAlgElt, RngIntElt -> FldPrElt
Conjugate(a, k) : RngOrdElt, RngIntElt -> FldPrElt
Equivalent to Conjugates(a)[k].
Length(a) : FldAlgElt -> FldPrElt
Length(a) : RngOrdElt -> FldPrElt
Return the T_2-norm of 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 r_1 + r_2 of logarithms of the absolute values of the conjugates of a number field or order element a != 0.

Example RngOrd_Discriminant (H53E16)

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 T_2 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
The relative norm N_(L/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.
AbsoluteNorm(a) : FldAlgElt -> FldRatElt
NormAbs(a) : FldAlgElt -> FldRatElt
AbsoluteNorm(a) : RngOrdElt -> FldRatElt
NormAbs(a) : RngOrdElt -> FldRatElt
The absolute norm N_(L/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 Tr_(L/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.
AbsoluteTrace(a) : FldAlgElt -> FldRatElt
TraceAbs(a) : FldAlgElt -> FldRatElt
AbsoluteTrace(a) : RngOrdElt -> FldRatElt
TraceAbs(a) : RngOrdElt -> FldRatElt
The absolute trace Tr_(L/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.

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.

Flat(e) : FldAlgElt -> [ FldRatElt]
The coefficients of e wrt. to the canonical Q basis for its field. This is performed by iterating Eltseq until the coefficients are rational numbers.
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 a.
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 aw_i with respect to the basis w_1, ..., w_n.

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 L_i := sum L_(i - 1) omega_(i, j), L := L_n and L_0 := Q. Then the representation matrix is computed with respect to the Q-basis (prod_j omega_(i_j, j))_(i in I) consisting of products of basis elements of the different levels.


Example RngOrd_NormsEtc (H53E17)

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

> 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

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 v_I(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.
 [Next][Prev] [Right] [Left] [Up] [Index] [Root]