---
title: "Matrix Group Actions on Polynomials"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/InvariantTheory/matrix.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/InvariantTheory/matrix.md"
part: "Commutative Algebra"
chapter: "Invariant Theory"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Commutative Algebra", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/index-commutative-algebra.md"}
  - {"title": "Invariant Theory", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/InvariantTheory/index-invariant-theory.md"}
prev: {"title": "Permutation Group Actions on Polynomials", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/InvariantTheory/permutation.md"}
next: {"title": "Algebraic Group Actions on Polynomials", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/InvariantTheory/algebraic.md"}
intrinsics:
  - {"name": "^", "signature": "f ^ a: RngMPolElt, GrpMatElt -> RngMPolElt"}
  - {"name": "^", "signature": "f ^ G: RngMPolElt, GrpMat -> { RngMPolElt }"}
examples:
  - "ex-df3c71"
---

<a id="matrix"></a>
<a id="rnginvar-matrix"></a>
# Matrix Group Actions on Polynomials

If $P$ is a polynomial ring in $n$ indeterminates $x_1, \ldots, x_n$, over the ring $S$, then ${\operatorname{GL}}(n, S)$ acts on $P$ as follows: Let **x** denote the vector $(x_1, \ldots, x_n)$. Then the image $g$ of a polynomial $f$ of $P$ under the action of a matrix $a$ of ${\operatorname{GL}}(n, S)$ is defined by $g({\bf x}) = f({\bf x}*a)$.

<a id="operation-op-pow-rngmpolelt-grpmatelt"></a>
## `f ^ a: RngMPolElt, GrpMatElt -> RngMPolElt`

Given a polynomial $f$ belonging to a polynomial ring having $n$ indeterminates and coefficient ring $S$, and a matrix $a$ belonging subgroup $G$ of ${\operatorname{GL}}(n, S)$, return the image of $f$ under $a$.

<a id="operation-op-pow-rngmpolelt-grpmat"></a>
## `f ^ G: RngMPolElt, GrpMat -> { RngMPolElt }`

Given a polynomial $f$ belonging to a polynomial ring having $n$ indeterminates and coefficient ring $S$, and a to a subgroup of ${\operatorname{GL}}(n, S)$, return the orbit of $f$ under $G$.

<a id="example-ex-df3c71"></a>
## `Example: Matrix Group Action on Polynomials (ex-df3c71)`

We act on the polynomial ring in two indeterminates over the field $K = Q(\sqrt 2)$, by a cyclic subgroup of ${\operatorname{GL}}(2, K)$.

```magma
> K := QuadraticField(2);
> Aq := [ x / K.1 : x in [1, 1, -1, 1]];
> G := MatrixGroup<2, K | Aq>;
> P<x, y> := PolynomialRing(K, 2);
> f := x^2 + x * y + y^2;
> g := f^G.1;
> g;
1/2*x^2 + 3/2*y^2
> f^G;
{
   1/2*x^2 + 3/2*y^2,
   x^2 - x*y + y^2,
   x^2 + x*y + y^2,
   3/2*x^2 + 1/2*y^2
}
```
