 // an easy example
ring r1 = 0,(a,b),dp; // a commutative ring
poly P = a^2+ab+b^3;
ring r2 = 0,(x,y),dp;
def W=nc_algebra(1,1); // a Weyl algebra
setring W;
map M = r1, x^2, y^3;
// note: M is a map and not a morphism
M(P);
==> y9x2y3+x4
// now, a more involved example
LIB "ncalg.lib";
def Usl2 = makeUsl2();
// this algebra is U(sl_2), generated by e,f,h
setring Usl2;
poly P = 4*e*f+h^22*h; // the central elt of Usl2
poly Q = e^3*fh^4; // some polynomial
ring W1 = 0,(D,X),dp;
def W2=nc_algebra(1,1);
setring W2;
// this algebra is the opposite Weyl algebra
map F = Usl2, X, D*D*X, 2*D*X;
F(P); // 0, because P is in the kernel of F
==> 0
F(Q);
==> 16D4X4+96D3X3D2X4112D2X2+6DX3+16DX6X2
