+
    ‹°³jº   ã                   ór   € ^ RI Ht ^ RIHt ^ RIHt ]P                  tR tR tR t	R t
R tR	 tR
 tR tR# )é    )ÚDirectProduct)ÚPermutationGroup)ÚPermutationc                 ó°   € . p^ p^pV  F-  pW$,          pW4,          pVP                  \        V4      4       K/  	  \        V!  pRVn        W%n        W5n        V# )aX  
Returns the direct product of cyclic groups with the given orders.

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

According to the structure theorem for finite abelian groups ([1]),
every finite abelian group can be written as the direct product of
finitely many cyclic groups.

Examples
========

>>> from sympy.combinatorics.named_groups import AbelianGroup
>>> AbelianGroup(3, 4)
PermutationGroup([
        (6)(0 1 2),
        (3 4 5 6)])
>>> _.is_group
True

See Also
========

DirectProduct

References
==========

.. [1] https://groupprops.subwiki.org/wiki/Structure_theorem_for_finitely_generated_abelian_groups

T)ÚappendÚCyclicGroupr   Ú_is_abelianÚ_degreeÚ_order)Úcyclic_ordersÚgroupsÚdegreeÚorderÚsizeÚGs   *     Úa/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/combinatorics/named_groups.pyÚAbelianGroupr      s_   € ðB €FØ€FØ€EÛˆØ�ˆØ�ˆØ�‰”k $Ó'Ö(ñ ô 	�vÑ€AØ€A„MØ„IØ„Hà€Hó    c                ó:  € V R9   d   \        \        ^ .4      .4      # \        \        V 4      4      pV^,          V^,          V^ ,          uV^ &   V^&   V^&   TpV ^,          '       d*   \        \        ^V 4      4      pVP	                  ^ 4       TpM:\        \        ^V 4      4      pVP	                  ^4       VP                  ^ ^ 4       TpW#.pW#8X  d
   VR,          p\        V Uu. uF  p\        V4      NK  	  upRR7      p\        WPV 4       RVn        V# u upi )aÕ  
Generates the alternating group on ``n`` elements as a permutation group.

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

For ``n > 2``, the generators taken are ``(0 1 2), (0 1 2 ... n-1)`` for
``n`` odd
and ``(0 1 2), (1 2 ... n-1)`` for ``n`` even (See [1], p.31, ex.6.9.).
After the group is generated, some of its basic properties are set.
The cases ``n = 1, 2`` are handled separately.

Examples
========

>>> from sympy.combinatorics.named_groups import AlternatingGroup
>>> G = AlternatingGroup(4)
>>> G.is_group
True
>>> a = list(G.generate_dimino())
>>> len(a)
12
>>> all(perm.is_even for perm in a)
True

See Also
========

SymmetricGroup, CyclicGroup, DihedralGroup

References
==========

.. [1] Armstrong, M. "Groups and Symmetry"

