+
    
þÎj ã                   ó4  € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RI	HtHtHtHt ^ RIHt ^ R	IHtHt ^ R
IHt ^ RIHtHt ^ RIHt ^ RIHt ^ RIH t H!t! ^ RI"H#t# ^ RI$H%t% ^ RI&H't'H(t( ^ RI)H*t* ^ RI+H,t, ^ RI-H.t.H/t/H0t0 ^ RI1H2t2H3t3H4t4 ^ RI5H6t6 ^ RI7H8t8 ^ RI9H:t:H;t; ^ RI<H=t= ^ RI>H?t? ^ RI@HAtA . RSOtBR, tC ! R- R.4      tD ! R/ R0]D]/4      tE ! R1 R2]D]/4      tF ! R3 R4]D].4      tG ! R5 R6]D].4      tH ! R7 R$]D].4      tI ! R8 R%]D].4      tJ ! R9 R]04      tK ! R: R]4      tL]G! R;4      tM]H! R;4      tN]I! R;4      tO]J! R;4      tP]E! R;4      tQ]F! R;4      tR ! R< R=]44      tS ! R> R]S]34      tT ! R? R]S]24      tU ! R@ R ]S]34      tV ! RA R!]S]24      tW ! RB R"]S]34      tX ! RC R#]S]24      tYRD tZ ! RE RF]S4      t[ ! RG R&][]34      t\ ! RH R'][]24      t] ! RI R(][]34      t^ ! RJ R)][]24      t_ ! RK R*][]34      t` ! RL R+][]24      taRTRN ltbRO tcRURP ltdRQ teRR tfRM# )Vz$Quantum mechanical angular momentum.)ÚSum)ÚAdd)ÚTuple)ÚExpr)Ú
int_valued)ÚMul)ÚIÚIntegerÚRationalÚpi)ÚS)ÚDummyÚsymbols)Úsympify)ÚbinomialÚ	factorial)Úexp)Úsqrt)ÚcosÚsin)Úsimplify)Úzeros)Ú
prettyFormÚ
stringPict©Úpretty_symbol)ÚQExpr)ÚHermitianOperatorÚOperatorÚUnitaryOperator)ÚBraÚKetÚState)ÚKroneckerDelta)Úhbar)ÚComplexSpaceÚDirectSumHilbertSpace)ÚTensorProduct)ÚCG)ÚqapplyÚRotationÚWignerDÚJxKetÚJxBraÚJyKetÚJyBraÚJzKetÚJzBraÚJzOpÚJ2OpÚJxKetCoupledÚJxBraCoupledÚJyKetCoupledÚJyBraCoupledÚJzKetCoupledÚJzBraCoupledc                 ó  € \        V 4      p ^V ,          ^,           pVP                  '       d   V^ 8”  g   \        RV ,          4      hT\        \	        ^V ,          ^,           4      4       Uu. uF  q V,
          NK  	  up3# u upi )é   z<Only integer or half-integer values allowed for j, got: : %r)r   Ú
is_IntegerÚ
ValueErrorÚrangeÚint)ÚjÚsizeÚis   &  ÚP/opt/data/home/.local/lib/python3.14/site-packages/sympy/physics/quantum/spin.pyÚm_valuesrD   ?   sr   € Ü�‹
€AØˆQ�3��7€DØ�?�?ˆ? $¨¤(ÜØJÈQÕNó
ð 	
ð ¤¤s¨1¨Q­3°­7£|Ô!4Ó5Ñ!4˜A�a—%�%Ñ!4Ñ5Ð5Ð5ùÒ5s   Á,Bc                   ó˜   a € ] tR t^Nt o Rt]R 4       t]R 4       tR t	R t
R tR tR tR	 tR
 tR tR tR tR tR tR tR tRtV tR# )Ú
SpinOpBasezBase class for spin operators.c                ó4   € \        \        P                  4      # ©N©r%   r   ÚInfinity©ÚclsÚlabels   &&rC   Ú_eval_hilbert_spaceÚSpinOpBase._eval_hilbert_spaceQ   ó   € ô œAŸJ™JÓ'Ð'ó    c                ó(   € V P                   ^ ,          # ©é    ©Úargs©Úselfs   &rC   ÚnameÚSpinOpBase.nameV   ó   € à�y‰y˜�|ÐrQ   c                ó:   € V P                   : V P                  : 2# rH   ©rY   Ú_coord©rX   ÚprinterrV   s   &&*rC   Ú_print_contentsÚSpinOpBase._print_contentsZ   s   € ØŸ› D§K£KÐ0Ð0rQ   c                óŠ   € \        \        V P                  4      4      p\        V P                  4      pV P	                  W44      # rH   )r   ÚstrrY   r^   Ú_print_subscript_pretty©rX   r`   rV   ÚaÚbs   &&*  rC   Ú_print_contents_prettyÚ!SpinOpBase._print_contents_pretty]   s3   € Ü”s˜4Ÿ9™9“~Ó&ˆÜ�t—{‘{Ó#ˆØ×+Ñ+¨AÓ1Ð1rQ   c                ó<   € V P                   : R V P                  : 2# )Ú_r]   r_   s   &&*rC   Ú_print_contents_latexÚ SpinOpBase._print_contents_latexb   s   € Ø ŸIœI t§{£{Ð4Ð4rQ   c           	     ó  € VP                  R \        P                  4      p\        V4      w  rE\	        WD4      p\        V4       F:  p\        V4       F(  pV P                  W5V,          W5V,          4      p	W–Wx3&   K*  	  K<  	  V# )r@   )Úgetr   ÚHalfrD   r   r>   Úmatrix_element)
rX   ÚbasisÚoptionsr@   rA   ÚmvalsÚresultÚpÚqÚmes
   &&,       rC   Ú_represent_baseÚSpinOpBase._represent_basee   sq   € Ø�K‰K˜œQŸV™VÓ$ˆÜ˜q“k‰ˆÜ�tÓ"ˆÜ�t–ˆAÜ˜4–[�Ø×(Ñ(¨°!­H°a¸q½ÓB�Ø!�q�t“ó !ñ ð ˆrQ   c                ó`  € VP                  V P                  4      p\        V\        4      '       d    \        VP
                  ,          V,          pM;\        V\        4      '       d   V P                  ! V3/ VB pM\        W,          4      pWPV,          8X  d   \        hVP                  V4      # rH   )
Úrewriters   Ú
isinstancer"   r$   Úmr   Ú_apply_operator_Sumr)   ÚNotImplementedError)rX   ÚketÚ
orig_basisrt   ÚstateÚrets   &&&,  rC   Ú	_apply_opÚSpinOpBase._apply_opo   s€   € Ø—‘˜DŸJ™JÓ'ˆä�eœU×#Ò#Ü˜Ÿ™•< Õ&‰Cä˜œs×#Ò#Ø×*Ò*¨5Ñ<°GÑ<‰Cä˜�Ó$ˆCØ�u•*ÔÜ%Ð%Ø�{‰{˜:Ó&Ð&rQ   c                ó*   € V P                   ! VR 3/ VB # ©ÚJx©r†   ©rX   r‚   rt   s   &&,rC   Ú_apply_operator_JxKetÚ SpinOpBase._apply_operator_JxKet}   ó   € Ø�~Š~˜c 4Ñ3¨7Ñ3Ð3rQ   c                ó*   € V P                   ! VR 3/ VB # r‰   r‹   rŒ   s   &&,rC   Ú_apply_operator_JxKetCoupledÚ'SpinOpBase._apply_operator_JxKetCoupled€   r�   rQ   c                ó*   € V P                   ! VR 3/ VB # ©ÚJyr‹   rŒ   s   &&,rC   Ú_apply_operator_JyKetÚ SpinOpBase._apply_operator_JyKetƒ   r�   rQ   c                ó*   € V P                   ! VR 3/ VB # r”   r‹   rŒ   s   &&,rC   Ú_apply_operator_JyKetCoupledÚ'SpinOpBase._apply_operator_JyKetCoupled†   r�   rQ   c                ó*   € V P                   ! VR 3/ VB # ©ÚJzr‹   rŒ   s   &&,rC   Ú_apply_operator_JzKetÚ SpinOpBase._apply_operator_JzKet‰   r�   rQ   c                ó*   € V P                   ! VR 3/ VB # rœ   r‹   rŒ   s   &&,rC   Ú_apply_operator_JzKetCoupledÚ'SpinOpBase._apply_operator_JzKetCoupledŒ   r�   rQ   c                óö  € \        V \        \        \        34      '       g   \        h. p\        \        VP                  4      4       F˜  p. pVP                  VP                  R V 4       VP                  V P                  VP                  V,          4      4       VP                  VP                  V^,           R  4       VP                  VP                  ! V!  4       Kš  	  \        V!  P                  4       # rH   )r~   ÚJxOpÚJyOpr2   r�   r>   ÚlenrV   ÚextendÚappendÚ_apply_operatorÚ	__class__r   Úexpand)rX   Útprt   rv   ÚnÚargs   &&,   rC   Ú_apply_operator_TensorProductÚ(SpinOpBase._apply_operator_TensorProduct�   s¸   € ô ˜$¤¤t¬TÐ 2×3Ò3Ü%Ð%ØˆÜ”s˜2Ÿ7™7“|Ö$ˆAØˆCØ�J‰J�r—w‘w˜r �{Ô#Ø�J‰J�t×+Ñ+¨B¯G©G°A­JÓ7Ô8Ø�J‰J�r—w‘w˜q 1�u˜v�Ô'Ø�M‰M˜"Ÿ,š,¨Ñ,Ö-ñ %ô �F‰|×"Ñ"Ó$Ð$rQ   c                ó    € \        WP                  ,          4      pW0VP                  ,          8X  d   \        h\        V.VP                  O5!  # rH   )r)   Úfunctionr�   r   Úlimits)rX   Úsrt   Únew_funcs   &&, rC   r€   ÚSpinOpBase._apply_operator_Sumž   s:   € Ü˜$Ÿz™z�/Ó*ˆØ˜AŸJ™J•Ô&Ü%Ð%Ü�8Ð'˜aŸh™hÓ'Ð'rQ   c                ó>   € V P                  4       P                  4       # rH   )Ú_represent_default_basisÚtrace©rX   rt   s   &,rC   Ú_eval_traceÚSpinOpBase._eval_trace¤   s   € ð ×,Ñ,Ó.×4Ñ4Ó6Ð6rQ   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚclassmethodrN   ÚpropertyrY   ra   ri   rm   rz   r†   r�   r‘   r–   r™   rž   r¡   r¯   r€   r»   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @rC   rF   rF   N   sy   ø‡ € Ù(àñ(ó ð(ð ñó ðò1ò2ò
5òò'ò4ò4ò4ò4ò4ò4ò%ò(÷7ð 7rQ   rF   c                   óV   a € ] tR t^­t o RtRtRtR tR tR t	R t
R tR	 tR
 tRtV tR# )ÚJplusOpzThe J+ operator.Ú+r�   c                óP   € ^\         ,          \        V P                  4      ,          # ©r;   )r$   r2   rY   ©rX   Úothers   &&rC   Ú_eval_commutator_JminusOpÚ!JplusOp._eval_commutator_JminusOp´   s   € Ø”�v”d˜4Ÿ9™9“oÕ%Ð%rQ   c                ó–  € VP                   pVP                  pVP                  '       d)   VP                  '       d   WC8¼  d   \        P                  # \
        \        W3\        P                  ,           ,          WD\        P                  ,           ,          ,
          4      ,          \        W4\        P                  ,           4      ,          # rH   ©	r@   r   Ú	is_Numberr   ÚZeror$   r   ÚOner0   ©rX   r‚   rt   r@   r   s   &&,  rC   rž   ÚJplusOp._apply_operator_JzKet·   sn   € Ø�E‰EˆØ�E‰EˆØ�;�;ˆ;˜1Ÿ;Ÿ;˜;ØŒvÜ—v‘v�Ü”D˜¤§¡�I�¨´·±­I­Õ6Ó7Õ7¼¸aÄQÇUÁUÅÓ8KÕKÐKrQ   c                óÈ  € VP                   pVP                  pVP                  pVP                  pVP                  '       d)   VP                  '       d   WC8¼  d   \
        P                  # \        \        W3\
        P                  ,           ,          WD\
        P                  ,           ,          ,
          4      ,          \        W4\
        P                  ,           WV4      ,          # rH   ©r@   r   ÚjnÚcouplingrÔ   r   rÕ   r$   r   rÖ   r8   ©rX   r‚   rt   r@   r   rÛ   rÜ   s   &&,    rC   r¡   Ú$JplusOp._apply_operator_JzKetCoupled¿   sƒ   € Ø�E‰EˆØ�E‰EˆØ�V‰VˆØ—<‘<ˆØ�;�;ˆ;˜1Ÿ;Ÿ;˜;ØŒvÜ—v‘v�Ü”D˜¤§¡�I�¨´·±­I­Õ6Ó7Õ7¼ÀQÌAÏEÉEÍ	ÐSUÓ8`Õ`Ð`rQ   c                ó  € \         \        W\        P                  ,           ,          WD\        P                  ,           ,          ,
          4      ,          pV\	        W$^,           4      ,          pV\	        W4      ,          pV# ©é   ©r$   r   r   rÖ   r#   ©rX   r@   r   ÚjpÚmprv   s   &&&&& rC   rr   ÚJplusOp.matrix_elementÉ   óQ   € Ü”d˜1¤!§%¡%�i�=¨2´A·E±E­z­?Õ:Ó;Õ;ˆØ”. ¨¥FÓ+Õ+ˆØ”. Ó'Õ'ˆØˆrQ   c                ó&   € V P                   ! R/ VB # ©NrH   ©Ú_represent_JzOprº   s   &,rC   r¸   Ú JplusOp._represent_default_basisÏ   ó   € Ø×#Ò#Ñ4¨GÑ4Ð4rQ   c                ó(   € V P                   ! V3/ VB # rH   ©rz   ©rX   rs   rt   s   &&,rC   rë   ÚJplusOp._represent_JzOpÒ   ó   € Ø×#Ò# EÑ5¨WÑ5Ð5rQ   c                ój   € \        V^ ,          4      \        \        V^ ,          4      ,          ,           # rS   ©r¤   r   r¥   ©rX   rV   Úkwargss   &*,rC   Ú_eval_rewrite_as_xyzÚJplusOp._eval_rewrite_as_xyzÕ   ó!   € Ü�D˜•G‹}œq¤ d¨1¥g£�Õ.Ð.rQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   r^   rs   rÐ   rž   r¡   rr   r¸   rë   r÷   rÅ   rÆ   rÇ   s   @rC   rÊ   rÊ   ­   s<   ø‡ € Ùà€Fà€Eò&òLòaòò5ò6÷/ð /rQ   rÊ   c                   óP   a € ] tR t^Ùt o RtRtRtR tR tR t	R t
R tR	 tR
tV tR# )ÚJminusOpzThe J- operator.Ú-r�   c                ó˜  € VP                   pVP                  pVP                  '       d*   VP                  '       d   WC) 8:  d   \        P                  # \
        \        W3\        P                  ,           ,          WD\        P                  ,
          ,          ,
          4      ,          \        W4\        P                  ,
          4      ,          # rH   rÓ   r×   s   &&,  rC   rž   ÚJminusOp._apply_operator_JzKetà   sp   € Ø�E‰EˆØ�E‰EˆØ�;�;ˆ;˜1Ÿ;Ÿ;˜;Ø�BŒwÜ—v‘v�Ü”D˜¤§¡�I�¨´·±­I­Õ6Ó7Õ7¼¸aÄQÇUÁUÅÓ8KÕKÐKrQ   c                óÊ  € VP                   pVP                  pVP                  pVP                  pVP                  '       d*   VP                  '       d   WC) 8:  d   \
        P                  # \        \        W3\
        P                  ,           ,          WD\
        P                  ,
          ,          ,
          4      ,          \        W4\
        P                  ,
          WV4      ,          # rH   rÚ   rÝ   s   &&,    rC   r¡   Ú%JminusOp._apply_operator_JzKetCoupledè   s…   € Ø�E‰EˆØ�E‰EˆØ�V‰VˆØ—<‘<ˆØ�;�;ˆ;˜1Ÿ;Ÿ;˜;Ø�BŒwÜ—v‘v�Ü”D˜¤§¡�I�¨´·±­I­Õ6Ó7Õ7¼ÀQÌAÏEÉEÍ	ÐSUÓ8`Õ`Ð`rQ   c                ó  € \         \        W\        P                  ,           ,          WD\        P                  ,
          ,          ,
          4      ,          pV\	        W$^,
          4      ,          pV\	        W4      ,          pV# rà   râ   rã   s   &&&&& rC   rr   ÚJminusOp.matrix_elementò   rç   rQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   Ú!JminusOp._represent_default_basisø   rí   rQ   c                ó(   € V P                   ! V3/ VB # rH   rï   rð   s   &&,rC   rë   ÚJminusOp._represent_JzOpû   rò   rQ   c                ój   € \        V^ ,          4      \        \        V^ ,          4      ,          ,
          # rS   rô   rõ   s   &*,rC   r÷   ÚJminusOp._eval_rewrite_as_xyzþ   rù   rQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   r^   rs   rž   r¡   rr   r¸   rë   r÷   rÅ   rÆ   rÇ   s   @rC   rû   rû   Ù   s7   ø‡ € Ùà€Fà€EòLòaòò5ò6÷/ð /rQ   rû   c                   óV   a € ] tR tRt o RtRtRtR tR tR t	R t
