It seems that Mathematica only has group functionality for permutation groups? Then there is a step to transform the abstract finite one to a permutation one.
As an example, consider the following problem
Suppose $G=\langle a,b|a^2=1,b^3=1,(ab)^2=1\rangle$, try to compute $ab^2ab^2a$.
It can proceed by viewing the elements of group just as a string, and the rule of group can be view as a rule of string replace. Any way, I would like to use NonCommutativeMultiply
instead:
Firstly, let us define the rule, basically, we only need to define the rule for $ab$ and $ba$, since whenever we know how to commute these two generators, then we can use the fact $a^2=1=b^3$ to simplify our expression. It is not hard to compute $ab=b^2a$, $ba=ab^2$:
rel = {c___ ** a ** a ** d___ :> c ** i ** d,
c___ ** b ** b ** b ** d___ :> c ** i ** d,
c___ ** a ** b ** d___ :> c ** b ** b ** a ** d,
c___ ** b ** a ** d___ :> c ** a ** b ** b ** d , a___ ** i :> a,
i ** a___ :> a}
Now, let us define the set of group elements. Since $a$ is a order 2 element and $b$ is order $3$, we know that $G$ must be a subgroup of order $6=o(a)\times o(b)$, thus the elements can be expressed by
set = {i, a, b, b ** b, a ** b, b ** a}
Lastly, we can compute what's the results of $a$ multiply from left:
a ** # & /@ set/.rel
The problem: It seems my rule has not do the function of simplify the expression, as you can see the results is
{a, NonCommutativeMultiply[i], b ** b ** a, b ** b ** a ** b, i ** b,
b ** b ** a ** a}
the element b**b**a**a
should be b**b
, so please help me to correct the rule?
The correct result should be
aset = {a, i, a ** b, b ** a, b, b ** b}
form which we can find the permutation by
FindPermutation[set, aset]
which gives
Cycles[{{1, 2}, {3, 5}, {4, 6}}]