:Né   NF)ÚdupsT)r   é   )	r   r   ÚlistÚranger   ÚinsertÚ_af_newÚ set_alternating_group_propertiesÚ_is_alt)ÚnÚaÚgen1Úgen2Úgensr   s   &     r   ÚAlternatingGroupr$   8   s   € ðL 	ˆF„{Ü¤¨a¨SÓ!1Ð 2Ó3Ð3äŒU�1‹X‹€AØ˜•t˜Q˜q�T 1 Q¥4Ð€A€a�Dˆ!ˆA‰$��!‘Ø€DØˆ1‡u„uÜ”�q˜!“ÓˆØ	�‰�ŒØ‰ä”�q˜!“ÓˆØ	�‰�ŒØ	�‰��AŒØˆØˆ<€DØ„|Ø�B�xˆÜ©dÓ3©d¨œ' !ž*©dÑ3¸%Ô@€Aä$ Q¨1Ô-Ø€A„IØ€Hùò	 4s   Ã&Dc                ó¢   € V^8  d   RV n         RV n        MRV n         RV n        V^8  d	   RV n        MRV n        W n        RV n        RV n        R# )z.Set known properties of an alternating group. TFN©r	   Ú_is_nilpotentÚ_is_solvabler
   Ú_is_transitiveÚ_is_dihedral©r   r   r   s   &&&r   r   r   w   sN   € àˆ1„uØˆŒØˆ�àˆŒØˆŒØˆ1„uØˆ�àˆŒØ„IØ€AÔØ€A†Nr   c                óä   € \        \        ^V 4      4      pVP                  ^ 4       \        V4      p\	        V.4      pRVn        RVn        RVn        Wn        RVn	        Wn
        V ^8H  Vn        V# )ag  
Generates the cyclic group of order ``n`` as a permutation group.

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

The generator taken is the ``n``-cycle ``(0 1 2 ... n-1)``
(in cycle notation). After the group is generated, some of its basic
properties are set.

Examples
========

>>> from sympy.combinatorics.named_groups import CyclicGroup
>>> G = CyclicGroup(6)
>>> G.is_group
True
>>> G.order()
6
>>> list(G.generate_schreier_sims(af=True))
[[0, 1, 2, 3, 4, 5], [1, 2, 3, 4, 5, 0], [2, 3, 4, 5, 0, 1],
[3, 4, 5, 0, 1, 2], [4, 5, 0, 1, 2, 3], [5, 0, 1, 2, 3, 4]]

See Also
========

SymmetricGroup, DihedralGroup, AlternatingGroup

T)r   r   r   r   r   r	   r'   r(   r
   r)   r   r*   )r   r    Úgenr   s   &   r   r   r   ˆ   sk   € ô< 	ŒU�1�a‹[Ó€AØ‡H�HˆQ„KÜ
�!‹*€CÜ˜#˜Ó€Aà€A„MØ€A„OØ€A„NØ„IØ€AÔØ„HØ˜1‘f€A„NØ€Hr   c                ó,  € V ^8X  d   \        \        ^^ .4      .4      # V ^8X  d0   \        \        . RO4      \        . RO4      \        . RO4      .4      # \        \        ^V 4      4      pVP	                  ^ 4       \        V4      p\        \        V 4      4      pVP                  4        \        V4      p\        W#.4      pW ^,
          ,          ^ 8X  d	   RVn        MRVn        RVn        RVn	        RVn
        Wn        RVn        ^V ,          Vn        V# )a  
Generates the dihedral group `D_n` as a permutation group.

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

The dihedral group `D_n` is the group of symmetries of the regular
``n``-gon. The generators taken are the ``n``-cycle ``a = (0 1 2 ... n-1)``
(a rotation of the ``n``-gon) and ``b = (0 n-1)(1 n-2)...``
(a reflection of the ``n``-gon) in cycle rotation. It is easy to see that
these satisfy ``a**n = b**2 = 1`` and ``bab = ~a`` so they indeed generate
`D_n` (See [1]). After the group is generated, some of its basic properties
are set.

Examples
========

>>> from sympy.combinatorics.named_groups import DihedralGroup
>>> G = DihedralGroup(5)
>>> G.is_group
True
>>> a = list(G.generate_dimino())
>>> [perm.cyclic_form for perm in a]
[[], [[0, 1, 2, 3, 4]], [[0, 2, 4, 1, 3]],
[[0, 3, 1, 4, 2]], [[0, 4, 3, 2, 1]], [[0, 4], [1, 3]],
[[1, 4], [2, 3]], [[0, 1], [2, 4]], [[0, 2], [3, 4]],
[[0, 3], [1, 2]]]

See Also
========

SymmetricGroup, CyclicGroup, AlternatingGroup

References
==========

.. [1] https://en.wikipedia.org/wiki/Dihedral_group

TF)r   r   é   r   )r   r/   r   r   )r/   r   r   r   )r   r   r   r   r   r   Úreverser'   r*   r	   r(   r
   r)   r   )r   r    r!   r"   r   s   &    r   ÚDihedralGroupr1   µ   só   € ðR 	ˆA„vÜ¤¨a°¨VÓ!4Ð 5Ó6Ð6ØˆA„vÜ¤ª\Ó!:Üš<Ó(¬+²lÓ*Cð!Eó Fð 	Fô 	ŒU�1�a‹[Ó€AØ‡H�HˆQ„KÜ�1‹:€DÜŒU�1‹X‹€AØ‡I�I„KÜ�1‹:€DÜ˜$˜Ó&€Aàˆa�C…y�A„~Øˆ�àˆŒØ€A„NØ€A„MØ€A„NØ„IØ€AÔØ��s€A„HØ€Hr   c                ó�  € V ^8X  d   \        \        ^ .4      .4      pM”V ^8X  d   \        \        ^^ .4      .4      pMu\        \        ^V 4      4      pVP	                  ^ 4       \        V4      p\        \        V 4      4      pV^,          V^ ,          uV^ &   V^&   \        V4      p\        W4.4      p\        WV 4       RVn        V# )aÜ  
