def METHOD_NAME(self) -> Array:
    try:
        lookup = self._canonical_lookup()
        inverses = []
        # `np.argsort` on a 1D permutation list generates the inverse permutation
        # it acts along last axis by default, so can perform it on to_array()
        # `np.argsort` changes int32 to int64 on Windows,
        # and we need to change it back
        perms = self.to_array()
        invperms = np.argsort(perms).astype(perms.dtype)
        for invperm in invperms:
            inverses.append(lookup[HashableArray(invperm)])
        return np.asarray(inverses, dtype=int)
    except KeyError as err:
        raise RuntimeError(
            "PermutationGroup does not contain the inverse of all elements"
        ) from err