def METHOD_NAME(self) -> Array:
    perms = self.to_array()
    inverse = perms[self.inverse].squeeze()
    n_symm = len(perms)
    lookup = np.unique(np.column_stack((perms, np.arange(len(self)))), axis=0)
    METHOD_NAME = np.zeros([n_symm, n_symm], dtype=int)
    for i, g_inv in enumerate(inverse):
        row_perms = perms[:, g_inv]
        row_perms = np.unique(
            np.column_stack((row_perms, np.arange(len(self)))), axis=0
        )
        # row_perms should be a permutation of perms, so identical after sorting
        if np.any(row_perms[:, :-1] != lookup[:, :-1]):
            raise RuntimeError(
                "PermutationGroup is not closed under multiplication"
            )
        # match elements in row_perms to group indices
        METHOD_NAME[i, row_perms[:, -1]] = lookup[:, -1]
    return METHOD_NAME