Ë
    7^(h¦S  ã                   ó`   — d dl mZ d dlmZ d dlmZ d dlmZ  G d„ de«      Z G d„ de«      Z	y	)
é    ©Úisprime)ÚPermutationGroup)ÚDefaultPrinting)Ú
free_groupc                   ó(   — e Zd ZdZdZdd„Zd„ Zd„ Zy)ÚPolycyclicGroupTNc                 óz   — || _         || _        || _        |st        | j                   ||«      | _        y|| _        y)a  

        Parameters
        ==========

        pc_sequence : list
            A sequence of elements whose classes generate the cyclic factor
            groups of pc_series.
        pc_series : list
            A subnormal sequence of subgroups where each factor group is cyclic.
        relative_order : list
            The orders of factor groups of pc_series.
        collector : Collector
            By default, it is None. Collector class provides the
            polycyclic presentation with various other functionalities.

        N)ÚpcgsÚ	pc_seriesÚrelative_orderÚ	CollectorÚ	collector)ÚselfÚpc_sequencer   r   r   s        ú[/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sympy/combinatorics/pc_groups.pyÚ__init__zPolycyclicGroup.__init__   s7   € ð$  ˆŒ	Ø"ˆŒØ,ˆÔÙPYœ 4§9¡9¨i¸ÓHˆ�Ð_hˆ�ó    c                 ó:   — t        d„ | j                  D «       «      S )Nc              3   ó2   K  — | ]  }t        |«      –— Œ y ­w©Nr   )Ú.0Úorders     r   ú	<genexpr>z1PolycyclicGroup.is_prime_order.<locals>.<genexpr>$   s   è ø€ ÒC e”7˜5—>ÑCùs   ‚)Úallr   ©r   s    r   Úis_prime_orderzPolycyclicGroup.is_prime_order#   s   € ÜÑC¨t×/BÑ/BÔCÓCÐCr   c                 ó,   — t        | j                  «      S r   )Úlenr   r   s    r   ÚlengthzPolycyclicGroup.length&   s   € Ü�4—9‘9‹~Ðr   r   )Ú__name__Ú
__module__Ú__qualname__Úis_groupÚis_solvabler   r   r    © r   r   r	   r	      s   „ à€HØ€Kóiò.Dór   r	   c                   ó`   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)r   zœ
    References
    ==========

    .. [1] Holt, D., Eick, B., O'Brien, E.
           "Handbook of Computational Group Theory"
           Section 8.1.3
    Nc                 ó2  — || _         || _        || _        |s&t        dj	                  t        |«      «      «      d   n|| _        t        | j                  j                  «      D ��ci c]  \  }}||“Œ
 c}}| _        | j                  «       | _
        yc c}}w )a  

        Most of the parameters for the Collector class are the same as for PolycyclicGroup.
        Others are described below.

        Parameters
        ==========

        free_group_ : tuple
            free_group_ provides the mapping of polycyclic generating
            sequence with the free group elements.
        pc_presentation : dict
            Provides the presentation of polycyclic groups with the
            help of power and conjugate relators.

        See Also
        ========

        PolycyclicGroup

        zx:{}r   N)r   r   r   r   Úformatr   Ú	enumerateÚsymbolsÚindexÚpc_relatorsÚpc_presentation)r   r   r   r   Úfree_group_r.   ÚiÚss           r   r   zCollector.__init__5   s}   € ð, ˆŒ	Ø"ˆŒØ,ˆÔÙITœ* V§]¡]´3°t³9Ó%=Ó>¸qÒAÐZeˆŒÜ'0°·±×1HÑ1HÓ'I×J™t˜q !�a˜‘dÓJˆŒ
Ø#×/Ñ/Ó1ˆÕùó Ks   Á'Bc                 ót  — |sy|j                   }| j                  }| j                  }t        t	        |«      «      D ]-  }||   \  }}|||      sŒ|dk  s||||      dz
  kD  sŒ(||ffc S  t        t	        |«      dz
  «      D ]3  }||   \  }}||dz      \  }}	||   ||   kD  sŒ"|	dkD  rdnd}
