The class of all ring homomorphisms is RingMap. A ring homomorphism from a polynomial ring S to a ring R is obtained with map by providing a list of elements in R to which the generators (variables) of S should go, as follows.
i1 : R = ZZ/101[a,b]; |
i2 : S = ZZ/101[x,y,z]; |
i3 : f = map(R,S,{a^2,a*b,b^2}) |
(Notice that the target of f is the first argument of map and the source of f is the second argument.)
We can apply this ring map to elements of S in the usual way.
i4 : f(x+y+z) |
i5 : f S_2 |
Composition of ring maps is possible.
i6 : g = map(S,ZZ/101[t],{x+y+z}) |
i7 : f * g |
The defining matrix of f can be recovered with the key matrix.
i8 : f.matrix |
We can produce the kernel of f with kernel.
i9 : kernel f |
We can produce the image of f with image. It is computed as its source ring modulo its kernel.
i10 : image f |
We can check whether the map is homogeneous with isHomogeneous.
i11 : isHomogeneous f |
We can obtain the ring of the graph of f with graphRing.
i12 : graphRing f |
We can obtain the ideal of the graph of f with graphIdeal, except that currently the result is a matrix rather than an ideal, sigh.
i13 : graphIdeal f |