In the lists below F usually refers to an algebraic field, K to a number field and O to an order.
Number fields form the Magma category FldNum, orders form RngOrd and their fields of fractions form FldOrd. The notional power structures exist as parents of algebraic fields and their orders, no operations are allowed.
Procedure to change the names of the generating elements in the number field K to the contents of the sequence of strings s.The i-th sequence element will be the name used for the generator of the (i - 1)-st subfield down from K as determined by the creation of K, the first element being used as the name for the generator of K. In the case where K is defined by more than one polynomial as an absolute extension, the ith sequence element will be the name used for the root of the ith polynomial used in the creation of K.
This procedure only changes the names used in printing the elements of K. It does not assign to any identifiers the value of a generator in K; to do this, use an assignment statement, or use angle brackets when creating the field.
Note that since this is a procedure that modifies K, it is necessary to have a reference ~K to K in the call to this function.
Given a number field K, return the element which has the i-th name attached to it, that is, the generator of the (i - 1)-st subfield down from K as determined by the creation of K. Here i must be in the range 1≤i≤m, where m is the number of polynomials used in creating K. If K was created using multiple polynomials as an absolute extension, K.i will be a root of the ith polynomial used in creating K.
Assign the strings in the sequence s to the names of the basis elements of the field of fractions F.
Return the ith basis element of the field of fractions F.
Return the ith basis element of the order O.
Each order and field has other orders and fields which are related to it in various ways.
Given an algebraic field F, return the algebraic field over which F was defined. For an absolute number field F, the function returns the rational field Q.
Given an order O, this returns the order over which O was defined. For an absolute order O this will be the integers Z.
Given an algebraic field F, this returns an isomorphic number field L defined as an absolute extension (i.e. over Q).
Given an order O, this returns an isomorphic order O' defined as an order in an absolute extension (over Q).
Given an algebraic field F or an order O, this returns an isomorphic field L defined as an absolute simple extension or the Z-isomorphic order in it. (For algorithm, see [Tra76])
Given algebraic fields L and F such that Magma knows that F is a subfield of L, return an isomorphic algebraic field M defined as an extension over F.
Given an equation order O or a field of fractions F of an equation order O return the sequence of orders or fields each defined by a defining polynomial of O or F.
> R<x> := PolynomialRing(Integers()); > Composite := function( K, L ) > T<y> := PolynomialRing( K ); > f := T!DefiningPolynomial( L ); > ff := Factorization(f); > LKM := NumberField(ff[1][1]); > return AbsoluteField(LKM); > end function;To create, for example, the field Q(Sqrt(2), Sqrt(3), Sqrt(5)), the above function should be applied twice:
> K := NumberField(x^2-3); > L := NumberField(x^2-2); > M := NumberField(x^2-5); > KL := Composite(K, L); > S<s> := PolynomialRing(BaseField(KL)); > KLM<w> := Composite(KL, M); > KLM; Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576 over the Rational FieldNote, that the same field may be constructed with just one call to NumberField followed by AbsoluteField:
> KLM2 := AbsoluteField(NumberField([x^2-3, x^2-2, x^2-5])); > KLM2; Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576 over the Rational Fieldor by
> AbsoluteField(ext<Rationals() | [x^2-3, x^2-2, x^2-5]>); Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576 over the Rational FieldIn general, however, the resulting polynomials of KLM and KLM2 will differ. To see the difference between SimpleExtension and AbsoluteField, we will create KLM2 again:
> KLM3 := NumberField([x^2-3, x^2-2, x^2-5]: Abs); > AbsoluteField(KLM3); Number Field with defining polynomials [ x^2 - 3, x^2 - 2, x^2 - 5] over the Rational Field > SimpleExtension(KLM3); Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576 over the Rational Field
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.
Delta: RngElt Default: 0.99
Given an order O, return an order O' obtained from O by a transformation matrix T, which is returned as a second value. O' will have a LLL-reduced basis.
> M := MaximalOrder(x^4-14*x^3+14*x^2-14*x+14); > L, T := LLL(M); > L; Maximal Order, Transformation of M Transformation Matrix: [ 1 0 0 0] [ -3 1 0 0] [ 3 -13 1 0] [ -7 1 -13 1] > T; [ 1 0 0 0] [ -3 1 0 0] [ 3 -13 1 0] [ -7 1 -13 1] > Basis(M); [ M.1, M.2, M.3, M.4 ] > Basis(L, M); [ [1, 0, 0, 0], [-3, 1, 0, 0], [3, -13, 1, 0], [-7, 1, -13, 1] ] > L eq M; trueEven though L and M are considered to be equal because they contain the same elements L has a basis which is LLL reduced but M does not.
Following on from the orders and ideals example (H39E5) we have
> R<x> := PolynomialRing(Integers()); > K := NumberField(x^4-420*x^2+40000); > E := EquationOrder(K); > O := Round2(E, K); [ <2, 18>, <5, 8>, <41, 2> ] index is 2 index is 4 index is 8 index is 4 index is 2 index is 1 index is 5 index is 25 index is 1 index is 1 index of equation order in maximal order is: 64000 > L := LLL(O); > O; Transformation of E Transformation Matrix: [800 0 0 0] [ 0 400 0 0] [ 0 200 20 0] [400 180 0 1] Denominator: 800 > O:Maximal; F[1] | F[2] / / Q F [ 1] Given by transformation matrix F [ 2] x^4 - 420*x^2 + 40000 Index: 64000/1 Signature: [4, 0] > L; Transformation of O Transformation Matrix: [-1 0 0 0] [-1 -1 0 1] [10 1 -2 0] [ 5 1 -1 0] > L:Maximal; F[1] | F[2] | F[3] / / Q F [ 1] Given by transformation matrix F [ 2] Given by transformation matrix F [ 3] x^4 - 420*x^2 + 40000 Index: 1/1 Signature: [4, 0] > Simplify(L):Maximal; F[1] | F[2] / / Q F [ 1] Given by transformation matrix F [ 2] x^4 - 420*x^2 + 40000 Index: 64000/1 Signature: [4, 0] > Simplify(L); Transformation of E Transformation Matrix: [-800 0 0 0] [-400 -220 0 1] [8000 0 -40 0] [4000 200 -20 0] Denominator: 800
Overwrite: BoolElt Default: false
Install the embedding of a simple field F in L where the image of the primitive element of F is the element a of L. This embedding will be used in coercing from F into L.If the addition of this embedding causes an inconsistency with currently known embeddings then the embedding will not be added unless Overwrite is set to true.
Overwrite: BoolElt Default: false
Install the embedding of the non-simple field F in L where the image of the generating elements of F are in the sequence a of elements of L. This embedding will be used in coercing from F into L.If the addition of this embedding causes an inconsistency with currently known embeddings then the embedding will not be added unless Overwrite is set to true.
Returns the embedding map of F in L if an embedding is known.
> k := NumberField(x^2-2); > l := NumberField(x^2-2); > l!k.1; >> l!k.1; ^ Runtime error in '!': Arguments are not compatible LHS: FldNum RHS: FldNumElt > l eq k; false > Embed(k, l, l.1); > l!k.1; l.1 > Embed(l, k, k.1); > k!l.1; k.1Embed is useful in specifying the embedding of a field in a larger field.
> l<a> := NumberField(x^3-2); > L<b> := NumberField(x^6+108); > Root(L!2, 3); 1/18*b^4 > Embed(l, L, $1); > L!l.1; 1/18*b^4Another embedding would be
> Roots(PolynomialRing(L)!DefiningPolynomial(l)); [ <1/36*(-b^4 - 18*b), 1>, <1/36*(-b^4 + 18*b), 1>, <1/18*b^4, 1> ] > Embed(l, L, $1[1][1] : Overwrite := true); > L!l.1; 1/36*(-b^4 - 18*b)
Precision: RngIntElt Default: 50
For an absolute extension K of Q or O of Z, compute the completion at a prime ideal P which must be either a prime ideal of the maximal order or unramified. The result will be a local field or ring with default precision Precision or e*Precision if the ideal is ramified with ramification degree e.The returned map is the canonical injection into the completion. It allows pointwise inverse operations.
Precision: RngIntElt Default: 50
For an absolute extension K over Q and a (finite) place P, compute the completion at P. The precision and the map are as described for Completion.
The completion of Order(P) at the prime ideal P up to default precision prec.
Given an order O of an algebraic number field and a prime ideal p of O return the localization of O at p and the map from O into the localization.
These functions are used to recreate a number field as an associative algebra or as a vector space. In both cases, the base field may be any subfield.
Returns the associative structure constant algebra which is isomorphic to the algebraic field K as an algebra over J. Also returns the isomorphism from K to the algebra mapping wi to the i + 1st unit vector of the algebra where w is a primitive element of K.If a sequence S is given it is taken to be a basis of K over J and the isomorphism will map the ith element of S to the ith unit vector of the algebra.
The vector space isomorphic to the algebraic field K as a vector space over J and the isomorphism from K to the vector space. The isomorphism maps wi to the i + 1st unit vector of the vector space where w is a primitive element of K.If S is given, the isomorphism will map the ith element of S to the ith unit vector of the vector space.
> K := NumberField([x^2 - 2, x^2 - 3, x^2 - 7]); > J := AbsoluteField(NumberField([x^2 - 2, x^2 - 7])); > A, m := Algebra(K, J); > A; Associative Algebra of dimension 2 with base ring J > m; Mapping from: RngOrd: K to AlgAss: A > m(K.1); (1/10*(J.1^3 - 13*J.1) 0) > m(K.1^2); (2 0) > m(K.2); (1/470*(83*J.1^3 + 125*J.1^2 - 1419*J.1 - 1735) 1/940*(-24*J.1^3 - 5*J.1^2 + 382*J.1 + 295)) > m(K.2^2); (3 0) > m(K.3); (1/10*(-J.1^3 + 23*J.1) 0) > m(K.3^2); (7 0) > A.1 @@ m; 1 > A.2 @@ m; (($.1 - 1)*$.1 - $.1 - 1)*K.1 + ($.1 + 1)*$.1 + $.1 + 1 > > r := 5*K.1 - 8*K.2 + K.3; > m(r); (1/235*(-238*J.1^3 - 500*J.1^2 + 4689*J.1 + 6940) 1/235*(48*J.1^3 + 10*J.1^2 - 764*J.1 - 590)) > MinimalPolynomial($1); $.1^2 + 1/5*(-4*J.1^3 + 42*J.1)*$.1 + 5*J.1^2 - 180 > Evaluate($1, r); 0 > K:Maximal; K | | $1 | | $2 | | Q K : $.1^2 - 2 $1 : $.1^2 - 3 $2 : x^2 - 7 > Parent($3); Univariate Polynomial Ring over J > J; Number Field with defining polynomial $.1^4 - 18*$.1^2 + 25 over the Rational Field
Some information describing an order can be retrieved.
Given an algebraic field F, return the degree [F:G] of F over its ground field G. For an order O it returns the relative degree of O over its ground order.
Given an order O or an algebraic field F, return the absolute degree of O over Z or F over Q.
Given an extension F of Q, return the discriminant of F. This discriminant is defined to be the discriminant of the order of the field of fractions or the equation order of a number field.The discriminant of any order O defined over Z is by definition the discriminant of its basis, where the discriminant of any sequence of elements ω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.
The discriminant in a relative extension is the ideal generated by the discriminants of all sequences of elements ωi from O, where the discriminant of a sequence is defined to be the determinant of its trace matrix. This can only be computed in when the coefficient ring of O is maximal or when O has a power basis.
The discriminant of relative orders is an ideal of the base ring.
Given an order O, return the absolute value of the discriminant of O regarded as an order over Z.
Given an algebraic field K, return the absolute value of the discriminant of K regarded as an extension of Q.
The reduced discriminant of an order O is defined as the maximal elementary divisor (elementary ideal) of the torsion module O^#/O where O^# is the dual module to O with respect to the trace form. The reduced discriminant of an algebraic field is that of the order of a field of fractions and that of the equation order of a number field.For absolute extensions this is the largest entry of the Smith normal form of the TraceMatrix. For relative extensions, in addition to the TraceMatrix one has to consider the coefficient ideals.
For orders with a power basis, this is (a generator of) the inverse of the ideal generated by the cofactors X and Y of Xf + Yf'=1 where f is the defining polynomial of the order and f' its first derivative.
Current: BoolElt Default: false
Given a number field K or an order O, return the regulator of K or O, as a real number. 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.If Current is true and a maximal system of independent units is known, then the regulator of that system is returned. In this case no effort is spent to produce a system of fundamental units.
The precision of the answer may be controlled by using SetKantPrecision for the relevant order.
Given an order O or number field K, return a lower bound on the regulator of O or K. This only works in an absolute extension.
Given an absolute algebraic field F, or an order O of F, returns two integers, one being the number of real embeddings, the other the number of pairs of complex embeddings of F.
The unit rank of the order O or the number field K (one less than the number of real embeddings plus number of pairs of complex embeddings).
The module index of order S in order O, for orders S⊂O. O and S must have the same equation order and S must be a suborder of O.
Given an algebraic field F, the polynomial defining F as an extension of its ground field G is returned. For an order O, a integral polynomial is returned that defines O over its coefficient ring.For non simple extensions, this will return a list of polynomials.
Given an absolute algebraic field F or an order O in F, and an integer n, return the zeroes of the defining polynomial of F with a precision of exactly n decimal digits. The function returns a sequence of length the degree of F; all of the real zeroes appear before the complex zeroes.
> L := NumberField(x^6+108); > DefiningPolynomial(L); x^6 + 108 > Zeros(L, 30); [ 1.889881574842309747150815910899999999994 + 1.0911236359717214035600726141999999999977*i, 1.889881574842309747150815910899999999994 - 1.0911236359717214035600726141999999999977*i, 0.E-29 + 2.1822472719434428071201452283999999999955*i, 0.E-29 - 2.1822472719434428071201452283999999999955*i, -1.889881574842309747150815910899999999994 + 1.0911236359717214035600726141999999999977*i, -1.889881574842309747150815910899999999994 - 1.0911236359717214035600726141999999999977*i ] > l := NumberField(x^3 - 2); > DefiningPolynomial(l); x^3 - 2 > Zeros(l, 30); [ 1.259921049894873164767210607299999999994, -0.629960524947436582383605303639109999999 + 1.0911236359717214035600726141999999999977*i, -0.629960524947436582383605303639109999999 - 1.0911236359717214035600726141999999999977*i ]
The different of a maximal order O⊂K is defined as the inverse ideal of { x ∈K | Tr(xO)⊂O}.
The conductor of an order O is the largest ideal of its maximal order that is still contained in O: { x ∈M | xM ⊆O}.
The basis of an order or algebraic field can be expressed using elements from any compatible ring. Basis related matrices can be formed.
Return the current basis for the order O or algebraic field F over its ground ring as a sequence of elements of its field of fractions or as a sequence of elements of R.
An integral basis for the algebraic field F is returned as a sequence of elements of F or R if given. This is the same as the basis for the maximal order. Note that the maximal order will be determined (and stored) if necessary.
> f := x^5 + 5*x^4 - 75*x^3 + 250*x^2 + 65625; > M := MaximalOrder(f); > M; Maximal Order of Equation Order with defining polynomial x^5 + 5*x^4 - 75*x^3 + 250*x^2 + 65625 over its ground order > Basis(M); [ M.1, M.2, M.3, M.4, M.5 ] > Basis(NumberField(M)); [ 1, $.1, $.1^2, $.1^3, $.1^4 ] > Basis(M, NumberField(M)); [ 1, 1/5*$.1, 1/25*$.1^2, 1/125*$.1^3, 1/625*$.1^4 ]
Returns an absolute basis for the algebraic field K, i.e. a basis for K as a Q vector space. The basis will consist of the products of the basis elements of the intermediate fields. The expansion is done depth-first.
Given an order O in a number field K of degree n, this returns an 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 bi is the i-th basis element of O, bi=∑j=1nMijαj - 1 where M is the matrix and α 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 entries of the basis matrix are from the subfield of K, instead of the coefficient ring of the order.
Returns the transformation matrix for the transformation between the orders O and P with common equation order of degree n. The function returns an n x n matrix T with integral entries 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 common number field on the basis for P.
The coefficient ideals of the order O of a relative extension. These are the ideals {Ai} of the coefficient ring of O such that for every element e of O, e = ∑i ai * bi where {bi} is the basis returned for O and each ai ∈Ai.
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); > I, B; [ 1, 1/2*y, 1/40*(y^2 + 10*y), 1/800*(y^3 + 180*y + 400) ] [ O.1, O.2, O.3, O.4 ] > Basis(O, K); [ 1, 1/2*y, 1/40*(y^2 + 10*y), 1/800*(y^3 + 180*y + 400) ]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.
> BM := BasisMatrix(O); > Mod := RSpace(RationalField(), Degree(K)); > z := O ! y; > e := z^2-3*z; > em := Mod ! ElementToSequence(e); > em; ( 0 -26 40 0) > f := em*BM; > 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 get 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; > e; (-393 -360 0 800) > &+[e[i]*B[i] : i in [1 .. Degree(K)] ]; -393/1*O.1 - 360/1*O.2 + 800/1*O.4 > K!$1; y^3 + 7
Given an order O of some number field K of degree n, return the multiplication table with respect to the basis of O as a sequence of n matrices of size n x n. The i-th matrix will have as its j-th row the basis representation of bibj, where bi is the i-th basis element for O.
Return the trace matrix of an order O or algebraic field F, which has the trace Tr(ωiωj) as its i, j-th entry where the ωi are the basis for O or F.
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 row 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); > B[2]; O.2 > T := MultiplicationTable(O); > T[2]; [ 0 1 0 0] [ 0 -5 10 0] [ -5 -7 5 10] [-25 -7 15 0] > &+[ T[2][3][i]*B[i] : i in [1..4] ]; -5/1*O.1 - 7/1*O.2 + 5/1*O.3 + 10/1*O.4 > B[2]*B[3]; -5/1*O.1 - 7/1*O.2 + 5/1*O.3 + 10/1*O.4The trace matrix may be found either by using the built-in function or by the one-line definition given below (for a field of degree 4):
> TraceMatrix(O); [ 4 0 21 2] [ 0 210 105 215] [ 21 105 173 118] [ 2 215 118 226] > 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]
Orders and algebraic fields can be tested for having several properties that may hold for general rings.
leftskip=large These predicates are clear.
Two orders are equal if the transformation matrix taking one to the other is integral and has determinant 1 or -1. For the transformation matrix to exist the orders must have the same number field.
Returns true if and only if the fields F and L, are the same.No two algebraic fields which have been created independently of each other will be considered equal since it is possible that they can be embedded into a larger field in more than one way.
Returns true iff Type(R) matches FldNum.
Returns true iff Type(R) matches FldAlg (i.e. either FldNum or FldOrd).
This is not a check for euclidean number fields. This function will always return an error.
Checks if the field F or the order O is defined as a simple extension over the base ring.
Always true for fields.
Always false for orders. Even if the class number is 1, orders are not considered to be PIDs.
This function returns true if there is an automorphism in the field K that acts like complex conjugation.
For an element x of a field K where HasComplexConjugate returns true (in particular this includes totally real fields, cyclotomic and quadratic fields and CM-extensions), the conjugate of x is returned.
Since orders are rings with additional properties, special predicates are applicable.
This returns true if the basis of the order O is an integral power basis, false otherwise.
This returns true if the order O in the field F is the maximal order of F, false otherwise. The user is warned that this may trigger the computation of the maximal order.
Returns true iff the order O is a constructed as an absolute extension of Z.
Returns true iff the order O is wildly ramified, i.e. if there is a prime ideal P of O such that the characteristic of its residue class field divides its ramification index.
Returns true iff the order O is not wildly ramified, i.e. if for all prime ideals P of O the characteristic of its residue class field does not divide the ramification index.
Returns true iff the order O is unramified at the finite places.
Here all the predicates that are specific to algebraic fields are listed.
Given two algebraic fields F and L, this returns true as well as an isomorphism F -> L, if F and L are isomorphic, and it returns false otherwise.
Given two algebraic fields F and L, this returns true as well as an embedding F -> L, if F is a subfield of L, and it returns false otherwise.
Returns true if and only if the algebraic field F is a normal extension. At present this may only be applied if F is an absolute extension or simple relative extension. In the relative case the result is obtained via Galois group computation.
Returns true if and only if the algebraic field F is a normal extension with abelian Galois group. At present this may only be applied if F is an absolute extension or simple relative extension. In the relative case the result is obtained via Galois Group computation.
Returns true if and only if the algebraic field F is a normal extension with cyclic Galois group. At present this may only be applied if F is an absolute extension or simple relative extension. In the relative case the result is obtained via Galois and automorphism group.
Returns true iff the algebraic field K is a constructed as an absolute extension of Q.
Returns true iff the algebraic field K is wildly ramified, i.e. if there is a prime ideal P of K (its maximal order) such that the characteristic of its residue class field divides the ramification index.
Returns true iff the algebraic field K is not wildly ramified, i.e. if for all prime ideals P of the maximal order of K, the characteristic of its residue class field does not divide the ramification index.
Returns true iff the algebraic field K is unramified at the finite places.
If the number field K is quadratic, return true and an isomorphic quadratic field.
Tests if the number field F is totally real, ie. if all infinite places are real. For absolute fields this is equivalent to the defining polynomial having only real roots.
Several properties of orders can be set to be known and/or to have a given value.
Set the order O to be maximal if b is true or known to be non maximal if b is false.
Set the torsion unit of the order O to be the element e with order r.
This tells Magma to assume that the currently known unit group for the order O is the full unit group, in all subsequent calculations involving NumberField(O). (This can only be invoked after a unit group has been computed.)