[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
Changing Monomial Order

Changing Monomial Order

Often one wishes to change the monomial order of an ideal. Magma allows one to do this by use of the ChangeOrder function.

ChangeOrder(I, Q) : RngMPol, RngMPol -> RngMPol, Map
Given an ideal I of the polynomial ring P = R[x_1, ..., x_n], together with a polynomial ring Q of rank n (with possibly a different order to that of P), return the ideal J of Q corresponding to I and the isomorphism f from P to Q. The map f simply maps P.i to Q.i for each i. The point of the function is that one can change the order on monomials of I to be that of Q. When a Gröbner basis of J is needed to be calculated, Magma uses the Gröbner Walk starting from a Gröbner basis of I if possible---this usually makes order conversion much more efficient than computing a Gröbner basis of J from scratch.
ChangeOrder(I, order) : RngMPol, ..., -> RngMPol, Map
Given an ideal I of the polynomial ring P = R[x_1, ..., x_n], together with a monomial order order, construct the polynomial ring Q = R[x_1, ..., x_n] with order order, and then return the ideal J of Q corresponding to I and the isomorphism f from P to Q. See the section on monomial orders for the valid values for the argument order. The map f simply maps P.i to Q.i for each i. The point of the function is that one can change the order on monomials of I to be order. When a Gröbner basis of J is needed to be calculated, Magma uses the Gröbner Walk starting from a Gröbner basis of I if possible---this usually makes order conversion much more efficient than computing a Gröbner basis of J from scratch.

Example RngMPol_ChangeOrder (H29E21)

We write a function univgen which, given a zero-dimensional ideal, computes the univariate elimination ideal generator for a particular variable by changing order to the appropriate univariate order. Note that this function is the same as (and is in fact implemented in exactly the same way as) the intrinsic function UnivariateEliminationIdealGenerator. We then find the appropriate univariate polynomials for a particular ideal.

> function univgen(I, i)
>    // Make sure I has a Groebner basis so that
>    // the Walk algorithm will be used when
>    // constructing a Groebner basis of J
>    Groebner(I);
>    J := ChangeOrder(I, "univ", i);
>    Groebner(J);
>    return rep{f: f in Basis(J) | IsUnivariate(f, i)};
> end function;
>
> P<x, y, z> := PolynomialRing(RationalField(), 3, "grevlex");
> I := ideal<P |
>     1 - x + x*y^2 - x*z^2,
>     1 - y + y*x^2 + y*z^2,
>     1 - z - z*x^2 + z*y^2 >;
>
> univgen(I, 1);
x^21 - x^20 - 2*x^19 + 4*x^18 - 5/2*x^17 - 5/2*x^16 + 4*x^15 - 
    15/2*x^14 + 129/16*x^13 + 11/16*x^12 - 103/8*x^11 + 
    131/8*x^10 - 49/16*x^9 - 171/16*x^8 + 12*x^7 - 3*x^6 - 
    29/8*x^5 + 15/4*x^4 - 17/16*x^3 - 5/16*x^2 + 5/16*x - 1/16
> univgen(I, 2);
y^14 - y^13 - 13/2*y^12 + 8*y^11 + 53/4*y^10 - 97/4*y^9 - 
    45/8*y^8 + 33*y^7 - 25/2*y^6 - 18*y^5 + 107/8*y^4 + 5/8*y^3 -
    27/8*y^2 + 9/8*y - 1/8
> univgen(I, 3);
z^21 - z^20 - 2*z^19 + 4*z^18 - 5/2*z^17 - 5/2*z^16 + 4*z^15 - 
    15/2*z^14 + 129/16*z^13 + 11/16*z^12 - 103/8*z^11 + 
    131/8*z^10 - 49/16*z^9 - 171/16*z^8 + 12*z^7 - 3*z^6 - 
    29/8*z^5 + 15/4*z^4 - 17/16*z^3 - 5/16*z^2 + 5/16*z - 1/16

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