<s>[INST] Efficient computation of conjugacy classes of a small group. I'm trying to construct a character table for a group of order 54 given by:
$$ \langle a,b : a^9 = b^6 = 1, b^{-1} a b = a^2\rangle $$
To do this first I need to compute conjugacy classes. This feels like a tedious task and I'm looking for some guidance on how to compute those efficiently.
 [/INST] $G = \{a^mb^n:0\le m\le 8,0\le n\le 5\}$. For an element $a^mb^n\in G$, $b^{-1}a^mb^nb = a^{2m}b^n$ and thus for a fixed $n$, $a^mb^n$ (with $m = 1,2,4,5,7,8$ or with $m = 3,6$) are in a same conjugacy class. Moreover, $$a^{-1}a^mb^na = a^{m-1}b^nab^{-n}b^n = a^{m-1}a^{5^n}b^n$$since $ba^2b^{-1} = a = (a^2)^5$ and $a^2$ is also a generator of $\langle a\rangle$. Note that a conjugate by $a$ or $b$ does not change $n$. Therefore, we only need to discuss $n$.
(1) $n=0$, then $a^{-1}a^mb^na = a^mb^n$, so the conjugate by $a$ is fixed. So $\{1\},\{a,a^2,a^4,a^5,a^7,a^8\},\{a^3,a^6\}$ are conjugacy classes.
(2) $n=1$, then $a^{-1}a^mb^na = a^{m+4}b^n$. So $\{b,ab,\dots, a^8b\}$ is a conjugacy class, since $m+4$ runs all the $m$'s.
(3) $n=2$, then $a^{-1}a^mb^na = a^{m+24}b^n = a^{m+6}b^n$. Now $a^3b^2$, $a^6b^2$ and $b^2$ are in the same conjugacy class, while other $m$ forms another conjugacy class.
(4) $n=3$, then $a^{-1}a^mb^na = a^{m+124}b^n = a^{m+7}b^n$. The same as (2) since it runs all the $m$'s.
(5) $n=4$, then $a^{-1}a^mb^na = a^{m+3}b^n $. The same as (3).
(6) $n=5$, then $a^{-1}a^mb^na = a^{m+1}b^n$. The same as (2).
</s>