'Return the direct product of two permutation groups as a permutation
group.
This implementation realizes the direct product by shifting the index
set for the generators of the second group: so if we have `G` acting
on `n1` points and `H` acting on `n2` points, `G*H` acts on `n1 + n2`
points.
Examples
>>> from sympy.combinatorics.perm_groups import PermutationGroup
>>> from sympy.combinatorics.named_groups import CyclicGroup
>>> G = CyclicGroup(5)
>>> H = G*G
>>> H
PermutationGroup([
(9)(0 1 2 3 4),
(5 6 7 8 9)])
>>> H.order()
25'

def __mul__(self, other):

    gens1 = [perm._array_form for perm in self.generators]
    gens2 = [perm._array_form for perm in other.generators]
    n1 = self._degree
    n2 = other._degree
    start = list(range(n1))
    end = list(range(n1, (n1 + n2)))
    for i in range(len(gens2)):
        gens2[i] = [(x + n1) for x in gens2[i]]
    gens2 = [(start + gen) for gen in gens2]
    gens1 = [(gen + end) for gen in gens1]
    together = (gens1 + gens2)
    gens = [_af_new(x) for x in together]
    return PermutationGroup(gens)