R	 tR
 tR tRtV tR# )r¤   i  zThe Jx operator.ÚxrŠ   c                óX   € \         \        ,          \        V P                  4      ,          # rH   )r   r$   r2   rY   rÎ   s   &&rC   Ú_eval_commutator_JyOpÚJxOp._eval_commutator_JyOp	  ó   € Ü”�v”d˜4Ÿ9™9“oÕ%Ð%rQ   c                óZ   € \         ) \        ,          \        V P                  4      ,          # rH   ©r   r$   r¥   rY   rÎ   s   &&rC   Ú_eval_commutator_JzOpÚJxOp._eval_commutator_JzOp  ó   € Üˆr”$�w”t˜DŸI™I“Õ&Ð&rQ   c                óÊ   € \        V P                  4      P                  ! V3/ VB p\        V P                  4      P                  ! V3/ VB pW4,           \	        ^4      ,          # rÍ   )rÊ   rY   rž   rû   r	   ©rX   r‚   rt   rä   Újms   &&,  rC   rž   ÚJxOp._apply_operator_JzKet  sO   € Ü�T—Y‘YÓ×5Ò5°cÑE¸WÑEˆÜ�d—i‘iÓ ×6Ò6°sÑF¸gÑFˆØ•œ ›Õ#Ð#rQ   c                óÊ   € \        V P                  4      P                  ! V3/ VB p\        V P                  4      P                  ! V3/ VB pW4,           \	        ^4      ,          # rÍ   )rÊ   rY   r¡   rû   r	   r  s   &&,  rC   r¡   Ú!JxOp._apply_operator_JzKetCoupled  sO   € Ü�T—Y‘YÓ×<Ò<¸SÑLÀGÑLˆÜ�d—i‘iÓ ×=Ò=¸cÑMÀWÑMˆØ•œ ›Õ#Ð#rQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   ÚJxOp._represent_default_basis  rí   rQ   c                óÊ   € \        V P                  4      P                  ! V3/ VB p\        V P                  4      P                  ! V3/ VB pW4,           \	        ^4      ,          # rÍ   )rÊ   rY   rë   rû   r	   ©rX   rs   rt   rä   r  s   &&,  rC   rë   ÚJxOp._represent_JzOp  sO   € Ü�T—Y‘YÓ×/Ò/°ÑA¸ÑAˆÜ�d—i‘iÓ ×0Ò0°ÑB¸'ÑBˆØ•œ ›Õ#Ð#rQ   c                ób   € \        V^ ,          4      \        V^ ,          4      ,           ^,          # rS   )rÊ   rû   rõ   s   &*,rC   Ú_eval_rewrite_as_plusminusÚJxOp._eval_rewrite_as_plusminus!  s$   € Ü˜˜Q�Ó ¤8¨D°­GÓ#4Õ4°aÕ7Ð7rQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   r^   rs   r  r  rž   r¡   r¸   rë   r   rÅ   rÆ   rÇ   s   @rC   r¤   r¤     s:   ø‡ € Ùà€Fà€Eò&ò'ò$ò
$ò
5ò$÷
8ð 8rQ   r¤   c                   óV   a € ] tR tRt o RtRtRtR tR tR t	R t
R	 tR
 tR tRtV tR# )r¥   i%  zThe Jy operator.Úyr•   c                óX   € \         \        ,          \        V P                  4      ,          # rH   ©r   r$   r¤   rY   rÎ   s   &&rC   r  ÚJyOp._eval_commutator_JzOp,  r  rQ   c                óZ   € \         ) \        ,          \        V P                  4      ,          # rH   )r   r$   r3   rY   rÎ   s   &&rC   Ú_eval_commutator_JxOpÚJyOp._eval_commutator_JxOp/  r  rQ   c                óà   € \        V P                  4      P                  ! V3/ VB p\        V P                  4      P                  ! V3/ VB pW4,
          \	        ^4      \
        ,          ,          # rÍ   )rÊ   rY   rž   rû   r	   r   r  s   &&,  rC   rž   ÚJyOp._apply_operator_JzKet2  sS   € Ü�T—Y‘YÓ×5Ò5°cÑE¸WÑEˆÜ�d—i‘iÓ ×6Ò6°sÑF¸gÑFˆØ•œ' !›*¤Q�,Õ'Ð'rQ   c                óà   € \        V P                  4      P                  ! V3/ VB p\        V P                  4      P                  ! V3/ VB pW4,
          \	        ^4      \
        ,          ,          # rÍ   )rÊ   rY   r¡   rû   r	   r   r  s   &&,  rC   r¡   Ú!JyOp._apply_operator_JzKetCoupled7  sS   € Ü�T—Y‘YÓ×<Ò<¸SÑLÀGÑLˆÜ�d—i‘iÓ ×=Ò=¸cÑMÀWÑMˆØ•œ' !›*¤Q�,Õ'Ð'rQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   ÚJyOp._represent_default_basis<  rí   rQ   c                óà   € \        V P                  4      P                  ! V3/ VB p\        V P                  4      P                  ! V3/ VB pW4,
          \	        ^4      \
        ,          ,          # rÍ   )rÊ   rY   rë   rû   r	   r   r  s   &&,  rC   rë   ÚJyOp._represent_JzOp?  sS   € Ü�T—Y‘YÓ×/Ò/°ÑA¸ÑAˆÜ�d—i‘iÓ ×0Ò0°ÑB¸'ÑBˆØ•œ' !›*¤Q�,Õ'Ð'rQ   c                óx   € \        V^ ,          4      \        V^ ,          4      ,
          ^\        ,          ,          # rS   )rÊ   rû   r   rõ   s   &*,rC   r   ÚJyOp._eval_rewrite_as_plusminusD  s(   € Ü˜˜Q�Ó ¤8¨D°­GÓ#4Õ4°q¼µsÕ;Ð;rQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   r^   rs   r  r(  rž   r¡   r¸   rë   r   rÅ   rÆ   rÇ   s   @rC   r¥   r¥   %  s:   ø‡ € Ùà€Fà€Eò&ò'ò(ò
(ò
5ò(÷
<ð <rQ   r¥   c                   óV   a € ] tR tRt o RtRtRtR tR tR t	R t
R	 tR
 tR tRtV tR# )r2   iH  zThe Jz operator.Úzr�   c                óX   € \         \        ,          \        V P                  4      ,          # rH   r  rÎ   s   &&rC   r(  ÚJzOp._eval_commutator_JxOpO  r  rQ   c                óZ   € \         ) \        ,          \        V P                  4      ,          # rH   r%  rÎ   s   &&rC   r  ÚJzOp._eval_commutator_JyOpR  r  rQ   c                óB   € \         \        V P                  4      ,          # rH   )r$   rÊ   rY   rÎ   s   &&rC   Ú_eval_commutator_JplusOpÚJzOp._eval_commutator_JplusOpU  s   € Ü”G˜DŸI™IÓ&Õ&Ð&rQ   c                óD   € \         ) \        V P                  4      ,          # rH   )r$   rû   rY   rÎ   s   &&rC   rÐ   ÚJzOp._eval_commutator_JminusOpX  s   € Üˆu”X˜dŸi™iÓ(Õ(Ð(rQ   c                óh   € \         V,          pV\        W$4      ,          pV\        W4      ,          pV# rH   ©r$   r#   rã   s   &&&&& rC   rr   ÚJzOp.matrix_element[  s.   € Ü�b•ˆØ”. Ó'Õ'ˆØ”. Ó'Õ'ˆØˆrQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   ÚJzOp._represent_default_basisa  rí   rQ   c                ó(   € V P                   ! V3/ VB # rH   rï   rð   s   &&,rC   rë   ÚJzOp._represent_JzOpd  rò   rQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   r^   rs   r(  r  r;  rÐ   rr   r¸   rë   rÅ   rÆ   rÇ   s   @rC   r2   r2   H  s:   ø‡ € Ùà€Fà€Eò&ò'ò'ò)òò5÷6ð 6rQ   c                   ó”   a € ] tR tRt o RtRtR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )r3   ih  zThe J^2 operator.Ú2c                ó"   € \         P                  # rH   ©r   rÕ   rÎ   s   &&rC   r(  ÚJ2Op._eval_commutator_JxOpm  ó   € Ü�v‰vˆrQ   c                ó"   € \         P                  # rH   rI  rÎ   s   &&rC   r  ÚJ2Op._eval_commutator_JyOpp  rK  rQ   c                ó"   € \         P                  # rH   rI  rÎ   s   &&rC   r  ÚJ2Op._eval_commutator_JzOps  rK  rQ   c                ó"   € \         P                  # rH   rI  rÎ   s   &&rC   r;  ÚJ2Op._eval_commutator_JplusOpv  rK  rQ   c                ó"   € \         P                  # rH   rI  rÎ   s   &&rC   rÐ   ÚJ2Op._eval_commutator_JminusOpy  rK  rQ   c                ól   € VP                   p\        ^,          V,          V^,           ,          V,          # rÍ   ©r@   r$   ©rX   r‚   rt   r@   s   &&, rC   r�   ÚJ2Op._apply_operator_JxKet|  ó'   € Ø�E‰EˆÜ�Q�w�q�y˜!˜a�%Õ  Õ$Ð$rQ   c                ól   € VP                   p\        ^,          V,          V^,           ,          V,          # rÍ   rU  rV  s   &&, rC   r‘   Ú!J2Op._apply_operator_JxKetCoupled€  rX  rQ   c                ól   € VP                   p\        ^,          V,          V^,           ,          V,          # rÍ   rU  rV  s   &&, rC   r–   ÚJ2Op._apply_operator_JyKet„  rX  rQ   c                ól   € VP                   p\        ^,          V,          V^,           ,          V,          # rÍ   rU  rV  s   &&, rC   r™   Ú!J2Op._apply_operator_JyKetCoupledˆ  rX  rQ   c                ól   € VP                   p\        ^,          V,          V^,           ,          V,          # rÍ   rU  rV  s   &&, rC   rž   ÚJ2Op._apply_operator_JzKetŒ  rX  rQ   c                ól   € VP                   p\        ^,          V,          V^,           ,          V,          # rÍ   rU  rV  s   &&, rC   r¡   Ú!J2Op._apply_operator_JzKetCoupled�  rX  rQ   c                ó’   € \         ^,          V,          V^,           ,          pV\        W$4      ,          pV\        W4      ,          pV# rÍ   r@  rã   s   &&&&& rC   rr   ÚJ2Op.matrix_element”  s;   € Ü˜•'˜1•˜a !�eÕ$ˆØ”. Ó'Õ'ˆØ”. Ó'Õ'ˆØˆrQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   ÚJ2Op._represent_default_basisš  rí   rQ   c                ó(   € V P                   ! V3/ VB # rH   rï   rð   s   &&,rC   rë   ÚJ2Op._represent_JzOp�  rò   rQ   c                ód   € \        \        V P                  4      4      p\        R 4      pW4,          # )rG  )r   rd   rY   rf   s   &&*  rC   ri   ÚJ2Op._print_contents_pretty   s$   € Ü”s˜4Ÿ9™9“~Ó&ˆÜ�s‹OˆØ�tˆrQ   c                ó:   € R \        V P                  4      ,          # )z%s^2)rd   rY   r_   s   &&*rC   rm   ÚJ2Op._print_contents_latex¥  s   € Øœ˜TŸY™Y›Õ'Ð'rQ   c                ó¬   € \        V^ ,          4      ^,          \        V^ ,          4      ^,          ,           \        V^ ,          4      ^,          ,           # rS   )r¤   r¥   r2   rõ   s   &*,rC   r÷   ÚJ2Op._eval_rewrite_as_xyz¨  s9   € Ü�D˜•G‹}˜aÕ¤$ t¨A¥w£-°Õ"2Õ2´T¸$¸q½'³]ÀAÕ5EÕEÐErQ   c                óâ   € V^ ,          p\        V4      ^,          \        P                  \        V4      \	        V4      ,          \	        V4      \        V4      ,          ,           ,          ,           # rS   )r2   r   rq   rÊ   rû   )rX   rV   rö   rg   s   &*, rC   r   ÚJ2Op._eval_rewrite_as_plusminus«  sM   € Ø��GˆÜ�A‹w˜�zÜ�F‰F”G˜A“Jœx¨›{Õ*¬X°a«[¼À»Õ-CÕCÕDõEð 	ErQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   r^   r(  r  r  r;  rÐ   r�   r‘   r–   r™   rž   r¡   rr   r¸   rë   ri   rm   r÷   r   rÅ   rÆ   rÇ   s   @rC   r3   r3   h  so   ø‡ € Ùà€Fòòòòòò%ò%ò%ò%ò%ò%òò5ò6òò
(òF÷Eð ErQ   c                   ó  a € ] tR tRt o Rt]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       tR tR	 tR
 tR t]R 4       t]R 4       tR tR tR tR tRR/R ltR tR tR tRR/R ltR tR tR tRtV tR# )r*   i±  aÙ  Wigner D operator in terms of Euler angles.

Defines the rotation operator in terms of the Euler angles defined by
the z-y-z convention for a passive transformation. That is the coordinate
axes are rotated first about the z-axis, giving the new x'-y'-z' axes. Then
this new coordinate system is rotated about the new y'-axis, giving new
x''-y''-z'' axes. Then this new coordinate system is rotated about the
z''-axis. Conventions follow those laid out in [1]_.

Parameters
==========

alpha : Number, Symbol
    First Euler Angle
beta : Number, Symbol
    Second Euler angle
gamma : Number, Symbol
    Third Euler angle

Examples
========

A simple example rotation operator:

    >>> from sympy import pi
    >>> from sympy.physics.quantum.spin import Rotation
    >>> Rotation(pi, 0, pi/2)
    R(pi,0,pi/2)

With symbolic Euler angles and calculating the inverse rotation operator:

    >>> from sympy import symbols
    >>> a, b, c = symbols('a b c')
    >>> Rotation(a, b, c)
    R(a,b,c)
    >>> Rotation(a, b, c).inverse()
    R(-c,-b,-a)

See Also
========

WignerD: Symbolic Wigner-D function
D: Wigner-D function
d: Wigner small-d function

References
==========

.. [1] Varshalovich, D A, Quantum Theory of Angular Momentum. 1988.
c                óv   € \         P                  ! V4      p\        V4      ^8w  d   \        RV,          4      hV# )é   z 3 Euler angles required, got: %r)r   Ú
_eval_argsr¦   r=   )rL   rV   s   &&rC   rt  ÚRotation._eval_argså  s3   € ä×Ò Ó%ˆÜˆt‹9˜Œ>ÜÐ?À$ÕFÓGÐGØˆrQ   c                ó4   € \        \        P                  4      # rH   rI   rK   s   &&rC   rN   ÚRotation._eval_hilbert_spaceì  rP   rQ   c                ó(   € V P                   ^ ,          # rS   ©rM   rW   s   &rC   ÚalphaÚRotation.alphañ  ó   € à�z‰z˜!�}ÐrQ   c                ó(   € V P                   ^,          # rà   ry  rW   s   &rC   ÚbetaÚRotation.betaõ  r|  rQ   c                ó(   € V P                   ^,          # rÍ   ry  rW   s   &rC   ÚgammaÚRotation.gammaù  r|  rQ   c                ó   € R # )ÚRr½   r_   s   &&*rC   Ú_print_operator_nameÚRotation._print_operator_nameý  s   € ÙrQ   c                óR   € VP                   '       d   \        R4      # \        R4      # )u   â„›zR u   â„› )Ú_use_unicoder   r_   s   &&*rC   Ú_print_operator_name_prettyÚ$Rotation._print_operator_name_pretty   s%   € Ø××ÐÜÐ:Ó;Ð;ä˜dÓ#Ð#rQ   c                ó   € R # )z\mathcal{R}r½   r_   s   &&*rC   Ú_print_operator_name_latexÚ#Rotation._print_operator_name_latex  s   € ÙrQ   c                ó^   € \        V P                  ) V P                  ) V P                  ) 4      # rH   )r*   r�  r~  rz  rW   s   &rC   Ú_eval_inverseÚRotation._eval_inverse	  s#   € Ü˜Ÿ™˜ d§i¡i Z°$·*±*°Ó=Ð=rQ   c                ó   € \        WW4WV4      # )a  Wigner D-function.

Returns an instance of the WignerD class corresponding to the Wigner-D
function specified by the parameters.

Parameters
===========

j : Number
    Total angular momentum
m : Number
    Eigenvalue of angular momentum along axis after rotation
mp : Number
    Eigenvalue of angular momentum along rotated axis
alpha : Number, Symbol
    First Euler angle of rotation
beta : Number, Symbol
    Second Euler angle of rotation
gamma : Number, Symbol
    Third Euler angle of rotation

Examples
========

