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

Structure Operations

In the lists below K usually refers to a number field, O to an order.

Subsections

Category and Parent

Number fields form the Magma category FldNum, orders form RngOrd. The notional power structures exist as parents of number fields and their orders, they allow no operations.

Category(K) : FldNum -> Cat
Parent(K) : FldNum -> Pow
Category(O) : RngOrd -> Cat
Parent(O) : RngOrd -> Pow

Related Structures

PrimeRing(K) : FldNum -> RngRat
PrimeField(K) : FldNum -> RngRat
PrimeRing(O) : RngOrd -> RngInt
Centre(K) : FldNum -> FldNum
Centre(O) : RngOrd -> RngOrd
GroundField(K) : FldNum -> FldNum
GroundField(K) : FldNum -> FldRat
Given a number field K, this returns the number field over which K was defined by a single equation (so the last in a possible tower of subfields used in the definition of K). For an absolute number field K this will be the rational field Q.
AbsoluteField(K) : FldNum -> FldNum
Given a number field K, this returns an isomorphic number field L defined as an absolute extension (over Q). Here K must either have ground field Q (in which case K and L will coincide) or have a ground field G that is an absolute extension of Q. For more complicated situations this function will have to be invoked repeatedly.
AbsoluteOrder(O) : RngOrd -> RngOrd
Given an order O, this returns an isomorphic order O' defined as an absolute equation order (over Z). Here O must either be an order in an absolute number field itself (in which case O and O' will coincide) or a relative extension of an order in a ground field G that is an absolute extension of Q. For more complicated situations this function will have to be invoked repeatedly.
Simplify(O) : RngOrd -> RngOrd
Given an order O, obtained by a chain of transformations from an equation order E, return an order that is given directly by a single transformation over E.
LLL(O) : RngOrd -> RngOrd, AlgMatElt
Given an order O, return an order O' obtained from the old order by a transformation matrix T, which is returned as a second value, such that O' has a LLL-reduced basis.
Lattice(O) : RngOrd -> ModLat
Lattice(I) : RngOrdIdl -> ModLat
Given an absolute order O, or an ideal I in an order, return the lattice determined by O or I.

Galois group

Finding Galois groups of (normal closures) of number fields in general is a hard problem. The implementation of the GaloisGroup function below was adapted from a version developed by the Pari group in Bordeaux.

GaloisGroup(K) : FldNum -> GrpPerm
Given a number field K, defined by an irreducible monic polynomial of degree n over the integers, this function returns a permutation group that forms the Galois group of the normal closure of K (in some algebraic closure of Q). The permutation group acts on the point 1, 2, ..., n. Currently this function is restricted to field and polynomial of degree n<8.

Subfields

This section contains two extremely useful functions for the computation of all subfields or all subfields of a given degree of an absolute number field.

Subfields(K, n) : FldNum -> [ < FldNum, Hom > ]
Given an absolute number field K and an integer greater than 1, this function returns a sequence of pairs (2-tuples) containing the subfields of K of degree n together with the embedding homomorphisms of each subfield into K. It is possible that the sequence contains isomorphic fields.
Subfields(K) : FldNum -> [ < FldNum, Hom > ]
Given an absolute number field K, this function returns a sequence of pairs (2-tuples) containing the subfields of K together with the embedding homomorphisms of each subfield into K. It is possible that the sequence contains isomorphic fields.

Invariants

Characteristic(K) : FldNum -> RngIntElt
Characteristic(O) : RngOrd -> RngIntElt
Degree(O) : RngOrd -> RngIntElt
Degree(K) : FldNum -> RngIntElt
Given a number field K, return the degree [K:G] of K over its ground field G. For an order O it returns the relative degree of O over its ground order.
AbsoluteDegree(O) : RngOrd -> RngIntElt
Given an order O, return the absolute degree of O, which equals the absolute degree of the field of fractions of O over Q.
Discriminant(O) : RngOrd -> RngIntElt
Discriminant(K) : FldNum -> RngIntElt
Given a number field K, return the discriminant of K. This discriminant is defined to be the discriminant of the maximal order of the field; as a consequence, its computation may trigger the determination of the maximal order and consequently this function will only work in absolute extensions.

The discriminant of any order defined over Z is by definition the discriminant of its basis, where the discriminant of any sequence of elements omega _i from K is defined to be the determinant of the trace matrix of the sequence.

The discriminant of absolute fields and orders is an integer.

