I am working with polynomials in several variables with the obvious action of Sn. That is, given a polynomial f in the variables x1,…,xn, a permutation σ∈Sn acts on f by sending xi to xσ(i).
What I would like to do is to give Mathematica a polynomial, for example
x21x2+x3
and have it compute the image of this under the action of a particular element. For example, if I gave it (123) it would output
x22x3+x1.
Thanks!
Answer
This should be a start.
groupElementAction[expr_, vars_, perm_] /;
Length[perm] == Length[vars] && PermutationListQ[perm] :=
expr /. Thread[vars -> Permute[vars, perm]]
That example:
groupElementAction[x1^2*x2 + x3, {x1, x2, x3}, {2, 3, 1}]
(* Out[131]= x2 + x1 x3^2 *)
With some tweaking it can be made to handle the explicit cycle form of permutation group elements.
Comments
Post a Comment