Return the Wigner-D matrix element for a defined rotation, both
numerical and symbolic:

    >>> from sympy.physics.quantum.spin import Rotation
    >>> from sympy import pi, symbols
    >>> alpha, beta, gamma = symbols('alpha beta gamma')
    >>> Rotation.D(1, 1, 0,pi, pi/2,-pi)
    WignerD(1, 1, 0, pi, pi/2, -pi)

See Also
========

WignerD: Symbolic Wigner-D function

©r+   )rL   r@   r   rå   rz  r~  r�  s   &&&&&&&rC   ÚDÚ
Rotation.D  s   € ôR �q˜R¨Ó4Ð4rQ   c                ó    € \        WV^ V^ 4      # )a  Wigner small-d function.

Returns an instance of the WignerD class corresponding to the Wigner-D
function specified by the parameters with the alpha and gamma angles
given as 0.

Parameters
===========

j : Number
    Total angular momentum
m : Number
    Eigenvalue of angular momentum along axis after rotation
mp : Number
    Eigenvalue of angular momentum along rotated axis
beta : Number, Symbol
    Second Euler angle of rotation

Examples
========

Return the Wigner-D matrix element for a defined rotation, both
numerical and symbolic:

    >>> from sympy.physics.quantum.spin import Rotation
    >>> from sympy import pi, symbols
    >>> beta = symbols('beta')
    >>> Rotation.d(1, 1, 0, pi/2)
    WignerD(1, 1, 0, 0, pi/2, 0)

See Also
========

WignerD: Symbolic Wigner-D function

r’  )rL   r@   r   rå   r~  s   &&&&&rC   ÚdÚ
Rotation.d7  s   € ôL �q˜R  D¨!Ó,Ð,rQ   c                ó¢   € V P                   P                  W2W@P                  V P                  V P                  4      pV\        W4      ,          pV# rH   )rª   r“  rz  r~  r�  r#   rã   s   &&&&& rC   rr   ÚRotation.matrix_element_  sA   € Ø—‘×!Ñ!Ø�2—z‘z 4§9¡9¨d¯j©jó
ˆð 	”. Ó'Õ'ˆØˆrQ   c           	     óŠ  € \        VP                  R \        P                  4      4      p\        VP                  R4      4      p\	        V4      w  rV\        WU4      p\        V4       FX  p\        V4       FF  p	V P                  W6V,          W6V	,          4      p
V'       d   V
P                  4       WxV	3&   KA  W§W‰3&   KH  	  KZ  	  V# )r@   Údoit)	r   rp   r   rq   rD   r   r>   rr   r›  )rX   rs   rt   r@   ÚevaluaterA   ru   rv   rw   rx   ry   s   &&,        rC   rz   ÚRotation._represent_basef  s�   € Ü�G—K‘K ¤Q§V¡VÓ,Ó-ˆä˜7Ÿ;™; vÓ.Ó/ˆÜ˜q“k‰ˆÜ�tÓ"ˆÜ�t–ˆAÜ˜4–[�Ø×(Ñ(¨°!­H°a¸q½ÓB�ßØ#%§7¡7£9�F˜a˜4“Là#%˜1˜4“Ló !ñ ð ˆrQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   Ú!Rotation._represent_default_basisu  rí   rQ   c                ó(   € V P                   ! V3/ VB # rH   rï   rð   s   &&,rC   rë   ÚRotation._represent_JzOpx  rò   rQ   ÚdummyTc          
     ó  € V P                   pV P                  pV P                  pVP                  pVP                  p	VP
                  '       dm   . p
\        V4      pV^,          pV FG  p\        P                  W‰WÕWg4      pVP                  4       pV
P                  Wñ! W�4      ,          4       KI  	  \        V
!  # V'       d   \        R4      pM\        R4      p\        \        P                  W‰WÕWg4      V! W�4      ,          WØ) V34      # ©rá   rå   )rz  r~  r�  r@   r   Ú	is_numberrD   r*   r“  r›  r¨   r   r   r   r   )rX   r„   r‚   r¢  rt   rg   rh   Úgr@   r   r´   rA   Úszrå   Úrr5  s   &&&$,           rC   Ú_apply_operator_uncoupledÚ"Rotation._apply_operator_uncoupled{  sÓ   € Ø�J‰JˆØ�I‰IˆØ�J‰JˆØ�E‰EˆØ�E‰EˆØ�;�;ˆ;ØˆAÜ˜A“;ˆDØ�a•ˆBÛ�Ü—J‘J˜q R¨AÓ1�Ø—F‘F“H�Ø—‘˜˜5 ›<�Ö(ñ ô ˜‘7ˆNçÜ˜4“[‘ä˜T“]�Ü”x—z‘z !¨¨qÓ4±U¸1³\ÕAÀBÈÈAÀ;ÓOÐOrQ   c                ó2   € V P                   ! \        V3/ VB # rH   )r©  r,   rŒ   s   &&,rC   r�   ÚRotation._apply_operator_JxKet‘  ó   € Ø×-Ò-¬e°SÑD¸GÑDÐDrQ   c                ó2   € V P                   ! \        V3/ VB # rH   )r©  r.   rŒ   s   &&,rC   r–   ÚRotation._apply_operator_JyKet”  r­  rQ   c                ó2   € V P                   ! \        V3/ VB # rH   )r©  r0   rŒ   s   &&,rC   rž   ÚRotation._apply_operator_JzKet—  r­  rQ   c          
     óL  € V P                   pV P                  pV P                  pVP                  pVP                  p	VP
                  p
VP                  pVP                  '       do   . p\        V4      pV^,          pV FI  p\        P                  W‰WõWg4      pVP                  4       pVP                  VV! W�W«4      ,          4       KK  	  \        V!  # V'       d   \        R4      pM\        R4      p\!        \        P                  W‰WõWg4      V! W�W«4      ,          Wø) V34      # r¤  )rz  r~  r�  r@   r   rÛ   rÜ   r¥  rD   r*   r“  r›  r¨   r   r   r   r   )rX   r„   r‚   r¢  rt   rg   rh   r¦  r@   r   rÛ   rÜ   r´   rA   r§  rå   r¨  r5  s   &&&$,             rC   Ú_apply_operator_coupledÚ Rotation._apply_operator_coupledš  sö   € Ø�J‰JˆØ�I‰IˆØ�J‰JˆØ�E‰EˆØ�E‰EˆØ�V‰VˆØ—<‘<ˆØ�;�;ˆ;ØˆAÜ˜A“;ˆDØ�a•ˆBÛ�Ü—J‘J˜q R¨AÓ1�Ø—F‘F“H�Ø—‘˜™5 ¨Ó5Õ5Ö6ñ ô ˜‘7ˆNçÜ˜4“[‘ä˜T“]�Ü”x—z‘z !¨¨qÓ4±UØ�ró6%õ %Ø')¨2¨q kó3ð 3rQ   c                ó2   € V P                   ! \        V3/ VB # rH   )r³  r4   rŒ   s   &&,rC   r‘   Ú%Rotation._apply_operator_JxKetCoupled³  ó   € Ø×+Ò+¬L¸#ÑIÀÑIÐIrQ   c                ó2   € V P                   ! \        V3/ VB # rH   )r³  r6   rŒ   s   &&,rC   r™   Ú%Rotation._apply_operator_JyKetCoupled¶  r·  rQ   c                ó2   € V P                   ! \        V3/ VB # rH   )r³  r8   rŒ   s   &&,rC   r¡   Ú%Rotation._apply_operator_JzKetCoupled¹  r·  rQ   r½   N) r¾   r¿   rÀ   rÁ   rÂ   rÃ   rt  rN   rÄ   rz  r~  r�  r…  r‰  rŒ  r�  r“  r–  rr   rz   r¸   rë   r©  r�   r–   rž   r³  r‘   r™   r¡   rÅ   rÆ   rÇ   s   @rC   r*   r*   ±  s  ø‡ € ñ1ðf ñó ðð ñ(ó ð(ð ñó ðð ñó ðð ñó ðòò$òò>ð ñ(5ó ð(5ðT ñ%-ó ð%-òNòò5ò6ðP¸Tô Pò,EòEòEð3¸4ô 3ò2JòJ÷Jð JrQ   c                   ó¦   a € ] tR tRt o RtRtR t]R 4       t]R 4       t	]R 4       t
]R 4       t]R	 4       t]R
 4       tR tR tR tR tRtV tR# )r+   i¼  aÿ  Wigner-D function

The Wigner D-function gives the matrix elements of the rotation
operator in the jm-representation. For the Euler angles `\alpha`,
`\beta`, `\gamma`, the D-function is defined such that:

.. math ::
    <j,m| \mathcal{R}(\alpha, \beta, \gamma ) |j',m'> = \delta_{jj'} D(j, m, m', \alpha, \beta, \gamma)

Where the rotation operator is as defined by the Rotation class [1]_.

The Wigner D-function defined in this way gives:

