+
    i7                     ^    ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHt R t	R t
R tR tR	 tR
 tR# )    Permutation)symbolsMatrix)
variationsrotate_leftc              #  Z   "   R \        \        V 4      V 4       4        Rj  xL
  R#  L5i)z
Generates the symmetric group of order n, Sn.

Examples
========

>>> from sympy.combinatorics.generators import symmetric
>>> list(symmetric(3))
[(2), (1 2), (2)(0 1), (0 1 2), (0 2 1), (0 2)]
c              3   8   "   T F  p\        V4      x  K  	  R # 5iNr   ).0perms   & \/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/combinatorics/generators.py	<genexpr>symmetric.<locals>.<genexpr>   s     F.EdD!!.Es   N)r   range)ns   &r   	symmetricr      s!      Gjq1.EFFFs    +)+c              #     "   \        \        V 4      4      p\        V 4       F  p\        V4      x  \        V^4      pK  	  R# 5i)z
Generates the cyclic group of order n, Cn.

Examples
========

>>> from sympy.combinatorics.generators import cyclic
>>> list(cyclic(5))
[(4), (0 1 2 3 4), (0 2 4 1 3),
 (0 3 1 4 2), (0 4 3 2 1)]

See Also
========

dihedral
N)listr   r   r	   r   genis   &  r   cyclicr      s9     " uQx.C1X##q! s   AAc              #     "   \        \        V 4      V 4       F&  p\        V4      pVP                  '       g   K"  Vx  K(  	  R# 5i)z
Generates the alternating group of order n, An.

Examples
========

>>> from sympy.combinatorics.generators import alternating
>>> list(alternating(3))
[(2), (0 1 2), (0 2 1)]
N)r   r   r   is_even)r   r   ps   &  r   alternatingr   ,   s4      58Q'999G (s
   3A
Ac              #    "   V ^8X  d!   \        ^ ^.4      x  \        ^^ .4      x  R# V ^8X  d?   \        . RO4      x  \        . RO4      x  \        . RO4      x  \        . RO4      x  R# \        \        V 4      4      p\        V 4       F3  p\        V4      x  \        VRRR1,          4      x  \        V^4      pK5  	  R# 5i)a  
Generates the dihedral group of order 2n, Dn.

The result is given as a subgroup of Sn, except for the special cases n=1
(the group S2) and n=2 (the Klein 4-group) where that's not possible
and embeddings in S2 and S4 respectively are given.

Examples
========

>>> from sympy.combinatorics.generators import dihedral
>>> list(dihedral(3))
[(2), (0 2), (0 1 2), (1 2), (0 2 1), (2)(0 1)]

See Also
========

cyclic
N)r            )r    r   r"   r!   )r!   r"   r   r    )r"   r!   r    r   )r   r   r   r	   r   s   &  r   dihedralr$   =   s     ( 	Av1a&!!1a&!!	
a,'','','',''58nqAc""c$B$i((c1%C s   CCc                     . RO. RO. RO. RO. RO. RO.p V  UUUu. uF7  p\        V UUu. uF  q" Uu. uF  q3^,
          NK  	  upNK  	  upp^0R7      NK9  	  uppp# u upi u uppi u upppi )zhReturn the permutations of the 3x3 Rubik's cube, see
https://www.gap-system.org/Doc/Examples/rubik.html
)size))r    r"         )r!            )	   !         )
   "         )   #         ))r,   r4         )r0            )r    r/   )   (   )r+      ,   %   )r(      .   r5   ))r/   r7      rB   )r3         r?   )r(   r.   +   r8   )r*      *   r:   )r'      r=   r4   ))r.   r6       rJ   )r2         rH   )r"   &   rG   r7   )r)   $   -   rE   )r'   r-   0   rD   ))r-   r5   r>   rN   )r1   rA   '   rO   )r"   r,   rC   rK   )r!   r<   /   rL   )r    r9   rQ   r6   ))r=   rG   rQ   rC   )rI   rP   rS   r@   )r9   rB   rJ   rN   )r;   rF   rM   rR   )r8   rD   rK   r>   r   )axxir   s       r   rubik_cube_generatorsrW   a   sr    
						-	A NOOQKq9q,Aa%%,q9CQOO,9Os'   A(A"AA"