ReducedDiscriminant(O) : RngOrd -> RngIntElt
ReducedDiscriminant(K) : FldNum -> RngIntElt
The reduced discriminant of the defining polynomial f of K, that is, the least positive integer in the ideal generated by f and its first derivative.

This is the same as the maximal elementary divisor of the trace matrix of K.

Regulator(O) : RngOrd -> FldReElt
Regulator(K) : FldNum -> FldReElt
Given a number field K, return the regulator of K, as a real number. (If the unit rank is 0, this returns 1.) Note that this will trigger the computation of the maximal order and its unit group if they are not known yet. This only works in an absolute extension.
Signature(O) : RngOrd -> RngIntElt, RngIntElt
Signature(K) : FldNum -> RngIntElt, RngIntElt
Given an absolute number field K, or an order O of K, return two integers, being the number of real embeddings and the number of pairs of complex embeddings of K.
Index(O, E) : RngOrd, RngOrd -> RngIntElt
The index of order E in order O, for orders E subset O subset K.
DefiningPolynomial(K) : FldNum -> RngUPolElt
DefiningPolynomial(O) : RngOrd -> RngUPolElt
Given a number field K, the polynomial (with rational coefficients) defining K as an extension of its ground field G is returned. For an order O a polynomial is returned defining O over its ground ring.
Zeros(O, n) : RngOrd, RngIntElt -> [ FldReElt ]
Zeros(K, n) : FldNum, RngIntElt -> [ FldReElt ]
Given ana absolute number field K or an order in K, and an integer n, return the zeros of the defining polynomial of K to precision at least n. The function returns a sequence of length the degree of K, containing real numbers; the first r are the real zeros, the next s are real parts of the complex roots followed by the s imaginary parts. Here (r, s) is the signature of the field.

The zeros are stored with the field; when recomputed to a higher precision the stored values are replaced. Initially the zeros are known to the real precision stored with the field (see SetKANTPrecision). if the zeros are known already to a precision greater than the value n with which Zeros is invoked, the returned values will have the greater precision.

Basis Representation

Basis(O) : RngOrd -> [FldNumElt]
Return the current basis for O over its ground ring as a sequence of elements of its field of fractions.
IntegralBasis(K) : FldNum -> [FldNumElt]
An integral basis for the absolute number field K is returned as a sequence of elements of K. This is the same as the basis for the maximal order. Note that the maximal order will be determined (and stored) if necessary.
BasisMatrix(O) : RngOrd -> AlgMatElt
Given an order O in a number field K of degree n, this returns a n x n matrix whose i-th row contains the (rational) coefficients for the i-th basis element of O with respect to the power basis of K. Thus, if b_i is the i-th basis element of O, b_i=sum_(j=1)^(n)M_(ij)alpha^(j - 1) where M is the matrix and alpha is the generator of K.

The matrix is the same as TransformationMatrix(O, E), where E is the equation order for K, except that the coefficients are integers in this case.

TransformationMatrix(O, P) : RngOrd -> AlgMatElt, RngIntElt
Returns the transformation matrix for the transformation between the orders O and P in a common number field of degree n. The function returns a n x n matrix T with integer coefficients as well as a common integer denominator. The rows of the matrix express the n basis elements of O as a linear combination of the basis elements of P. Hence the effect of multiplying T on the left by a row vector v containing the basis coefficients of an element of O is the row vector v.T expressing the same element of the number field on the basis for P.

Example FldNum_Bases (H28E9)

We continue our example of a field of degree 4.

The functions Basis and IntegralBasis both return a sequence of elements, that can be accessed using the operators for enumerated sequences. Note that if, as in our example, O is the maximal order of K, both functions produce the same output:

> R<x> := PolynomialRing(Integers());
> f := x^4 - 420*x^2 + 40000;
> K<y> := NumberField(f);
> O := MaximalOrder(K);
> I := IntegralBasis(K);
> B := Basis(O);
> print I, B;
[ (1), (1/2 * x), (1/4 * x + 1/40 * x^2 ), (1/2 + 9/40 * x + 1/800 * x^3 ) ]
[ (1), (1/2 * x), (1/4 * x + 1/40 * x^2 ), (1/2 + 9/40 * x + 1/800 * x^3 ) ]
The BasisMatrix function makes it possible to move between orders, in the following manner. We may regard orders as free Z-modules of rank the degree of the number field. The basis matrix then provides the transformation between the order and the equation order. The function ElementToSequence can be used to create module elements.

