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

Element Operations

Subsections

Parent and Category

Parent(a) : FldNumElt -> FldNum
Parent(w) : RngOrdElt -> RngOrd
Category(a) : FldNumElt -> Cat
Category(w) : RngOrdElt -> Cat

Arithmetic

The table below lists the generic arithmetic functions on number field and order elements. Note that automatic coercion ensures that the binary operations +, -, *, and / may be performed on an element of a number field and an element of one of its orders; the result will be a number field element. Since division of order elements does not generally result in an order element, / for two elements of an order returns an element of the field of fractions of the order; also, the exponent k in a^k must be non-negative.

+ a : FldNumElt -> FldNumElt
+ w : RngOrdElt -> RngOrdElt
- a : FldNumElt -> FldNumElt
- w : RngOrdElt -> RngOrdElt
a + b : FldNumElt, FldNumElt -> FldNumElt
w + v : RngOrdElt, RngOrdElt -> RngOrdElt
a - b : FldNumElt, FldNumElt -> FldNumElt
w - v : RngOrdElt, RngOrdElt -> RngOrdElt
a * b : FldNumElt, FldNumElt -> FldNumElt
w * v : RngOrdElt, RngOrdElt -> RngOrdElt
a / b : FldNumElt, FldNumElt -> FldNumElt
w / v : RngOrdElt, RngOrdElt -> FldNumElt
a ^ k : FldNumElt, RngIntElt -> FldNumElt
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.)
Sqrt(a) : RngOrdElt -> RngOrdElt
Sqrt(a) : FldNumElt -> FldNumElt
SquareRoot(a) : RngOrdElt -> RngOrdElt
SquareRoot(a) : FldNumElt -> FldNumElt
Returns the square root of a if it exists in the order or field containing a.
Root(a, n) : RngOrdElt -> RngOrdElt
Root(a, n) : FldNumElt -> FldNumElt
Returns the n-th root of a if it exists in the order or field containing a.

Equality and Membership

a eq b : FldNumElt, FldNumElt -> BoolElt
w eq v : RngOrdElt, RngOrdElt -> RngOrdElt
a ne b : FldNumElt, FldNumElt -> BoolElt
w ne v : RngOrdElt, RngOrdElt -> FldNumElt
a in K : FldNumElt, FldNum -> BoolElt
w in O : RngOrdElt, RngOrd -> BoolElt

Predicates on Elements

Besides the generic predicates IsMinusOne, IsZero and IsOne, the predicates IsIntegral and IsPrimitive are defined on elements of number fields and orders. It is also possible to test for powers.

IsZero(a) : FldNumElt -> BoolElt
IsZero(w) : RngOrdElt -> BoolElt
IsOne(a) : FldNumElt -> BoolElt
IsOne(w) : RngOrdElt -> BoolElt
IsMinusOne(a) : FldNumElt -> BoolElt
IsMinusOne(w) : RngOrdElt -> BoolElt
IsUnit(a) : FldNumElt -> BoolElt
IsUnit(w) : RngOrdElt -> BoolElt
IsIntegral(a) : FldNumElt -> BoolElt
IsIntegral(a) : RngOrdElt -> BoolElt
True if the element a of number field K or of an order in K is contained in the ring of integers of K, false otherwise. (This is vacuously true for order elements.) (This function uses the minimal polynomial to get the answer, which means that the calculation of the maximal order is not triggered in case it is not known yet.)
IsPrimitive(a) : FldNumElt -> BoolElt
IsPrimitive(a) : RngOrdElt -> BoolElt
True if the element a of the number field K or one of its orders O is a primitive element of K.
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.
IsPowerTimesUnit(w, n) : RngOrdElt, RngIntElt -> BoolElt, RngOrdElt
Given an element w in an order O and an integer n greater than 0, this function returns true if and only if there exists an element v in O, and a unit u of O such that v^n=uw; if true is returned, such an element v is returned as well.
IsPowerTimesTorsionUnit(w, n) : RngOrdElt, RngIntElt -> BoolElt, RngOrdElt
Given an element w in an order O and an integer n greater than 0, this function returns true if and only if there exists an element v in O, and a torsion unit t of O such that v^n=tw; if true is returned, such an element v is returned as well.

Finding Special Elements

K . 1 : FldNum -> FldNumElt
Return a generator (primitive element) for the number field K=G(alpha) over the ground field G. This is the image alpha of x in G[x]/f where f is the defining polynomial of K.
PrimitiveElement(K) : FldNum -> FldNumElt
Returns a primitive element for the number field, usually K.1.
[Future release] ShortPrimitiveElement(O) : RngOrd -> RngOrdElt
ShortPrimitiveElement(K) : FldNum -> FldNumElt
Given an order O, this function returns an order element that is a primitive element for its field of fractions having small length (that is, small T_2 norm -- see the Length function for a definition). With the number field K as an argument, a short primitive element in the equation order is returned.

