Often one wishes to change the monomial order of an ideal. Magma allows one to do this by use of the ChangeOrder function.
Given an ideal I of the polynomial ring P = R[x1, ..., xn], 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 a conversion algorithm starting from a Gröbner basis of I if possible---this usually makes order conversion much more efficient than by computing a Gröbner basis of J from scratch.
Given an ideal I of the polynomial ring P = R[x1, ..., xn], together with a monomial order {order} (see Section Representation and Monomial Orders), construct the polynomial ring Q = R[x1, ..., xn] 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.
Given an ideal I of the polynomial ring P = R[x1, ..., xn], together with a tuple T, construct the polynomial ring Q = R[x1, ..., xn] with the monomial order given by the tuple T on the monomials, and then return the ideal J of Q corresponding to I and the isomorphism f from P to Q. T must be a tuple whose components match the valid arguments for the monomial orders in Section Representation and Monomial Orders (or a tuple returned by the function MonomialOrder).
> function univgen(I, i) > // Make sure I has a Groebner basis so that > // the conversion 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