# operation of permutation elements

I would like to permute the elements of the set $A$ using symmetric group. How may I be able to do that? For example, in Sage,

G = SymmetricGroup(3)
for i in G: print [j*i*j^(-1) for j in G]


gives all the conjugacy classes for $S_3$ group. How may I able to do same with SymmetricGroup is Mathematica.

Furthermore, I would like find the elements of $S_3$ that leaves the set $A=\{1, 2\}$ invariant or leaves each element fixed. How may I be able to do that?

I find the OP questions somewhat unclear. In any case, the answers can be found in the tutorials "Permutations" and "Permutation Groups".

I would like to permute the elements of the set A using symmetric group.

In:= Permute[{1,2,3},SymmetricGroup]

Out= {{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}}


The Mathematica equivalent of the Sage code:

G = SymmetricGroup(3)
for i in G: print [j*i*j^(-1) for j in G]


should be written with other operators/functions, otherwise j*i*j^(-1) will simplify to i. Here I use NonCommutativeMultiply and Inverse:

In:= Permute[NonCommutativeMultiply[j, i, Inverse[j]], SymmetricGroup]

Out= {j ** i ** Inverse[j], j ** Inverse[j] ** i,
i ** j ** Inverse[j], i ** Inverse[j] ** j, Inverse[j] ** j ** i,
Inverse[j] ** i ** j}


Furthermore, I would like find the elements of $S_3$ that leaves the set $A=\{1,2\}$ invariant [...]

This is unclear to me because:

In:= GroupStabilizer[SymmetricGroup, {1, 2}]

Out= PermutationGroup[{}]


hence

In:= Permute[{1,2,3}, GroupStabilizer[SymmetricGroup, {1, 2}]]

Out= {{}}


May be the following examples are helpful illustrations.

Fixing the 3d element using $S_3$:

In:= Permute[Range, GroupStabilizer[SymmetricGroup, {3}]]

Out= {{1, 2, 3}, {2, 1, 3}}


Fixing the elements {1,2} using $S_4$:

In:= Permute[Range, GroupStabilizer[SymmetricGroup, {1, 2}]]

Out= {{1, 2, 3, 4}, {1, 2, 4, 3}}