Ask Your Question

Revision history [back]

The link you provide explains how to allow using g * f to let g act on f.

Here is a way to define the action that does not use that.

It requires typing act(g, f) rather than g * f.

Define the action:

def act(g, f):
    r"""
    Act by this invertible matrix ``g`` on this polynomial ``f``
    by ``g⋅f(x) = f(h(x))`` where ``h`` is the inverse of ``g``.
    """
    M = f.parent()
    return f(*(g.inverse() * vector(M, M.gens())))

Use it:

sage: R.<x, y> = QQ['x, y']
sage: G = GL(2, QQ)
sage: act = GeneralLinearGroupAction(G, R)
sage: f = x + y
sage: g = G([1, 2, 3, 5])
sage: act(g, f)
-2*x + y

Hope someone can say more on registering the group action so that g * f returns the same as act(g, f).