
    g                     >    d dl mZ d dlmZ d dlmZ ej        Zd ZdS )    )PermutationGroup)Permutation)uniqc                     g }g }d}d}| D ]Q}|j         t          |j                  }|                               |z  }|                    |           ||z  }Rg }t	          |          D ]1}|                    t          t	          |                               2d}	dt	          t          |                    D ]q}t	          |	|	||         z             D ]?}
| |         j        |
|	z
           j        }fd|D             ||
         ||         z   <   @|	||         z  }	||         z  rt          t          d |D                                 }t          |d          S )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   c                     g | ]}|z   S  r   ).0xcurrent_degs     `/var/www/html/ai-engine/env/lib/python3.11/site-packages/sympy/combinatorics/group_constructs.py
<listcomp>z!DirectProduct.<locals>.<listcomp>9   s    ...Q[...    c                 F    g | ]}t          t          |                    S r   )_af_newlist)r	   as     r   r   z!DirectProduct.<locals>.<listcomp><   s&    @@@7477++@@@r   F)dups)	degreelen
generatorsappendranger   
array_formr   r   )groupsdegrees
gens_counttotal_degree
total_gensgroupcurrent_num_gens
array_gensicurrent_genjgen	perm_gensr   s                @r   DirectProductr'      s   : GJLJ ' 'lu/00{####*+++&&

J: 5 5$u\22334444KK3z??## " "{K*Q-$?@@ 	/ 	/A1I(!k/:FC....#... qM+kGAJ&>>??z!}$wqz!T@@Z@@@AABBIIE2222r   N)sympy.combinatorics.perm_groupsr    sympy.combinatorics.permutationsr   sympy.utilities.iterablesr   r   r'   r   r   r   <module>r+      s\    < < < < < < 8 8 8 8 8 8 * * * * * *

53 53 53 53 53r   