||f||
ffc S  y)a¹  
        Returns the minimal uncollected subwords.

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

        A word ``v`` defined on generators in ``X`` is a minimal
        uncollected subword of the word ``w`` if ``v`` is a subword
        of ``w`` and it has one of the following form

        * `v = {x_{i+1}}^{a_j}x_i`

        * `v = {x_{i+1}}^{a_j}{x_i}^{-1}`

        * `v = {x_i}^{a_j}`

        for `a_j` not in `\{1, \ldots, s-1\}`. Where, ``s`` is the power
        exponent of the corresponding generator.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> from sympy.combinatorics import free_group
        >>> G = SymmetricGroup(4)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> F, x1, x2 = free_group("x1, x2")
        >>> word = x2**2*x1**7
        >>> collector.minimal_uncollected_subword(word)
        ((x2, 2),)

        Nr   é   éÿÿÿÿ)Ú
array_formr   r,   Úranger   )r   ÚwordÚarrayÚrer,   r0   Ús1Úe1Ús2Úe2Úes              r   Úminimal_uncollected_subwordz%Collector.minimal_uncollected_subwordR   sî   € ñF Øà—‘ˆØ× Ñ ˆØ—
‘
ˆä”s˜5“zÓ"ò 	$ˆAØ˜1‘X‰FˆB�à�%˜‘)‹} " q¢&¨B°°E¸"±I±¸q±Ó,@Ø˜R˜�|Ò#ð		$ô ”s˜5“z !‘|Ó$ò 	+ˆAØ˜1‘X‰FˆB�Ø˜1˜Q™3‘Z‰FˆB�à�R‰y˜5 ™9Ó$Ø˜aš‘A R�Ø˜R˜ 2 q 'Ð*Ò*ð	+ð r   c                 óœ   — i }i }| j                   j                  «       D ](  \  }}t        |j                  «      dk(  r|||<   Œ$|||<   Œ* ||fS )a±  
        Separates the given relators of pc presentation in power and
        conjugate relations.

        Returns
        =======

        (power_rel, conj_rel)
            Separates pc presentation into power and conjugate relations.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> G = SymmetricGroup(3)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> power_rel, conj_rel = collector.relations()
        >>> power_rel
        {x0**2: (), x1**3: ()}
        >>> conj_rel
        {x0**-1*x1*x0: x1**2}

        See Also
        ========

        pc_relators

        r3   )r.   Úitemsr   r5   )r   Úpower_relatorsÚconjugate_relatorsÚkeyÚvalues        r   Ú	relationszCollector.relationsŒ   se   € ð< ˆØÐØ×.Ñ.×4Ñ4Ó6ò 	0‰JˆC�Ü�3—>‘>Ó" aÒ'Ø&+�˜sÒ#à*/Ð" 3Ò'ð		0ð
 Ð1Ð1Ð1r   c                 óÎ   — d}d}t        t        |«      t        |«      z
  dz   «      D ]8  }|j                  ||t        |«      z   «      |k(  sŒ%|}|t        |«      z   } ||fS  ||fS )aŒ  
        Returns the start and ending index of a given
        subword in a word.

        Parameters
        ==========

        word : FreeGroupElement
            word defined on free group elements for a
            polycyclic group.
        w : FreeGroupElement
            subword of a given word, whose starting and
            ending index to be computed.

        Returns
        =======

        (i, j)
            A tuple containing starting and ending index of ``w``
            in the given word. If not exists, (-1,-1) is returned.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> from sympy.combinatorics import free_group
        >>> G = SymmetricGroup(4)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> F, x1, x2 = free_group("x1, x2")
        >>> word = x2**2*x1**7
        >>> w = x2**2*x1
        >>> collector.subword_index(word, w)
        (0, 3)
        >>> w = x1**7
        >>> collector.subword_index(word, w)
        (2, 9)
        >>> w = x1**8
        >>> collector.subword_index(word, w)
        (-1, -1)

        r4   r3   )r6   r   Úsubword)r   r7   ÚwÚlowÚhighr0   s         r   Úsubword_indexzCollector.subword_index³   s{   € ðV ˆØˆÜ”s˜4“y¤ Q£Ñ'¨Ñ)Ó*ò 	ˆAØ�|‰|˜A˜q¤ Q£™xÓ(¨AÓ-Ø�Øœ˜Q›‘x�ØØ�DˆyÐð	ð
 �DˆyÐr   c                 ó¤   — |j                   }|d   d   }|d   d   }|df|df|dff}| j                  j                  |«      }| j                  |   S )a  
        Return a conjugate relation.

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

        Given a word formed by two free group elements, the
        corresponding conjugate relation with those free
        group elements is formed and mapped with the collected
        word in the polycyclic presentation.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> from sympy.combinatorics import free_group
        >>> G = SymmetricGroup(3)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> F, x0, x1 = free_group("x0, x1")
        >>> w = x1*x0
        >>> collector.map_relation(w)
        x1**2

        See Also
        ========

        pc_presentation

        r   r3   r4   )r5   r   Údtyper.   )r   rI   r8   r:   r<   rD   s         r   Úmap_relationzCollector.map_relationç   sd   € ð> —‘ˆØ�1‰X�a‰[ˆØ�1‰X�a‰[ˆØ�Bˆx˜"˜a˜ 2 q 'Ð*ˆØ�o‰o×#Ñ# CÓ(ˆØ×#Ñ# CÑ(Ð(r   c                 ó°  — | j                   }	 | j                  |«      }|s	 |S | j                  | |j                  |«      «      \  }}|dk(  rŒB|d   \  }}t	        |«      dk(  rá| j
                  | j                  |      }||z  }	||	|z  z
  }