.. math ::
    D(j, m, m', \alpha, \beta, \gamma) = e^{-i m \alpha} d(j, m, m', \beta) e^{-i m' \gamma}

Where d is the Wigner small-d function, which is given by Rotation.d.

The Wigner small-d function gives the component of the Wigner
D-function that is determined by the second Euler angle. That is the
Wigner D-function is:

.. math ::
    D(j, m, m', \alpha, \beta, \gamma) = e^{-i m \alpha} d(j, m, m', \beta) e^{-i m' \gamma}

Where d is the small-d function. The Wigner D-function is given by
Rotation.D.

Note that to evaluate the D-function, the j, m and mp parameters must
be integer or half integer numbers.

Parameters
==========

j : Number
    Total angular momentum
m : Number
    Eigenvalue of angular momentum along axis after rotation
mp : Number
    Eigenvalue of angular momentum along rotated axis
alpha : Number, Symbol
    First Euler angle of rotation
beta : Number, Symbol
    Second Euler angle of rotation
gamma : Number, Symbol
    Third Euler angle of rotation

Examples
========

Evaluate the Wigner-D matrix elements of a simple rotation:

    >>> from sympy.physics.quantum.spin import Rotation
    >>> from sympy import pi
    >>> rot = Rotation.D(1, 1, 0, pi, pi/2, 0)
    >>> rot
    WignerD(1, 1, 0, pi, pi/2, 0)
    >>> rot.doit()
    sqrt(2)/2

Evaluate the Wigner-d matrix elements of a simple rotation

    >>> rot = Rotation.d(1, 1, 0, pi/2)
    >>> rot
    WignerD(1, 1, 0, 0, pi/2, 0)
    >>> rot.doit()
    -sqrt(2)/2

See Also
========

Rotation: Rotation operator

References
==========

.. [1] Varshalovich, D A, Quantum Theory of Angular Momentum. 1988.
Tc                ó  € \        V4      ^8X  g   \        RV,          4      h\        V4      pVP                  RR4      pV'       d'   \        P
                  ! V .VO5!  P                  4       # \        P
                  ! V .VO5!  # )é   z6 parameters expected, got %srœ  F)r¦   r=   r   rp   r   Ú__new__Ú_eval_wignerd)rL   rV   Úhintsrœ  s   &*, rC   r¿  ÚWignerD.__new__  sk   € Ü�4‹y˜AŒ~ÜÐ<¸tÕCÓDÐDÜ�t‹}ˆØ—9‘9˜Z¨Ó/ˆßÜ—<’< Ð+ dÓ+×9Ñ9Ó;Ð;Ü�|Š|˜CÐ' $Ó'Ð'rQ   c                ó(   € V P                   ^ ,          # rS   rU   rW   s   &rC   r@   Ú	WignerD.j  r[   rQ   c                ó(   € V P                   ^,          # rà   rU   rW   s   &rC   r   Ú	WignerD.m  r[   rQ   c                ó(   € V P                   ^,          # rÍ   rU   rW   s   &rC   rå   Ú
WignerD.mp  r[   rQ   c                ó(   € V P                   ^,          # ©rs  rU   rW   s   &rC   rz  ÚWignerD.alpha#  r[   rQ   c                ó(   € V P                   ^,          # )é   rU   rW   s   &rC   r~  ÚWignerD.beta'  r[   rQ   c                ó(   € V P                   ^,          # )é   rU   rW   s   &rC   r�  ÚWignerD.gamma+  r[   rQ   c                ó–  € V P                   ^ 8X  d‰   V P                  ^ 8X  dx   RVP                  V P                  4      : RVP                  V P                  4      : RVP                  V P
                  4      : RVP                  V P                  4      : R2	# RVP                  V P                  4      : RVP                  V P                  4      : RVP                  V P
                  4      : RVP                  V P                   4      : RVP                  V P                  4      : RVP                  V P                  4      : R2# )rT   zd^{z}_{Ú,z}\left(z\right)zD^{)rz  r�  Ú_printr@   r   rå   r~  r_   s   &&*rC   Ú_latexÚWignerD._latex/  s×   € Ø�:‰:˜Œ?˜tŸz™z¨Q�ð —N‘N 4§6¡6Ö*¨G¯N©NØŸ™ö- Ø!(§¡°·±Ö!8Ø—N‘N 4§9¡9Ö-ð	0ð 0øð —‘Ø—F‘FöØ$Ÿ^™^¨D¯F©FÖ3°W·^±^ÀDÇGÁGÖ5LØ—‘˜tŸz™zÖ*¨G¯N©N¸4¿9¹9Ö,EÀwÇ~Á~ÐVZ×V`ÑV`ÖGað	dð 	drQ   c                óÈ  € VP                  V P                  4      pVP                  V P                  4      p\        VP	                  R 4      !  p\        VP	                  VP                  V P
                  4      4      !  p\        VP                  4       VP                  4       4      p\        VP                  R4      !  p\        VP                  R4      !  pWSP                  4       8”  d4   \        VP	                  RWSP                  4       ,
          ,          4      !  pWTP                  4       8”  d4   \        VP	                  RWTP                  4       ,
          ,          4      !  pV P                  ^ 8X  dG   V P                  ^ 8X  d6   VP                  V P                  4      p\        RRV,          ,           4      pMÆVP                  V P                  4      p\        VP	                  R 4      !  p\        VP	                  VP                  V P                  4      4      !  p\        VP	                  R 4      !  p\        VP	                  VP                  V P                  4      4      !  p\        RRV,          ,           4      p\        VP                  4       !  p\        VP                  V4      !  p\        VP                  V4      !  p\        VP	                  V4      !  pV# )rÓ  Ú r–  r“  )rÔ  r@   r   r   Úrightrå   ÚmaxÚwidthÚleftrz  r�  r~  r   ÚparensÚaboveÚbelow)rX   r`   rV   ÚtopÚbotÚpadr´   s   &&*    rC   Ú_prettyÚWignerD._pretty<  sú  € Ø�n‰n˜TŸV™VÓ$ˆà�n‰n˜TŸV™VÓ$ˆÜ˜#Ÿ)™) C›.Ñ)ˆÜ˜#Ÿ)™) G§N¡N°4·7±7Ó$;Ó<Ñ=ˆä�#—)‘)“+˜sŸy™y›{Ó+ˆÜ˜#Ÿ(™( 3›-Ñ(ˆÜ˜#Ÿ(™( 3›-Ñ(ˆØ—‘“ÔÜ˜cŸi™i¨¨S·9±9³;Õ->Õ(?Ó@ÑAˆCØ—‘“ÔÜ˜cŸi™i¨¨S·9±9³;Õ->Õ(?Ó@ÑAˆCØ�:‰:˜Œ?˜tŸz™z¨QœØ—>‘> $§)¡)Ó,ˆDÜ˜3  S¥�=Ó)‰Aà—>‘> $§*¡*Ó-ˆDÜ˜tŸz™z¨#›Ñ/ˆDÜ˜tŸz™z¨'¯.©.¸¿¹Ó*CÓDÑEˆDÜ˜tŸz™z¨#›Ñ/ˆDÜ˜tŸz™z¨'¯.©.¸¿¹Ó*DÓEÑFˆDä˜3  S¥�=Ó)ˆAä˜4Ÿ;™;›=Ñ)ˆÜ˜Ÿ™ ›Ñ%ˆÜ˜Ÿ™ ›Ñ%ˆÜ˜Ÿ™ ›Ñ&ˆØˆrQ   c                ó6   € R VR&   \        V P                  / VB # )Trœ  )r+   rV   )rX   rÁ  s   &,rC   r›  ÚWignerD.doit\  s    € Ø ˆˆjÑÜ˜Ÿ	™	Ð+ UÑ+Ð+rQ   c           
     óT  € V P                   pV P                  pV P                  pV P                  pV P                  pV P
                  pV^ 8X  d   V^ 8X  d   V^ 8X  d   \        W#4      # VP                  '       g   \        RV,          4      h^ pV\        ^,          8X  Ed8   \        ^V,          ^,           4       F…  pW�V,           8”  g   W�V,
          8”  g   WƒV,
          8  d   K,  V\        P                  V,          \        W,           V4      ,          \        W,
          W‚,           V,
          4      ,          ,          pK‡  	  V\        P                  W#,
          ,          ^V,          ,          \        \        W,           4      \        W,
          4      ,          \        W,           4      \        W,
          4      ,          ,          4      ,          ,          pEM\!        V4      w  ršV
 F«  pV\"        P%                  WV\        ^,          4      P'                  4       \)        V) V,          4      \*        \-        V) V,          4      ,          ,           ,          \"        P%                  WV) \        ^,          4      P'                  4       ,          ,          pK­  	  V\*        ^V,          V,
          V,
          ,          ,          R^V,          ,          ,          p\/        V4      pV\1        \*        ) V,          V,          4      \1        \*        ) V,          V,          4      ,          ,          pV# )rT   z1j parameter must be numerical to evaluate, got %séÿÿÿÿ)r@   r   rå   rz  r~  r�  r#   r¥  r=   r   r>   r   ÚNegativeOner   r   r   rD   r*   r–  r›  r   r   r   r   r   )rX   r@   r   rå   rz  r~  r�  r¨  ÚkrA   ru   Úmpps   &           rC   rÀ  ÚWignerD._eval_wignerd`  sA  € Ø�F‰FˆØ�F‰FˆØ�W‰WˆØ—
‘
ˆØ�y‰yˆØ—
‘
ˆØ�AŒ:˜$ !œ)¨°¬
Ü! !Ó(Ð(Ø�{�{ˆ{ÜØCÀaÕGóIð IàˆØ”2�a•4�<ô ˜1˜Q�3 �7–^�Ø˜2•v”: ¨¥U¤¨a°qµ&¬jÙØ”a—m‘m aÕ'¬°µ¸Ó(;Õ;¼HÀQÅVÈQÍUÐUWÍZÓ<XÕXÕX’ñ $ð ”!—-‘- 1¥6Õ*¨Q°­TÕ1´$´yÀÅÓ7GÜ˜a�eÓ$õ8%Ü(1°!µ&Ó(9¼)ÀAÅFÓ:KÕ(Kõ8Mó 3Nõ Nõ NŠAô # 1›+‰KˆDÛ�Ø”X—Z‘Z  c¬2¨a­4Ó0×5Ñ5Ó7¼¸c¸TÀ$½Y»Ì!ÌCÐQTÐPTÐUYÕPYËNÕJZÕ9ZÕ[Ü—J‘J˜q¨ s¬B¨q­DÓ1×6Ñ6Ó8õ9õ 9’ñ ð ”!�a˜•c˜A•g •lÕ#Õ# R¨1¨Q­3¥KÕ/ˆAä˜“ˆAØ	ŒS”!��A•�e•‹_œS¤!  B¥ u¥Ó-Õ-Õ-ˆØˆrQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   Úis_commutativer¿  rÄ   r@   r   rå   rz  r~  r�  rÕ  rã  r›  rÀ  rÅ   rÆ   rÇ   s   @rC   r+   r+   ¼  s«   ø‡ € ñMð^ €Nò(ð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðòdòò@,÷)ð )rQ   ÚJc                   ó”   a € ] tR tRt o RtRtR t]R 4       t]R 4       t	]
R 4       tR tR	 tR
 tR tR tR tR tR tR tRtV tR# )Ú	SpinStatei™  z'Base class for angular momentum states.rÓ  c                ó‚  € \        V4      p\        V4      pVP                  '       dJ   ^V,          \        ^V,          4      8w  d   \        RV,          4      hV^ 8  d   \        RV,          4      hVP                  '       d1   ^V,          \        ^V,          4      8w  d   \        RV,          4      hVP                  '       de   VP                  '       dS   \	        V4      V8”  d   \        RV: RV: 24      h\        W,
          4      W,
          8w  d   \        RV: RV: 24      h\
        P                  ! WV4      # )r;   z*j must be integer or half-integer, got: %szj must be >= 0, got: %sz*m must be integer or half-integer, got: %sz1Allowed values for m are -j <= m <= j, got j, m: z, z8Both j and m must be integer or half-integer, got j, m: )r   r¥  r?   r=   Úabsr"   r¿  )rL   r@   r   s   &&&rC   r¿  ÚSpinState.__new__ž  só   € Ü�A‹JˆÜ�A‹JˆØ�;�;ˆ;Ø��s”c˜!˜A�#“hŒÜ Ø@À1ÕDóFð Fà�1ŒuÜ Ð!:¸QÕ!>Ó?Ð?Ø�;�;ˆ;Ø��s”c˜!˜A�#“hŒÜ Ø@À1ÕDóFð Fà�;�;ˆ;˜1Ÿ;Ÿ;˜;Ü�1‹v˜ŒzÝ Ó^_ÒabÐ!cÓdÐdÜ�1•5‹z˜Q�UÔ"Ý ÓefÒhiÐ!jÓkÐkÜ�}Š}˜S QÓ'Ð'rQ   c                ó(   € V P                   ^ ,          # rS   ry  rW   s   &rC   r@   ÚSpinState.j²  r|  rQ   c                ó(   € V P                   ^,          # rà   ry  rW   s   &rC   r   ÚSpinState.m¶  r|  rQ   c                óB   € \        ^V^ ,          ,          ^,           4      # rÍ   )r%   rK   s   &&rC   rN   ÚSpinState._eval_hilbert_spaceº  s   € ä˜A˜e A�h�J¨�NÓ+Ð+rQ   c           	     ó8  € V P                   pV P                  p\        VP                  R ^ 4      4      p\        VP                  R^ 4      4      p\        VP                  R^ 4      4      p\	        V4      w  rx\        V^4      p	\        V4       Fˆ  w  r«VP                  '       dA   \        P                  V P                   W°P                  WEV4      P                  4       Wš^ 3&   KW  \        P                  V P                   VV P                  WEV4      Wš^ 3&   KŠ  	  V	# )rz  r~  r�  )r@   r   r   rp   rD   r   Ú	enumerater¥  r*   r“  r›  )rX   rt   r@   r   rz  r~  r�  rA   ru   rv   rw   Úmvals   &,          rC   rz   ÚSpinState._represent_base¾  sã   € Ø�F‰FˆØ�F‰FˆÜ˜Ÿ™ G¨QÓ/Ó0ˆÜ�w—{‘{ 6¨1Ó-Ó.ˆÜ˜Ÿ™ G¨QÓ/Ó0ˆÜ˜q“k‰ˆÜ�t˜Q“ˆä  Ö'‰GˆAØ�{�{ˆ{Ü'Ÿz™zØ—F‘F˜D§&¡&¨%°uó >ß>B¹d»fð ˜!�t“ô  (Ÿz™z¨$¯&©&°$Ø*.¯&©&°%¸uó F�˜!�t“ñ (ð ˆrQ   c                óž   € \        V \        4      '       d   V P                  ! \        \        3/ VB # V P                  ! \        \
        3/ VB # rH   )r~   r    Ú_rewrite_basisrŠ   r-   r,   ©rX   rV   rt   s   &*,rC   Ú_eval_rewrite_as_JxÚSpinState._eval_rewrite_as_JxÐ  ó?   € Ü�dœC× Ò Ø×&Ò&¤r¬5Ñ<°GÑ<Ð<Ø×"Ò"¤2¤uÑ8°Ñ8Ð8rQ   c                óž   € \        V \        4      '       d   V P                  ! \        \        3/ VB # V P                  ! \        \
        3/ VB # rH   )r~   r    rÿ  r•   r/   r.   r   s   &*,rC   Ú_eval_rewrite_as_JyÚSpinState._eval_rewrite_as_JyÕ  r  rQ   c                óž   € \        V \        4      '       d   V P                  ! \        \        3/ VB # V P                  ! \        \
        3/ VB # rH   )r~   r    rÿ  r�   r1   r0   r   s   &*,rC   Ú_eval_rewrite_as_JzÚSpinState._eval_rewrite_as_JzÚ  r  rQ   c                óÈ  € ^ RI Hp V P                  pV P                  R,          pVP                  '       dõ   \        V \        4      '       dH   V\        V4      8X  d   V^,          pM/^V,          ^,
          ^V,          ^,           ,          ^,          pM^ pV! V 3RV/VB p\        \        ^V,          ^,           4       U	u. uF'  q˜Wy,           ,          V! WUV	,
          .VO5!  ,          NK)  	  up	!  p
\        V \        4      '       d!   VP                  R4      RJ d   \        V
4      # V
# ^ p	\        R4      pV P                  V^ 4      V 8w  d   V	^,          p	\        RV	,          4      p \        V \        4      '       d   ^ VR
3pM^ V3p\        V \        4      '       d2   V! V P                  ! V!  VR7      ^ ,          P                  R	,          pMAV! V P                  ! V!  VR7      ^ ,          P                  ^ ,          P                  R	,          pVR8X  d   V # V! W[.VO5!  p\         P"                  ! W[V P$                  .VO5!  p\'        Wþ,          Wµ) V34      # u up	i )rT   )Ú	represent:r;   NNrs   ÚcoupledFÚmizmi%d)rs   :rs  r¾  N)rT   rT   )rT   rT   rT   )Úsympy.physics.quantum.representr  r@   rV   r¥  r~   ÚCoupledSpinStater?   r   r>   rp   Úuncoupler   Úsubsr!   rª   r*   r“  r   r   )rX   rs   Úevectrt   r  r@   rV   ÚstartÚvectrB   rv   r  Ú	test_argsÚanglesr„   Últs   &&&,            rC   rÿ  ÚSpinState._rewrite_basisß  s  € Ý=Ø�F‰FˆØ�y‰y˜�}ˆØ�;�;ˆ;Ü˜$Ô 0×1Ò1Øœ˜A›”;Ø˜q�D‘Eà˜q�S 1�W q¨¥s¨Q¥wÕ/°Õ1‘Eà�Ù˜TÑ:¨Ð:°'Ñ:ˆDÜÜBGÈÈ!ÍÈaÍÄ.ÓQÁ.¸Q�u•y•/¡%¨¨q­5Ð"8°4Ó"8×8Ð8Á.ÑQñSˆFä˜$Ô 0×1Ò1°g·k±kÀ)Ó6LÐPUÓ6UÜ Ó'Ð'ØˆMàˆAÜ˜“ˆBà—)‘)˜B Ó" dÔ*Ø�Q•�Ü˜V a�ZÓ(�Øä˜$Ô 0×1Ò1Ø  F˜O‘	à ˜G�	Ü˜$¤×$Ò$Ù"Ø—N’N IÑ.°eô=Ø=>õ@ß@DÁÀSõJ‘ñ # 4§>¢>Øñ$ Ø',ô.Ø./õ1ß15±°aõ9ß9=¹¸cõC�à˜Ô"Ø�á˜aÐ+ dÓ+�Ü—Z’Z  t§v¡vÐ7°Ó7�Ü˜2�8 b¨"¨a [Ó1Ð1ùò9 Rs   Ã-Ic                ó�  € \        V P                  VP                  4      pVP                  4       V P                  Jd<   W0P	                  R 4      VP                  VP
                  ,
          ,          ,          pV# V\        V P                  VP                  4      \        V P
                  VP
                  4      ,          ,          pV# rH   )r#   r@   Ú
dual_classrª   Ú_represent_JxOpr   ©rX   ÚbrarÁ  rv   s   &&, rC   Ú_eval_innerproduct_JxBraÚ"SpinState._eval_innerproduct_JxBra  ó�   € Ü §¡¨¯©Ó.ˆØ�>‰>Ó 4§>¡>Ó1Ø×*Ñ*¨4Ó0°·±¸¿¹µÕ?Õ?ˆFð ˆð ”nØ—‘˜Ÿ™óÜ-¨d¯f©f°c·e±eÓ<õ=õ =ˆFàˆrQ   c                ó�  € \        V P                  VP                  4      pVP                  4       V P                  Jd<   W0P	                  R 4      VP                  VP
                  ,
          ,          ,          pV# V\        V P                  VP                  4      \        V P
                  VP
                  4      ,          ,          pV# rH   )r#   r@   r  rª   Ú_represent_JyOpr   r  s   &&, rC   Ú_eval_innerproduct_JyBraÚ"SpinState._eval_innerproduct_JyBra  r   rQ   c                ó�  € \        V P                  VP                  4      pVP                  4       V P                  Jd<   W0P	                  R 4      VP                  VP
                  ,
          ,          ,          pV# V\        V P                  VP                  4      \        V P
                  VP
                  4      ,          ,          pV# rH   )r#   r@   r  rª   rë   r   r  s   &&, rC   Ú_eval_innerproduct_JzBraÚ"SpinState._eval_innerproduct_JzBra  r   rQ   c                ó.   € W,          P                  4       # rH   )r›  )rX   r  rÁ  s   &&,rC   r»   ÚSpinState._eval_trace&  s   € ð •�‰Ó Ð rQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   Ú_label_separatorr¿  rÄ   r@   r   rÃ   rN   rz   r  r  r  rÿ  r  r#  r&  r»   rÅ   rÆ   rÇ   s   @rC   rð  rð  ™  s‚   ø‡ € Ù1àÐò(ð( ñó ðð ñó ðð ñ,ó ð,òò$9ò
9ò
9ò
*2òXòò÷!ð !rQ   rð  c                   ó\   a € ] tR tRt o Rt]R 4       t]R 4       tR tR t	R t
R tR	tV tR
# )r,   i6  zoEigenket of Jx.

See JzKet for the usage of spin eigenstates.

See Also
========

JzKet: Usage of spin states

c                ó   € \         # rH   ©r-   rW   s   &rC   r  ÚJxKet.dual_classB  ó   € äˆrQ   c                ó   € \         # rH   ©r4   rW   s   &rC   Úcoupled_classÚJxKet.coupled_classF  ó   € äÐrQ   c                ó&   € V P                   ! R/ VB # ré   )r  rº   s   &,rC   r¸   ÚJxKet._represent_default_basisJ  rí   rQ   c                ó&   € V P                   ! R/ VB # ©Nr½   rï   rð   s   &&,rC   r  ÚJxKet._represent_JxOpM  ó   € Ø×#Ò#Ñ. gÑ.Ð.rQ   c           	     óT   € V P                   ! RR \        \        ^^4      ,          /VB # ©rz  r½   ©rz   r   r
   rð   s   &&,rC   r"  ÚJxKet._represent_JyOpP  s&   € Ø×#Ò#ÑG¬"¬X°a¸«^Õ*;ÐG¸wÑGÐGrQ   c                ó@   € V P                   ! RR \        ^,          /VB # ©r~  r½   ©rz   r   rð   s   &&,rC   rë   ÚJxKet._represent_JzOpS  s   € Ø×#Ò#Ñ9¬¨A­Ð9°Ñ9Ð9rQ   r½   N©r¾   r¿   rÀ   rÁ   rÂ   rÃ   r  r2  r¸   r  r"  rë   rÅ   rÆ   rÇ   s   @rC   r,   r,   6  sL   ø‡ € ñ	ð ñó ðð ñó ðò5ò/òH÷:ð :rQ   c                   óD   a € ] tR tRt o Rt]R 4       t]R 4       tRtV t	R# )r-   iW  zoEigenbra of Jx.

See JzKet for the usage of spin eigenstates.

See Also
========

JzKet: Usage of spin states

c                ó   € \         # rH   ©r,   rW   s   &rC   r  ÚJxBra.dual_classc  r/  rQ   c                ó   € \         # rH   ©r5   rW   s   &rC   r2  ÚJxBra.coupled_classg  r4  rQ   r½   N©
r¾   r¿   rÀ   rÁ   rÂ   rÃ   r  r2  rÅ   rÆ   rÇ   s   @rC   r-   r-   W  ó2   ø‡ € ñ	ð ñó ðð ñó örQ   c                   ó\   a € ] tR tRt o Rt]R 4       t]R 4       tR tR t	R t
R tR	tV tR
# )r.   il  zoEigenket of Jy.

See JzKet for the usage of spin eigenstates.

See Also
========

JzKet: Usage of spin states

c                ó   € \         # rH   ©r/   rW   s   &rC   r  ÚJyKet.dual_classx  r/  rQ   c                ó   € \         # rH   ©r6   rW   s   &rC   r2  ÚJyKet.coupled_class|  r4  rQ   c                ó&   € V P                   ! R/ VB # ré   )r"  rº   s   &,rC   r¸   ÚJyKet._represent_default_basis€  rí   rQ   c                ó@   € V P                   ! RR \        ^,          /VB # ©r�  r½   rA  rð   s   &&,rC   r  ÚJyKet._represent_JxOpƒ  s   € Ø×#Ò#Ñ:¬"¨Q­$Ð:°'Ñ:Ð:rQ   c                ó&   € V P                   ! R/ VB # r8  rï   rð   s   &&,rC   r"  ÚJyKet._represent_JyOp†  r:  rQ   c           
     óŠ   € V P                   ! RR \        \        ^^4      ,          R\        ) ^,          R\        ^,          /VB # ©rz  r~  r�  r½   r=  rð   s   &&,rC   rë   ÚJyKet._represent_JzOp‰  s<   € Ø×#Ò#Ñ_¬"¬X°a¸«^Õ*;Ð_Ä2À#ÀaÅ%Ð_ÌrÐRSÍtÐ_ÐW^Ñ_Ð_rQ   r½   NrC  rÇ   s   @rC   r.   r.   l  sM   ø‡ € ñ	ð ñó ðð ñó ðò5ò;ò/÷`ð `rQ   c                   óD   a € ] tR tRt o Rt]R 4       t]R 4       tRtV t	R# )r/   i�  zoEigenbra of Jy.