> K<x> := NumberField(x^4-420*x^2+40000);
> O := MaximalOrder(K);
> BM := BasisMatrix(O);
> Mod := RSpace(RationalField(), Degree(K));
> z := O ! x;
> e := z^2-3*z;
> em := Mod ! ElementToSequence(e);
> print em;
(  0 -26  40   0)
> f := em*BM;
> print f;
( 0 -3  1  0)
So, since f is represented with respect to the basis of the equation order, which is the power basis, we indeed find the original element back. Of course it is much more useful to go in the other direction, using the inverse transformation (we check the result in the last line):

> E := EquationOrder(K);
> f := y^3+7;
> fm := Mod ! ElementToSequence(f);
> e := fm*BM^-1;
> print e;
(-393 -360    0  800)
> print &+[e[i]*B[i] : i in [1..Degree(K)] ];
x^3 + 7

MultiplicationTable(O) : RngOrd -> [AlgMatElt]
Given an order O of some number field K of degree n, return the multiplication table with respect to its basis as a sequence of n matrices (with integer coefficients) of size n x n. The i-th matrix will have as its j-th row the basis representation of b_ib_j, where b_i is the i-th basis element for O. i
TraceMatrix(O) : RngOrd -> AlgMatElt
Return the trace matrix of an order O, which has the trace Tr( omega _i x omega _j) as its i, j-th entry (where the omega _i are the basis for O).

Example FldNum_MultiplicationTable (H28E10)

We continue our example of a field of degree 4.

The multiplication table of the order O consists of 4 matrices, such that the i-th 4 x 4 matrix (1 <= i <= 4) determines the multiplication by the i-th basis element of O (as a linear transformation with respect to that basis). Thus the third column of T[2] gives the basis coefficients for the product of B[2] and B[3], and we can use the sequence reduction operator to calculate B[2] * B[3] in an alternative way:

> R<x> := PolynomialRing(Integers());
> f := x^4 - 420*x^2 + 40000;
> K<y> := NumberField(f);
> O := MaximalOrder(K);
> B := Basis(O);
> print B[2];
1/2*y
> T := MultiplicationTable(O);
> print T[2];
    [  0   0  -5 -25]
    [  1  -5  -7  -7]
    [  0  10   5  15]
    [  0   0  10   0]
> print  &+[ T[2][i][3]*B[i] : i in [1..4] ];
    1/80*y^3 + 1/8*y^2
> print B[2]*B[3];
    1/80*y^3 + 1/8*y^2
The trace matrix can either be found using the built-in function. or by the one-line definition given below (for a field of degree 4):

> print TraceMatrix(O);
    [  4   0  21   2]
    [  0 210 105 215]
    [ 21 105 173 118]
    [  2 215 118 226]
> print MatrixRing(RationalField(), 4) ! [Trace(B[i]*B[j]): i, j in [1..4] ];
>
    [  4   0  21   2]
    [  0 210 105 215]
    [ 21 105 173 118]
    [  2 215 118 226]

Ring Predicates

IsCommutative(K) : FldNum -> BoolElt
IsUnitary(K) : FldNum -> BoolElt
IsFinite(K) : FldNum -> BoolElt
IsOrdered(K) : FldNum -> BoolElt
IsCommutative(O) : RngOrd -> BoolElt
IsUnitary(O) : RngOrd -> BoolElt
IsFinite(O) : RngOrd -> BoolElt
IsOrdered(O) : RngOrd -> BoolElt
IsField(K) : FldNum -> BoolElt
IsEuclideanDomain(K) : FldNum -> BoolElt
IsPID(K) : FldNum -> BoolElt
IsUFD(K) : FldNum -> BoolElt
IsField(O) : RngOrd -> BoolElt
IsEuclideanDomain(O) : RngOrd -> BoolElt
IsPID(O) : RngOrd -> BoolElt
IsUFD(O) : RngOrd -> BoolElt
IsDivisionRing(K) : FldNum -> BoolElt
IsEuclideanRing(K) : FldNum -> BoolElt
IsDivisionRing(O) : RngOrd -> BoolElt
IsEuclideanRing(O) : RngOrd -> BoolElt
IsPrincipalIdealRing(K) : FldNum -> BoolElt
IsDomain(K) : FldNum -> BoolElt
IsPrincipalIdealRing(O) : RngOrd -> BoolElt
IsDomain(O) : RngOrd -> BoolElt
K eq L : FldNum, FldNum -> BoolElt
K ne L : FldNum, FldNum -> BoolElt
O eq P : RngOrd, RngOrd -> BoolElt
O ne P : RngOrd, RngOrd -> BoolElt
O subset P : RngOrd, RngOrd -> BoolElt
IsIsomorphic(K, L) : FldNum, FldNum -> BoolElt, Map
Given two number fields K and L, this returns true as well as an isomorphism K -> L, if K and L are isomorphic, and it returns false otherwise.
IsSubfield(K, L) : FldNum, FldNum -> BoolElt, Map
Given two number fields K and L, this returns true as well as an embedding K hookrightarrow L, if K is a subfield of L, and it returns false otherwise.
K eq L : FldNum, FldNum -> BoolElt
Returns true if and only if the orders N and O, or the fields K and L, are the same.