|d   d   |ff} |j                  |«      }| j                  |   rE| j                  |   j                  }|d   \  }}|d   d   |
f||	|z  ff} |j                  |«      }n%|
dk7  r|d   d   |
ff} |j                  |«      }nd}|j                   |j                  |«      |«      }t	        |«      dk(  ry|d   d   dkD  rn|d   \  }}|dff} |j                  |«      }| j                   |j                  |«      «      }|||z  z  } |j                  |«      }|j                  |||«      }n‰t	        |«      dk(  r{|d   d   dk  rp|d   \  }}|dff} |j                  |«      }| j                   |j                  |«      «      }|dz  ||z  z  } |j                  |«      }|j                  |||«      }�ŒJ)a„  
        Return the collected form of a word.

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

        A word ``w`` is called collected, if `w = {x_{i_1}}^{a_1} * \ldots *
        {x_{i_r}}^{a_r}` with `i_1 < i_2< \ldots < i_r` and `a_j` is in
        `\{1, \ldots, {s_j}-1\}`.

        Otherwise w is uncollected.

        Parameters
        ==========

        word : FreeGroupElement
            An uncollected word.

        Returns
        =======

        word
            A collected word of form `w = {x_{i_1}}^{a_1}, \ldots,
            {x_{i_r}}^{a_r}` with `i_1, i_2, \ldots, i_r` and `a_j \in
            \{1, \ldots, {s_j}-1\}`.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> from sympy.combinatorics.perm_groups import PermutationGroup
        >>> from sympy.combinatorics import free_group
        >>> G = SymmetricGroup(4)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> F, x0, x1, x2, x3 = free_group("x0, x1, x2, x3")
        >>> word = x3*x2*x1*x0
        >>> collected_word = collector.collected_word(word)
        >>> free_to_perm = {}
        >>> free_group = collector.free_group
        >>> for sym, gen in zip(free_group.symbols, collector.pcgs):
        ...     free_to_perm[sym] = gen
        >>> G1 = PermutationGroup()
        >>> for w in word:
        ...     sym = w[0]
        ...     perm = free_to_perm[sym]
        ...     G1 = PermutationGroup([perm] + G1.generators)
        >>> G2 = PermutationGroup()
        >>> for w in collected_word:
        ...     sym = w[0]
        ...     perm = free_to_perm[sym]
        ...     G2 = PermutationGroup([perm] + G2.generators)

        The two are not identical, but they are equivalent:

        >>> G1.equals(G2), G1 == G2
        (True, False)

        See Also
        ========

        minimal_uncollected_subword

        r4   r   r3   Né   )r   r?   rL   rN   r   r   r,   r.   r5   Úeliminate_wordrO   Úsubstituted_word)r   r7   r   rI   rJ   rK   r:   r;   r9   ÚqÚrrD   ÚpresentationÚsymÚexpÚword_r<   r=   s                     r   Úcollected_wordzCollector.collected_word  s²  € ðB —_‘_ˆ
