(self)
return True
Test if the group is Abelian.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation.print_cyclic = True
        >>> from sympy.combinatorics.perm_groups import PermutationGroup
        >>> a = Permutation([0, 2, 1])
        >>> b = Permutation([1, 0, 2])
        >>> G = PermutationGroup([a, b])
        >>> G.is_abelian
        False
        >>> a = Permutation([0, 2, 1])
        >>> G = PermutationGroup([a])
        >>> G.is_abelian
        True
Test if the group is Abelian.
Test if the group is Abelian .
def is_abelian(self):
        """Test if the group is Abelian.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation.print_cyclic = True
        >>> from sympy.combinatorics.perm_groups import PermutationGroup
        >>> a = Permutation([0, 2, 1])
        >>> b = Permutation([1, 0, 2])
        >>> G = PermutationGroup([a, b])
        >>> G.is_abelian
        False
        >>> a = Permutation([0, 2, 1])
        >>> G = PermutationGroup([a])
        >>> G.is_abelian
        True

        """
        if self._is_abelian is not None:
            return self._is_abelian

        self._is_abelian = True
        gens = [p._array_form for p in self.generators]
        for x in gens:
            for y in gens:
                if y <= x:
                    continue
                if not _af_commutes_with(x, y):
                    self._is_abelian = False
                    return False
        return True
def is_abelian ( self ) : if self . _is_abelian is not None : return self . _is_abelian self . _is_abelian = True gens = [ p . _array_form for p in self . generators ] for x in gens : for y in gens : if y <= x : continue if not _af_commutes_with ( x , y ) : self . _is_abelian = False return False return True