See JzKet for the usage of spin eigenstates.

See Also
========

JzKet: Usage of spin states

c                ó   € \         # rH   ©r.   rW   s   &rC   r  ÚJyBra.dual_class™  r/  rQ   c                ó   € \         # rH   ©r7   rW   s   &rC   r2  ÚJyBra.coupled_class�  r4  rQ   r½   NrK  rÇ   s   @rC   r/   r/   �  rL  rQ   c                   ó\   a € ] tR tRt o Rt]R 4       t]R 4       tR tR t	R t
R tR	tV tR
# )r0   i¢  aú
  Eigenket of Jz.

Spin state which is an eigenstate of the Jz operator. Uncoupled states,
that is states representing the interaction of multiple separate spin
states, are defined as a tensor product of states.

Parameters
==========

j : Number, Symbol
    Total spin angular momentum
m : Number, Symbol
    Eigenvalue of the Jz spin operator

Examples
========

*Normal States:*

Defining simple spin states, both numerical and symbolic:

    >>> from sympy.physics.quantum.spin import JzKet, JxKet
    >>> from sympy import symbols
    >>> JzKet(1, 0)
    |1,0>
    >>> j, m = symbols('j m')
    >>> JzKet(j, m)
    |j,m>

Rewriting the JzKet in terms of eigenkets of the Jx operator:
Note: that the resulting eigenstates are JxKet's

    >>> JzKet(1,1).rewrite("Jx")
    |1,-1>/2 - sqrt(2)*|1,0>/2 + |1,1>/2

Get the vector representation of a state in terms of the basis elements
of the Jx operator:

    >>> from sympy.physics.quantum.represent import represent
    >>> from sympy.physics.quantum.spin import Jx, Jz
    >>> represent(JzKet(1,-1), basis=Jx)
    Matrix([
    [      1/2],
    [sqrt(2)/2],
    [      1/2]])

Apply innerproducts between states:

    >>> from sympy.physics.quantum.innerproduct import InnerProduct
    >>> from sympy.physics.quantum.spin import JxBra
    >>> i = InnerProduct(JxBra(1,1), JzKet(1,1))
    >>> i
    <1,1|1,1>
    >>> i.doit()
    1/2

*Uncoupled States:*

Define an uncoupled state as a TensorProduct between two Jz eigenkets:

    >>> from sympy.physics.quantum.tensorproduct import TensorProduct
    >>> j1,m1,j2,m2 = symbols('j1 m1 j2 m2')
    >>> TensorProduct(JzKet(1,0), JzKet(1,1))
    |1,0>x|1,1>
    >>> TensorProduct(JzKet(j1,m1), JzKet(j2,m2))
    |j1,m1>x|j2,m2>

A TensorProduct can be rewritten, in which case the eigenstates that make
up the tensor product is rewritten to the new basis:

    >>> TensorProduct(JzKet(1,1),JxKet(1,1)).rewrite('Jz')
    |1,1>x|1,-1>/2 + sqrt(2)*|1,1>x|1,0>/2 + |1,1>x|1,1>/2

The represent method for TensorProduct's gives the vector representation of
the state. Note that the state in the product basis is the equivalent of the
tensor product of the vector representation of the component eigenstates:

    >>> represent(TensorProduct(JzKet(1,0),JzKet(1,1)))
    Matrix([
    [0],
    [0],
    [0],
    [1],
    [0],
    [0],
    [0],
    [0],
    [0]])
    >>> represent(TensorProduct(JzKet(1,1),JxKet(1,1)), basis=Jz)
    Matrix([
    [      1/2],
    [sqrt(2)/2],
    [      1/2],
    [        0],
    [        0],
    [        0],
    [        0],
    [        0],
    [        0]])

See Also
========

JzKetCoupled: Coupled eigenstates
sympy.physics.quantum.tensorproduct.TensorProduct: Used to specify uncoupled states
uncouple: Uncouples states given coupling parameters
couple: Couples uncoupled states

c                ó   € \         # rH   ©r1   rW   s   &rC   r  ÚJzKet.dual_class  r/  rQ   c                ó   € \         # rH   ©r8   rW   s   &rC   r2  ÚJzKet.coupled_class  r4  rQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   ÚJzKet._represent_default_basis  rí   rQ   c           	     óT   € V P                   ! RR \        \        ^^4      ,          /VB # r@  r=  rð   s   &&,rC   r  ÚJzKet._represent_JxOp  s&   € Ø×#Ò#ÑF¬¬H°Q¸«NÕ):ÐF¸gÑFÐFrQ   c           
     óˆ   € V P                   ! RR \        \        ^^4      ,          R\        ^,          R\        ^,          /VB # r\  r=  rð   s   &&,rC   r"  ÚJzKet._represent_JyOp  s:   € Ø×#Ò#Ñ^¬"¬X°a¸«^Õ*;Ð^Ä"ÀQÅ$Ð^ÌbÐQRÍdÐ^ÐV]Ñ^Ð^rQ   c                ó&   € V P                   ! R/ VB # r8  rï   rð   s   &&,rC   rë   ÚJzKet._represent_JzOp"  r:  rQ   r½   NrC  rÇ   s   @rC   r0   r0   ¢  sO   ø‡ € ñlð\ ñó ðð ñó ðò5òGò_÷/ð /rQ   c                   óD   a € ] tR tRt o Rt]R 4       t]R 4       tRtV t	R# )r1   i&  zsEigenbra of Jz.

See the JzKet for the usage of spin eigenstates.

See Also
========

JzKet: Usage of spin states

c                ó   € \         # rH   ©r0   rW   s   &rC   r  ÚJzBra.dual_class2  r/  rQ   c                ó   € \         # rH   ©r9   rW   s   &rC   r2  ÚJzBra.coupled_class6  r4  rQ   r½   NrK  rÇ   s   @rC   r1   r1   &  rL  rQ   c                 ól  € \        V4       Uu. uF  q"^,           .NK  	  pp. p. pV  F‚  w  rgpVP                  V4       VP                  W6^,
          ,          W7^,
          ,          34       \        W6^,
          ,          W7^,
          ,          ,           4      p	W“V	^ ,          ^,
          &   K„  	  WT3# u upi rà   )r>   r¨   Úsorted)
Ú	jcouplingÚlengthr­   Ún_listÚ
coupled_jnÚ	coupled_nÚn1Ún2Új_newÚn_sorts
   &&        rC   Ú_build_coupledr†  ?  sž   € Ü % f¤Ó/¡˜1�A•‹w¡€FÐ/Ø€JØ€IÛ"‰ˆ�Ø×Ñ˜%Ô Ø×Ñ˜6 q¥&�>¨6°qµ&­>Ð:Ô<Ü˜ A�v�¨°Qµ­Õ7Ó8ˆØ &ˆv�a�y˜1�}Óñ	 #ð
 Ð Ð ùò 0s   ŽB1c                   ó¤   a € ] tR tRt o RtR tR tR tR t]	R 4       t
]	R 4       t]	R	 4       t]	R
 4       t]R 4       tR tR tR tR tRtV tR# )r  iK  z/Base class for coupled angular momentum states.c                ó  a€ \        W4       \        V4      ^ 8X  dx   . p\        ^\        S4      4       F>  pTP                  ^T\	        \        V4       Uu. uF  pSV,          NK  	  up!  34       K@  	  VP                  ^\        S4      V34       M<\        V4      ^8X  d   V^ ,          pM"\        R\        V4      ^,           ,          4      h\        S\        \        \        34      '       g'   \        RSP                  P                  ,          4      h\        V\        \        \        34      '       g'   \        RVP                  P                  ,          4      h\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   \        R4      h\        S4      ^,
          \        V4      8X  g.   \        R\        S4      ^,
          \        V4      3,          4      h\        ;QJ d    R	 V 4       F  '       d   K   RM	  RM! R	 V 4       4      '       g   \        R