Two number fields will be the same if and only if their defining polynomials are the same; in fact the one structure will then necessarily be a copy of the other.

Two orders are equal if their fields of fraction are the same and the transformation matrix taking one to the other is integral and has determinant 1.

IsMaximal(O) : RngOrd -> BoolElt
This returns true if the order O in the field K is the maximal order of K, false otherwise.

Ideal Class Groups

This subsection describes the functions related to finding class groups and class numbers for (the maximal order O of) an absolute number field.

The method employed is the relation method, basically consisting of the following steps. In the first step a list of prime ideals of norm below a given bound is generated, the factor basis. In the second step a search is conducted to find in each of the prime ideals a few elements for which the principal ideal generated by it factors completely over the factor basis. Using these relations, a generating set for the ideal class group is derived (via matrix echelonization), and in the final step it is checked that the correct orders for the generators are found. In that step knowledge about the units of O is needed.

To determine the class group (or number) correctly one has to make sure that all ideals with norm below the Minkowski bound (or below the Bach bound in case one assumes the necessary generalized Riemann hypotheses) are taken into consideration, and that the final stage (which may be time consuming) is properly executed. Optional arguments allow the user to override these, but then correctness of the result can not be guaranteed.

Once a class group computation has been completed, the results are stored with the number field.

ClassGroup(O: parameters) : RngOrd -> GrpAb, Map
ClassGroup(K: parameters) : FldNum -> GrpAb, Map
    Bound: RngIntElt                    Default: M
    Euler: BoolElt                      Default: true
    Check: BoolElt                      Default: true
The group of ideal classes for the ring of integers O of the number field K is returned as an abelian group, together with a map from this abstract group to O.

With the default values for the optional parameters the Minkowski bound is used and checking takes place in the last step of the algorithm (see the explanation above).

If Check := false, most of the time-consuming tests will not be executed. In this case the result is can not be guaranteed to be correct: it may be that the true order of generators divides the one obtained.

To speed up the computation further, the user may use a smaller bound than the Minkowski bound, by giving a positive integer value to Bound.

The optional argument Euler is used to control testing of whether or not enough relations have been found: if its value is true (the default case) an Euler product computation is performed for this reason.

ClassNumber(O: parameters) : RngOrd -> RngIntElt
ClassNumber(K: parameters) : FldNumElt -> RngIntElt
    Bound: RngIntElt                    Default: M
    Euler: BoolElt                      Default: true
    Check: BoolElt                      Default: true
Return the class number of the ring of integers O of a number field K. The meaning of the parameters is the same as for ClassGroup.
ClassGroupStructure(O: parameters) : RngOrd -> [RngIntElt]
ClassGroupStructure(K): parameters : FldNum -> [RngIntElt]
    Bound: RngIntElt                    Default: M
    Euler: BoolElt                      Default: true
    Check: BoolElt                      Default: true
A sequence of integers, being the orders of cyclic factors of the class group of the ring of integers O of a number field K, is returned. For the meaning of the parameters see the function ClassGroup above.
BachBound(K) : FldNum -> RngIntElt
An (integer) upper bound for norms of generators of the ideal class group for K assuming the appropriate generalized Riemann hypotheses.
MinkowskiBound(K) : FldNum -> RngIntElt
An unconditional (integer) upper bound for norms of the generators of the ideal class group for K.
FactorBasis(O, B) : RngOrd, RngIntElt -> [ RngOrdIdl ]
Given the maximal order O, this function returns a sequence of prime ideals of norm less than a given bound B. This factor basis will not be stored with the order O, and does not affect possible class group and unit group computations.

