Whoever listens... On 28 Apr., 22:26, Simon King <simon.k...@nuigalway.ie> wrote: > Hi! > > Let R,S be rings and f:R-->S be a ring homomorphism. If R,S are base > rings of, e.g., matrix rings or polynomial rings, shouldn't it be > possible to construct the homomorphism of the "bigger" rings induced > by f? But how?
Since there was no answer, I guess it isn't implemented yet. Perhaps it works like this: def my_map(f,x): P = parent(x) try: return P([f(t) for t in x]) except TypeError: return P([my_map(f,t) for t in x]) and then I get: sage: R.<x> = ZZ[] sage: f = R.hom([2*x],R) sage: S.<y> = R[] sage: p = S.random_element() sage: p (-x + 3)*y^2 + (-x^2 + x + 12)*y + 2*x^2 + x + 1 sage: my_map(f,p) (-2*x + 3)*y^2 + (-4*x^2 + 2*x + 12)*y + 8*x^2 + 2*x + 1 and sage: MS = MatrixSpace(R,2,2) sage: M = MS.random_element() sage: M [9*x^2 + x + 1 -2*x^2 + 6*x] [ x^2 + x - 17 x^2 - x - 3] sage: my_map(f,M) [36*x^2 + 2*x + 1 -8*x^2 + 12*x] [4*x^2 + 2*x - 17 4*x^2 - 2*x - 3] Do you think that the above makes sense to implement in the call method of a new generic class, say, RingHomomorphism_from_basering, whose instances would be created in S.hom(f,S) and MS.hom(f,MS)? Or does anybody have a better idea? Cheers, Simon -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org