ØØ×0Ñ0°Ó6ˆAÙØðZ ˆðW ×*Ñ*¨4Ð1A°×1AÑ1AÀ!Ó1DÓE‰IˆC�Ø�bŠyØà�q‘T‰FˆB�Ü�1‹v˜Š{Ø×(Ñ(¨¯©°B©Ñ8�Ø˜"‘H�Ø�q˜‘t‘G�à˜!™˜Q™ �}Ð'�Ø&�j×&Ñ& sÓ+�Ø×'Ñ'¨Ò,Ø#'×#7Ñ#7¸Ñ#<×#GÑ#G�LØ+¨A™‘H�C˜Ø ™d 1™g q˜\¨C°°3±¨<Ð8�EØ,˜J×,Ñ,¨UÓ3‘Eà˜A’vØ"# A¡$ q¡'¨1 Ð 0˜Ø 0 
× 0Ñ 0°Ó 7™à $˜Ø×*Ñ*Ð+;¨:×+;Ñ+;¸AÓ+>ÀÓF�ä�1‹v˜Š{˜q ™t A™w¨š{Ø˜1™‘��BØ˜1�g�[�Ø%�Z×%Ñ% bÓ)�Ø×)Ñ)Ð*:¨*×*:Ñ*:¸1Ó*=Ó>�Ø˜5 "™9™�Ø(˜
×(Ñ(¨Ó/�Ø×,Ñ,¨S°$¸Ó>‘ä�Q“˜1’  1¡ a¡¨1¢Ø˜1™‘��BØ˜1�g�[�Ø%�Z×%Ñ% bÓ)�Ø×)Ñ)Ð*:¨*×*:Ñ*:¸1Ó*=Ó>�Ø˜B™˜u b™yÑ(�Ø(˜
×(Ñ(¨Ó/�Ø×,Ñ,¨S°$¸Ó>�ñ] r   c                 ó°  — | j                   }| j                  }i }i }| j                  }t        ||j                  «      D ]  \  }}|dz  ||dz  <   |||<   Œ |ddd…   }| j
                  ddd…   }|ddd…   }g }	t        |«      D �]L  \  }
}||
   }||   |z  }||
   }|j                  ||z  d¬«      }|j                  «        |j                  }|D ]
  }|||   z  }Œ | j                  |«      }|r|nd||<   || _        |	j                  |«       t        |	«      dkD  sŒ›|	t        |	«      dz
     }||   }t        t        |	«      dz
  «      D ]‚  }||	|      }|dz  |z  |z  }|dz  |	|   z  |z  }|j                  |d¬«      }|j                  «        |j                  }|D ]
  }|||   z  }Œ | j                  |«      }|r|nd||<   || _        Œ„ �ŒO |S )aM  
        Return the polycyclic presentation.

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

        There are two types of relations used in polycyclic
        presentation.

        * Power relations : Power relators are of the form `x_i^{re_i}`,
          where `i \in \{0, \ldots, \mathrm{len(pcgs)}\}`, ``x`` represents polycyclic
          generator and ``re`` is the corresponding relative order.

        * Conjugate relations : Conjugate relators are of the form `x_j^-1x_ix_j`,
          where `j < i \in \{0, \ldots, \mathrm{len(pcgs)}\}`.

        Returns
        =======

        A dictionary with power and conjugate relations as key and
        their collected form as corresponding values.

        Notes
        =====

        Identity Permutation is mapped with empty ``()``.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> from sympy.combinatorics.permutations import Permutation
        >>> S = SymmetricGroup(49).sylow_subgroup(7)
        >>> der = S.derived_series()
        >>> G = der[len(der)-2]
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> pcgs = PcGroup.pcgs
        >>> len(pcgs)
        6
        >>> free_group = collector.free_group
        >>> pc_resentation = collector.pc_presentation
        >>> free_to_perm = {}
        >>> for s, g in zip(free_group.symbols, pcgs):
        ...     free_to_perm[s] = g

        >>> for k, v in pc_resentation.items():
        ...     k_array = k.array_form
        ...     if v != ():
        ...        v_array = v.array_form
        ...     lhs = Permutation()
        ...     for gen in k_array:
        ...         s = gen[0]
        ...         e = gen[1]
        ...         lhs = lhs*free_to_perm[s]**e
        ...     if v == ():
        ...         assert lhs.is_identity
        ...         continue
        ...     rhs = Permutation()
        ...     for gen in v_array:
        ...         s = gen[0]
        ...         e = gen[1]
        ...         rhs = rhs*free_to_perm[s]**e
        ...     assert lhs == rhs

        r4   NT©Úoriginalr&   r3   )r   r   r   ÚzipÚ