This bound is B, unless a factor basis for O with a different bound B' has been created before, in which case that is used. If no factor basis for O has been stored, one with bound B will be created, but it will not be stored with O, so that it is possible to create several factor bases with different bounds this way. Note however that factor bases used in the computation for unit groups and class groups will be stored with O.

RelationMatrix(O, B, n) : RngOrd, RngIntElt -> ModHomElt
Given a maximal order O, generate (at most) n relations for each prime ideal in the factor basis for O with bound B on the norms of the ideals. The relations are given by columns in a matrix. If at some stage the relations generate the trivial group, no more relations are generated.

Unit Groups

The relation method, outlined in the previous subsection, can also be used for unit group calculations. Therefore unit group calculations (including those triggered as a side effect) may cause the creation of factor bases and relations. There are some other methods (like Dirichlet's method) implemented, which are faster under certain circumstances. Descriptions can be found in , (pp. 343--344), and in . These methods will only work in the absolute case.

TorsionSubgroup(O) : RngOrd -> GrpAb, Map
TorsionSubgroup(K) : FldNum -> GrpAb, Map
The torsion subgroup of the unit group of the order O, or, in case of a number field K, of its maximal order O. The torsion subgroup is returned as an abelian group, together with a map m from the group to the order O. The torsion subgroup will be cyclic, and is generated by m(T.1).
IndependentUnits(O) : RngOrd -> GrpAb, Map
IndependentUnits(K) : FldNum -> GrpAb, Map
    Al: MonStgElt                       Default: "Automatic"
Given an order O, this function returns a sequence of independent units; they generate a subgroup of finite index in the full unit group. Given a number field K it does the same for the maximal order of K. The function returns aan abelian group (generated by the independent units) as well as a homomorphism from the group to the order.

The optional argument Alg can be used to specify an algorithm. It should be one of "Automatic", (default, a choice will be made for the user) "Dirichlet", "Mixed" (the best known Dirichlet method), or "Relation".

pFundamentalUnits(O, p) : RngOrd, RngIntElt -> GrpAb, Map
pFundamentalUnits(K, p) : FldNum, RngIntElt -> GrpAb, Map
Given an order O in a number field, this function returns an (abstract) abelian group U, as well as a map m from U to the order. The image of U under m will be the p-part of the unit group of O, where p is a prime number. If a field K is given rather than an order, the above is computed for the maximal order of K.
UnitGroup(O) : RngOrd -> GrpAb, Map
UnitGroup(K) : FldNum -> GrpAb, Map
    Al: MonStgElt                       Default: "Automatic"
Given an order O in a number field, this function returns an (abstract) abelian group U, as well as a map m from U to the order. The unit group consists of the torsion subgroup, generated by the image m(U.1) and a free part, generated in O by the images m(U.i) for 2 <= i <= r + s.

If the argument to this function is a number field, the unit group of its maximal order is returned. Note that the maximal order may have to be determined first.

The optional argument Alg can be used to specify an algorithm. It should be one of "Automatic", (default, a choice will be made for the user) "Dirichlet", "Mixed" (the best known Dirichlet method), or "Relation".

UnitRank(O) : RngOrd -> RngIntElt
UnitRank(K) : FldNum-> RngIntElt
Return the unit rank of the ring of integers O of a number field K.

Example FldNum_UnitGroup (H28E11)

In our field defined by x^4 - 420 * x^2 + 40000 we simply obtain the class and unit groups as follows.

> R<x> := PolynomialRing(Integers());
> f := x^4 - 420*x^2 + 40000;
> K<y> := NumberField(f);
> C := ClassGroup(K);
> print C;
GrpFP: C on 1 generator
Relations
       C.1 = Id(C)
> U := UnitGroup(K);
> print U;
GrpFP: U on 4 generators
Relations
      U.1^2 = Id(U)
      U.3 * U.4 = U.4 * U.3
      U.2 * U.3 = U.3 * U.2
      U.2 * U.4 = U.4 * U.2
      U.1 * U.2 = U.2 * U.1
      U.1 * U.3 = U.3 * U.1
      U.1 * U.4 = U.4 * U.1
> print TorsionSubgroup(K);
GrpFP on 1 generator
Relations
      $.1^2 = Id($)

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