The element returned will often be the shortest primitive element of the order, but this is not guaranteed.

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 internal precision (the equation order is a field is being used). See the section on special options for more information.

AbsoluteValues(a) : FldNumElt -> [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) : FldNumElt -> 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(a, |alpha_j|)).

Conjugates(a) : FldNumElt -> [ FldPrElt ]
Conjugates(a) : RngOrdElt -> [ FldPrElt ]
Return 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) : FldNumElt, RngIntElt -> FldPrElt
Conjugate(a, k) : RngOrdElt, RngIntElt -> FldPrElt
Equivalent to Conjugates(a)[k].
Length(a) : FldNumElt -> 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 (as normalized by the Conjugates function).
Logs(a) : FldNumElt -> [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 FldNum_Discriminant (H36E12)

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);
42024.999999999987
> Discriminant(O);
42025
Thus the new discriminant returns a (complex) approximation to the built in Discriminant function, giving the above result for the maximal order O of the previous example.

Here is an alternative way to get the T_2 norm returned by Length, using the complex Norm function, and the Conjugates.

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

Norm, Trace, and Minimal Polynomial

Norm(a) : FldNumElt -> FldNumElt
Norm(a) : FldNumElt -> FldRatElt
Norm(a) : RngOrdElt -> RngOrdElt
Norm(a) : RngOrdElt -> RngIntElt
The relative norm N_(L/K)(a) from L to K of the element a of L; here K must be the field or order over which L is defined as an extension.
AbsoluteNorm(a) : FldNumElt -> FldRatElt
AbsoluteNorm(a) : RngOrdElt -> FldRatElt
The absolute norm N_(L/Q)(a) from L to Q of the element a of L (or one of its orders).
Trace(a) : FldNumElt -> FldNumElt
Trace(a) : FldNumElt -> FldRatElt
Trace(a) : RngOrdElt -> RngOrdElt
Trace(a) : RngOrdElt -> RngIntElt
The relative trace Tr_(L/K)(a) from L to K of the element a of L; here K must be the field or order over which L is defined as an extension.
AbsoluteTrace(a) : FldNumElt -> FldRatElt
AbsoluteTrace(a) : RngOrdElt -> FldRatElt
The absolute trace Tr_(L/Q)(a) from L to Q of the element a of L (or one of its orders).
CharacteristicPolynomial(a) : FldNumElt -> RngUPolElt
CharacteristicPolynomial(a) : RngOrdElt -> RngUPolElt
Given an element a from a number field or order L, return the characteristic polynomial of the element over the subfield or suborder K; here K must be the field or order over which L is defined as an extension.
AbsoluteCharacteristicPolynomial(a) : FldNumElt -> RngUPolElt
AbsoluteCharacteristicPolynomial(a) : RngOrdElt -> RngUPolElt
Given an element a from a number 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) : FldNumElt -> RngUPolElt
MinimalPolynomial(a) : RngOrdElt -> RngUPolElt
Given an element a from a number field or order L, return the minimal polynomial of the element over the subfield or suborder K; here K must be the field or order over which L is defined as an extension.
AbsoluteMinimalPolynomial(a) : FldNumElt -> RngUPolElt
AbsoluteMinimalPolynomial(a) : RngOrdElt -> RngUPolElt
Given an element a from a number 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

RepresentationMatrix(a) : FldNumElt -> AlgMatElt
RepresentationMatrix(a) : RngOrdElt -> 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 (absolute) basis for the order; if a is a number field element, the (possibly relative) power basis for the field is used. The ith column of the representation matrix gives the coefficients of aw_i with respect to the basis w_1, ..., w_n.
AbsoluteRepresentationMatrix(a) : FldNumElt -> AlgMatElt
AbsoluteRepresentationMatrix(a) : RngOrdElt -> AlgMatElt
Return the representation matrix of a relative to Q, where a is an element of the relative number field L. If a is an order element, the representation matrix is relative to Z instead.
Valuation(w, I) : RngOrdElt, RngOrdIdl -> RngIntElt
Given a prime ideal I and an element w of an order O, this function returns the valuation v_I(w) of w with respect to I; this valuation will be a non-negative integer.

Example FldNum_NormsEtc (H36E13)

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

> 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      0      0 -20000]
[   1/2      0      0      0]
[     0    1/2      0    210]
[     0      0    1/2      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

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