generatorsr   r*   Úgenerator_productÚreverseÚidentityrZ   r.   Úappendr   r6   )r   r   Ú	rel_orderr-   Úperm_to_freer   Úgenr1   ÚseriesÚcollected_gensr0   r9   ÚrelationÚGÚlr7   ÚgÚconjÚ
conjugatorÚjÚ
conjugatedÚgenss                         r   r-   zCollector.pc_relatorsƒ  sM  € ðF —_‘_ˆ
Ø×'Ñ'ˆ	ØˆØˆØ�y‰yˆä˜$ 
× 5Ñ 5Ó6ò 	"‰FˆC�Ø$% r¡EˆL˜˜b™Ñ!Ø !ˆL˜Òð	"ð ‘D�b�D‰zˆØ—‘¡ " Ñ%ˆØ™d ˜d‘Oˆ	Øˆä “oó #	7‰FˆAˆsØ˜1‘ˆBØ# CÑ(¨"Ñ,ˆHØ�q‘	ˆAà×#Ñ# C¨¡G¸Ð#Ó=ˆAØ�I‰IŒKà×&Ñ&ˆDØò ,�Ø˜L¨™OÑ+‘ð,ð ×&Ñ& tÓ,ˆDÙ,0¡D°bˆK˜Ñ!Ø#.ˆDÔ à×!Ñ! #Ô&Ü�>Ó" QÓ&Ø%¤c¨.Ó&9¸!Ñ&;Ñ<�Ø)¨$Ñ/�
äœs >Ó2°1Ñ4Ó5ò 7�AØ!-¨n¸QÑ.?Ñ!@�Jà)¨2™~¨jÑ8¸ÑC�HØ ™8 N°1Ñ$5Ñ5°dÑ:�Dà×+Ñ+¨D¸TÐ+ÓB�AØ—I‘I”KØ%×.Ñ.�DØò 4˜Ø# L°¡OÑ3™ð4ð  ×.Ñ.¨tÓ4�DÙ48©D¸b�K Ñ)Ø+6�DÕ(ò7ð+#	7ðJ Ðr   c                 ó  — | j                   }t        «       }| j                  D ]  }t        |g|j                  z   «      }Œ |j	                  |d¬«      }|j                  «        i }t        |j                  | j                  «      D ]  \  }}|dz  ||dz  <   |||<   Œ |j                  }|D ]
  }|||   z  }Œ | j                  |«      }	| j                  }
