The following describes how number fields, orders and their fields of fractions may be created. It also shows some ways of creating elements of these rings and homomorphisms from these rings into an arbitrary ring.
Algebraic Number Fields can be created in a number of ways. Fields of Fractions can be created as FieldOfFractions(O) where O is some order or from an existing field of fractions by using some of the constructors and functions described below. All creation of number fields involves polynomials. The fields can be created as absolute extensions, i.e. an extension of Q by an irreducible polynomial, or as a relative extension which is an extension of an algebraic field by a polynomial irreducible over that field.
Check: BoolElt Default: true
DoLinearExtension: BoolElt Default: false
Global: BoolElt Default: false
Given an irreducible polynomial f of degree n>1 over K := Q or some number field K, create the number field L=K(alpha) obtained by adjoining a root alpha of f to K.The polynomial f is allowed to have either integer coefficients, coefficients in an order of K, coefficients from the rational field or some algebraic field K. If the polynomial is defined over a field and the coefficient have denominators greater than 1, an equivalent polynomial d * f(x) is used to define L, where d is the least common multiple of the denominators of the coefficients of f.
If the optional parameter Check is set to false then the polynomial is not checked for irreducibility. This is useful when building relative extensions where factoring can be time consuming.
If DoLinearExtension is true and the degree of f is one a trivial extension is returned. This is an object of type FldNum but of degree 1. By default, or if the parameter is false, the coefficient field of f is returned. This is important in situations where the number of extensions matters. Since all invariants are relative to the current representation, the difference can be important. Furthermore, a degree 1 extension of Q although isomorphic to Q supports all of the number field functions including fractional ideals - but the arithmetic is slower.
If Global is true, then Magma checks if this polynomial is the defining polynomial of some other field created using Global := true. In this case, the old field will be returned.
The angle bracket notation may be used to assign the root alpha to an identifier e.g. L<y> := NumberField(f) where y will be a root of f.
Check: BoolElt Default: true
DoLinearExtension: BoolElt Default: false
Abs: BoolElt Default: false
Let K be a possibly trivial algebraic extension of Q. Given a sequence s of polynomials s_1, ..., s_m, each of degree greater than 1 and irreducible over K, create the number field L=K(alpha_1, ..., alpha_m) obtained by adjoining a root alpha_i of each s_i to K. The polynomials s_i are allowed to have coefficients in an order of K (or Z) or in K or a suitable field of fractions, but if in the latter cases denominators occur in the coefficients of s_i, an integral polynomial is used instead of s_i, as in the case of the definition of a number field by a single polynomial.If m>1 and Abs is false, a tower of extension fields L_0=K subset L_1=K(alpha_m) subset L_(2)=K(alpha_(m - 1), alpha_(m)) subset ... subset L_m = K(alpha_1, ..., alpha_m)=L is created, and L is a relative extension by s_1 over its ground field L_(m - 1)=K(alpha_2, ..., alpha_m). Thus, this construction has the same effect as m applications of the ext constructor. The angle bracket notation may be used to assign the m generators alpha_i to identifiers: L<a_1, ..., a_m> := NumberField([ s_1, ..., s_m ]); thus the first generator a_1, which corresponds to L.1, generates L over its ground field.
Note that it is important to ensure that in each of the above steps the polynomial s_i is irreducible over L_(i - 1); by default Magma will check that this is the case. If the optional parameter Check is set to false then this checking will not be done.
If the optional parameter Abs is changed to true, then a non-simple extension will be returned. This is a extension of the coefficient field of the f_i but such that the base field of L will be K. The ith generator will be a root of the ith polynomial in this case, but all of the generators will have K as parent.
If the optional parameter DoLinearExtension is set to true, linear polynomials will not be removed from the list.
Check: BoolElt Default: true
Global: BoolElt Default: false
Abs: BoolElt Default: false
DoLinearExtension: BoolElt Default: false
Create the algebraic field defined by extending F by the polynomials s_i or the polynomials in the sequence s. As for NumberField(S) above F may be Q and additionally F may be a field of fractions. If F is a field of fractions a field of fractions will be returned otherwise a number field will be returned. A tower of fields similar to that of NumberField is created and the same restrictions as for that function apply to the polynomials that can be used in the constructor.
> R<x> := PolynomialRing(Integers()); > f := x^4 - 420*x^2 + 40000; > K<y> := NumberField(f); > assert Degree(K) eq 4; > K; Number Field with defining polynomial x^4 - 420*x^2 + 40000 over the Rational FieldBy assigning the generating element to y, we can from here on specify elements in the field as polynomials in y. The elements will always be printed as polynomials in Q[y]/f:
> z := y^5/11; > z; 1/11*(420*y^3 - 40000*y)
K can be further extended by the use of either ext or NumberField.
> R<y> := PolynomialRing(K); > f := y^2 + y + 1; > L := ext<K | f>; > L; Number Field with defining polynomial y^2 + y + 1 over KThis is equivalent to
> KL := NumberField([x^2 + x + 1, x^4 - 420*x^2 + 40000]); > KL; Number Field with defining polynomial $.1^2 + $.1 + 1 over its ground fieldbut different to
> LK := NumberField([x^4 - 420*x^2 + 40000, x^2 + x + 1]); > LK; Number Field with defining polynomial $.1^4 - 420*$.1^2 + 40000 over its ground fieldTo illustrate the use of Global:
> K1 := NumberField(x^3-2 : Global);
> K2 := NumberField(x^3-2 : Global);
> L1 := NumberField(x^3-2);
> L2 := NumberField(x^3-2);
> K1 eq K2;
true
> K1 eq L1;
false
> L1 eq L2;
false;
> K1!K2.1;
K1.1;
> K2!K1.1;
K1.1
>> L1!L2.1;
^
Runtime error in '!': Arguments are not compatible
LHS: FldNum
RHS: FldNumElt
A typical application of DoLinearExtension is as follows.
To construct a Kummer extension of degree p,
one has to start with a field containing the p-th roots of unity.
In most situation this will be a field extension of degree p - 1, but
what happens if zeta_p is already in the base field?
> AdjoinRoot := function(K, p: DoLinearExtension := false) > f := CyclotomicPolynomial(p); > f := Polynomial(K, f); > f := Factorisation(f)[1][1]; > return ext<K|f : DoLinearExtension := DoLinearExtension>; > end function; > K := NumberField(x^2+x+1); > E1 := AdjoinRoot(K, 3); > E1; Number Field with defining polynomial x^2 + x + 1 over the Rational Field > E2 := AdjoinRoot(K, 3 : DoLinearExtension); > E2; Number Field with defining polynomial ext<K|>.1 - K.1 over K > Norm(E1.1); 1 > Norm(E2.1); K.1 > Norm($1); 1
Check: BoolElt Default: true
Let F be a algebraic field. Let a be an integral element of F chosen such that a is not an n-th power for any n dividing d. Returns the algebraic field obtained by adjoining the d-th root of a to F.
Given an algebraic field F, return the splitting field of its defining polynomial. The roots of the defining polynomial in the splitting field are also returned.
Given an irreducible polynomial f over Z, return its splitting field.
Given a algebraic field F with ground field G and n elements e_i in F, return the algebraic field H=G(e_1, ..., e_n) generated by the e_i (over G), as well as the embedding homomorphism from H to F.
Let F and L be absolute algebraic fields. Returns a sequence of fields [M_1, ..., M_r] such that each field M_i contains both a root of the generating polynomial of F and a root of the generating polynomial of L.In detail: Suppose that F is the smaller field (wrt. the degree). As a first step we factorise the defining polynomial of L over F. For each factor obtained, an extension of F is constructed and then transformed into a absolute extension. The sequence of extension fields is returned to the user.
Check: BoolElt Default: true
Given a ring of polynomials R in one variable over a number field K, create the number field K(alpha) obtained by adjoining a root alpha of f to K. Here the coefficient ring K of R is allowed to be the rational field Q. The polynomial f is allowed to have coefficients in K, but if coefficients occur in f which require denominator greater than 1 when expressed on the basis of K, the polynomial will be replaced by an equivalent one requiring no such denominators: tilde f(x)=df(x), where d is a common denominator. The parameter Check is handled as above.The angle bracket notation may be used to assign the root alpha to an identifier: K<y> := quo< FldNum : R | f >.
If the category FldNum is not specified, quo< R | f > creates the quotient ring R/f as a generic ring (not as a number field), in which only elementary arithmetic is possible.
> K := RadicalExtension(Rationals(), 3, 2);
> l := CompositeFields(K, K);
> l;
[
Number Field with defining polynomial ext<Q|>.1^3 - 2 over the Rational
Field,
Number Field with defining polynomial ext<Q|>.1^6 + 108 over the Rational
Field
]
The second element of l corresponds to the smallest field L_2
containing two distinct roots of x^3 - 2. Since the degree of K is
3, L_2 is the splitting field of f and therefore the normal closure
of K.
Given an algebraic field F with ground field Q, this function will attempt to find an isomorphic field L with a better defining polynomial (in the sense defined below) than the one used to define F. If such a polynomial is found then L is returned; otherwise F will be returned.If the argument d is not specified, a polynomial g with integer coefficients is defined to be better than f if it is monic, irreducible, defines a number field isomorphic to F and its discriminant is smaller (in absolute value) than that of f. If a second argument d is specified, then g is defined to be better if in addition to the previous requirements d is not an index divisor, that is, if d does not divide the index (defined in the Invariants sub--section) [O_L : E_L] of the equation order E_L of L in the maximal order O_L, (which are defined in the next sub--section).
Note however, that as a first step this function will determine the maximal order of F which may take some time if the field is large.
> R<x> := PolynomialRing(Integers());
> K := NumberField(x^4-420*x^2+40000);
> L := OptimizedRepresentation(K);
> L ne K;
true
> L;
Number Field with defining polynomial ext<Q|>.1^4 - 4*ext<Q|>.1^3 -
17*ext<Q|>.1^2 + 42*ext<Q|>.1 + 59 over the Rational Field
> assert L eq OptimizedRepresentation(L);
> f := x^4 - 420*x^2 + 40000;
> Factorization(Discriminant(f));
[ <2, 18>, <5, 8>, <41, 2> ]
> g := x^4 - 4*x^3 - 17*x^2 + 42*x + 59;
> Factorization(Discriminant(g));
[ <2, 4>, <3, 4>, <5, 2>, <41, 2> ]
> OL := MaximalOrder(L);
> EL := EquationOrder(L);
> Index(OL, EL);
36
> OptimizedRepresentation(L, 2) eq L;
true
As we see from this computation, the prime
5 (as well as 41) divides the discriminant of g twice.
This means that, potentially, 5 would still divide the index
of the equation order in
the maximal order O_L of L. However, in fact E_L has only index
36 in O_L.
The optimized representation of L such that 2 does not divide the index of EL in OL is L so 2 does divide the index seemingly contrary to the description above. However, if a more optimal representation cannot be found then the field is returned which is what happens here.
The maximal order of an algebraic field and the equation order of a number field can be obtained from the field. The maximal order ( O)_K is the ring of integers of an algebraic field consisting of all integral elements of the field; that is, elements which are roots of monic integer polynomials. It may also be called the number ring of a number field. The algorithm used is a mixture of the Round--2 and Round--4 methods ([Coh93], [Bai96], [Poh93], [PZ89]) for absolute extensions and a variant of the Round--2 for relative extensions ([Coh00], [Fri97]). Other orders of a field are unitary subrings of finite index in the ring of integers; they contain a subset of the integral elements in the field. The equation order ( E)_K=Z[alpha] of K=Q(alpha) isomorphic to Q[X]/f(X), where K is a number field defined by a monic integral polynomial, has the same basis as K, a power basis. Obviously ( E)_K subset ( O)_K since the minimal polynomial of alpha is integral and monic. Once an order is created in Magma further orders can be created from it.
SetVerbose("MaximalOrder", n): Maximum: 5
Create the ring of integers of the algebraic field F. An integral basis for F can be found as the basis of the maximal order.
Check: BoolElt Default: true
Al: MonStgElt Default: "Auto"
Discriminant: Any Default:
Ramification: SeqEnum Default:
SetVerbose("MaximalOrder", n): Maximum: 5
This is equivalent to MaximalOrder(NumberField(f)).The Check parameter if set to false will prevent checking of the polynomial for irreducibility.
The Al parameter selects the algorithm to be used for the computation. Other options are "Round2" and "Round4". These select pure forms of the Round-2 and Round-4 algorithms respectively. By default a combination of these two algorithms is applied. The Round 4 algorithm is used first if possible and if the polynomial can be split into smaller degree polynomials, Round 2 is used on factors of degree 2.
If the Discriminant or Ramification parameters are supplied an algorithm which can compute the maximal order given the discriminant of the maximal order will be used. Discriminant must be an integer if f is an integer or rational polynomial and must be an ideal of the order containing the coefficients of f if f is over an order. Ramification must contain integers if f is an integer or rational polynomial and must contain ideals of the order containing the coefficients of f if f is over an order. The ramification sequence is taken to contain prime factors of the discriminant. Only one of these parameters can be specified and if one of them is then Al cannot be specified.
Al: MonStgElt Default: "Auto"
Discriminant: Any Default:
Ramification: SeqEnum Default:
SetVerbose("MaximalOrder", n): Maximum: 5
This is equivalent to MaximalOrder(FieldOfFractions(O)).The Al parameter selects the algorithm to be used for the computation. Other options are "Round2" and "Round4". These select the Round 2 and Round 4 algorithms respectively. By default a combination of these two algorithms is applied. The Round 4 algorithm is used first if possible and if the defining polynomial can be split into smaller degree polynomials, Round 2 is used on the orders of factors of degree 2.
If the Discriminant or Ramification parameters are supplied an algorithm which can compute the maximal order given the discriminant of the maximal order will be used. Discriminant must be an integer if O is an absolute order and must be an ideal of O if O is a relative order. Ramification must contain integers if O is an absolute order and must contain ideals of O if O is a relative order. The ramification sequence is taken to contain prime factors of the discriminant. Only one of these parameters can be specified and if one of them is then Al cannot be specified.
Check: BoolElt Default: true
Given an irreducible monic integral polynomial f of degree greater than 1, return the equation order E=Z[X]/f(X) corresponding to f. If the optional parameter Check is set to false then the polynomial will not be checked for irreducibility.
Return the equation order corresponding to the polynomial with which the number field K was defined. K must have been defined by a monic integral polynomial. Thus this function returns the extension of the equation order of the ground field of K by the defining polynomial of K.
Provided O is not an equation order, O is a transformation of some order O'. This function returns O'.
A sub order of O which is defined by a polynomial. e.g. R[x] / f where R is a polynomial ring over the coefficient ring of O and f is in R. It will also be the final order of SubOrder(SubOrder( ... SubOrder(O))). O must have a monic defining polynomial for the equation order to exist.
> R<x> := PolynomialRing(Integers()); > K := NumberField(x^4-420*x^2+40000); > E := EquationOrder(K); > O := MaximalOrder(K); > Index(O, E); 64000Note that entirely different things happen here: for the equation order nothing has to be computed, but the determination of the maximal order involves the complicated Round 2 (or 4) algorithm. In our particular example above, E is a subring of index 2^9.5^3 in O (see also the example for Orders and ideals in the next subsection where a maximal order is created).
The following shows the advantage of the Ramification parameter to the MaximalOrder function.
> R<t> := PolynomialRing(Integers());
> f1 := t^14 - 63*t^12 - 9555*t^11 + 118671*t^10 - 708246*t^9 - 17922660*t^8 +
> 859373823*t^7 + 2085856500*t^6 - 117366985106*t^5 - 335941176396*t^4 +
> 4638317668005*t^3 + 17926524826973*t^2 + 7429846568445*t+ 91264986397629;
> d1 := [2, 3, 5, 7, 59];
> time MaximalOrder(f1:Ramification := d1);
Maximal Order of Equation Order with defining polynomial x^14 - 63*x^12 -
9555*x^11 + 118671*x^10 - 708246*x^9 - 17922660*x^8 + 859373823*x^7 +
2085856500*x^6 - 117366985106*x^5 - 335941176396*x^4 + 4638317668005*x^3 +
17926524826973*x^2 + 7429846568445*x + 91264986397629 over Z
Time: 2.829
> time MaximalOrder(f1);
Maximal Order of Equation Order with defining polynomial x^14 - 63*x^12 -
9555*x^11 + 118671*x^10 - 708246*x^9 - 17922660*x^8 + 859373823*x^7 +
2085856500*x^6 - 117366985106*x^5 - 335941176396*x^4 + 4638317668005*x^3 +
17926524826973*x^2 + 7429846568445*x + 91264986397629 over Z
Time: 15.609
> f2 := t^14 - 129864*t^12 - 517832*t^11 + 6567239322*t^10 + 33352434192*t^9 -
> 166594899026864*t^8 - 752915315481312*t^7 + 2275891736459084940*t^6 +
> 7743078094604088768*t^5 - 16633213695413438344032*t^4 -
> 39871919309692447523616*t^3 + 60126791399546070679893112*t^2 +
> 77844118533852728698751040*t - 83173498199506854751458701376;
> d2 := [2,3,7,4145023];
>
> time MaximalOrder(f2:Ramification := d2);
Maximal Order of Equation Order with defining polynomial x^14 - 129864*x^12 -
517832*x^11 + 6567239322*x^10 + 33352434192*x^9 - 166594899026864*x^8 -
752915315481312*x^7 + 2275891736459084940*x^6 + 7743078094604088768*x^5 -
16633213695413438344032*x^4 - 39871919309692447523616*x^3 +
60126791399546070679893112*x^2 + 77844118533852728698751040*x -
83173498199506854751458701376 over Z
Time: 9.099
> time MaximalOrder(f2);
Maximal Order of Equation Order with defining polynomial x^14 - 129864*x^12 -
517832*x^11 + 6567239322*x^10 + 33352434192*x^9 - 166594899026864*x^8 -
752915315481312*x^7 + 2275891736459084940*x^6 + 7743078094604088768*x^5 -
16633213695413438344032*x^4 - 39871919309692447523616*x^3 +
60126791399546070679893112*x^2 + 77844118533852728698751040*x -
83173498199506854751458701376 over Z
Time: 26.559
> f13 := t^15 - 114*t^14 + 282185319*t^13 + 1247857228852*t^12 -
> 35114805704965233*t^11 - 141524337796433387826*t^10 +
> 2604584980442264028744009*t^9 + 14153948932132918272984150384*t^8 -
> 178273077248353369941327628479552*t^7 - 1142953506821390914419260564494304768
> *t^6 + 15975069142211276963134599495014990639616*t^5 +
> 33516684438303088018217308253251277376159744*t^4 -
> 617589777108203716232396372453619309554471256064*t^3 -
> 397561412445066919545461762354884631501806174863360*t^2 +
> 2266657182908547570648245464215192357802047101628186624*t
> - 1302222456532760256406916223259306960561657428777814196224;
> d13 := [2, 3, 3377890562461, 7623585272461];
> time MaximalOrder(f13: Ramification := d13);
Maximal Order of Equation Order with defining polynomial x^15 - 114*x^14 +
282185319*x^13 + 1247857228852*x^12 - 35114805704965233*x^11 -
141524337796433387826*x^10 + 2604584980442264028744009*x^9 +
14153948932132918272984150384*x^8 - 178273077248353369941327628479552*x^7 -
1142953506821390914419260564494304768*x^6 +
15975069142211276963134599495014990639616*x^5 +
33516684438303088018217308253251277376159744*x^4 -
617589777108203716232396372453619309554471256064*x^3 -
397561412445066919545461762354884631501806174863360*x^2 +
2266657182908547570648245464215192357802047101628186624*x -
1302222456532760256406916223259306960561657428777814196224 over Z
Time: 9.009
> time MaximalOrder(f13);
The last line did not complete running in over 7 hours.
Create the suborder of O generated (as an algebra over Z) by the elements a_1, ..., a_r in O, that is, create Z[a_1, ..., a_r]. If the algebra does not have full rank as a sub-module of O, an error results. Note, however, that it is currently not required that 1 is in the sub-ring.
Given an order O, and elements a_1, ..., a_r lying in the maximal order of O, create the order O[a_1, ..., a_r]. Note that using this constructor O can only be extended to be as large as the maximal order. This does not cause the maximal order to get computed.
Given an order O and a polynomial f of degree n with coefficients in O, create the extension E of O by a root of f which forms a free module of rank n over O : E isomorphic to O[alpha]; it is necessary for f to be irreducible over O.
Return the field containing all fractions of elements of O. The angle bracket notation can be used to assign names to the basis elements of F and assign these elements to variables, e.g. F<x, y> := FieldOfFractions(MaximalOrder(x^2 + 3)).
The order of which F was created as its field of fractions. This function is an inverse to FieldOfFractions.
The number field of an order is recursively defined by:
- the number field of Z is Q
- the number field of O is the number field of the coefficient ring of O, (i.e. the order over which O is defined), with an element alpha adjoined where alpha is a root of the defining polynomial of O.
The number field of Order(F).
> R<x> := PolynomialRing(Integers());
> 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(FieldOfFractions(M));
[
M.1,
M.2,
M.3,
M.4,
M.5
]
> Basis(NumberField(M));
[
1,
$.1,
$.1^2,
$.1^3,
$.1^4
]
> Basis(M);
[
M.1,
M.2,
M.3,
M.4,
M.5
]
> M.1 eq 1;
true
> M.2 eq NumberField(M).1;
false
> E := EquationOrder(M);
> NumberField(M) eq NumberField(E);
true
> Basis(FieldOfFractions(E), NumberField(M));
[
1,
$.1,
$.1^2,
$.1^3,
$.1^4
]
> M!Basis(FieldOfFractions(E))[1];
[1, 0, 0, 0, 0]
> M!Basis(FieldOfFractions(E))[2];
[0, 5, 0, 0, 0]
> M!NumberField(M).1;
[0, 5, 0, 0, 0]
Given an order O with ground ring Z, this function will attempt to find an isomorphic maximal order M with a better defining polynomial than the one used to define O. If such a polynomial is found then M is returned; otherwise O will be returned.If the argument d is not specified, a polynomial g with integer coefficients is defined to be better than f if it is monic, irreducible, defines an order isomorphic to O and its discriminant is smaller in absolute value than that of f. If a second argument d is specified, then g is defined to be better if in addition to the previous requirements d is not an index divisor, that is, if d does not divide the index (defined in the Invariants sub--section) [M : E_M] of the equation order E_M of M in M.
Add two orders with the same equation order. Computes the smallest common over order.
Check: BoolElt Default: true
Create the order with basis Basis(O)*T/d. Check can be set to false when the order is large to avoid checking that the result actually is an order.
Verify: BoolElt Default: true
Order: BoolElt Default: false
Given n elements e_1, ..., e_n in an algebraic extension field F over Q create the minimal order O of F which contains all the e_i. If Verify is true, it is verified that the e_i are integral algebraic numbers. This can be a lengthy process if the field is of large degree.Setting Order to true when the order is large will avoid verifying that the Z-module generated by e_1, ..., e_n is closed under multiplication. By default, products of the generators will be added until the module is closed under multiplication.
Orders may be created using ideals of another order. Ideals are discussed in Section Ideals and Quotients.
Returns the multiplicator ring of the ideal I of the order O, that is, the subring of elements of the field of fractions K of O multiplying I into itself: M={ x: x in F | xI subset I}.
Al: MonStgElt Default: "Auto"
The p-maximal overorder of O (see also the example below). The options for the Al parameter are the same as those for MaximalOrder.
Returns the p-radical of an order O for a prime integer p, defined as the ideal consisting of elements of O for which some power lies in the ideal pO.It is possible to call this function even if p is not prime. In this case the p-trace-radical will be computed, i.e. { x in F | Tr(xO)subseteq Z}. If p is square free and all divisors are larger than the field degree, this is the intersection of the radicals for all l dividing p. In particular together with MultiplicatorRing this can sometime be used to compute maximal orders without factoring the discriminant [Bj94], [Fri00] or at least "good" approximations.
To illustrate how the Round 2 algorithm for the determination of the ring of integers works, we present an implementation of it in the Magma language. The key functions are MultiplicatorRing and pRadical, called by the following function pMaximalOverOrder;
> pMaximalOverOrder := function(ord, p) > ovr := MultiplicatorRing(pRadical(ord, p)); > print "index is", Index(ovr, ord); > return (Index(ovr, ord) eq 1) select ovr else $$(ovr, p); > end function;which finds the largest overorder in which the given order has p-power index. This function is now simply applied to the equation order, for each prime dividing the discriminant:
> Round2 := function(E, K) > // E should be the equation order of a number field K > d := Discriminant(E); > fact := Factorization(Abs(d)); > print fact; > M := E; > for x in fact do > M := M+pMaximalOverOrder(E, x[1]); > end for; > print "index of equation order in maximal order is:", Index(M, E); > return M; > end function;In our running example, this produces the following output:
> R<x> := PolynomialRing(Integers()); > K := NumberField(x^4-420*x^2+40000); > E := EquationOrder(K); > 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 Transformation of E Transformation Matrix: [800 0 0 400] [ 0 400 200 180] [ 0 0 20 0] [ 0 0 0 1] Denominator: 800
Elements of algebraic fields and of orders are displayed quite differently. Algebraic field elements are always printed as a linear combination with rational coefficients of the basis elements of the field. For number fields which have a power basis this is also a polynomial in the primitive element of the field with rational coefficients; that is, an element of G[x]/f, where f was the defining polynomial of the field over the ground field G. Since in general G will be an algebraic field itself, elements in relative extensions, i.e. G strictly bigger than Q, will be printed as linear combinations with linear combinations as coefficients and for number fields will look like multivariate polynomials. In fact they are recursively defined univariate polynomials.
Elements of orders are displayed as sequences of integer coefficients, referring to the basis of the order. To convert this Z-basis representation to a polynomial expression in the primitive element of an associated number field, the element should be coerced into the number field (using !). To print the element as a linear combination of the basis elements, coerce the element into the field of fractions.
Coerce a into the field F. Here a may be an integer or a rational field element, or an element from a subfield of F, or from an order in such.
Given the algebraic field, F of degree m over its ground field G and a sequence [a_0, ..., a_(m - 1)] of elements of G, construct the element a_0alpha_0 + a_1alpha_1 + ... a_(m - 1)alpha_(m - 1) of F where the alpha_i are the basis elements of F.
Coerce a into the order O. Here a is allowed to be an integer, or an integral element of an associated algebraic field of O, or an element of a quotient order.
Given the order O of degree m and elements a_0, a_(1), ..., a_(m - 1) in the ground order of O, construct the element a_0alpha_0 + a_1 alpha_1 + ... + a_(m - 1) alpha_(m - 1) of O, where alpha_0, ..., alpha_(m - 1) is the basis for the order.
A random element of the algebraic field F or order O. The maximal size of the coefficients is determined by m.
> R<x> := PolynomialRing(Integers()); > K<y> := NumberField(x^4-420*x^2+40000); > O := MaximalOrder(K); > e := O ! (y^2/40 + y/4); > f := elt< O | [0, 0, 1, 0]>; > f eq e; true > F<a, b, c, d> := FieldOfFractions(O); > g := F![0, 0, 1, 0]; > g eq e; true > g; cThese constructions would have failed if the element was not in O.
To specify homomorphisms from algebraic fields or orders in algebraic fields, it is necessary to specify the image of the generating elements, and possible to specify a map on the ground field.
Given an algebraic field F, defined as an extension of the ground field G, as well as some ring R, build the homomorphism phi obtained by sending the defining primitive element alpha of F to the element r in R.If F is a field of fractions then r will be the image of the primitive element of the field of fractions of the equation order of Order(F).
It is possible (if G=Q) and sometimes necessary (if G != Q) to specify a homomorphism phi on K by specifying its action on G by providing a homomorphism h with G as its domain and R its codomain together with the image of alpha.
Given an order O, a ring R and an element r in R, construct a homomorphism phi by sending the primitive element of the equation order of O to r.To be more precise: Let K be the field of fractions of O, k be the base field of K i.e. the field of fractions of the base ring of O and N := NumberField(O).
As a k--algebra K is generated by x := K!N.1. x will be a zero of DefiningPolynomial(O). The element r given in the map construction will be the image of x.
When O is an equation order e.g. if O was defined using a monic integral polynomial x will be O.2.
As in the field case it is possible to specify a map on the coefficient ring of O (ring over which O is defined) with codomain R.
> R<x> := PolynomialRing(Integers()); > K<y> := NumberField(x^2-2); > KL<w> := NumberField(x^4-10*x^2+1); > H := hom< K -> KL | (9*w-w^3)/2 >; > H(y); 1/2*(-w^3 + 9*w) > H(y)^2; 2Homomorphisms can be created between any order or algebraic field and any ring.
> f := x^4 + 5*x^3 - 25*x^2 + 125*x + 625; > M := MaximalOrder(f); > F<a, b, c, d> := FieldOfFractions(M); > FF := FiniteField(5, 3); > F; Field of Fractions of M > FF; Finite field of size 5^3 > h := hom< F -> FF | 3*FF.1>; > h; Mapping from: FldOrd: F to FldFin: FFThis unexpected behaviour occurs because when the basis of F is expressed with respect to the power basis of the number field they have denominator divisible by 5. A more well--behaved example is shown below.
> h(a); h(b); 1 >> h(a); h(b); ^ Runtime error in map application: Application of map failed > h(5*b); h(5*5*c); h(5*5*5*d); FF.1^94 FF.1^64 FF.1^34
> FF := FiniteField(11, 5); > h := hom< F -> FF | 7*FF.1>; > h(a); 1 > h(b); h(c); h(d); FF.1^48316 FF.1^96632 FF.1^144948 > 7*FF.1; FF.1^112736 > 5*h(b); FF.1^112736 > PrimitiveElement(F); 5/1*b