How to define group action on sagemath?

148 Views Asked by At

I hope you are well. I have the following problem and I'm having difficulties to make this implementation in sage. Problem: Consider $f \in \mathbb{R}[x,y]$ and $M \in M_{2}(\mathbb{R})$. How can I implement the $M \cdot f (x,y)=f(M^{-1}(x,y))$ group action in sage?

I took a look at the link: https://doc.sagemath.org/html/en/reference/coercion/sage/categories/action.html But I couldn't understand much.

I thank you for your attention.

1

There are 1 best solutions below

0
On

Here is an implementation of the actual function taking a matrix M and a polynomial f and returning the polynomial $M \cdot f$:

def act(M, f):
   R = f.parent()
   x,y = R.gens()
   v = vector((x,y))
   w = M.inverse()*v
   return f.subs({x:w[0], y:w[1]})

Here is an example application:

sage: R.<x,y> = PolynomialRing(QQ,2)
sage: M = matrix([[1,2],[3,4]])
sage: act(M, x)
-2*x + y
sage: act(M, y)
3/2*x - 1/2*y

I am less sure how one would integrate this in the official action-framework of Sage.