If this isn't clear, I'm sorry.
I'm investigating what groups one gets using a certain procedure.
Take a group $H$. Let $w=x_ex_mx_k^{-1}$ be an element of the free group on $X:=\{x_h\mid h\in H\}$ for $m,k\in H\setminus\{e\}$ with $m\neq k$ and $e$ the identity of $H$. I'm looking at the groups given by the presentation $$G_H(w):=\langle X\mid \{x_hx_{hm}x_{hk}^{-1}\mid h\in H\}\rangle.$$ (They generalise the Fibonacci groups.)
For instance, for $H=C_2\times C_2=\{e,a,b,ab\}$ and $w=x_ex_ax_b^{-1}$, $G_H(w)=C_3$.
There are $7P2=42$ choices for $w=x_ex_mx_k^{-1}$ (not controlling for substitutions in $w$) when $H=C_2\times C_4=\langle a,b\mid a^2, b^4, ab=ba\rangle$. In GAP, for $w=x_ex_ax_b^{-1}$, I use
F:=FreeGroup("e","a","r","s","t","x","y","z");
rels:=ParseRelators(F,"ea=r,ae=x,rx=s,sy=t,tz=e,xr=y,ys=z,zt=a");
g:=F/rels;
iso:=IsomorphismSimplifiedFpGroup(g);
h:=Image(iso);
Print(RelatorsOfFpGroup(h));
with e$=x_e$, a$=x_a$, r$=x_b$, etc., and I'm calculating & changing the relations manually for each $w$.
Is there a quicker way of doing this (that can be generalised to any group $H$)?
Please help :)
As requested in the comments, here's a full presentation of $G_H(w)$ for $H=C_2\times C_4=\langle a,b\mid a^2, b^4, ab=ba\rangle$ (with identity $e$) and $w=x_ex_ax_b^{-1}$ in terms of the $(x_h)_{h\in H}$:
$$G_H(w)=\langle \{x_h\mid h\in H\}\mid x_ex_a=x_b, x_ax_e=x_{ab}, x_{b}x_{ab}=x_{b^2}, x_{b^2}x_{ab^2}=x_{b^3}, x_{b^3}x_{ab^3}=x_e, x_{ab}x_b=x_{ab^2}, x_{ab^2}x_{b^2}=x_{ab^3}, x_{ab^3}x_{b^3}=x_a\rangle.$$
You probably want to write yourself a function that forms such a list. For example, let
This function takes as argument a free group and two functions that calculate the values $p(i)$ and $q(i)$ in a triple $x_i*x_{p(i)}*x_{q(i)}$ with negative values denoting inverses. For example
Now create an appropriate free group (with generators named after the elements of $H$) and choose the parameters $m$ and $k$ of the example:
Now construct functiuons $p$ and $q$ which for generator $h$ (well, the number of generator $h$) return the number of the generator $hm$ and $q$ ditto:
Then
returns the list
which at first glance looks like yours.