up previous next
RingElems    --    convert an expression into a RINGELEM


Syntax
RingElems(R: RING, S: STRING): LIST of RINGELEM

Description
This function converts the string S into a LIST of RINGELEM in R , if possible. This is useful for operating with different rings, with no need for use R /tt>.

The expression in S may contain operations and parentheses, but no programming variables nor function calls. New from version 5.3.0.

Example
/**/ P ::= ZZ/(5)[x,y];   S ::= QQ[x,y,z[1..4,3..7]];

/**/  RingElems(P, "x^2, (x-3*y)^5");  --> elements of P
[x^2,  x^5 +2*y^5]
/**/  RingElems(S, "x^2, (x-3*y)^5");  --> elements of S
[x^2,  x^5 -15*x^4*y +90*x^3*y^2 -270*x^2*y^3 +405*x*y^4 -243*y^5]

-- even for making ideal in new rings:
/**/  I := ideal(RingElems(NewPolyRing(QQ, "i"), "i^2 +1"));  I;
ideal(i^2 +1)

See Also