Generates the symmetric group on ``n`` elements as a permutation group.

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

The generators taken are the ``n``-cycle
``(0 1 2 ... n-1)`` and the transposition ``(0 1)`` (in cycle notation).
(See [1]). After the group is generated, some of its basic properties
are set.

Examples
========

>>> from sympy.combinatorics.named_groups import SymmetricGroup
>>> G = SymmetricGroup(4)
>>> G.is_group
True
>>> G.order()
24
>>> list(G.generate_schreier_sims(af=True))
[[0, 1, 2, 3], [1, 2, 3, 0], [2, 3, 0, 1], [3, 1, 2, 0], [0, 2, 3, 1],
[1, 3, 0, 2], [2, 0, 1, 3], [3, 2, 0, 1], [0, 3, 1, 2], [1, 0, 2, 3],
[2, 1, 3, 0], [3, 0, 1, 2], [0, 1, 3, 2], [1, 2, 0, 3], [2, 3, 1, 0],
[3, 1, 0, 2], [0, 2, 1, 3], [1, 3, 2, 0], [2, 0, 3, 1], [3, 2, 1, 0],
[0, 3, 2, 1], [1, 0, 3, 2], [2, 1, 0, 3], [3, 0, 2, 1]]

See Also
========

CyclicGroup, DihedralGroup, AlternatingGroup

References
==========

.. [1] https://en.wikipedia.org/wiki/Symmetric_group#Generators_and_relations

T)r   r   r   r   r   r   Úset_symmetric_group_propertiesÚ_is_sym)r   r   r    r!   r"   s   &    r   ÚSymmetricGroupr5   ù   s´   € ðN 	ˆA„vÜœk¨1¨#Ó.Ð/Ó0‰Ø	
ˆaŒÜœk¨1¨a¨&Ó1Ð2Ó3‰ä”�q˜!“ÓˆØ	�‰�ŒÜ�q‹zˆÜ”�q“‹NˆØ�q•T˜1˜Q�4ˆ
ˆˆ!‰ˆa�‰dÜ�q‹zˆÜ˜d˜\Ó*ˆÜ" 1¨Ô+Ø€A„IØ€Hr   c                ó¨   € V^8  d   RV n         RV n        MRV n         RV n        V^8  d	   RV n        MRV n        W n        RV n        VR9   V n        R# )z+Set known properties of a symmetric group. TFN)r   r/   r&   r+   s   &&&r   r3   r3   1  sR   € àˆ1„uØˆŒØˆ�àˆŒØˆŒØˆ1„uØˆ�àˆŒØ„IØ€AÔØ˜6‘k€A†Nr   c                óT   € ^ RI Hp V ^8:  d   \        R4      h\        V! V 4      4      # )z‡Return a group of Rubik's cube generators

>>> from sympy.combinatorics.named_groups import RubikGroup
>>> RubikGroup(2).is_group
True
)Úrubikz(Invalid cube. n has to be greater than 1)Úsympy.combinatorics.generatorsr8   Ú
ValueErrorr   )r   r8   s   & r   Ú
RubikGroupr;   B  s)   € õ 5ØˆA„vÜÐCÓDÐDÜ™E !›HÓ%Ð%r   N)Ú$sympy.combinatorics.group_constructsr   Úsympy.combinatorics.perm_groupsr   Ú sympy.combinatorics.permutationsr   r   r   r$   r   r   r1   r5   r3   r;   © r   r   Ú<module>r@      sG   ðÝ >Ý <Ý 8à
×
Ñ
€ò-ò`<ò~ò"*òZAòH5òp#ô"
&r   