
    wg                     F    d dl mZ d dlmZ d dlmZ ej                  Zd Zy)    )PermutationGroup)Permutation)uniqc                     g }g }d}d}| D ]O  }|j                   }t        |j                        }|j                  |       ||z  }|j                  |       ||z  }Q g }t	        |      D ]%  }	|j                  t        t	        |                   ' d}
d}t	        t        |            D ]g  }	t	        |
|
||	   z         D ]@  }| |	   j                  ||
z
     j                  }|D cg c]  }||z   	 c}||   ||||	   z    B |
||	   z  }
|||	   z  }i t        t        |D cg c]  }t        t        |             c}            }t        |d      S c c}w c c}w )a8  
    Returns the direct product of several groups as a permutation group.

    Explanation
    ===========

    This is implemented much like the __mul__ procedure for taking the direct
    product of two permutation groups, but the idea of shifting the
    generators is realized in the case of an arbitrary number of groups.
    A call to DirectProduct(G1, G2, ..., Gn) is generally expected to be faster
    than a call to G1*G2*...*Gn (and thus the need for this algorithm).

    Examples
    ========

    >>> from sympy.combinatorics.group_constructs import DirectProduct
    >>> from sympy.combinatorics.named_groups import CyclicGroup
    >>> C = CyclicGroup(4)
    >>> G = DirectProduct(C, C, C)
    >>> G.order()
    64

    See Also
    ========

    sympy.combinatorics.perm_groups.PermutationGroup.__mul__

    r   F)dups)
degreelen
generatorsappendrangelist
array_formr   _af_newr   )groupsdegrees
gens_counttotal_degree
total_gensgroupcurrent_degcurrent_num_gens
array_gensicurrent_genjgenxa	perm_genss                   i/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/sympy/combinatorics/group_constructs.pyDirectProductr!      s   : GJLJ 'llu//0{##*+&&
' J: 5$u\2345KK3z?# "{K*Q-$?@ 	/A1I((!k/:FFC*-.Q[. qM+kGAJ&>?	/ 	z!}$wqz!" TZ@747+@ABIIE22	 / As   %E"EN)sympy.combinatorics.perm_groupsr    sympy.combinatorics.permutationsr   sympy.utilities.iterablesr   r   r!        r    <module>r'      s    < 8 *


53r&   