4      h\        V4      p\        V4      p\        S Uu. uF  p\        V4      NK  	  up!  o\        V UU	Uu. uF.  w  r‰p\        \        V4      \        V	4      \        V4      4      NK0  	  upp	p!  p\        ;QJ d    R S 4       F  '       g   K   RM	  RM! R S 4       4      '       d   \        RS,          4      h\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \        R4      h\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   \        R4      h\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \        R4      h\!        V\        S4      4      w  r«\        S4      p\#        V
4       EF!  w  pw  r‰V\%        V4      ^,
          ,          pV\%        V	4      ^,
          ,          pWµ,          p\        V4      P&                  '       dª   \        V4      P&                  '       d�   \        V4      P&                  '       dt   WÞ,           V8  d   \        RV^,           WÞV3,          4      h\)        WÞ,
          4      V8”  d   \        RV^,           WÞV3,          4      h\+        WÞ,           4      '       d    Wü\%        W‰,           4      ^,
          &   EK$  	  \        V4      ^ 8”  d!   VR,          ^,          V8w  d   \        R4      h\,        P.                  ! WVSV4      # u upi u upi u upp	pi )rT   z5CoupledSpinState only takes 3 or 4 arguments, got: %sz'jn must be Tuple, list or tuple, got %sz.jcoupling must be Tuple, list or tuple, got %sc              3   óX   "  € T F   p\        V\        \        \        34      x € K"  	  R # 5irH   )r~   ÚlistÚtupler   ©Ú.0Úterms   & rC   Ú	<genexpr>Ú+CoupledSpinState.__new__.<locals>.<genexpr>d  s!   é € ÐPÁi¸d”:˜d¤T¬5´%Ð$8×9Ð9Ãiùs   ‚(*FTz6All elements of jcoupling must be list, tuple or Tuplez(jcoupling must have length of %d, got %dc              3   ó>   "  € T F  p\        V4      ^8H  x € K  	  R# 5i)rs  N©r¦   )r�  r
  s   & rC   r�  r�  j  s   é € Ð2©	 1”3�q“6˜Q–;«	ùó   ‚z,All elements of jcoupling must have length 3c              3   ó€   "  € T F4  qP                   '       g   K  ^V,          \        ^V,          4      8g  x € K6  	  R# 5i©r;   N©r¥  r?   )r�  Újis   & rC   r�  r�  s  s(   é € Ð>©2 R·µÔ ˆq��t”s˜1˜R�4“yÖ «2ùs   ‚>š$>z;All elements of jn must be integer or half-integer, got: %sc              3   ón   "  € T F+  w  rq1\        V4      8g  ;'       g    V\        V4      8g  x € K-  	  R # 5irH   )r?   )r�  r‚  rƒ  rl   s   &   rC   r�  r�  u  s-   é € ÐKÁ±+°2¸1”S˜“W‰}×-Ð- ¤c¨"£g¡Ô-Ãùs   ‚35z%Indices in jcoupling must be integersc              3   ó¤   <"  € T FE  w  rq1^8  ;'       g2    V^8  ;'       g%    V\        S4      8„  ;'       g    V\        S4      8„  x € KG  	  R# 5i)rá   Nr’  )r�  r‚  rƒ  rl   rÛ   s   &   €rC   r�  r�  w  sH   øé € Ð]ÑS\ÁKÀRÈQ�A‰v×?Ð?˜˜a™×?Ð? 2¬¨B«¡<×?Ð?°2¼¸B»±<Ô?ÓS\ùs   ƒA–A£A¹Az?Indices must be between 1 and the number of coupled spin spacesc              3   óˆ   "  € T F8  w   rVP                   '       g   K  ^V,          \        ^V,          4      8g  x € K:  	  R# 5ir•  r–  )r�  rl   r—  s   &  rC   r�  r�  y  s.   é € ÐM±9¡Z a¨ÀÇÅÔ ˆq��t”s˜1˜R�4“yÖ ³9ùs
   ‚Až$AzGAll coupled j values in coupling scheme must be integer or half-integerzQAll couplings must have j1+j2 >= j3, in coupling number %d got j1,j2,j3: %d,%d,%dzSAll couplings must have |j1+j2| <= j3, in coupling number %d got j1,j2,j3: %d,%d,%dz>Last j value coupled together must be the final j of the staterè  )rð  r¦   r>   r¨   r   Ú	TypeErrorr~   rŠ  r‹  r   rª   r¾   Úallr=   r   Úanyr†  rû  Úminr¥  rò  r   r"   r¿  )rL   r@   r   rÛ   r}  r­   rB   r—  r‚  rƒ  r�  r€  ÚjvalsÚj1Új2Új3s   &&&f*           rC   r¿  ÚCoupledSpinState.__new__N  sY  ø€ ä�!Œäˆy‹>˜QÔàˆIÜ˜1œc "›gÖ&�Ø× Ñ  1 a¬¼eÀA¼hÓ.G¹h¸¨r°!¯u¨u¹hÑ.GÑ)HÐ"IÖKñ 'à×Ñ˜q¤# b£'¨1˜oÕ/Ü�‹^˜qÔ à! !�‰IäÐSÔWZÐ[dÓWeÐhiÕWiÕjÓlÐlä˜"œt¤U¬EÐ2×3Ò3ÜÐEØŸL™L×1Ñ1õ2ó 3ð 3ä˜)¤d¬E´5Ð%9×:Ò:ÜÐLØ%×/Ñ/×8Ñ8õ9ó :ð :ç‹sÑPÁiÓP�s�sŠsÑPÁiÓP×PÒPÜØHóJð Jä�2‹w˜�{œc )›nÔ,ÜÐGÜ! "›g¨�k¬3¨y«>Ð:õ;ó <ð <ç‹sÑ2©	Ó2�s�sŠsÑ2©	Ó2×2Ò2ÜÐKÓLÐLä�A‹JˆÜ�A‹JˆÜ©BÓ/©B b”g˜b–k©BÑ/Ñ1ˆÜÙ?HõJÙ?H©|°¸ô #¤7Øó$Ü˜“œg b›kö+Ù?HóJñ Lˆ	÷ ‹3Ñ>©2Ó>�3�3Š3Ñ>©2Ó>×>Ò>ÜÐZÐ]_Õ_Ó`Ð`ß‹3ÑKÁÓK�3�3Š3ÑKÁÓK×KÒKÜÐDÓEÐEß‹3Ô]ÑS\Ó]�3�3Š3Ô]ÑS\Ó]×]Ò]ÜÐ^Ó_Ð_ß‹3ÑM±9ÓM�3�3Š3ÑM±9ÓM×MÒMÜÐfÓgÐgÜ .¨y¼#¸b»'Ó BÑˆ	Ü�R“ˆÜ$ Y×/‰KˆA‰x�Ø”s˜2“w •{Õ#ˆBØ”s˜2“w •{Õ#ˆBØ•ˆBÜ�r‹{×$×$Ð$¬°«×)>×)>Ð)>Ä7È2Ã;×CX×CXÐCXØ•7˜R”<Ü$ð &GØJKÈaÍ%ÐQSÐY[ÐI\õ&]ó ^ð ^ä�r•w“< "Ô$Ü$ð &GØJKÈaÍ%ÐQSÐY[ÐI\õ&]ó ^ð ^ä˜b�g×&Ò&ØØ&(”#�b•g“, Õ"Ô#ñ 0ô ˆy‹>˜AÔ )¨B¥-°Õ"2°aÔ"7ÜÐ]Ó^Ð^ä�}Š}˜S Q¨¨IÓ6Ð6ùòq /Hùò2 0ùôJs   ÁU0ÉU5É84U:c                ó  € VP                  V P                  4      VP                  V P                  4      .p\        V P                  ^R7       F-  w  rEVP                  RWAP                  V4      3,          4       K/  	  \        V P                  RR V P                  RR 4       FU  w  pw  rxVP                  RRP                  R \        Wx,           4       4       4      : RVP                  V4      : 24       KW  	  RP                  V4      # )	rá   ©r  zj%d=%sNzj(rÓ  c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5irH   ©rd   ©r�  rB   s   & rC   r�  Ú0CoupledSpinState._print_label.<locals>.<genexpr>˜  ó   é € Ð9© Aœ˜QŸ˜«ùó   ‚z)=rè  )rÔ  r@   r   rû  rÛ   r¨   Úzipr€  r�  Újoinr|  )	rX   r`   rV   rM   rB   r—  rÛ   r‚  rƒ  s	   &&*      rC   Ú_print_labelÚCoupledSpinState._print_label�  sÕ   € Ø—‘ §¡Ó'¨¯©¸¿¹Ó)?Ð@ˆÜ˜tŸw™w¨a×0‰EˆAØ�L‰L˜Ø—>‘> "Ó%ð%õ ö ñ 1ô   §¡°°Ð 4°d·n±nÀSÀbÐ6IÖJ‰LˆB‘�Ø�LŠLØ—‘Ñ9¬°µ¬Ó9Ö9¸7¿>¹>È"Õ;Mðö ñ Kð �x‰x˜‹ÐrQ   c                óÀ  € V P                   V P                  .p\        V P                  ^R7       Fc  w  rERV,          p\	        V4      p\        VR,           4      p\        VP                  VP                  V4      4      !  pVP                  V4       Ke  	  \        V P                  RR V P                  RR 4       F€  w  pw  ršRP                  R \        Wš,           4       4       4      p\        RV,           R,           4      p\        VP                  VP                  V4      4      !  pVP                  V4       K‚  	  V P                  ! W0P                  V.VO5!  # )	rá   r¥  új%dÚ=NrÓ  c              3   óT   "  € T F  p\        R V,          4      R,          x € K   	  R# 5i)r±  Nrè  r   r¨  s   & rC   r�  Ú7CoupledSpinState._print_label_pretty.<locals>.<genexpr>¥  s!   é € ÐO¹¸!œ u¨q¥yÓ1°"×5Ò5»ùs   ‚&(r@   rè  )r@   r   rû  rÛ   r   r   rÙ  rÔ  r¨   r¬  r€  r�  r­  r|  Ú_print_sequence_prettyr*  )rX   r`   rV   rM   rB   r—  ÚsymbÚitemrÛ   r‚  rƒ  r­   s   &&*         rC   Ú_print_label_prettyÚ$CoupledSpinState._print_label_prettyœ  s   € Ø—‘˜Ÿ™Ð ˆÜ˜tŸw™w¨a×0‰EˆAØ˜1•9ˆDÜ  Ó&ˆDÜ˜d S�jÓ)ˆDÜ˜tŸz™z¨'¯.©.¸Ó*<Ó=Ñ>ˆDØ�L‰L˜Öñ 1ô   §¡°°Ð 4°d·n±nÀSÀbÐ6IÖJ‰LˆB‘�Ø—‘ÑO¼vÀbÅg¼ÓOÓOˆAÜ˜c A�g¨�mÓ,ˆDÜ˜tŸz™z¨'¯.©.¸Ó*<Ó=Ñ>ˆDØ�L‰L˜Öñ	 Kð
 ×*Ò*Ø×(Ñ(¨'ð
Ø48ó
ð 	
rQ   c           
     óN  € VP                   ! V P                  .VO5!  VP                   ! V P                  .VO5!  .p\        V P                  ^R7       F0  w  rEVP                  RWAP                   ! V.VO5!  3,          4       K2  	  \        V P                  RR V P                  RR 4       FZ  w  pw  rxRP                  R \        Wx,           4       4       4      p	VP                  RV	: RVP                   ! V.VO5!  : 24       K\  	  V P                  P                  V4      # )	rá   r¥  z	j_{%d}=%sNrÓ  c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5irH   r§  r¨  s   & rC   r�  Ú6CoupledSpinState._print_label_latex.<locals>.<genexpr>µ  rª  r«  zj_{z}=rè  )rÔ  r@   r   rû  rÛ   r¨   r¬  r€  r�  r­  r|  r*  )
rX   r`   rV   rM   rB   r—  rÛ   r‚  rƒ  r­   s
   &&*       rC   Ú_print_label_latexÚ#CoupledSpinState._print_label_latex­  sî   € à�NŠN˜4Ÿ6™6Ð) DÓ)Ø�NŠN˜4Ÿ6™6Ð) DÓ)ð
ˆô ˜tŸw™w¨a×0‰EˆAØ�L‰L˜¨¯>ª>¸"Ð+D¸tÓ+DÐ'EÕEÖGñ 1ä §¡°°Ð 4°d·n±nÀSÀbÐ6IÖJ‰LˆB‘�Ø—‘Ñ9¬°µ¬Ó9Ó9ˆAØ�LŠL«¨7¯>ª>¸"Ð+D¸tÕ+DÐEÖGñ Kð ×$Ñ$×)Ñ)¨%Ó0Ð0rQ   c                ó(   € V P                   ^,          # rÍ   ry  rW   s   &rC   rÛ   ÚCoupledSpinState.jn¹  r|  rQ   c                ó(   € V P                   ^,          # rÊ  ry  rW   s   &rC   rÜ   ÚCoupledSpinState.coupling½  r|  rQ   c                ó~   € \        V P                  ^,          \        V P                  ^,          4      4      ^,          # rÊ  ©r†  rM   r¦   rW   s   &rC   r€  ÚCoupledSpinState.coupled_jnÁ  ó)   € ä˜dŸj™j¨�m¬S°·±¸AµÓ-?Ó@ÀÕCÐCrQ   c                ó~   € \        V P                  ^,          \        V P                  ^,          4      4      ^ ,          # rÊ  rÄ  rW   s   &rC   r�  ÚCoupledSpinState.coupled_nÅ  rÆ  rQ   c                ó
  € \        V^,          !  pVP                  '       dE   \        \        \	        ^V,          ^,           4      ^ R4       Uu. uF  p\        V4      NK  	  up!  # \        ^V,          ^,           4      # u upi )r;   éþÿÿÿ)r   r¥  r&   r>   r?   r%   )rL   rM   r@   r
  s   &&  rC   rN   Ú$CoupledSpinState._eval_hilbert_spaceÉ  sl   € ä��q•‰NˆØ�;�;ˆ;Ü(ÄUÌ3ÈqÐQRÍsÐUVÍwË<ÐYZÐ\^ÔE_Ó*aÑE_À¬L¸®OÑE_Ñ*aÑbÐbô    !¥ a¥Ó(Ð(ùò +bs   ÁB c                óª  € V P                  4       pV P                  P                  '       g   \        R 4      hV P                  P
                  P                  '       g   \        R4      h\        V P                  P
                  ^4      pV P                  \        V P                  4      8X  d   V P                  ^,          pM@^V P                  ,          ^,
          ^^V P                  ,          ,           ,          ^,          pV! V P                  V P                  4      P                  ! R/ VB W4V^V P                  ,          ,           ^,           1^ 3&   V# )z1State must not have symbolic j value to representz2State must not have symbolic j values to representr½   )
Úuncoupled_classr@   r¥  r=   Úhilbert_spaceÚ	dimensionr   r?   r   rz   )rX   rt   r  rv   r  s   &,   rC   Ú_represent_coupled_baseÚ(CoupledSpinState._represent_coupled_baseÖ  s  € Ø×$Ñ$Ó&ˆØ�v‰v××ÐÜØCóEð Eà×!Ñ!×+Ñ+×5×5Ð5ÜØDóFð Fä�t×)Ñ)×3Ñ3°QÓ7ˆØ�6‰6”S˜Ÿ™“[Ô Ø—F‘F˜A•I‰Eà�t—v‘v•X •\ A¨¨$¯&©&­¥LÕ1°!Õ3ˆEÙ05Ø�F‰F�D—F‘Fó1ß+™Oð1,ñ 17Ø.5ñ17ˆ�U˜Q˜tŸv™v�XÕ%¨Õ)Ð)¨1Ð,Ñ-àˆrQ   c                óž   € \        V \        4      '       d   V P                  ! \        \        3/ VB # V P                  ! \        \
        3/ VB # rH   )r~   r    rÿ  rŠ   r5   r4   r   s   &*,rC   r  Ú$CoupledSpinState._eval_rewrite_as_Jxç  ó?   € Ü�dœC× Ò Ø×&Ò&¤r¬<ÑC¸7ÑCÐCØ×"Ò"¤2¤|Ñ?°wÑ?Ð?rQ   c                óž   € \        V \        4      '       d   V P                  ! \        \        3/ VB # V P                  ! \        \
        3/ VB # rH   )r~   r    rÿ  r•   r7   r6   r   s   &*,rC   r  Ú$CoupledSpinState._eval_rewrite_as_Jyì  rÔ  rQ   c                óž   € \        V \        4      '       d   V P                  ! \        \        3/ VB # V P                  ! \        \
        3/ VB # rH   )r~   r    rÿ  r�   r9   r8   r   s   &*,rC   r  Ú$CoupledSpinState._eval_rewrite_as_Jzñ  rÔ  rQ   r½   N)r¾   r¿   rÀ   rÁ   rÂ   r¿  r®  r¸  r½  rÄ   rÛ   rÜ   r€  r�  rÃ   rN   rÐ  r  r  r  rÅ   rÆ   rÇ   s   @rC   r  r  K  s£   ø‡ € Ù9ò@7òD
ò
ò"
1ð ñó ðð ñó ðð ñDó ðDð ñDó ðDð ñ
)ó ð
)òò"@ò
@÷
@ð @rQ   r  c                   ó\   a € ] tR tRt o Rt]R 4       t]R 4       tR tR t	R t
R tR	tV tR
# )r4   i÷  z•Coupled eigenket of Jx.

See JzKetCoupled for the usage of coupled spin eigenstates.

See Also
========

JzKetCoupled: Usage of coupled spin states

c                ó   € \         # rH   rI  rW   s   &rC   r  ÚJxKetCoupled.dual_class  r4  rQ   c                ó   € \         # rH   rF  rW   s   &rC   rÍ  ÚJxKetCoupled.uncoupled_class  r/  rQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   Ú%JxKetCoupled._represent_default_basis  rí   rQ   c                ó&   € V P                   ! R/ VB # r8  ©rÐ  rð   s   &&,rC   r  ÚJxKetCoupled._represent_JxOp  ó   € Ø×+Ò+Ñ6¨gÑ6Ð6rQ   c           	     óT   € V P                   ! RR \        \        ^^4      ,          /VB # r<  ©rÐ  r   r
   rð   s   &&,rC   r"  ÚJxKetCoupled._represent_JyOp  s&   € Ø×+Ò+ÑO´"´X¸aÀ³^Õ2CÐOÀwÑOÐOrQ   c                ó@   € V P                   ! RR \        ^,          /VB # r@  ©rÐ  r   rð   s   &&,rC   rë   ÚJxKetCoupled._represent_JzOp  s   € Ø×+Ò+ÑA´°AµÐA¸ÑAÐArQ   r½   N©r¾   r¿   rÀ   rÁ   rÂ   rÃ   r  rÍ  r¸   r  r"  rë   rÅ   rÆ   rÇ   s   @rC   r4   r4   ÷  sN   ø‡ € ñ	ð ñó ðð ñó ðò5ò7òP÷Bð BrQ   c                   óD   a € ] tR tRt o Rt]R 4       t]R 4       tRtV t	R# )r5   i  z•Coupled eigenbra of Jx.

See JzKetCoupled for the usage of coupled spin eigenstates.

See Also
========

JzKetCoupled: Usage of coupled spin states

c                ó   € \         # rH   r1  rW   s   &rC   r  ÚJxBraCoupled.dual_class$  r4  rQ   c                ó   € \         # rH   r-  rW   s   &rC   rÍ  ÚJxBraCoupled.uncoupled_class(  r/  rQ   r½   N©
r¾   r¿   rÀ   rÁ   rÂ   rÃ   r  rÍ  rÅ   rÆ   rÇ   s   @rC   r5   r5     ó2   ø‡ € ñ	ð ñó ðð ñó örQ   c                   ó\   a € ] tR tRt o Rt]R 4       t]R 4       tR tR t	R t
R tR	tV tR
# )r6   i-  z•Coupled eigenket of Jy.

See JzKetCoupled for the usage of coupled spin eigenstates.

See Also
========

JzKetCoupled: Usage of coupled spin states

c                ó   € \         # rH   rc  rW   s   &rC   r  ÚJyKetCoupled.dual_class9  r4  rQ   c                ó   € \         # rH   r`  rW   s   &rC   rÍ  ÚJyKetCoupled.uncoupled_class=  r/  rQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   Ú%JyKetCoupled._represent_default_basisA  rí   rQ   c                ó@   € V P                   ! RR \        ^,          /VB # rW  rè  rð   s   &&,rC   r  ÚJyKetCoupled._represent_JxOpD  s   € Ø×+Ò+ÑB´"°Qµ$ÐB¸'ÑBÐBrQ   c                ó&   € V P                   ! R/ VB # r8  rá  rð   s   &&,rC   r"  ÚJyKetCoupled._represent_JyOpG  rã  rQ   c           
     óŠ   € V P                   ! RR \        \        ^^4      ,          R\        ) ^,          R\        ^,          /VB # r\  rå  rð   s   &&,rC   rë   ÚJyKetCoupled._represent_JzOpJ  s>   € Ø×+Ò+Ñg´"´X¸aÀ³^Õ2CÐgÌ2È#ÈaÍ%ÐgÔWYÐZ[ÕW[ÐgÐ_fÑgÐgrQ   r½   Nrê  rÇ   s   @rC   r6   r6   -  sN   ø‡ € ñ	ð ñó ðð ñó ðò5òCò7÷hð hrQ   c                   óD   a € ] tR tRt o Rt]R 4       t]R 4       tRtV t	R# )r7   iN  z•Coupled eigenbra of Jy.

See JzKetCoupled for the usage of coupled spin eigenstates.

See Also
========

JzKetCoupled: Usage of coupled spin states

c                ó   € \         # rH   rR  rW   s   &rC   r  ÚJyBraCoupled.dual_classZ  r4  rQ   c                ó   € \         # rH   rO  rW   s   &rC   rÍ  ÚJyBraCoupled.uncoupled_class^  r/  rQ   r½   Nrð  rÇ   s   @rC   r7   r7   N  rñ  rQ   c                   ó\   a € ] tR tRt o Rt]R 4       t]R 4       tR tR t	R t
R tR	tV tR
# )r8   ic  až  Coupled eigenket of Jz

Spin state that is an eigenket of Jz which represents the coupling of
separate spin spaces.

The arguments for creating instances of JzKetCoupled are ``j``, ``m``,
``jn`` and an optional ``jcoupling`` argument. The ``j`` and ``m`` options
are the total angular momentum quantum numbers, as used for normal states
(e.g. JzKet).

The other required parameter in ``jn``, which is a tuple defining the `j_n`
angular momentum quantum numbers of the product spaces. So for example, if
a state represented the coupling of the product basis state
`\left|j_1,m_1\right\rangle\times\left|j_2,m_2\right\rangle`, the ``jn``
for this state would be ``(j1,j2)``.

The final option is ``jcoupling``, which is used to define how the spaces
specified by ``jn`` are coupled, which includes both the order these spaces
are coupled together and the quantum numbers that arise from these
couplings. The ``jcoupling`` parameter itself is a list of lists, such that
each of the sublists defines a single coupling between the spin spaces. If
there are N coupled angular momentum spaces, that is ``jn`` has N elements,
then there must be N-1 sublists. Each of these sublists making up the
``jcoupling`` parameter have length 3. The first two elements are the
indices of the product spaces that are considered to be coupled together.
For example, if we want to couple `j_1` and `j_4`, the indices would be 1
and 4. If a state has already been coupled, it is referenced by the
smallest index that is coupled, so if `j_2` and `j_4` has already been
coupled to some `j_{24}`, then this value can be coupled by referencing it
with index 2. The final element of the sublist is the quantum number of the
coupled state. So putting everything together, into a valid sublist for
``jcoupling``, if `j_1` and `j_2` are coupled to an angular momentum space
with quantum number `j_{12}` with the value ``j12``, the sublist would be
``(1,2,j12)``, N-1 of these sublists are used in the list for
``jcoupling``.

Note the ``jcoupling`` parameter is optional, if it is not specified, the
default coupling is taken. This default value is to coupled the spaces in
order and take the quantum number of the coupling to be the maximum value.
For example, if the spin spaces are `j_1`, `j_2`, `j_3`, `j_4`, then the
default coupling couples `j_1` and `j_2` to `j_{12}=j_1+j_2`, then,
`j_{12}` and `j_3` are coupled to `j_{123}=j_{12}+j_3`, and finally
`j_{123}` and `j_4` to `j=j_{123}+j_4`. The jcoupling value that would
correspond to this is:

    ``((1,2,j1+j2),(1,3,j1+j2+j3))``

Parameters
==========

args : tuple
    The arguments that must be passed are ``j``, ``m``, ``jn``, and
    ``jcoupling``. The ``j`` value is the total angular momentum. The ``m``
    value is the eigenvalue of the Jz spin operator. The ``jn`` list are
    the j values of argular momentum spaces coupled together. The
    ``jcoupling`` parameter is an optional parameter defining how the spaces
    are coupled together. See the above description for how these coupling
    parameters are defined.

Examples
========

Defining simple spin states, both numerical and symbolic:

    >>> from sympy.physics.quantum.spin import JzKetCoupled
    >>> from sympy import symbols
    >>> JzKetCoupled(1, 0, (1, 1))
    |1,0,j1=1,j2=1>
    >>> j, m, j1, j2 = symbols('j m j1 j2')
    >>> JzKetCoupled(j, m, (j1, j2))
    |j,m,j1=j1,j2=j2>

Defining coupled spin states for more than 2 coupled spaces with various
coupling parameters:

    >>> JzKetCoupled(2, 1, (1, 1, 1))
    |2,1,j1=1,j2=1,j3=1,j(1,2)=2>
    >>> JzKetCoupled(2, 1, (1, 1, 1), ((1,2,2),(1,3,2)) )
    |2,1,j1=1,j2=1,j3=1,j(1,2)=2>
    >>> JzKetCoupled(2, 1, (1, 1, 1), ((2,3,1),(1,2,2)) )
    |2,1,j1=1,j2=1,j3=1,j(2,3)=1>

Rewriting the JzKetCoupled in terms of eigenkets of the Jx operator:
Note: that the resulting eigenstates are JxKetCoupled

    >>> JzKetCoupled(1,1,(1,1)).rewrite("Jx")
    |1,-1,j1=1,j2=1>/2 - sqrt(2)*|1,0,j1=1,j2=1>/2 + |1,1,j1=1,j2=1>/2

The rewrite method can be used to convert a coupled state to an uncoupled
state. This is done by passing coupled=False to the rewrite function:

    >>> JzKetCoupled(1, 0, (1, 1)).rewrite('Jz', coupled=False)
    -sqrt(2)*|1,-1>x|1,1>/2 + sqrt(2)*|1,1>x|1,-1>/2

Get the vector representation of a state in terms of the basis elements
of the Jx operator:

    >>> from sympy.physics.quantum.represent import represent
    >>> from sympy.physics.quantum.spin import Jx
    >>> from sympy import S
    >>> represent(JzKetCoupled(1,-1,(S(1)/2,S(1)/2)), basis=Jx)
    Matrix([
    [        0],
    [      1/2],
    [sqrt(2)/2],
    [      1/2]])

See Also
========

JzKet: Normal spin eigenstates
uncouple: Uncoupling of coupling spin states
couple: Coupling of uncoupled spin states

c                ó   € \         # rH   ry  rW   s   &rC   r  ÚJzKetCoupled.dual_classØ  r4  rQ   c                ó   € \         # rH   rv  rW   s   &rC   rÍ  ÚJzKetCoupled.uncoupled_classÜ  r/  rQ   c                ó&   € V P                   ! R/ VB # ré   rê   rº   s   &,rC   r¸   Ú%JzKetCoupled._represent_default_basisà  rí   rQ   c           	     óT   € V P                   ! RR \        \        ^^4      ,          /VB # r@  rå  rð   s   &&,rC   r  ÚJzKetCoupled._represent_JxOpã  s&   € Ø×+Ò+ÑN´´H¸QÀ³NÕ1BÐNÀgÑNÐNrQ   c           
     óˆ   € V P                   ! RR \        \        ^^4      ,          R\        ^,          R\        ^,          /VB # r\  rå  rð   s   &&,rC   r"  ÚJzKetCoupled._represent_JyOpæ  s<   € Ø×+Ò+Ñf´"´X¸aÀ³^Õ2CÐfÌ"ÈQÍ$ÐfÔVXÐYZÕVZÐfÐ^eÑfÐfrQ   c                ó&   € V P                   ! R/ VB # r8  rá  rð   s   &&,rC   rë   ÚJzKetCoupled._represent_JzOpé  rã  rQ   r½   Nrê  rÇ   s   @rC   r8   r8   c  sO   ø‡ € ñrðh ñó ðð ñó ðò5òOòg÷7ð 7rQ   c                   óD   a € ] tR tRt o Rt]R 4       t]R 4       tRtV t	R# )r9   ií  z™Coupled eigenbra of Jz.

See the JzKetCoupled for the usage of coupled spin eigenstates.

See Also
========

JzKetCoupled: Usage of coupled spin states

c                ó   € \         # rH   rj  rW   s   &rC   r  ÚJzBraCoupled.dual_classù  r4  rQ   c                ó   € \         # rH   rg  rW   s   &rC   rÍ  ÚJzBraCoupled.uncoupled_classý  r/  rQ   r½   Nrð  rÇ   s   @rC   r9   r9   í  rñ  rQ   Nc                óÚ  a€ V P                  \        4      pV FÎ  o\        ;QJ d&    R SP                   4       F  '       d   K   RM	  RM! R SP                   4       4      '       g   KS  \        ;QJ d)    V3R lSP                   4       F  '       d   K   RM	  RM! V3R lSP                   4       4      '       g   \	        R4      hV P                  S\        SV4      4      p KÐ  	  V # )a,	  Couple a tensor product of spin states

This function can be used to couple an uncoupled tensor product of spin
states. All of the eigenstates to be coupled must be of the same class. It
will return a linear combination of eigenstates that are subclasses of
CoupledSpinState determined by Clebsch-Gordan angular momentum coupling
coefficients.

Parameters
==========

expr : Expr
    An expression involving TensorProducts of spin states to be coupled.
    Each state must be a subclass of SpinState and they all must be the
    same class.

jcoupling_list : list or tuple
    Elements of this list are sub-lists of length 2 specifying the order of
    the coupling of the spin spaces. The length of this must be N-1, where N
    is the number of states in the tensor product to be coupled. The
    elements of this sublist are the same as the first two elements of each
    sublist in the ``jcoupling`` parameter defined for JzKetCoupled. If this
    parameter is not specified, the default value is taken, which couples
    the first and second product basis spaces, then couples this new coupled
    space to the third product space, etc

Examples
========

Couple a tensor product of numerical states for two spaces:

    >>> from sympy.physics.quantum.spin import JzKet, couple
    >>> from sympy.physics.quantum.tensorproduct import TensorProduct
    >>> couple(TensorProduct(JzKet(1,0), JzKet(1,1)))
    -sqrt(2)*|1,1,j1=1,j2=1>/2 + sqrt(2)*|2,1,j1=1,j2=1>/2


Numerical coupling of three spaces using the default coupling method, i.e.
first and second spaces couple, then this couples to the third space:

    >>> couple(TensorProduct(JzKet(1,1), JzKet(1,1), JzKet(1,0)))
    sqrt(6)*|2,2,j1=1,j2=1,j3=1,j(1,2)=2>/3 + sqrt(3)*|3,2,j1=1,j2=1,j3=1,j(1,2)=2>/3

Perform this same coupling, but we define the coupling to first couple
the first and third spaces:

    >>> couple(TensorProduct(JzKet(1,1), JzKet(1,1), JzKet(1,0)), ((1,3),(1,2)) )
    sqrt(2)*|2,2,j1=1,j2=1,j3=1,j(1,3)=1>/2 - sqrt(6)*|2,2,j1=1,j2=1,j3=1,j(1,3)=2>/6 + sqrt(3)*|3,2,j1=1,j2=1,j3=1,j(1,3)=2>/3

Couple a tensor product of symbolic states:

    >>> from sympy import symbols
    >>> j1,m1,j2,m2 = symbols('j1 m1 j2 m2')
    >>> couple(TensorProduct(JzKet(j1,m1), JzKet(j2,m2)))
    Sum(CG(j1, m1, j2, m2, j, m1 + m2)*|j,m1 + m2,j1=j1,j2=j2>, (j, m1 + m2, j1 + j2))

c              3   óB   "  € T F  p\        V\        4      x € K  	  R # 5irH   )r~   rð  ©r�  r„   s   & rC   r�  Úcouple.<locals>.<genexpr>C  s   é € ÐE¹W°E”:˜e¤Y×/Ð/»Wùs   ‚FTc              3   ót   <"  € T F-  qP                   SP                  ^ ,          P                   J x € K/  	  R# 5i©rT   N)rª   rV   )r�  r„   r¬   s   & €rC   r�  r  F  s&   øé € ÐPÉ¸u—?‘? b§g¡g¨a¥j×&:Ñ&:Õ:Ëùs   ƒ58z!All states must be the same basis)Úatomsr'   rœ  rV   r›  r  Ú_couple)ÚexprÚjcoupling_listrg   r¬   s   && @rC   Úcoupler     s�   ø€ ðt 	�
‰
”=Ó!€AÛˆç‹sÑE¸R¿WºWÓE�s�sŠsÑE¸R¿WºWÓE×EÒEÙç‹sÔPÈÏÊÓP�s�sŠsÔPÈÏÊÓP×PÒPÜÐ?Ó@Ð@Ø�y‰y˜œW R¨Ó8Ó9Šñ ð €KrQ   c                 ób  € V P                   pV^ ,          P                  4       pVf9   . p\        ^\        V4      4       F  pVP	                  ^V^,           34       K  	  \        V4      \        V4      ^,
          8X  g.   \        R\        V4      ^,
          \        V4      3,          4      h\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   \        R4      h\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \        R4      h\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       dg   ^ .\        V4      ,          pV FM  w  rgWV^,
          ,          R8X  g   WW^,
          ,          R8X  d   \        R	4      hRV\        Wg4      ^,
          &   KO  	  V Uu. uF  qˆP                  NK  	  p	pV Uu. uF  qˆP                  NK  	  p
p. p\        \        V4      4       Uu. uF  qÌ^,           .NK  	  ppV Fo  pVw  rg\        WÖ^,
          ,          4      p\        W×^,
          ,          4      pVP	                  VV34       \        VV,           4      V\        Wg4      ^,
          &   Kq  	  \        ;QJ d    R
 V 4       F  '       d   K   RM	  RM! R
 V 4       4      '       EdF   V UUu. uFR  p\        V^ ,          V^,          ,            Uu. uF&  qIV^,
          ,          W¤^,
          ,          ,
          NK(  	  up!  NKT  	  ppp. p\        VR,          ^,           4       EF¼  p\        V4      p\!        VV,           ^,
          V4      p\        V4       EFƒ  p\#        VVV4      p\        ;QJ d&    R \%        VV4       4       F  '       g   K   RM	  RM! R \%        VV4       4       4      '       d   Ka  . p\        V	4      p. p\%        VV4       Fû  w  w  pppV\        V4      ^,
          ,          pV\        V4      ^,
          ,          pVV,           V,
          pVV\        VV,           4      ^,
          &   \        V Uu. uF  pV
V^,
          ,          NK  	  up!  p \        V Uu. uF  pV
V^,
          ,          NK  	  up!  p!V V!,           p"VP	                  VV VV!VV"34       VP	                  \        V4      \        V4      V34       Ký  	  \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   EK¸  \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   EKõ  \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   EK2  \'        V U#u. uF  p#\)        V#!  P+                  4       NK  	  up#!  p$V! XX"V	V4      pVP	                  V$V,          4       EK†  	  EK¿  	  \        V!  # . p. p. p%\        V	4      pV EFq  w  ppV\        V4      ^,
          ,          pV\        V4      ^,
          ,          p\        VV,           4      \        V4      8X  d   \-        R4      pMARRP/                  VV,            Uu. uF  pRV,          NK  	  up4      ,           p&\-        V&4      pVV\        VV,           4      ^,
          &   \        V Uu. uF  pV
V^,
          ,          NK  	  up!  p \        V Uu. uF  pV
V^,
          ,          NK  	  up!  p!V V!,           p"VP	                  VV VV!VV"34       VP	                  \        V4      \        V4      V34       V%P	                  VV"VV,           34       EKt  	  \'        V U#u. uF  p#\)        V#!  NK  	  up#!  p$V! XX"V	V4      p\1        V$V,          .V%O5!  # u upi u upi u upi u upi u uppi u upi u upi u up#i u upi u upi u upi u up#i )rT   z(jcoupling_list must be length %d, got %dc              3   ó>   "  € T F  p\        V4      ^8H  x € K  	  R# 5ir•  r’  )r�  rÜ   s   & rC   r�  Ú_couple.<locals>.<genexpr>Z  s   é € ÐB±> x”�H“ Ö"³>ùr“  FTz"Each coupling must define 2 spacesc              3   ó.   "  € T F  w  rW8H  x € K  	  R # 5irH   r½   ©r�  r‚  rƒ  s   &  rC   r�  r#  \  s   é € Ð
1¡.™˜ˆ2Ž8£.ùó   ‚z'Spin spaces cannot couple to themselvesc              3   óŠ   "  € T F9  w  r\        V4      P                  ;'       d    \        V4      P                  x € K;  	  R # 5irH   )r   r¥  r%  s   &  rC   r�  r#  ^  s1   é € Ð
XÉ¹v¸rŒ7�2‹;× Ñ ×:Ð:¤W¨R£[×%:Ñ%:Ô:Ëùs
   ‚"A¥Az8Spaces coupling j_n's are referenced by smallest n valuec              3   óˆ   "  € T F8  qP                   P                  ;'       d    VP                  P                  x € K:  	  R # 5irH   )r@   r¥  r   r  s   & rC   r�  r#  w  s-   é € Ð
GÁ°u�7‰7×Ñ×2Ð2 §¡×!2Ñ!2Ô2Ãùs
   ‚ A£Ac              3   ó.   "  € T F  w  rW8„  x € K  	  R # 5irH   r½   )r�  r–  r   s   &  rC   r�  r#  ‡  s   é € ÐBÑ)A¡ �q–uÓ)Aùr&  c              3   óZ   "  € T F!  p\        V^,          4      V^,          8„  x € K#  	  R# 5i)rÐ  N©rò  rŒ  s   & rC   r�  r#  ™  s!   é € ÐC¹(°$”s˜4 �7“| d¨1¥gÖ-»(ùs   ‚)+c              3   ób   "  € T F%  q^ ,          V^,          ,           V^,          8  x € K'  	  R# 5ir  r½   rŒ  s   & rC   r�  r#  ›  s$   é € ÐH¹x°t˜A•w  a¥Õ(¨4°­7Ö2»xùs   ‚-/c              3   óv   "  € T F/  p\        V^ ,          V^,          ,
          4      V^,          8„  x € K1  	  R# 5ir  r+  rŒ  s   & rC   r�  r#  �  s+   é € ÐMÁH¸D”s˜4 �7 T¨!¥WÕ,Ó-°°QµÖ7ÃHùs   ‚79r@   Ú z%srè  )rV   r2  r>   r¦   r¨   r›  rœ  r=   r�  rÚ  r@   r   rŠ  r|  rž  r   r   Ú_confignum_to_difflistr¬  r   r(   r›  r   r­  r   )'r¬   r  ÚstatesÚcoupled_evectr­   Új_testr‚  rƒ  r„   rÛ   ÚmnÚcoupling_listrB   r  Ú
j_couplingÚj1_nÚj2_nrÜ   Údiff_maxrv   ÚdiffÚtotÚ
config_numÚ	diff_listÚcg_termsÚ	coupled_jr}  Úcoupling_diffr   r¡  r¢  r
  Úm1Úm2Úm3rŽ  ÚcoeffÚ	sum_termsÚj3_names'   &&                                     rC   r  r  L  sÅ  € Ø�W‰W€FØ˜1•I×+Ñ+Ó-€Mð ÒØˆÜ�qœ#˜f›+Ö&ˆAØ×!Ñ! A q¨1¥u :Ö/ñ 'ô ˆ~Ó¤# f£+°¥/Ô1ÜÐBÜ˜V› q�¬#¨nÓ*=Ð>õ?ó @ð 	@ç‹3ÑB±>ÓB�3�3Š3ÑB±>ÓB×BÒBÜÐ=Ó>Ð>ß
ƒsÑ
1¡.Ó
1‡s‡s‚sÑ
1¡.Ó
1×1Ò1ÜÐBÓCÐCß
ƒsÑ
XÉÓ
X‡s‡s‚sÑ
XÉÓ
X×XÒXØ�”S˜“[•ˆÛ$‰FˆBØ˜1•f�~ Ô# v°1­f¥~¸Ô';Ü Ð!\Ó]Ð]Ø&(ˆF”3�r“; •?Ó#ñ %ñ  &Ó	&™v�e�'Œ'™v€BÐ	&Ù%Ó	&™v�e�'Œ'™v€BÐ	&ð €MÜ %¤c¨&£kÔ 2Ó4Ñ 2˜1�A•‹wÑ 2€FÐ4Û$ˆ
à‰ˆä�F �6•NÓ#ˆÜ�F �6•NÓ#ˆØ×Ñ˜t T˜lÔ,ä$*¨4°$­;Ó$7ˆ”�B“˜a•Ó!ñ %÷ ƒsÑ
GÁÓ
G‡s‡s‚sÑ
GÁÓ
G×GÓGñ :GôIÙ9F¨Xô ¸HÀQ½KØ! !�ö=%ó 'ñ =%°q  A¥�Y¨°­E­×2Ð2ñ =%ñ 'ô )Ù9Fð 	ñ IàˆÜ˜( 2�,¨Õ*×+ˆDä�MÓ"ˆAÜ˜4 !�8 a�<¨Ó.ˆCä# CŸj�
Ü2°:¸tÀQÓG�	÷ “3ÑB¬¨Y¸Ô)AÓB—3—3’3ÑB¬¨Y¸Ô)AÓB×BÒBÙð �Ü  ›H�	Ø�	Ü36°}ÀiÖ3PÑ/‘L�T˜4 -Ø"¤C¨£I°¥MÕ3�BØ"¤C¨£I°¥MÕ3�BØ˜b� =Õ0�BØ8:�Iœs 4¨$¥;Ó/°!Õ3Ñ5Ü±DÓ9±D¨q  A¨¥E§ ±DÑ9Ñ;�BÜ±DÓ9±D¨q  A¨¥E§ ±DÑ9Ñ;�BØ˜b��BØ—O‘O b¨"¨b°"°b¸"Ð%=Ô?Ø×$Ñ$¤s¨4£y´#°d³)¸RÐ&@ÖBñ 4Q÷ “3ÑC¹(ÓC—3—3’3ÑC¹(ÓC×CÒCÚß“3ÑH¹xÓH—3—3’3ÑH¹xÓH×HÒHÚß“3ÑMÁHÓM—3—3’3ÑMÁHÓM×MÒMÚÜ¹XÓF¹X°T¤ D¡	§¡Ö 0¹XÑFÑH�Ù% b¨"¨b°)Ó<�Ø—‘˜e E�k×*ô? )ñ ,ôJ �F‰|Ðð ˆØˆ	Øˆ	Ü˜“Hˆ	Ü'‰JˆD�$ØœC ›I¨�MÕ+ˆBØœC ›I¨�MÕ+ˆBÜ�4˜$•;Ó¤3 v£;Ô.Ü˜S“\‘à §¡¸4À$¾;Ó(G¹;°a¨°¯¨¹;Ñ(GÓ HÕH�Ü˜WÓ%�Ø02ˆI”s˜4 $�;Ó'¨!Õ+Ñ-Ü©DÓ1©D q˜˜A �EŸ˜©DÑ1Ñ3ˆBÜ©DÓ1©D q˜˜A �EŸ˜©DÑ1Ñ3ˆBØ�b•ˆBØ�O‰O˜b " b¨"¨b°"Ð5Ô7Ø×Ñœs 4›y¬#¨d«)°RÐ8Ô:Ø×Ñ˜b " b¨2¥gÐ.×/ñ (ô ©hÓ7©h dœ˜Dœ	©hÑ7Ñ9ˆÙ˜b " b¨)Ó4ˆÜ�5˜•;Ð+ Ó+Ð+ùòi 
'ùÚ	&ùò
 5ùò'ùó Iùò2  :ùÚ9ùò Gùò  )Hùò 2ùÚ1ùò
 8sT   Ç_4Ç5_9È#_>Ë,#`Ì,`Ì;	`Ò`Ò)`× `Ú;`Ü
`"
Ü1`'
Þ>`,à`c           	     óz   € V P                  \        4      pV F  pV P                  V\        WAV4      4      p K!  	  V # )aE
  Uncouple a coupled spin state

Gives the uncoupled representation of a coupled spin state. Arguments must
be either a spin state that is a subclass of CoupledSpinState or a spin
state that is a subclass of SpinState and an array giving the j values
of the spaces that are to be coupled

Parameters
==========

expr : Expr
    The expression containing states that are to be coupled. If the states
    are a subclass of SpinState, the ``jn`` and ``jcoupling`` parameters
    must be defined. If the states are a subclass of CoupledSpinState,
    ``jn`` and ``jcoupling`` will be taken from the state.

jn : list or tuple
    The list of the j-values that are coupled. If state is a
    CoupledSpinState, this parameter is ignored. This must be defined if
    state is not a subclass of CoupledSpinState. The syntax of this
    parameter is the same as the ``jn`` parameter of JzKetCoupled.

jcoupling_list : list or tuple
    The list defining how the j-values are coupled together. If state is a
    CoupledSpinState, this parameter is ignored. This must be defined if
    state is not a subclass of CoupledSpinState. The syntax of this
    parameter is the same as the ``jcoupling`` parameter of JzKetCoupled.

Examples
========

Uncouple a numerical state using a CoupledSpinState state:

    >>> from sympy.physics.quantum.spin import JzKetCoupled, uncouple
    >>> from sympy import S
    >>> uncouple(JzKetCoupled(1, 0, (S(1)/2, S(1)/2)))
    sqrt(2)*|1/2,-1/2>x|1/2,1/2>/2 + sqrt(2)*|1/2,1/2>x|1/2,-1/2>/2

Perform the same calculation using a SpinState state:

    >>> from sympy.physics.quantum.spin import JzKet
    >>> uncouple(JzKet(1, 0), (S(1)/2, S(1)/2))
    sqrt(2)*|1/2,-1/2>x|1/2,1/2>/2 + sqrt(2)*|1/2,1/2>x|1/2,-1/2>/2

Uncouple a numerical state of three coupled spaces using a CoupledSpinState state:

    >>> uncouple(JzKetCoupled(1, 1, (1, 1, 1), ((1,3,1),(1,2,1)) ))
    |1,-1>x|1,1>x|1,1>/2 - |1,0>x|1,0>x|1,1>/2 + |1,1>x|1,0>x|1,0>/2 - |1,1>x|1,1>x|1,-1>/2

Perform the same calculation using a SpinState state:

    >>> uncouple(JzKet(1, 1), (1, 1, 1), ((1,3,1),(1,2,1)) )
    |1,-1>x|1,1>x|1,1>/2 - |1,0>x|1,0>x|1,1>/2 + |1,1>x|1,0>x|1,0>/2 - |1,1>x|1,1>x|1,-1>/2

Uncouple a symbolic state using a CoupledSpinState state:

    >>> from sympy import symbols
    >>> j,m,j1,j2 = symbols('j m j1 j2')
    >>> uncouple(JzKetCoupled(j, m, (j1, j2)))
    Sum(CG(j1, m1, j2, m2, j, m)*|j1,m1>x|j2,m2>, (m1, -j1, j1), (m2, -j2, j2))

Perform the same calculation using a SpinState state

    >>> uncouple(JzKet(j, m), (j1, j2))
    Sum(CG(j1, m1, j2, m2, j, m)*|j1,m1>x|j2,m2>, (m1, -j1, j1), (m2, -j2, j2))

)r  rð  r  Ú	_uncouple)r  rÛ   r  rg   r„   s   &&&  rC   r  r  ½  s9   € ðH 	�
‰
”9Ó€AÛˆØ�y‰y˜¤	¨%°^Ó DÓEŠñ à€KrQ   c                 ó°  € \        V \        4      '       d7   V P                  pV P                  pV P                  pV P                  4       pEM8\        V \        4      '       Ed   Vf   \        R4      h\        V\        \        34      '       g   \        R4      hVfg   . p\        ^\        V4      4       FK  pTP                  ^^V,           \        \        V^,           4       Uu. uF  qqV,          NK  	  up!  34       KM  	  \        V\        \        34      '       g   \        R4      h\        V4      \        V4      ^,
          8X  g   \        R4      h\        V\        V4      4      w  r4V P                   pM\        R4      hV P"                  pV P$                  p. p	\        V4      p
