Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Polynomial transposition

Let's say I have

R1 = ZZ['y']['x']
R2 = ZZ['x']['y']

Is there a builtin function in Sage for converting an element from R1 to R2 by transposing the coefficients, not just switching the variables? For instance y*x+y should become (x+1)*y, not x*y+x.

I can do it by first coercing to ZZ['x','y'] and then to R2, but that seems clumsy (and possibly inefficient). I could also just write a loop, but that seems ugly (and again possibly inefficient). It would be fine with a function that just transposes the polynomial within R1 (then I can just coerce the result to R2 afterwards).