This section describes the main ways to construct number fields and orders, as well as creation of elements and homomorphisms.
A field may be created as an absolute extension (absolute field), i.e. an extension of Q by an irreducible polynomial, or as a relative extension (relative field), i.e. an extension of another field K by an irreducible polynomial over K. See also Section Creation of Structures for quadratic fields and Section Creation Functions for cyclotomic fields (these are the special subtypes of number fields in Magma). Some other constructions (which involve nontrivial computations) are the composite formed by two or more given fields, and the splitting field of a given polynomial or 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(α) obtained by adjoining a root α of f to K. For details see NumberField in Section Creation of Number Fields.The angle bracket notation may be used to assign the root α to an identifier e.g. L<y> := NumberField(f) where y will be a root of f.
This creates a number field isomorphic to Q. It is equivalent to NumberField(x-1 : DoLinearExtension), where x is PolynomialRing(Rationals()).1.The result is a field isomorphic to Q, but regarded by Magma as a number field (while Q itself is not, since FldRat is not a subtype of FldNum). It therefore supports all of the number field functions, while the Rationals() do not. On the other hand, arithmetic will be slower.
Coercion can be used to convert to and from the Rationals().
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 nonconstant polynomials s1, ..., sm, that are irreducible over K, create the number field L=K(α1, ..., αm) obtained by adjoining a root αi of each si to K. For details see NumberField in Section Creation of Number Fields.
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 si or the polynomials in the sequence s. Similar as for NumberField(S) described above, F may be Q or 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.
Check: BoolElt Default: true
Let F be an 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.
Abs: BoolElt Default: true
Opt: BoolElt Default: true
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.If Abs is true, the resulting field will be an absolute extension, otherwise a tower is returned.
If Opt is true, an attempt of using OptimizedRepresentation is done. If successful, the resulting field will have a much nicer representation. On the other hand, computing the intermediate maximal orders can be extremely time consuming.
Given an irreducible polynomial f over Z, return its splitting field.
Abs: BoolElt Default: false
Opt: BoolElt Default: false
Given a sequence L of polynomials over a number field or the rational numbers, compute a common splitting field, i.e. a field K such that every polynomial in L splits into linear factors over K. The roots of the polynomials are returned as the second return value.If the optional parameter Abs is true, then a primitive element for the splitting field is computed and the field returned will be generated by this primitive element over Q. If in addition Opt is also true, then an optimized representation of K is computed as well.
Given an algebraic field F with ground field G and n elements ei∈F, return the algebraic field H=G(e1, ..., en) generated by the ei (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 [M1, ..., Mr] such that each field Mi 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 an absolute extension. The sequence of extension fields is returned to the user.
For absolute number fields K and L, at least one of which must be normal, find a smallest common over field. Note that in contrast to CompositeFields above the result here is essentially unique since one field was normal.
For a normal number field K and abelian extension A of some subfield of K, find a smallest common over field. Note that in contrast to CompositeFields above the result here is essentially unique since K is normal.
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 as well as a map from F into L; 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) [OL : EL] of the equation order EL of L in the maximal order OL, (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.
> _<x> := PolynomialRing(Rationals()); > K := NumberField(x^4-420*x^2+40000); > L := OptimizedRepresentation(K); > L ne K; true > L; Number Field with defining polynomial x^4 - 4*x^3 - 17*x^2 + 42*x + 59 over the Rational Field > L eq OptimizedRepresentation(L); true > f := DefiningPolynomial(K); // f is an element of Q[x], so Discriminant(f) is in Q not Z > Z := IntegerRing(); > Factorization(Z ! Discriminant(f)); [ <2, 18>, <5, 8>, <41, 2> ] > g := DefiningPolynomial(L); > g; x^4 - 4*x^3 - 17*x^2 + 42*x + 59; > Factorization(Z ! 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; trueAs 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 OL of L. However, in fact EL has only index 36 in OL.
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 (O)K of an algebraic field and the equation order of a number field can be obtained from the field. 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[α] of K=Q(α) 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⊂(O)K since the minimal polynomial of α is integral and monic. Once an order is created in Magma further orders can be created from it.
Check: BoolElt Default: true
Given an irreducible non-constant monic integral polynomial f∈R[X], return the equation order E=R[X]/f(X) corresponding to f. If the optional parameter Check is set to false then the polynomial will not be checked for irreducibility.
Abs: BoolElt Default: false
DoLinearExtension: BoolElt Default: false
Check: BoolElt Default: true
Global: BoolElt Default: false
The equation order of NumberField(S).
Return the equation order corresponding to the polynomial with which the number field K was defined. The field 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 the order O is not an equation order, O is a transformation of some order O'. This function returns O'.
A suborder of the order 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))). The order O must have a monic defining polynomial for the equation order to exist.
Returns the ring of integers in the order O, ie. O itself.
> 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 29.53 in O (see also the example for orders and ideals in the subsection Orders and Ideals where a maximal order is created).
Create the suborder of the order O generated (as an algebra over Z) by the elements a1, ..., ar∈O, that is, create Z[a1, ..., ar]. 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 a1, ..., ar lying in the maximal order of O, create the order O[a1, ..., ar]. 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. See also Order for a different version that allows parameters to improve efficiency.
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[α]; 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:
- 1.
- the number field of Z is Q
- 2.
- 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 α adjoined where α is a root of the defining polynomial of O.
The number field of Order(F) for a field of fractions 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 order OO with discriminant the same as O with a better defining polynomial than the one used to define O. If such a polynomial is found then OO is returned; otherwise only false is 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) [OO : EOO] of the equation order EOO of OO in OO.
Add two orders O and P having the same equation order. Computes the smallest common over order.
The intersection of two orders O and P having the same equation order.
Return the order O as a transformation of the order P where O and P have the same coefficient ring.
Check: BoolElt Default: true
Let O be an absolute order with basis b1, ..., nn, T=(Ti, j)∈GL(n, Q) ∩Mat(n, Z) and d∈N. This function creates the order with basis (1/d∑j=1n Ti, jbj)i≤i≤n. The parameter Check can be set to false when the order is large to avoid checking that the result actually is an order. Note that this can result in a non-order being constructed which may cause errors later.
NFBasis: BoolElt Default: true
Check: BoolElt Default: true
Let O be an order with (pseudo) basis b1, ..., bn and M=∑i=1n Aiαi ⊆kn be an ok-module where ok is the coefficient ring of O. This function creates the order ∑i=1n Ai ci where ci := ∑j=1nαi, jbj. If the parameter Check is set to false, then it will not be checked that the result actually is an order (potentially expensive). Note that this can result in a non-order being constructed which may cause errors later. If the parameter NFBasis is set to false then the PseudoGenerators of the module M will be used rather than the PseudoBasis, however these pseudo generators must also be a pseudo basis.
Verify: BoolElt Default: true
IsBasis: BoolElt Default: false
Given n elements e1, ..., en in an algebraic extension field F over Q create the minimal order O of F which contains all the ei. If Verify is true, it is verified that the ei are integral algebraic numbers. This can be a lengthy process if the field is of large degree.Setting IsBasis to true assumes that the given elements actually form a basis for the new order, thus it avoids testing for multiplicative closure. Without this parameter the order returned will have a canonical basis chosen with no direct relation to the input. Note that setting IsBasis to true can result in a non-order being constructed if the elements in the sequence are not a basis which may cause errors later. By default, products of the generators will be added until the module is closed under multiplication.
If IsBasis is set to true to specify the basis of the resulting order rather than avoid the expense of the multiplicative closure computation, it can be checked that the result O is an order using Order(SubOrder(O), Matrix(CoefficientRing(O), M*d), d) where d is Denominator(M) where M is BasisMatrix(O);. If O is not an order this will cause an error.
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.
There are a number of algorithms which Magma uses whilst computing maximal orders. Each maximal order is a sum of p-maximal orders. The main algorithm used for p-maximal orders 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]).
However if the field is a radical (pure) extension, there is another algorithm available which is used to calculate each p-maximal order. In this case we can compute a pseudo basis for the p-maximal orders knowing only the valuation of the constant coefficient of the defining polynomial at p [Sut12].
It is possible to compute the maximal order of an absolute extension of Z or Q defined by one monic, integral polynomial using the Montes Algorithm [Sta18]. The Montes algorithm can be selected using Al := "Montes" when the input is a field or an order. For more on the Montes Algorithm see Section The Montes Algorithm.
The Round--2 and Round--4 algorithms can be selected by setting the parameter Al to "Round2" and "Round4" respectively. Another option for this parameter and for computation of p-maximal orders is the "Pauli" method. This method is only available for equation orders in simple relative extensions. It uses the factorization of the defining polynomial over the completion of the order.
Alternatively, if the discriminant of the maximal order is already known, the parameters Discriminant or Ramification can be used. If the input is an order O and 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 the coefficient ring of O if O is a relative order. Ramification must contain integers if O is an absolute order and must contain ideals of the coefficient ring 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 in this case Al cannot be specified. This algorithm is based on [BL94], Theorems 1.2 and 7.6.
Al: MonStgElt Default: "Auto"
Discriminant: Any Default:
Ramification: SeqEnum Default:
SetVerbose("MaximalOrder", n): Maximum: 5
Return the maximal order or ring of integers of the number field F. When the input is an order O or a field of fractions of an order O return the order containing O which is the largest order in the number field of O.An integral basis for F can be found as the basis of the maximal order.
For information on the parameters, see the introduction to this section above, Maximal Orders.
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.
For information on the other parameters, see the introduction to this section above.
> 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: 0.230 > 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: 0.590 > 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: 0.730 > 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: 0.840 > 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: 0.270The following call will not terminate, because the discriminant of the polynomial has a 257-digit composite factor which cannot be factored.
> time MaximalOrder(f13);
Orders may be created using ideals of another order. Ideals are discussed in Section Ideals and Quotients. The following intrinsics form part of the computation of maximal orders as discussed above in Section Maximal Orders.
Al: MonStgElt Default: "Auto"
The p-maximal overorder of O (see also the example below). This is the largest overorder P such that the index (P:O) is a power of p, a prime in the coefficient ring of O. The options for the Al parameter are the same as those for MaximalOrder.If O is a kummer extension then specific code is used to calculate each p-maximal order, rather than the Round 2 or Round 4 methods. In this case we know 1 or 2 elements which generate the p-maximal order and can easily write the order down.
Returns the p-radical of an order O for a prime p in the coefficient ring of O, 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 for p not prime (so long as p is greater than the degree of O if it is an integer). In this case the p-trace-radical will be computed, i.e. { x∈F | Tr(xO)⊆pZ}. 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 [BL94], [Fri00] or at least "good" approximations.
Returns the multiplicator ring M 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 ∈F : xI⊂I}.
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 some 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 0] [ 0 400 0 0] [ 0 200 20 0] [400 180 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 this 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 [a0, ..., am - 1] of elements of G, construct the element a0α0 + a1α1 + ... am - 1αm - 1 of F where the α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 a0, a1, ..., am - 1 in the ground order of O, construct the element a0α0 + a1 α1 + ... + am - 1 αm - 1 of O, where α0, ..., α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.
A random element of the ideal I as an element of the field of fractions of the associated order. The maximal size of the coefficients with respect to the ideal basis 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 φ obtained by sending the defining primitive element α of F to the element r∈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 φ on F 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 α. If R does not cover G then the homomorphism h from G into R is necessary to ensure that the ground field can be mapped into R.
Given an order O, a ring R and an element r∈R, construct a homomorphism φ 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, so x is 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. This is necessary if R does not cover the coefficient ring of O.
> 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 | Coercion(Rationals(), FF), 3*FF.1>; > h; Mapping from: FldOrd: F to FldFin: FF > 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^34This 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.
> FF := FiniteField(11, 5); > h := hom< F -> FF | Coercion(Rationals(), 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
Return the map from the order O of an algebraic number field to the ring R mapping the basis elements to b1, .., bn. If given, the map m should be from the coefficient ring of O to R and will be used to map the coefficients of the basis elements. If not given the coefficient ring of O should by covered by R.
Return whether the vector space homomorphism m is a homomorphism of rings.