\'        WC4       Fb  w  pw  rÍW¬^ ,          ^,
          ,          pW­^ ,          ^,
          ,          pV	P                  WÍWïV34       Wº\)        WÍ,           4      ^,
          &   Kd  	  VP*                  '       Ed   VP*                  '       Edï   V Uu. uF  p^V,          NK  	  pp\        V!  V,
          p\        V4      p\-        VV,           ^,
          V4      p. p\        V4       EF†  p\/        VVV4      p\0        ;QJ d&    R \'        VV4       4       F  '       g   K   RM	  RM! R \'        VV4       4       4      '       d   Ka  . pV	 F¢  pVw  pprïp\        V Uu. uF(  pVV^,
          ,          VV^,
          ,          ,
          NK*  	  up!  p\        V Uu. uF(  pVV^,
          ,          VV^,
          ,          ,
          NK*  	  up!  pVV,           pVP                  VVVVVV34       K¤  	  \3        V Uu. uF  p\5        V!  P7                  4       NK  	  up!  p \9        \'        VV4       UU!u. uF  w  pp!V! WwV!,
          4      NK  	  up!p!  p VP                  V V ,          4       EK‰  	  \        V!  # R	\        V4      ^,           ,          p"\;        V"4      p#V	R R
  UUUUUUu. uF†  w  pprïpT\        V Uu. uF  pV#V^,
          ,          NK  	  up!  T\        V Uu. uF  pV#V^,
          ,          NK  	  up!  T\        VV,            Uu. uF  pV#V^,
          ,          NK  	  up!  3NKˆ  	  pppppppVP                  ! V	R
,          3 UUUUUUu. uFY  w  pprïpT\        V Uu. uF  pV#V^,
          ,          NK  	  up!  T\        V Uu. uF  pV#V^,
          ,          NK  	  up!  Wx3NK[  	  upppppp!   \3        V U$u. uF  p$\5        V$!  NK  	  up$!  p%\'        VV#4       UUu. uF
  w  rxW‡) V3NK  	  p&pp\9        \'        VV#4       UUu. uF  w  rxV! Wx4      NK  	  upp!  p \=        V%V ,          .V&O5!  # u upi u upi u upi u upi u upi u up!pi u upi u upi u upi u uppppppi u upi u upi u uppppppi u up$i u uppi u uppi )Nz'Must specify j-values for coupled statezjn must be list or tuplez!jcoupling must be a list or tuplez?Must specify 2 fewer coupling terms than the number of j valueszstate must be a spin statec              3   ó.   "  € T F  w  rW8„  x € K  	  R # 5irH   r½   )r�  r–  rw   s   &  rC   r�  Ú_uncouple.<locals>.<genexpr>9  s   é € Ð>Ñ%=™T˜Q�1–5Ó%=ùr&  TFzm1:%drè  )r~   r  rÛ   r�  r€  rÍ  rð  r=   rŠ  r‹  r›  r>   r¦   r¨   r   r†  rª   r@   r   r¬  rž  r¥  r   r/  r�  r   r(   r›  r'   r   r   )'r„   rÛ   r  r�  r€  r  rB   r@   r   r4  Új_listr¢  r‚  rƒ  r   r¡  r
  r8  r9  r­   r:  rv   r;  r<  r=  rÜ   r6  r7  r@  rA  rB  rŽ  rC  r–  Úm_strru   Úcg_termÚcg_coeffrD  s'   &&&                                    rC   rG  rG    s™  € Ü�%Ô)×*Ò*Ø�X‰XˆØ—O‘Oˆ	Ø×%Ñ%ˆ
Ø×%Ñ%Ó'ŠÜ	�Eœ9×	%Ó	%ØŠ:ÜÐFÓGÐGÜ˜"œt¤U˜m×,Ò,ÜÐ6Ó7Ð7ØÒ!àˆNÜ˜1œc "›gÖ&�Ø×%Ñ%Ø˜˜A�œs´E¸!¸a½%´LÓ$A±L¨q¨§U U±LÑ$AÑBÐCöFñ 'ô ˜.¬4´¨-×8Ò8ÜÐ?Ó@Ð@Ü�>Ó"¤c¨"£g°¥kÔ1ÜÐ^Ó_Ð_Ü .¨~¼sÀ2»wÓ GÑˆ	Ø—‘‰äÐ4Ó5Ð5Ø�‰€AØ�‰€AØ€MÜ�"‹X€Fô ˜JÖ2‰ˆ‰HˆRà�q•E˜A•IÕˆØ�q•E˜A•IÕˆà×Ñ˜r r¨rÐ2Ô4à#%Œs�2•7‹|˜aÕÓ ñ 3ð 	‡{‡{�{�q—{—{‘{Ù"$Ó&¡"˜Q�Q�q—S�S¡"ˆÐ&Ü�B‰x˜!�|ˆä�‹GˆÜ�t˜a•x !•| TÓ*ˆàˆÜ Ÿ*ˆJÜ.¨z¸4ÀÓCˆIß‹sÑ>¤S¨°HÔ%=Ó>�s�sŠsÑ>¤S¨°HÔ%=Ó>×>Ò>ÙàˆHÛ)�Ø)1Ñ&��d˜B BÜÁ4ÓIÁ4¸a˜R  A¥�Y¨°1°qµ5Õ)9×9Ð9Á4ÑIÑK�ÜÁ4ÓIÁ4¸a˜R  A¥�Y¨°1°qµ5Õ)9×9Ð9Á4ÑIÑK�Ø˜"•W�Ø—‘ " b¨"¨b°"°bÐ!9Ö;ñ *ô ¹ÓC¹°œB ™IŸN™NÖ,¹ÑCÑEˆEÜ!Ü/2°2°yÔ/AÔCÑ/A¡t q¨!‘5˜ �E–?Ñ/AÒCñFˆEà�M‰M˜% �+×&ñ %ô  �F‰|Ðð œ3˜r›7 Q�;Õ'ˆÜ˜“ˆð cpÐpsÐqsÑbt÷wð wábtÑH^ÈÈdÐTVÐ\^ð œ±TÓ:±T°˜u Q¨¥UŸ|˜|±TÑ:Ñ;Øœ±TÓ:±T°˜u Q¨¥UŸ|˜|±TÑ:Ñ;Øœ°T¸D¶[ÓA±[°˜u Q¨¥UŸ|˜|±[ÑAÑBóDábtð 	õ wð 	�Šà@MÈbÕ@QÑ?R÷Uð Uá?RÑ%; T¨4°¸ð œs¹4Ó$@¹4°a U¨1¨q­5§\ \¹4Ñ$@ÑAØœs¹4Ó$@¹4°a U¨1¨q­5§\ \¹4Ñ$@ÑAØó!á?RöUò 	Vô ±XÓ>±X¨'œ˜Wœ±XÑ>Ñ?ˆÜ-0°°U¬^Ô=©^¡T Q�q˜"˜a“j©^ˆ	Ñ=Ü¼#¸bÀ%¼.Ô J¹.±$°!¡%¨¦+¹.Ò JÑLˆÜ�8˜E•>Ð. IÓ.Ð.ùò} %Bùò2 'ùò JùÚIùò DùãCùò ;ùÚ:ùÚAù÷wùò %AùÚ$@ù÷Uùò ?ùÛ=ùÛ JsŠ   Ã%W;ÉX Ì.XÍ.X
Î/ X
Ï(XÑX)Ñ3XÒX)ÒXÒ3X)ÓX$"Ó!
X)ÔX=Ô#X3Ô<X=Õ
X8"Õ#X=ÖYÖ'Y×Y
ØX)Ø3
X=c                 ó  € . p\        V4       Fv  pTpW$,
          ^,
          p\        W,           ^,
          V4      pW8¼  d-   W,          p V^,          p\        W,           ^,
          V4      pK2  VP                  WQ,
          4       Kx  	  V# rà   )r>   r   r¨   )r;  r9  Úlist_lenr<  r­   Ú	prev_diffÚ	rem_spotsÚrem_configss   &&&     rC   r/  r/  X  s~   € à€IÜ�8Ž_ˆØˆ	à•L 1Õ$ˆ	ä˜tÕ/°!Õ3°TÓ:ˆØÔ'ØÕ%ˆJØ�A�IˆDÜ" 4Õ#3°aÕ#7¸Ó>ŠKØ×Ñ˜Õ)Ö*ñ ð ÐrQ   )rD   ÚJplusÚJminusrŠ   r•   r�   ÚJ2r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r   r  rH   )NN)grÂ   Úsympy.concrete.summationsr   Úsympy.core.addr   Úsympy.core.containersr   Úsympy.core.exprr   Úsympy.core.numbersr   Úsympy.core.mulr   r   r	   r
   r   Úsympy.core.singletonr   Úsympy.core.symbolr   r   Úsympy.core.sympifyr   Ú(sympy.functions.combinatorial.factorialsr   r   Ú&sympy.functions.elementary.exponentialr   Ú(sympy.functions.elementary.miscellaneousr   Ú(sympy.functions.elementary.trigonometricr   r   Úsympy.simplify.simplifyr   Úsympy.matricesr   Ú sympy.printing.pretty.stringpictr   r   Ú&sympy.printing.pretty.pretty_symbologyr   Úsympy.physics.quantum.qexprr   Úsympy.physics.quantum.operatorr   r   r   Úsympy.physics.quantum.stater    r!   r"   Ú(sympy.functions.special.tensor_functionsr#   Úsympy.physics.quantum.constantsr$   Úsympy.physics.quantum.hilbertr%   r&   Ú#sympy.physics.quantum.tensorproductr'   Úsympy.physics.quantum.cgr(   Úsympy.physics.quantum.qapplyr)   Ú__all__rD   rF   rÊ   rû   r¤   r¥   r2   r3   r*   r+   rŠ   r•   r�   rV  rT  rU  rð  r,   r-   r.   r/   r0   r1   r†  r  r4   r5   r6   r7   r8   r9   r   r  r  rG  r/  r½   rQ   rC   Ú<module>rr     s=  ðÙ *å )Ý Ý 'Ý  Ý )Ý ß 9Ó 9Ý "ß .Ý &ß JÝ 6Ý 9ß ?Ý ,Ý  ß CÝ @å -÷=ñ =ç 7Ñ 7Ý CÝ 0ß MÝ =Ý 'Ý /ò€ò:6÷\7ñ \7ô~)/ˆj˜(ô )/ôX&/ˆz˜8ô &/ôR 8ˆ:Ð(ô  8ôF <ˆ:Ð(ô  <ôF6ˆ:Ð(ô 6ô@FEˆ:Ð(ô FEôRIJˆô IJôVMˆdô Mñ` 
ˆ#ƒY€Ù	ˆ#ƒY€Ù	ˆ#ƒY€Ù	ˆ#ƒY€Ù�‹€Ù	�#‹€ôZ!�ô Z!ôz:ˆI�sô :ôBˆI�sô ô*`ˆI�sô `ôBˆI�sô ô*A/ˆI�sô A/ôHˆI�sô ò2	!ôi@�yô i@ôXBÐ# Sô BôBÐ# Sô ô*hÐ# Sô hôBÐ# Sô ô*G7Ð# Sô G7ôTÐ# Sô ô2CòLn,ôbGòTN/ôbrQ   