A(A""A(c                  a aaaaaaaaaaaaaaaaaaaaaa  S ^8  d   \        R4      hVV 3R loV3R loV3R loVV 3R loVV 3R loVV 3R loVV 3R lo VV 3R	 loRVV 3R
 lloV3R loRVVVVVVVVVVVVVV 3R lloV3R lpRVVVVVVVVV3	R lloV3R lpRVVVVVVVVV3	R lloV3R lp\        R4      ;w  ooooooo/ o^ p\        ^4       FO  p. p\        S ^,          4       F  pVP                  V4       V^,          pK  	  \	        S S V4      SSV,          &   KQ  	  RVVV3R llp. o\        \        ^S ^,          ,          4      4      p	\        S ^,
          4       F  p
S! V
4       V! 4        V! V
4       K  	  V! ^4      V	8X  g   Q hS! 4        \        S ^,
          4       F(  p
S! V
4       V! 4        V! 4        S! 4        V! V
4       K*  	  V! 4        V! ^4      V	8X  g   Q hS! 4        V! 4        V! 4        \        S ^,
          4       FD  p
S! V
4       S! 4        S! 4        V! 4        V! 4        S! 4        V! 4        V! 4        V! V
4       KF  	  S! 4        S! 4        V! 4        V! ^4      V	8X  g   Q hS# )a  Return permutations for an nxn Rubik's cube.

Permutations returned are for rotation of each of the slice
from the face up to the last face for each of the 3 sides (in this order):
front, right and bottom. Hence, the first n - 1 permutations are for the
slices from the front.
zdimension of cube must be > 1c                 B   < SV ,          P                  SV,
          4      # r   colfr   facesr   s   &&r   getrrubik.<locals>.getr       Qx||AE""    c                 B   < SV ,          P                  V^,
          4      # r    rZ   r]   r   r^   s   &&r   getlrubik.<locals>.getl   ra   rb   c                 B   < SV ,          P                  V^,
          4      # rd   rowre   s   &&r   geturubik.<locals>.getu   ra   rb   c                 B   < SV ,          P                  SV,
          4      # r   ri   r\   s   &&r   getdrubik.<locals>.getd   ra   rb   c                 H   < \        S^V4      SV ,          RSV,
          3&   R# r    :NNNNr   r]   r   sr^   r   s   &&&r   setrrubik.<locals>.setr   !    #Aq!_aAErb   c                 H   < \        S^V4      SV ,          RV^,
          3&   R# rq   r   rr   s   &&&r   setlrubik.<locals>.setl   rv   rb   c                 H   < \        ^SV4      SV ,          V^,
          R3&   R# rq   r   rr   s   &&&r   seturubik.<locals>.setu   !    #Aq!_aQrb   c                 H   < \        ^SV4      SV ,          SV,
          R3&   R# rq   r   rr   s   &&&r   setdrubik.<locals>.setd   r}   rb   c                    < \        V4       Fd  pSV ,          p. p\        S4       F7  p\        S^,
          RR4       F  pVP                  W1V3,          4       K  	  K9  	  \        SSV4      SV &   Kf  	  R# )r    Nr#   )r   appendr   )Fr_facervcr^   r   s   &&    r   cwrubik.<locals>.cw   sj    qA8DB1Xq1ub"-AIIda4j) .  aB'E!H rb   c                    < S! V ^4       R# r"   N )r   r   s   &r   ccwrubik.<locals>.ccw   s    
1arb   c                 f  < \        V4       F  pV ^ 8X  d	   S	! S4       V ^,          p S! SV 4      pS! SV \        S! SV 4      4      4       S! SV \        \        S! SV 4      4      4      4       S! SV \        S
! SV 4      4      4       S! SV \        \        V4      4      4       V ^,          p K  	  R# )r   N)r   r   reversed)r   r   r   tempDr   LRUr   rn   rf   r_   rk   r   rx   rt   r{   s   &&  r   fcwrubik.<locals>.fcw   s    qAAv1FA1:DAtDAJ'(AtHT!QZ012AtDAJ'(AtHTN+,FA rb   c                    < S! V ^4       R# r   r   )r   r   s   &r   fccwrubik.<locals>.fccw   s    Aq	rb   c                    <	 \        V 4       Fe  pS
! S4       S	! S4       S
! S4       SS,          pS
! S4       SS,          SS&   S
! S4       SS,          SS&   S
! S4       SS,          SS&   VSS&   Kg  	  R # r   r   r   r   tBr   r   r   r   r   r   r   r^   s   &  r   FCWrubik.<locals>.FCW   st    qAqEFqEaAqEQxE!HqEQxE!HqEQxE!HE!H rb   c                     < S ! ^4       R# r   r   )r   s   r   FCCWrubik.<locals>.FCCW   
    Arb   c                    <	 \        V 4       FE  pS
! S4       S	! S4       SS,          pSS,          SS&   SS,          SS&   SS,          SS&   VSS&   KG  	  R # r   r   r   s   &  r   UCWrubik.<locals>.UCW   sX    qAqEFaAQxE!HQxE!HQxE!HE!H rb   c                     < S ! ^4       R# r   r   )r   s   r   UCCWrubik.<locals>.UCCW   r   rb   zU, F, R, B, L, Dc                    < . pS F  pVP                  SV,          4       K  	  V '       d   V# SP                  \        V4      4       R # r   )extendr   r   )showr   r]   r^   gnamess   &  r   r   rubik.<locals>.perm   s:    AHHU1X H	Q rb   rd   )r   )
ValueErrorr   r   r   r   r   )!r   r   r   r   countfir]   rT   r   Ir   r   r   r   r   r   r   r   r   r   r   r^   r   r   rn   rf   r_   rk   r   r   rx   rt   r{   s!   f          @@@@@@@@@@@@@@@@@@@@@@r   rubikr   v   s*    	1u899####----( (
 
 
  
  ''9::Aq!Q1u EEAhq!tAHHUOQJE  "!Q?eBi ! ! 	AU1QT6]A 1q5\AQ  7a<< E1q5\A 	Q  	F7a<< EFF1q5\A 	Q " EEF7a<<Hrb   N) sympy.combinatorics.permutationsr   sympy.core.symbolr   sympy.matricesr   sympy.utilities.iterablesr   r	   r   r   r   r$   rW   r   r   rb   r   <module>r      s3    8 % ! =G"."!&HP*wrb   