dgt        |«      z  }|	j                  }	|	D ]  }|d   ||
|d      <   Œ |S )aJ  
        Return the exponent vector of length equal to the
        length of polycyclic generating sequence.

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

        For a given generator/element ``g`` of the polycyclic group,
        it can be represented as `g = {x_1}^{e_1}, \ldots, {x_n}^{e_n}`,
        where `x_i` represents polycyclic generators and ``n`` is
        the number of generators in the free_group equal to the length
        of pcgs.

        Parameters
        ==========

        element : Permutation
            Generator of a polycyclic group.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> from sympy.combinatorics.permutations import Permutation
        >>> G = SymmetricGroup(4)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> pcgs = PcGroup.pcgs
        >>> collector.exponent_vector(G[0])
        [1, 0, 0, 0]
        >>> exp = collector.exponent_vector(G[1])
        >>> g = Permutation()
        >>> for i in range(len(exp)):
        ...     g = g*pcgs[i]**exp[i] if exp[i] else g
        >>> assert g == G[1]

        References
        ==========

        .. [1] Holt, D., Eick, B., O'Brien, E.
               "Handbook of Computational Group Theory"
               Section 8.1.1, Definition 8.4

        Tr\   r4   r   r3   )r   r   r   r_   r`   ra   r^   rb   rZ   r,   r   r5   )r   Úelementr   rj   rl   rq   re   rW   rI   r7   r,   Ú
exp_vectorÚts                r   Úexponent_vectorzCollector.exponent_vectorü  s)  € ðZ —_‘_ˆ
ÜÓˆØ—‘ò 	5ˆAÜ  !  q§|¡|Ñ!3Ó4‰Að	5à×"Ñ" 7°tÐ"Ó<ˆØ�‰ŒàˆÜ˜*×/Ñ/°·±Ó;ò 	"‰FˆC�Ø"% r¡'ˆL˜˜B™ÑØ!ˆL˜ŠOð	"ð ×ÑˆØò 	"ˆAØ�,˜q‘/Ñ!‰Að	"ð ×"Ñ" 1Ó%ˆà—
‘
ˆØ�Sœ˜Z›Ñ(ˆ
Ø�‰ˆØò 	+ˆAØ&'¨¡dˆJ�u˜Q˜q™T‘{Ò#ð	+àÐr   c                 óˆ   — | j                  |«      }t        d„ t        |«      D «       t        | j                  «      dz   «      S )a  
        Return the depth of a given element.

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

        The depth of a given element ``g`` is defined by
        `\mathrm{dep}[g] = i` if `e_1 = e_2 = \ldots = e_{i-1} = 0`
        and `e_i != 0`, where ``e`` represents the exponent-vector.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> G = SymmetricGroup(3)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> collector.depth(G[0])
        2
        >>> collector.depth(G[1])
        1

        References
        ==========

        .. [1] Holt, D., Eick, B., O'Brien, E.
               "Handbook of Computational Group Theory"
               Section 8.1.1, Definition 8.5

        c              3   ó2   K  — | ]  \  }}|sŒ	|d z   –— Œ y­w)r3   Nr&   )r   r0   Úxs      r   r   z"Collector.depth.<locals>.<genexpr>a  s   è ø€ Ò@™T˜Q ºa�Q�q•SÑ@ùs   ‚
�
r3   )rv   Únextr*   r   r   )r   rs   rt   s      r   ÚdepthzCollector.depthA  s:   € ð> ×)Ñ)¨'Ó2ˆ
ÜÑ@¤Y¨zÓ%:Ô@Ä#ÀdÇiÁiÃ.ÐQRÑBRÓSÐSr   c                 óŽ   — | j                  |«      }| j                  |«      }|t        | j                  «      dz   k7  r||dz
     S y)a  
        Return the leading non-zero exponent.

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

        The leading exponent for a given element `g` is defined
        by `\mathrm{leading\_exponent}[g]` `= e_i`, if `\mathrm{depth}[g] = i`.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> G = SymmetricGroup(3)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> collector.leading_exponent(G[1])
        1

        r3   N)rv   r{   r   r   )r   rs   rt   r{   s       r   Úleading_exponentzCollector.leading_exponentc  sI   € ð* ×)Ñ)¨'Ó2ˆ
Ø—
‘
˜7Ó#ˆØ”C˜Ÿ	™	“N 1Ñ$Ò$Ø˜e A™gÑ&Ð&Ør   c                 ót  — |}| j                  |«      }|t        | j                  «      k  rŒ||dz
     dk7  r�||dz
     }| j                  |«      | j                  |«      dz  z  }|| j                  |dz
     z  }|| z  |z  }| j                  |«      }|t        | j                  «      k  r||dz
     dk7  rŒ�|S )Nr3   r4   )r{   r   r   r}   r   )r   Úzrl   ÚhÚdÚkr>   s          r   Ú_siftzCollector._sift~  sÀ   € ØˆØ�J‰J�q‹MˆØ”#�d—i‘i“.Ò  Q q¨¡s¡V¨q¢[Ø�!�A‘#‘ˆAØ×%Ñ% aÓ(¨$×*?Ñ*?ÀÓ*BÀRÑ)GÑGˆAØ�D×'Ñ'¨¨!©Ñ,Ñ,ˆAØ�A�2‘�a‘ˆAØ—
‘
˜1“ˆAð ”#�d—i‘i“.Ò  Q q¨¡s¡V¨q£[ð ˆr   c                 ó|  — dgt        | j                  «      z  }|}|r„|j                  d«      }| j                  ||«      }| j	                  |«      }|t        | j                  «      k  r5|D ](  }|dk7  sŒ	|j                  |dz  |dz  z  |z  |z  «       Œ* |||dz
  <   |rŒ„|D �cg c]
  }|dk7  sŒ	|‘Œ }}|S c c}w )a8  

        Parameters
        ==========

        gens : list
            A list of generators on which polycyclic subgroup
            is to be defined.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import SymmetricGroup
        >>> S = SymmetricGroup(8)
        >>> G = S.sylow_subgroup(2)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> gens = [G[0], G[1]]
        >>> ipcgs = collector.induced_pcgs(gens)
        >>> [gen.order() for gen in ipcgs]
        [2, 2, 2]
        >>> G = S.sylow_subgroup(3)
        >>> PcGroup = G.polycyclic_group()
        >>> collector = PcGroup.collector
        >>> gens = [G[0], G[1]]
        >>> ipcgs = collector.induced_pcgs(gens)
        >>> [gen.order() for gen in ipcgs]
        [3]

        r3   r   r4   )r   r   Úpoprƒ   r{   rc   )r   rq   r   rj   rl   r€   r�   rf   s           r   Úinduced_pcgszCollector.induced_pcgs‰  sÊ   € ð> ˆC”�D—I‘I“ÑˆØˆÙØ—‘�a“ˆAØ—
‘
˜1˜aÓ ˆAØ—
‘
˜1“ˆAØ”3�t—y‘y“>Ò!Øò 6�CØ˜a“xØŸ™  B¡ s¨B¡w¡¨q¡°Ñ!4Õ5ð6ð ��!�A‘#‘ò ð Ö*�S ¨£ŠSÐ*ˆÐ*Øˆùò +s   Â&
B9Â1B9c                 ó~  — dgt        |«      z  }|}| j                  |«      }t        |«      D ]†  \  }}| j                  |«      |k(  sŒ| j                  |«      | j                  |«      z  }|| j                  |dz
     z  }|| z  |z  }|||<   | j                  |«      }| j                  |«      |k(  rŒlŒˆ |dk(  r|S y)z>
        Return the exponent vector for induced pcgs.
        r   r3   F)r   r{   r*   r}   r   )	r   Úipcgsrl   r>   r€   r�   r0   rf   Úfs	            r   Úconstructive_membership_testz&Collector.constructive_membership_test¶  sÎ   € ð ˆC”�E“
‰NˆØˆØ�J‰J�q‹MˆÜ Ó&ò 	"‰FˆAˆsØ—*‘*˜S“/ QÓ&Ø×)Ñ)¨!Ó,¨T×-BÑ-BÀ3Ó-GÑG�Ø˜×+Ñ+¨A¨a©CÑ0Ñ0�Ø˜1˜"‘I˜a‘K�Ø��!‘Ø—J‘J˜q“M�ð —*‘*˜S“/ QÔ&ð	"ð �Š6ØˆHØr   )NN)r!   r"   r#   Ú__doc__r   r?   rF   rL   rO   rZ   r-   rv   r{   r}   rƒ   r†   rŠ   r&   r   r   r   r   *   sU   „ ñó2ò:8òt%2òN2òh$)òNròjwòrCòJ TòDò6	ò+óZr   r   N)
Úsympy.ntheory.primetestr   Úsympy.combinatorics.perm_groupsr   Úsympy.printing.defaultsr   Úsympy.combinatorics.free_groupsr   r	   r   r&   r   r   ú<module>r�      s,   ðÝ +Ý <Ý 3Ý 6ô �oô  ôF\
�õ \
r   