(n, antisym=False)
return base, [_af_new(h) for h in gens]
Return base, gens of the minimal BSGS for (anti)symmetric tensor

    ``n``  rank of the tensor

    ``antisym = False`` symmetric tensor
    ``antisym = True``  antisymmetric tensor

    Examples
    ========

    >>> from sympy.combinatorics import Permutation
    >>> from sympy.combinatorics.tensor_can import get_symmetric_group_sgs
    >>> Permutation.print_cyclic = True
    >>> get_symmetric_group_sgs(3)
    ([0, 1], [Permutation(4)(0, 1), Permutation(4)(1, 2)])
Return base, gens of the minimal BSGS for (anti)symmetric tensor
Return base gens of the minimal BSGS for ( anti ) symmetric tensor
def get_symmetric_group_sgs(n, antisym=False):
    """
    Return base, gens of the minimal BSGS for (anti)symmetric tensor

    ``n``  rank of the tensor

    ``antisym = False`` symmetric tensor
    ``antisym = True``  antisymmetric tensor

    Examples
    ========

    >>> from sympy.combinatorics import Permutation
    >>> from sympy.combinatorics.tensor_can import get_symmetric_group_sgs
    >>> Permutation.print_cyclic = True
    >>> get_symmetric_group_sgs(3)
    ([0, 1], [Permutation(4)(0, 1), Permutation(4)(1, 2)])
    """
    if n == 1:
        return [], [_af_new(list(range(3)))]
    gens = [Permutation(n - 1)(i, i + 1)._array_form for i in range(n - 1)]
    if antisym == 0:
        gens = [x + [n, n + 1] for x in gens]
    else:
        gens = [x + [n + 1, n] for x in gens]
    base = list(range(n - 1))
    return base, [_af_new(h) for h in gens]
def get_symmetric_group_sgs ( n , antisym = False ) : if n == 1 : return [ ] , [ _af_new ( list ( range ( 3 ) ) ) ] gens = [ Permutation ( n - 1 ) ( i , i + 1 ) . _array_form for i in range ( n - 1 ) ] if antisym == 0 : gens = [ x + [ n , n + 1 ] for x in gens ] else : gens = [ x + [ n + 1 , n ] for x in gens ] base = list ( range ( n - 1 ) ) return base , [ _af_new ( h ) for h in gens ]