+
    iD              	       H   ^ RI HtHtHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHtHt ^ RIHt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 ^ RIHt ^ RI H!t!H"t" ^ RI#H$t$H%t% ^ RI&H't' ^ RI(H)t)H*t*H+t+H,t,H-t-H.t.H/t/ ^ RI0H1t1 ^ RI2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t> ^ RI?H@t@ ^ RIAHBtB ^ RICHDtE ^ RIFHGtGHHtHHItI R tJ]! 4       ;_uu_ 4         ! R R])]*]+4      tKRRR4       R tLR tM]! 4       ;_uu_ 4         ! R R])]*],4      tNRRR4       R tOR  tP]! 4       ;_uu_ 4         ! R! R"])]*]-4      tQRRR4       R# tRR$ tS]! 4       ;_uu_ 4         ! R% R&])]*].4      tTRRR4       R' tUR( tV]! 4       ;_uu_ 4         ! R) R*])]*]/4      tWRRR4       ]! 4       ;_uu_ 4         ! R+ R,])]*]14      tXRRR4       R- tYR. tZR/ t[R0 t\R1 t]R2 t^R3 t_R4 t`R5 taR6 tbR7 tcR8 tdR9 teR: tfR; tgR< thR= tiR> tjR? tkR@ tlRA tmRB tnRC toRD tpRE tqRF trRG tsRH ttRI tuRJ tvRK twRL txRM tyRN tzRO t{RP t|RQ t}RR t~RS tRT tRU tRV tRW tRX tRY tRZ tR[ tR\ tR] tR^ tR_ tR` tRa tRb tRc tRd tRe tRf tRg tRh tRi tRj tRk tRl tRm tRn tRo tRp tRq t]Rr 4       tRs tRt tRu tRv tRw tRx tRy tRz tR{ tR#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELz; i  + '       g   i     ELi; i)|    )raisesXFAILwarns_deprecated_sympy)Q)Expr)Add)Function)
NumberKindUndefinedKind)IIntegeroopiRational)S)Symbolsymbols)Abs)exp)sqrt)cossin)
ShapeErrorNonSquareMatrixError)
MatrixKind)_MinimalMatrix_CastableMatrixMatrixShapingMatrixPropertiesMatrixOperationsMatrixArithmeticMatrixSpecial)MatrixCalculus)Matrixdiageyematrix_multiply_elementwiseoneszerosSparseMatrixbandedMutableDenseMatrixMutableSparseMatrixImmutableDenseMatrixImmutableSparseMatrix)Poly)flatten)ImmutableDenseNDimArray)xyzc                      ^ RI Hp HpHpHpHpHpHp ^ RIH	pH
pHp	Hp
HpHp ^ RIHpHpHpHp V VVVVVVVVV	V
VV3pVVVV3pV Uu. uF  pV! ^^.^^..4      NK  	  ppRpV Fh  pV F1  p\)        4       ;_uu_ 4        \+        VV4      RJ g   Q h RRR4       K3  	  \)        4       ;_uu_ 4        \+        VV4      RJ g   Q h RRR4       Kj  	  R# u upi   + '       g   i     K  ; i  + '       g   i     K  ; i)r   )MatrixRequiredr   r"   r   r    r!   MatrixCommon)MatrixDeterminantMatrixReductionsMatrixSubspacesMatrixEigenr#   MatrixDeprecated)r$   ImmutableMatrixr*   r/   TNF )sympy.matrices.commonr7   r   r"   r   r    r!   r8   sympy.matrices.matricesr9   r:   r;   r<   r#   r=   sympyr$   r>   r*   r/   r   
isinstance)r7   r   r"   r   r    r!   r8   r9   r:   r;   r<   r#   r=   r$   r>   r*   r/   
all_mixinsall_matricesMMstmixins                          d/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/matrices/tests/test_commonmatrix.py!test_matrix_deprecated_isinstancerK   '   s   
     	J  		L (4	4|!!aVaV
|B	4
AA'))!!U+t333 *)  $%%a'5000 &%	  
5
 *))%%%s   C?C	1C,C),C=c                       ] tR t^itRtR# )ShapingOnlyMatrixr?   N__name__
__module____qualname____firstlineno____static_attributes__r?       rJ   rM   rM   i       rT   rM   Nc                     \        W R  4      # )c                     \        W8H  4      # Nintijs   &&rJ   <lambda>eye_Shaping.<locals>.<lambda>n   s
    AFrT   rM   ns   &rJ   eye_Shapingrc   m   s    Q#;<<rT   c                     \        W R  4      # )c                     ^ # r   r?   r[   s   &&rJ   r^   zeros_Shaping.<locals>.<lambda>r   s    rT   r`   ra   s   &rJ   zeros_Shapingrh   q   s    Q>22rT   c                       ] tR t^vtRtR# )PropertiesOnlyMatrixr?   NrN   r?   rT   rJ   rj   rj   v   rU   rT   rj   c                     \        W R  4      # )c                     \        W8H  4      # rX   rY   r[   s   &&rJ   r^    eye_Properties.<locals>.<lambda>{   
    3qv;rT   rj   ra   s   &rJ   eye_Propertiesrp   z       &>??rT   c                     \        W R  4      # )c                     ^ # rf   r?   r[   s   &&rJ   r^   "zeros_Properties.<locals>.<lambda>       1rT   ro   ra   s   &rJ   zeros_Propertiesrv   ~       n55rT   c                       ] tR t^tRtR# )OperationsOnlyMatrixr?   NrN   r?   rT   rJ   ry   ry      rU   rT   ry   c                     \        W R  4      # )c                     \        W8H  4      # rX   rY   r[   s   &&rJ   r^    eye_Operations.<locals>.<lambda>   rn   rT   ry   ra   s   &rJ   eye_Operationsr~      rq   rT   c                     \        W R  4      # )c                     ^ # rf   r?   r[   s   &&rJ   r^   "zeros_Operations.<locals>.<lambda>   ru   rT   r}   ra   s   &rJ   zeros_Operationsr      rw   rT   c                       ] tR t^tRtR# )ArithmeticOnlyMatrixr?   NrN   r?   rT   rJ   r   r      rU   rT   r   c                     \        W R  4      # )c                     \        W8H  4      # rX   rY   r[   s   &&rJ   r^    eye_Arithmetic.<locals>.<lambda>   rn   rT   r   ra   s   &rJ   eye_Arithmeticr      rq   rT   c                     \        W R  4      # )c                     ^ # rf   r?   r[   s   &&rJ   r^   "zeros_Arithmetic.<locals>.<lambda>   ru   rT   r   ra   s   &rJ   zeros_Arithmeticr      rw   rT   c                       ] tR t^tRtR# )SpecialOnlyMatrixr?   NrN   r?   rT   rJ   r   r      rU   rT   r   c                       ] tR t^tRtR# )CalculusOnlyMatrixr?   NrN   r?   rT   rJ   r   r      rU   rT   r   c                     \        ^^. RO4      p V P                  ^8X  g   Q hV P                  ^8X  g   Q hV ^,          ^8X  g   Q hV R,          ^8X  g   Q h\        V 4      . RO8X  g   Q h\        V R,          4      . RO8X  g   Q h\        V R,          4      ^^.8X  g   Q h\        V R,          4      \        V 4      8X  g   Q hV R,          V 8X  g   Q h\        V 4      V 8X  g   Q h\        . RO. RO.4      V 8X  g   Q h\        . RO. RO34      V 8X  g   Q h\        RR.4      V 8X  g   Q h\        R	4      V 8X  g   Q h\        ^^.^^.^^..4      V 8X  d   Q hR# )
   N)   r               r   r   )r   NNNr   r   r   )r   r   )r   r   r   r   r   )r   r   )r   rowscolslistr3   s    rJ   test__MinimalMatrixr      sV   q!/0A66Q;;66Q;;Q4199T7a<<7(((($=I%%%$=QF"""$=DG###T7a<<!!!!9i01Q6669i01Q6669i01Q66601Q666AAA78A=>>=rT   c                     \        ^^.^^..4      P                  \        \        4      8X  g   Q h\        ^ ^ .^ ^ ..4      P                  \        \        4      8X  g   Q h\        ^ ^ . 4      P                  \        \        4      8X  g   Q h\        \        ..4      P                  \        \        4      8X  g   Q h\        ^\        ^..4      ..4      P                  \        \
        4      8X  g   Q h\        ^..4      P                  \        \        4      8X  g   Q h\        ^\        ^..4      ..4      P                  \        \
        4      8X  g   Q hR# r   N)r$   kindr   r
   r3   r   r*   r?   rT   rJ   	test_kindr      s   Aq6Aq6"#((Jz,BBBBAq6Aq6"#((Jz,BBBB!Q  Jz$::::A3%=J!7777Avse}%&',,
=0IIII!##z*'====!VaSE]+,-22j6OOOOrT   c                      \        ^^. RO4      p V P                  4       pVP                  ^8X  g   Q h\        ^4       F  pW,          V^,           8X  d   K  Q h	  R# )r   N)r   r   r   r   )rM   vecr   range)mm_vecr\   s      rJ   test_vecr      sM    !Q-AEEGE::??1Xx1q5    rT   c            	      b   \        R 4      w  rr#\        W.W#..4      p\        W.W#..4      p\        W.W#..4      p\	        W.W#..4      pVP                  4       VP                  4       u;8X  d=   VP                  4       u;8X  d'   VP                  4       u;8X  d   RV RVRVRV/8X  g   Q h Q hR# )za:dNr   r   r   r   r   r   r   )r   r,   r.   r-   r/   todok)abcdm1m2m3m4s           rJ   
test_todokr      s    JA!	aVaV,	-B	vv.	/B	qfqf-	.B	/	0B88: 5rxxz 5RXXZ 5	FAvq&!45 5 5 5 5rT   c                  T   \         P                  \         P                  \        \        ,          \         P
                  .\        \        \        \        ^,          .\        \         P                  ) \        \        ,          ^..p \         P                  \         P                  \        \        ,          \         P
                  \        \        \        \        ^,          \        \         P                  ) \        \        ,          ^.p\        ^^V4      pVP                  4       V 8X  g   Q hR# r   N)	r   OneHalfr3   r4   Zeror5   rM   tolist)lstflat_lstr   s      rJ   test_tolistr      s    EE1661Q3'!Q1a41quufac1:M
NCqvvqsAFFAq!QT1quufac1MH!Q)A88:rT   c                      \        ^^\        P                  ^ .^ \        P                  .\        ^ ..4      p ^ ^ \        P                  /^^\        P                  /^^ \        //pV P                  4       V8X  g   Q hR# )r   N)rM   r   r   r   r3   todod)r   dicts     rJ   
test_tododr      se    !Q!%%a[1a& ABA155z1q!&&k1q!f5D779rT   c                    a  \        ^^. RO4      o \        \        V 3R l4       \        \        V 3R l4       \        \        V 3R l4       \        \        V 3R l4       S P                  ^4      S P                  R4      u;8X  d   \	        . RO. R	O.4      8X  g   Q h Q hS P                  ^4      S P                  R4      u;8X  d   \	        ^^.^^.^^..4      8X  g   Q h Q hS P                  ^4      S P                  R
4      u;8X  d   \	        . RO. RO.4      8X  g   Q h Q hS P                  ^4      S P                  R
4      u;8X  d   \	        ^^.^^.^^	..4      8X  g   Q h Q hR# )r   c                  &   < S P                  ^4      # r   row_deles   rJ   r^   "test_row_col_del.<locals>.<lambda>       qyy|rT   c                  &   < S P                  R4      # r   r   r   s   rJ   r^   r          qyy}rT   c                  &   < S P                  ^4      # r   col_delr   s   rJ   r^   r      r   rT   c                  &   < S P                  R4      # r   r   r   s   rJ   r^   r      r   rT   N	r   r   r   r   r   r         	   r   r   r   r   r   )rM   r   
IndexErrorr   r$   r   r   s   @rJ   test_row_col_delr      s&   !Q ;<A
:+,
:,-
:+,
:,-99Q<199R=JFIy3I,JJJJJJ99Q<199R=LFQFQFQF3K,LLLLLL99Q<199R=JFIy3I,JJJJJJ99Q<199R=LFQFQFQF3K,LLLLLLrT   c                  H   \        ^^.^^..4      p \        ^\        .\        ^..4      p\        ^\        ^.\        ^\        .\        \        \        ..4      pV P	                  4       V .8X  g   Q hVP	                  4       V.8X  g   Q hVP	                  4       V.8X  g   Q hR# r   )r$   r3   r4   r5   get_diag_blocks)r   r   r   s      rJ   test_get_diag_blocks1r      s    AA AAA AAq	Aq!9q!Qi01A1#%%%1#%%%1#%%%rT   c                     \        ^^.^^..4      p \        ^\        .\        ^..4      p\        ^\        ^.\        ^\        .\        \        \        ..4      p\	        WV4      \	        WV4      \	        WV4      \	        W"V4      3w  r4rV\        VP                  VP                  V4      p\        VP                  VP                  V4      p\        VP                  VP                  V4      p\        VP                  VP                  V4      pVP                  4       WV.8X  g   Q hVP                  4       WV.8X  g   Q hVP                  4       WV.8X  g   Q hVP                  4       W"V.8X  g   Q hR# r   )	r$   r3   r4   r5   r%   rM   r   r   r   )r   r   r   ABCDs          rJ   test_get_diag_blocks2r      sA   AA AAA AAq	Aq!9q!Qi01AaAQ1tA!}d1mKJA!!&&!&&!,A!&&!&&!,A!&&!&&!,A!&&!&&!,A1)+++1)+++1)+++1)+++rT   c                  J    \        ^^^ ^ .4      p V P                  R8X  g   Q hR# )r   Nr   r   )rM   shaper   s    rJ   
test_shaper     s&    !QA'A77frT   c                     \        ^4      p V P                  ^^	4      \        ^^	R4      8X  g   Q h\        ^^R 4      pVP                  ^^4      \        R4      8X  g   Q hVP                  ^^4      \        R4      8X  g   Q hR# )r   c                     W,           # rX   r?   r[   s   &&rJ   r^   test_reshape.<locals>.<lambda>  s    aerT   N)	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   )rc   reshaper$   rM   m0r   s     rJ   test_reshaper     s    	QB::ava,GHHHH	1a!3	4B::	1DEF F F::av&NOOOOrT   c                      \        ^^. RO4      p V P                  ^ 4      \        ^^. RO4      8X  g   Q hV P                  ^ 4      \        ^^. RO4      8X  g   Q hR# )r   Nr   r   )r   r   r   )rM   rowr$   colr   s    rJ   test_row_colr     sO    !Q ;<A558vaI....558vaI....rT   c                      \        ^4      P                  \        . RO4      4      \        . RO. RO. RO.4      8X  g   Q hR# )r   Nr   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   )rc   row_joinr$   r?   rT   rJ   test_row_joinr     s=    q>""6)#45<! "" " "rT   c                      \        ^4      P                  \        . RO.4      4      \        . RO. RO. RO. RO.4      8X  g   Q hR# )r   Nr   r   r   r   )r   r   r   )r   r   r   )rc   col_joinr$   r?   rT   rJ   test_col_joinr  #  sB    q>""69+#679   rT   c                     \        . RO.4      p \        R^4       F`  p. ROpVP                  V^4       \        \	        ^4      P                  W4      P                  ^ 4      P                  4       4      V8X  d   K`  Q h	  R# )r   Nr   r   r   r  )r$   r   insertr1   rc   
row_insertr   r   )r4r\   ls      rJ   test_row_insertr  +  sf    		B2q\	A{1~007;;A>EEGHAMMM rT   c                     \        . RO4      p \        R^4       F`  p. ROpVP                  V^4       \        \	        ^4      P                  W4      P                  ^ 4      P                  4       4      V8X  d   K`  Q h	  \        ^4      P                  ^\        ^^.^^.^^.^^.^^.^^..4      4      \        . RO. RO. RO. RO. R	O. R
O.4      8X  g   Q hR# )r   Nr  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   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )	r$   r   r  r1   rh   
col_insertr   r   rc   )c4r\   r  s      rJ   test_col_insertr  3  s    			B2q\	A}Q'2219==a@GGIJaOOO 
 q>$$QAAAAQRTUPVYZ\]X^/_(`a++++++- .. . .rT   c                  r  a  \        ^^R 4      o S P                  . RO^ ^.4      \        ^^. RO4      8X  g   Q hS P                  ^ ^.. RO4      \        ^^. RO4      8X  g   Q hS P                  \        ^4      \        ^4      4      S 8X  g   Q h\	        \
        V 3R l4       \	        \
        V 3R l4       R# )	r   c                 "    V ^,          V,           # r   r?   r[   s   &&rJ   r^   test_extract.<locals>.<lambda>D      QqS1WrT   c                  ,   < S P                  ^.^ .4      # )r   extractr   s   rJ   r^   r  H      qyy!qc2rT   c                  ,   < S P                  ^ .^.4      # rf   r  r   s   rJ   r^   r  I  r  rT   N)r   r   r   )r   r   r   r   r   
   r   r   r   )r   r   r   r   r      )rM   r  r$   r   r   r   r   s   @rJ   test_extractr  C  s    !Q 45A99YA'6!Q8K+LLLL99aVY'6!Q8K+LLLL99U1XuQx(A---
:23
:23rT   c                    aa \        ^^R 4      o\        ^^R 4      oSSP                  S4      8X  g   Q hSP                  SSS4      \         P                  SSS4      u;8X  d   \        . RO. RO. RO. RO.4      8X  g   Q h Q h\        \        VV3R l4       \        P                  ! 4       \        4       8X  g   Q h\        P
                  ! ^ ^ 4      p \        P
                  ! ^ ^4      p\        P
                  ! ^ ^4      p\        P
                  ! ^ ^4      p\         P                  WW#4      oSP                  ^ 8X  d   SP                  ^8X  g   Q hR# )	r   c                 "    V ^,          V,           # r  r?   r[   s   &&rJ   r^   test_hstack.<locals>.<lambda>M  r  rT   c                 "    V ^,          V,           # r  r?   r[   s   &&rJ   r^   r"  N      acAgrT   c                  (   < S P                  S S4      # rX   )hstackr   r   s   rJ   r^   r"  U      qxx2rT   N)	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  )rM   r&  r$   r   r   r)   r   r   )M1M2M3M4r   r   s       @@rJ   test_hstackr-  L  s%   !Q 45A	1a!5	6B88Aq! 1 8 8Aq A 4V1111	M3 F4 4 4 4 4 4
 :./==?fh&&& 
a	B	a	B	a	B	a	B  0A66Q;166Q;&&;rT   c                    a a \        ^^R 4      o \        ^^R 4      oS S P                  S 4      8X  g   Q hS P                  S S S 4      \         P                  S S S 4      u;8X  d6   \        . RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO.4      8X  g   Q h Q h\        \        V V3R l4       \        P                  ! 4       \        4       8X  g   Q hR# )	r   c                 "    V ^,          V,           # r  r?   r[   s   &&rJ   r^   test_vstack.<locals>.<lambda>b  r  rT   c                 "    V ^,          V,           # r  r?   r[   s   &&rJ   r^   r0  c  r$  rT   c                  (   < S P                  S S4      # rX   )vstackr'  s   rJ   r^   r0  r  r(  rT   Nr   r   )r   r   r   )r   r  r  )rM   r3  r$   r   r   r'  s   @@rJ   test_vstackr4  a  s    !Q 45A	1a!5	6B88Aq! 1 8 8Aq A .V + + + + + + + + + + + +M- F. . . . . . :./==?fh&&&rT   c            
         \        ^^^^\        ^^\        ,          ,
          .4      p V P                  4       \        P                  \        ^4      \        P
                  \        08X  g   Q hV P                  \        4      \        08X  g   Q hR# r   )rj   r3   atomsr   r   NegativeOner   r   s    rJ   
test_atomsr8  w  sb    QAq!Q1W#56A779!ammQ7777776?qc!!!rT   c                  X    \        \        .^ ..4      P                  \        08X  g   Q hR# r   N)rj   r3   free_symbolsr?   rT   rJ   test_free_symbolsr<  }  s%    !qc
+88QC???rT   c                  B   \        \        \        3R34      p V P                  \        4      '       g   Q hV P                  \        4      '       d   Q hV P                  \
        4      '       g   Q h\        ^\        3R34      p V P                  \        4      '       d   Q hR# )r   N)r   r   )rj   r3   r4   hasr5   r   r   s    rJ   test_hasr@    sq    q!ff-.A5588O8uuQxx<55===q!ff-.AuuQxx<xrT   c                     \        R 4      p \        ^^^^.4      P                  4       RJ g   Q h\        ^^^ V ^,          ^V ,          ,           ^,           \        V ^,           ^,          ) ^ V \        ,          \        ) V ) \        ,          ^ .	4      pVP                  4       RJ g   Q hVP                  RR7      RJ g   Q hVP                  R R7      RJ g   Q h\        ^^V U u. uF  q P                  ! 4       NK  	  up 4      pVP                  RR7      RJ g   Q h\        ^^\
        P                  .\        V4      R,          ,            U u. uF  q P                  ! 4       NK  	  up 4      pVP                  4       RJ g   Q hR# u up i u up i )r3   FTsimplifyc                     V # rX   r?   r   s   &rJ   r^   (test_is_anti_symmetric.<locals>.<lambda>  s    !rT   :r   NNN)r   rj   is_anti_symmetricr4   expandr   r   r   )r3   r   s     rJ   test_is_anti_symmetricrH    s]   A1q!f-??AUJJJQAq!taczA~qAEA:+q!A#PQrTUSUVWSWYZ#[\A D(((.%7774===Q#:1HHJ#:;A.$666Q$q'"+8M#N8M1HHJ8M#NOA E))) $;#Ns   "FFc                  R   \        ^^. RO4      p V P                  4       '       d   Q hV P                  4       '       g   Q hV P                  RR7      '       g   Q h\        ^^. RO4      p V P                  4       '       g   Q h\        ^^\        ^^^4      4      p V P                  4       '       g   Q hV P                  4       '       g   Q h\        ^^. RO4      p V \        ^^^4      8X  g   Q h\        ^^\	        ^^4      4      p V P                  4       '       d   Q hV P                  4       '       g   Q h\        R4      p V P                  4       '       g   Q h\        R4      p V P                  4       '       g   Q h\        ^^^\        ^,          ^\        ,          ,           ^,           \        \        ^,           ^,          ^^ \        ^ ^.	4      p V P                  4       '       g   Q hV P                  RR7      '       d   Q hV P                  4       P                  RR7      '       g   Q hR# )	r   FrB  N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   )	rj   is_diagonalis_symmetricr%   r)   r$   r3   r4   rG  r   s    rJ   test_diagonal_symmetricalrO    s   Q<0A}}>>>>5>))))Q<0A==???Q41a=1A==???>>Q#>?AQ1Q5A;/A~~==???56A==???34A==???q!aA!aQUQJ1aAFGA>>~~u~----88:""E"2222rT   c                     \        ^\        .\        ) ^..4      p V P                  '       g   Q h\        ^\        ,          \        .\        ) ^..4      p V P                  RJ g   Q h\        \        \        .\        ) ^..4      p V P                  e   Q h\        \        ^.\        ) ^..4      p V P                  RJ g   Q hR# )r   FN)rj   r   is_hermitianr3   r   s    rJ   test_is_hermitianrS    s    q!fr1g./A>>>>qsAh!Q01A>>U"""q!fr1g./A>>!!!q!fr1g./A>>U"""rT   c                     \        ^4      P                  '       g   Q h\        \        ^4      4      P                  '       d   Q h\        \	        ^4      4      P                  '       d   Q h\        . RO.4      P                  '       d   Q hR# )r   Nr  )rp   is_Identityrj   r)   r(   r?   rT   rJ   test_is_IdentityrV    sk    !(((((#E!H-99999#DG,88888#YK0<<<<<<rT   c                  Z   \        \        \        .\        \        ..4      p V P                  4       R J g   Q h\        . RO. RO.4      p V P                  4       RJ g   Q h\        . RO^^\        ^..4      p V P                  4       R J g   Q h\        ^\        ^..4      p V P                  4       R J g   Q h\        . RO.4      p V P                  4       RJ g   Q h\        ^.\        .^..4      p V P                  4       R J g   Q h\        ^.^.^..4      p V P                  4       RJ g   Q hR# )TFNr   r   r   r   r   r   r   r   r   )rj   r3   is_symbolicrR  s    rJ   test_is_symbolicr[    s   q!fq!f-.A==?d"""lL9:A==?e###lQ1aL9:A==?d"""q!Qi[)A==?d"""i[)A==?e###qcA3_-A==?d"""qcA3_-A==?e###rT   c                      \        . RO.4      p V P                  RJ g   Q h\        ^.^.^..4      p V P                  RJ g   Q hR# )r   TFNr   )rj   is_upperrR  s    rJ   test_is_upperr^    sH    i[)A::qcA3_-A::rT   c                      \        . RO.4      p V P                  RJ g   Q h\        ^.^.^..4      p V P                  RJ g   Q hR# )r   FTNr   )rj   is_lowerrR  s    rJ   test_is_lowerra    sH    i[)A::qcA3_-A::rT   c                      \        ^.^..4      p \        ^^.^^..4      pV P                  '       d   Q hVP                  '       g   Q hR# r   )rj   	is_squarer'  s     rJ   test_is_squarerd    sG    qcA3Z(A	1v1v.	/B{{{?<<<<rT   c                      \        ^^. RO4      p V P                  4       '       g   Q h\        ^^. RO4      p V P                  4       '       d   Q hR# )r   NrJ  )r   r   r   r   )rj   rN  r   s    rJ   test_is_symmetricrf    sG    Q<0A>>Q<0A~~rT   c                  R   \        . RO. RO. RO.4      p V P                  '       g   Q h\        ^^. RO4      p V P                  '       g   Q h\        ^^. RO4      p V P                  RJ g   Q hV P                  RJ g   Q h\        . RO. RO. RO.4      p V P                  '       d   Q hR# )	r   FN)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   )rj   is_upper_hessenbergis_lower_hessenbergr?  s    rJ   test_is_hessenbergrj    s    iI>?A     Q#>?A     Q#?@A  E)))  E)))iI>?A$$$$$$rT   c                     \        ^ ^ . 4      P                  '       g   Q h\        ^ ^ .^ ^ ..4      P                  '       g   Q h\        \        ^^4      4      P                  '       g   Q h\        \        ^4      4      P                  '       d   Q h\        \        ^ .^ ^ ..4      P                  R8X  g   Q h\        \        ^.^ ^ ..4      P                  R8X  g   Q h\        RRR7      p \        V ^ .^ ^ ..4      P                  R8X  g   Q hR# )r   NFr   T)nonzero)rj   is_zero_matrixr)   r&   r3   r   rR  s    rJ   test_is_zerorn    s    1b)88888!Q!Q 01@@@@@a,;;;;;#CF+:::::!Q!Q 01@@DHHH!Q!Q 01@@EIIIsD!A!Q!Q 01@@EIIIrT   c            
          \        \        ^^. RO4      P                  4       4      0 Rm8X  g   Q h\        RRR7      p \        \        ^^V ^ ^ ^.4      P                  4       4      V ^08X  g   Q hR# )r   r3   TrealN)r   r   r   r   >   r   r   r   )setrj   valuesr   r   s    rJ   test_valuesrt    sx    #Aq, 

&( ! ! !sA#Aq1aA, 

&(1v  rT   c                     \        \        ^4      4      p V P                  R 4      \        ^4      ^,          8X  g   Q hV P                  R 4      \        ^4      8X  g   Q hV P                  R 4      \	        ^4      8X  g   Q hR# )r   c                     ^V ,          # r   r?   r   s   &rJ   r^    test_applyfunc.<locals>.<lambda>  s    !A#rT   c                     ^ # rf   r?   r   s   &rJ   r^   rx        !rT   c                     ^# r   r?   r   s   &rJ   r^   rx    rz  rT   N)ry   r&   	applyfuncr)   r(   )r   s    rJ   test_applyfuncr~    se    	c!f	%B<<&#a&(222<<$a000<<$Q///rT   c                      ^ \         .^^ ..p \        ^ ^.\         ) ^ ..4      pVP                  4       \        V 4      8X  g   Q hR# r:  )r   ry   adjointr$   )datanss     rJ   test_adjointr  !  sE    q6Aq6
C
A!Q0
1C;;=F3K'''rT   c            
      \   \        ^^. RO4      p \        ^^^\        P                  ,           ^^\        P                  ,          ,           ^^\        P                  ,          ,           ^^\        P                  ,          ,           .4      pVP                  4       w  r#W 8X  g   Q hW08X  g   Q hR# )r   NrX  )ry   r   ImaginaryUnitas_real_imag)r   r   r   r   s       rJ   test_as_real_imagr  '  s    	aL	1B	a	
Q__	a!AOO"33	Aaooq1Q__#44	6
7B ??DA7N77N7rT   c                     \        ^ \        ^.. RO.4      p V P                  \        ^ ^.\        ^.^^ ..4      8X  g   Q hV P                  \        ^ \        ) ^.. RO.4      8X  g   Q hV P                  V P                  4       8X  g   Q hV P                  V P                  P                  8X  g   Q hV P                  \        ^ ^.\        ) ^.^^ ..4      8X  g   Q hR# )r   Nr   r   r   )ry   r   Tr$   r   	conjugateHrF   s    rJ   test_conjugater  2  s    q!Qi 	A 33&1a&a&a&" # # # # 33&1qb!*$& ' ' ' '33!++-33!##%%<<33&Aq'2q'q'# $ $ $ $rT   c                      \        \        \        \        R R7      ..4      p V ^ ,          ^\        ,          8w  g   Q hV P                  4       \	        ^\        ,          ..4      8X  g   Q hR# )F)evaluateN)ry   r   r3   doitr$   rR  s    rJ   	test_doitr  D  sO    s1a%89:;AQ41Q3;;668v!ug&&&rT   c                  0  a  \        ^^\        ^4      ^.4      o \        ;QJ d(    V 3R l\        ^4       4       F  '       d   K   RM	  RM! V 3R l\        ^4       4       4      '       g   Q h\        ;QJ d(    V 3R l\        ^4       4       F  '       d   K   RM	  RM! V 3R l\        ^4       4       4      '       g   Q h\        ;QJ d(    V 3R l\        ^4       4       F  '       d   K   RM	  RM! V 3R l\        ^4       4       4      '       g   Q hR# )r   c              3      <"   T F4  pSP                  4       V,          SV,          P                  4       8H  x  K6  	  R # 5irX   evalf.0r\   r   s   & rJ   	<genexpr>test_evalf.<locals>.<genexpr>L  s*     >Xqwwy|qtzz|+Xs   <?FTc              3      <"   T F6  pSP                  ^4      V,          SV,          P                  ^4      8H  x  K8  	  R# 5ir   r  r  s   & rJ   r  r  M  s.     @x!qwwqz!}!

1-x   >Ac              3      <"   T F6  pSP                  ^4      V,          SV,          P                  ^4      8H  x  K8  	  R# 5ir   ra   r  s   & rJ   r  r  N  s.     8x!qss1vayAaDFF1I%xr  N)ry   r   allr   rR  s   @rJ   
test_evalfr  J  s    QDGQ<0A3>U1X>333>U1X>>>>>3@uQx@333@uQx@@@@@38uQx83338uQx88888rT   c            	      b   \        \        \        \        ,           ,          ^.\        \        ,           \        ,          \        ,          \        \        \        \        \        ,           ,          ,           ,          ..4      p V P                  4       pV\	        \        \        ,          \        ^,          ,           ^.\        \        ^,          ,          \        \        ^,          ,          ,           \        \        ,          \        \        ^,          ,          ,           \        ^,          ,           ..4      8X  g   Q h\        RRR7      p\        ^^\        \        V,          4      .4      P                  RR7      \	        \        V4      \        \        V4      ,          ,           .4      8X  g   Q hR# )r   r   Trp  )complexN)
ry   r3   r4   rG  r$   r   r   r   r   r   )r   r   r   s      rJ   test_expandr  Q  s   	1q5	1~!a%Aq!aQi-?P/QR	SB	B
A#1*a1QT6AadF?AaC!AqD&L1a4,?@AC C C C 	sA1s1Q3xj1888F3q6Ac!fH$%&' ' 'rT   c            	         \        \        \        4      ^,          \        \        ^,          4      .\        \        ^,          4      \        \        4      ^,          ,          \        \        ^,          4      \        \        4      ^,          ,          ..4      p V P                  \        P                  ! \        4      \        P                  ! \        4      ,          4      pV\        \        ^,          \        \        4      .\        ^,          \        \        4      ,          \        ^,          \        \        4      ,          ..4      8X  g   Q hV P                  \        P                  ! \        4      \        P                  ! \        4      ,          4      pV\        \        ^,          \        .\        \        ^,          ,          \        ^,          \        ,          ..4      8X  g   Q hV P                  \        P                  ! \        4      \        P                  ! \        4      ,          4      pV\        \        ^,          \        ) .\        ) \        ^,          ,          \        ^,          ) \        ,          ..4      8X  g   Q hR# r   )ry   r   r3   r   r4   refiner   rq  r$   positivenegativer   s     rJ   test_refiner  ^  su   	A	41:6q!t*SVQY&QT
3q619(<=? 
@B	166!9qvvay(	)B!Q$A!Q$s1v+q!tCF{)CDEEEE	1::a=1::a=0	1B!Q$Qq!tVQT!V$456666	1::a=1::a=0	1B!Q$qbAg1uQw%789999rT   c                     aa \        R \        R7      w  oo\        ^^V3R l4      p \        ^^V3R l4      pVP                  SS4      pW 8X  g   Q hR# )F, Gclsc                     < S! W,           4      # rX   r?   )r\   r]   Gs   &&rJ   r^   test_replace.<locals>.<lambda>m      !#rT   c                     < S! W,           4      # rX   r?   r\   r]   Fs   &&rJ   r^   r  n  r  rT   Nr   r	   ry   replace)KrF   Nr  r  s      @@rJ   test_replacer  k  sI    6x(DAqQ#67AQ#67A			!QA6M6rT   c                  Z  a \        R \        R7      w  op \        ^^V ! ^ 4      S! ^ 4      V ! ^ 4      /3V ! ^4      S! ^4      V ! ^4      /3V ! ^4      S! ^4      V ! ^4      /3V ! ^4      S! ^4      V ! ^4      /3.4      p\        ^^V3R l4      pVP                  SV R4      pW18X  g   Q hR# )r  r  c                     < S! W,           4      # rX   r?   r  s   &&rJ   r^   "test_replace_map.<locals>.<lambda>w  r  rT   TNr  )r  r  rF   r  r  s       @rJ   test_replace_mapr  s  s    6x(DAqQQqTAaD!A$<$81Q4!A$!:NQRSTQUXYZ[X\PQRSPTXV QWYZ[\Y]`abc`dfghifj_kXl$n 	oAQ#67A			!QA6M6rT   c                  t   \        ^^.^^..4      p W P                  ^ 4      u;8X  d   V P                  ^4      8X  g   Q h Q hV P                  ^4      V P                  R4      u;8X  d)   V P                  ^4      u;8X  d   \        R4      8X  g   Q h Q hV P                  ^4      V P                  R4      u;8X  d)   V P                  ^4      u;8X  d   \        R4      8X  g   Q h Q hV P                  4       V P                  R4      u;8X  d)   V P                  R4      u;8X  d   \        R4      8X  g   Q h Q hR# )	r   Nr   ))r   r   r   r   r   ))r   r   r   r   i)r   r   )r   r   )r$   rot90r?  s    rJ   
test_rot90r  |  s    AA A
(aggaj(((((771:N
Nf=M6NNNNNN771:N
Nf=M6NNNNNN779Nqwwr{Nf=M6NNNNNNrT   c                     \        R 4      p \        R4      p\        ^\        ,          ^\        ,          ,           \        \        \        ,          ,           \        ,          .V! \        4      \        V! \        4      ,          ,           V! \        4      ,          ^^V ,          \        V \        ,          4      V ,          ,
          ,          \        ,          ..4      pVP                  4       \        \        \        ,           \        \        ,          ,          ^\        ,           .^\        ,           ^^^\        \        V ,          4      ,          ,
          \        V ,          ,          ,          ..4      8X  g   Q h^\        ,           ^,          p\        V..4      pVP                  4       \        V..4      8X  g   Q hVP                  \        R7      \        VP                  \        R7      ..4      8X  g   Q h\        ^^.^^..4      p^VP                  4       ,          P                  4       \        ^^"4      8X  g   Q hR# )rb   f)ratioN)r   r	   ry   r3   r4   r   r   rC  r$   r   tracer   )rb   r  rF   eqr   s        rJ   test_simplifyr    s   sAA1Q319q1Q3wRSmVQ4!AaD&=!A$&QqS3q2v;q=-@(AB(FHJ 	KA::<6a!ea!e_QQRU#T$%E1q1SAY;A.F+GI#K L L L L
a%!BrdV$A::<6B4&>)))::B:6BKKbK,A+B*C#DDDD 	Q!Q !AqwwyM##%!R888rT   c                     \        ^\        .\        ^..4      P                  \        ^4      \        ^^.^^..4      8X  g   Q h\        \        ^.\        \        ,           ^..4      P                  \        R.\        R..4      \        R^.R^..4      8X  g   Q h\        \        ^.\        \        ,           ^..4      P                  \        R3\        R3.4      \        R^.R^..4      8X  g   Q h\        \        ^.\        \        ,           ^..4      P                  \        R\        R/4      \        R^.R^..4      8X  g   Q h\        \        \        ,          ..4      P                  \        \        ^,
          \        \        ^,
          /RR7      \        \        ^,
          \        ^,
          ,          ..4      8X  g   Q hR# )r   T)simultaneousNr   r   r  )ry   r3   subsr$   r4   r?   rT   rJ   	test_subsr    s   !Q!Q 0166q!<AQRTUPVGW@XXXX!Q!a% 45::QGaW;MNB7RG$%& & &!Q!a% 45::QGaW;MNB7RG$%& & &!Q!a% 45::Ar1b>JB7RG$%& & &!A#(--q!a%AE.BQU-VQUQUO$%&' ' 'rT   c                  \    \        . RO. RO. RO.4      p V P                  4       ^8X  g   Q hR# )r   Nr  )r   r   r   )r   r   r   )ry   r  r  s    rJ   
test_tracer    s-    i 	A 779??rT   c                  8   \        ^\        .\        ^..4      P                  \        ^/4      \        ^^.^^..4      8X  g   Q h\        \        ^.\        \        ,           ^..4      P                  \        R\        R/4      \        R^.R^..4      8X  g   Q hR# )r   Nr   r   r  )ry   r3   xreplacer$   r4   r?   rT   rJ   test_xreplacer    s    !Q!Q 01::Aq6BAq6Aq6"#$ $ $!Q!a% 45>>2q"~NB7RG$%& & &rT   c                  8  a \        ^^. R
O4      o\        \        V3R l4       \        \        V3R l4       SP	                  ^ ^.^ ^..4      p SP                  ^ ^.^ ^..4      T u;8X  d   \        . RO. RO. RO.4      8X  g   Q h Q hSP                  ^ ^.^ ^..4      p SP                  ^ ^.^ ^..RR7      T u;8X  d   \        . RO. RO. RO.4      8X  g   Q h Q hSP                  ^ ^.^ ^..RR7      p SP                  ^ ^.^ ^..RRR7      T u;8X  d   \        . RO. RO. RO.4      8X  g   Q h Q hSP                  . RO4      \        . RO. RO. RO.4      8X  g   Q h^ RIH	p SP                  V! . RO4      4      \        . RO. RO. RO.4      8X  g   Q hR	# )r   c                  ,   < S P                  ^ ^..4      # rf   )permuterR  s   rJ   r^   test_permute.<locals>.<lambda>  s    qyy1a&2rT   c                  8   < S P                  \        R 4      4      # r   )r  r   rR  s   rJ   r^   r    s    qyy5rT   r   )orientationbackward)	direction)r  r  )PermutationN)r   r   r   r   r   r   r   r   r   r  r     rY  )r   r  r  r  rX  )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   )
ry   r   r   
ValueErrorpermute_rowsr  r$   permute_colssympy.combinatoricsr  )r   r  r   s     @rJ   test_permuter    s   Q#JKA
:23
:56	AA'(A99q!fq!f%&! >v,;,;,;7= 0> > > > > >
 	
AA'(A99q!fq!f%69:a ."+++$- .. . . . . 	
AA':>A99q!fq!f%6Z9PTU ."+++$- .. . . . . 99\"f,;,;,;.= '> > > >
 099[./6,;,;,;;= 4> > > >rT   c                  L   \        . RO. RO. RO. RO.4      p V P                  ^4      pV\        . RO. RO. RO. RO.4      8X  g   Q hV P                  R4      pV\        . RO. RO. RO. RO.4      8X  g   Q hV P                  4       pV\        . RO. RO. RO. RO.4      8X  g   Q hR# )r   Nr   r   r   r   )r   r   r   r   )r   r   r   r   r   r   r   r   r   )r   r   r   r   )ry   upper_triangular)r   Rs     rJ   test_upper_triangularr    s    	 	A 	
1A$$$$$	&     	
2A$$$$$	&     	
A$$$$$	&    rT   c                  L   \        . RO. RO. RO. RO.4      p V P                  4       pV\        . RO. RO. RO. RO.4      8X  g   Q hV P                  ^4      pV\        . RO. RO. RO. RO.4      8X  g   Q hV P                  R4      pV\        . RO. RO. RO. RO.4      8X  g   Q hR# )r   Nr  )r   r   r   r   )r   r   r   r   )r   r   r   r   r   r  )ry   lower_triangularr   )r   Ls     rJ   test_lower_triangularr    s    $$$$	 	A 	
A$$$$$	&& ' ' ' ' 	
1A$$$$$	&     	
2A$$$$$	&    rT   c                      \        ^R.\        \        ..4      p \        V 4      \        ^^.\	        \        4      \	        \        4      ..4      8X  g   Q hR# )r   Nr   )r   r3   r4   absr   r   s    rJ   test_absr    sG    q"g1v./Aq6)Aq6CFCF3C*DEEEErT   c            	        a a \        . RO\        \        \        .^\        ,          R\        \        ,          ..4      o S S ,           \        . RO^\        ,          ^\        ,          ^\        ,          .^\        ,          R^\        ,          \        ,          ..4      8X  g   Q h\        ^^^^.4      o\	        \
        V V3R l4       R# )r   c                     < S S,           # rX   r?   r   rb   s   rJ   r^   test_add.<locals>.<lambda>  s	    q1urT   Nr   i)r   r   r   i)r   r3   r4   r5   r   r   r  s   @@rJ   test_addr    s    i!QQqS#qsODEAq5()ac1Q3!_qsDRSTURUVWRWFX)YZZZZQAq6*A
:}%rT   c                    aa \        R4      o\        R	4      o\        \        VV3R l4       \        \        V3R l4       SS,          p V R
,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^ 8X  g   Q h \	        R4       V R
,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^8X  g   Q hV R,          ^ 8X  g   Q h SP                  V 4      pV\        SV 4      8X  g   Q hVR
,          ^8X  g   Q hVR,          ^8X  g   Q hVR,          ^8X  g   Q hVR,          ^8X  g   Q hVR,          ^ 8X  g   Q hVR,          ^ 8X  g   Q h\        \        VV3R l4       S\        R4      ,          p \        V \         4      '       g   Q hV R
,          \        8X  g   Q hV R,          ^\        ,          8X  g   Q hV R,          ^\        ,          8X  g   Q hV R,          ^ 8X  g   Q h\        S,          pW8X  g   Q h^S,          p \        V \         4      '       g   Q hV R
,          ^8X  g   Q hV R,          ^
8X  g   Q hV R,          ^8X  g   Q hV R,          ^ 8X  g   Q h \	        R4       \        V \         4      '       g   Q hV R
,          ^8X  g   Q hV R,          ^
8X  g   Q hV R,          ^8X  g   Q hV R,          ^ 8X  g   Q h \        \        ^^4      4      p\        ^^4      ) p\        WDV.4      pVP                  V4      \        V.V.V..4      8X  g   Q hR#   \
         d     EL^i ; i  \
         d     Lwi ; i)r   c                     < SS ,          # rX   r?   r   r   s   rJ   r^   %test_multiplication.<locals>.<lambda>-  s	    qsrT   c                     < S / ,          # rX   r?   rR  s   rJ   r^   r  .  s	    adrT   z	c = a @ bc                  &   < S P                  S4      # rX   )multiply_elementwiser  s   rJ   r^   r  L  s    q55a8rT   r3   z	c = 5 @ bN)r   r  rL  )r   )r   r   r   r   r   r   )r   r   r  )r   r   r   	TypeErrorevalSyntaxErrorr  r'   r   rC   r3   r$   r(   r   )r   hc2r   _hr   r   r   s         @@rJ   test_multiplicationr   !  sk     	A 	  	A
 :{#
9l#	!AT7a<<T7a<<T7a<<T7a<<T7b==T7a<<
[ w!||w!||w!||w!||w"}}w!||	q!A+Aq1111T7a<<T7a<<T7b==T7a<<T7a<<T7a<<
:89	F3KAa-....T7a<<T7ac>>T7ac>>T7a<<	
QB7N7	AAa-....T7a<<T7c>>T7c>>T7a<<	[ !12222w!||w#~~w#~~w!|| 	tAqzA
1a.B|A!!!$			0 )   i  N  s$   ,M( ,M: (M76M7:NNc                  @   \        ^^.^^..4      p V P                  ^4      \        8X  g   Q hV P                  ^4      \        8X  g   Q h \	        R4        \	        R4       R#   \
         d     L\         d     L'i ; i  \
         d     R# \         d     R# i ; i)r   z2 @ aza @ 2N)r$   
__matmul__NotImplemented__rmatmul__r  r  r  rR  s    rJ   test_matmulr  t  s    AA A<<?n,,,==~---WW      s<   A$ B $A>1A>:A>=A>BBBBc                      ! R R\         4      p \        ^^.^^..4      pV ! 4       pW!,          \        V^V,          .^V,          ^V,          ..4      8X  g   Q hW,          \        V^V,          .^V,          ^V,          ..4      8X  g   Q hR# )zX
Test that if explicitly specified as non-matrix, mul reverts
to scalar multiplication.
c                   "    ] tR tRtRtRtRtRtR# )test_non_matmul.<locals>.fooi  Fr?   Nr   )rO   rP   rQ   rR   	is_Matrixis_MatrixLiker   rS   r?   rT   rJ   foor    s    	rT   r  N)r   r$   )r  r   r   s      rJ   test_non_matmulr    s    
d 
 	AA AA3&1ac(QqS!A#J/00003&1ac(QqS!A#J/0000rT   c                  X   \        \        R  4       \        ^^.^^..4      p V ^,          R,          R8X  g   Q h\        . RO. RO. R	O.4      p V ^,          R,          R
8X  g   Q hV ^ ,          \        ^4      8X  g   Q hV ^,          V 8X  g   Q h\        ^..4      ^d,          R,          ^^d,          8X  g   Q h\        ^^.^^..4      \	        ^4      ,          \        ^^
.^^..4      8X  g   Q h\        ^^.^^..4      p V P                  ^RR7      V P                  ^RR7      8X  g   Q hR# )c                  &    \        R4      ^,          # )r   r   r$   r?   rT   rJ   r^   test_power.<locals>.<lambda>  s    ):rT   r   cayley)methodmultiplyN)i  i  i,*  i7  )r   r   r   )r   r   r   )r   r  r   )	i"  i     i  i  ip  i  i  i  r   )r   r   r   r&   r   r$   powr?  s    rJ   
test_powerr    s-   
!:;q!fq!f-.AqD!92222iJ?@AqD!9EEEEa43q6>>a4199 1#'3.5C???!Q!Q 0171:=AUXY[]W^aceg`hViAjjjj1qe}A55H5%r*)EEEErT   c                  R    \        ^^^^.4      p V ) \        ^^RR.4      8X  g   Q hR# )r   Nr   r   r   ra   s    rJ   test_negr    s2    QAq6*A2%aRH5555rT   c                  \    \        ^^^^.4      p W ,
          \        ^^^ ^ .4      8X  g   Q hR# r   r   ra   s    rJ   test_subr    s2    QAq6*A5(A1v6666rT   c            	          \        ^^^^.4      p V ^,          \        ^^\        P                  \        ^4      ^,          .4      8X  g   Q hR# r   )r   r   r   ra   s    rJ   test_divr    sA    QAq6*AQ3&q!affad1f-=>>>>rT   c                  T   \        \        P                  ^^4      4      . RO8X  g   Q h\        \        P                  ^4      4      . RO8X  g   Q h\        \        P                  ^4      4      \        8X  g   Q h\        \        P                  ^\        R7      4      \        8X  g   Q hR# )r   r  NrK  )r   r   r&   typer$   r?   rT   rJ   test_eyer    s    !%%a+,<<<!%%a()\999!%%a()->>>>!%%aV%45???rT   c                     \        \        P                  ^^4      4      . RO8X  g   Q h\        \        P                  ^4      4      . RO8X  g   Q h\        P                  ^^4      \        . RO. RO.4      8X  g   Q h\	        \        P                  ^4      4      \        8X  g   Q h\	        \        P                  ^\        R7      4      \        8X  g   Q hR# )r   r  Nr  r   r   r   )r   r   r(   r$   r  r?   rT   rJ   	test_onesr"    s    !&&q!,-===!&&q)*l:::!!!Q'69i2H+IIII!&&q)*.????!&&qf&56&@@@rT   c                     \        \        P                  ^^4      4      . RO8X  g   Q h\        \        P                  ^4      4      . RO8X  g   Q h\        P                  ^^4      \        . RO. RO.4      8X  g   Q h\	        \        P                  ^4      4      \        8X  g   Q h\	        \        P                  ^\        R7      4      \        8X  g   Q hR# )r   r  Nr  r  )r   r   r)   r$   r  r?   rT   rJ   
test_zerosr$    s    !''1-.,>>>!''*+|;;;""1a(FIy3I,JJJJ!''*+/@@@@!''v'676AAArT   c                  |	  a aaa \         P                  o\        ^^.^^..4      o \        ^\        .\        ^..4      o\        ^\        ^.\        ^\
        .\        \        \
        ..4      oS! S SS4      \        . R	O. R
O^ ^ ^\        ^ ^ .^ ^ \        ^^ ^ .^ ^ ^ ^ ^\        .^ ^ ^ ^ \        ^..4      8X  g   Q hS! S SS4      \        . RO. RO^ ^ ^\        ^ ^ ^ .^ ^ \        ^^ ^ ^ .^ ^ ^ ^ ^\        ^.^ ^ ^ ^ \        ^\
        .^ ^ ^ ^ \        \        \
        ..4      8X  g   Q hS! S SS4      \        . RO. RO^ ^ ^\        ^^ ^ .^ ^ \        ^\
        ^ ^ .^ ^ \        \        \
        ^ ^ .^ ^ ^ ^ ^ ^\        .^ ^ ^ ^ ^ \        ^..4      8X  g   Q h\        \        \        \
        .4      o \        ^^.^^..4      o\        ^^..4      oS! S ^SS4      \        \        ^ ^ ^ ^ ^ .\        ^ ^ ^ ^ ^ .\
        ^ ^ ^ ^ ^ .. RO. RO. RO. RO.4      8X  g   Q h\        \        V VVV3R l4       S! ^4      \        ^..4      8X  g   Q hS! ^^R7      \        ^^ .^ ^ ..4      8X  g   Q hS! ^^R7      \        ^^ .^ ^ ..4      8X  g   Q hS! ^^^R7      \        ^^ .^ ^ .^ ^ ..4      8X  g   Q hS! ^^.!  \        ^^ .^ ^..4      8X  g   Q hS! \        ^^.4      4      \        ^.^..4      8X  g   Q hS! ^^^.^.RR7      S! ^.^^.^..RR7      u;8X  d   \        ^^ .^^.^^ ..4      8X  g   Q h Q h\        S! ^4      4      \         8X  g   Q h\        S! ^\        R7      4      \        8X  g   Q h\        P                  ! . RO4      \        P                  ! ^^^4      8X  g   Q h\        P                  ! . RORR7      P                  R8X  g   Q h\        P                  ! . RO.4      P                  R8X  g   Q h\        P                  ! . RO.RR7      P                  R8X  g   Q h\        P                  ! . RO..4      P                  R8X  g   Q h\        P                  ! \        ^ ^4      ^^4      \        . RO. RO.4      8X  g   Q h\        P                  ! \        ^^ 4      ^^4      \        ^ ^ .^ ^ .^^ .^ ^..4      8X  g   Q hR# )r   c                     < S! S ^SS^R7      # )r   r   r?   r   r   r   r%   s   rJ   r^    test_diag_make.<locals>.<lambda>  s    tAq!QQ7rT   r'  )r   )r   r   F)unpackr  N)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   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$   r3   r4   r5   r   r  r  r   r(   r(  s   @@@@rJ   test_diag_maker+    sT   !!DAA AAA AAq	Aq!9q!Qi01A1a=F	
Aq!Q	
Aq!Q	
Aq!Q	
Aq!Q$     1a=F	
Aq!Q1	
Aq!Q1	
Aq!Q1	
Aq!Q1	
Aq!Q1$     1a=F	
Aq!Q1	
Aq!Q1	
Aq!Q1	
Aq!Q1	
Aq!Q1$     	1ayAAA AAxA 1av	
Aq!Q	
Aq!Q	
Aq!Q'      :787fqcUm###?fq!fq!f%56666?fq!fq!f%56666"fq!fq!fq!f-E&FFFF!Q=F	
A	
A$     1v6	
	
+ $    QFAu-1#1vs#E26<	
A	
A	
A> 7    
 Q=----QF#$...;;y!V[[Aq%9999;;y/55???;;	{#))V333;;	{51776AAA;;}%++v555;;tAqz1a(F4 -    ;;tAqz1a(F	
A	
A	
A	
A	4 -   rT   c                    a \        ^^\        ^	4      4      oSP                  4       p V SP                  ^ 4      8X  g   Q h\        V 4      R8X  g   Q h\        SP                  ^4      4      R8X  g   Q h\        SP                  R4      4      R8X  g   Q h\        SP                  ^4      4      R	8X  g   Q h\	        SP                  4       4      \	        S4      8X  g   Q h\        ^^R
^/4      p\	        VP                  4       4      \	        V4      8X  g   Q h\	        S4      \	        V4      8w  g   Q h\        \        V3R l4       \        \        V3R l4       \        \        V3R l4       \        ^^4      p\        \        ^VP                  ,
          VP                  4       Uu/ uF  pV\        VP                  V4      4      bK   	  up4      V8X  g   Q hR# u upi )r   c                  &   < S P                  ^4      # r  diagonalr   s   rJ   r^   test_diagonal.<locals>.<lambda>,  s    qzz!}rT   c                  &   < S P                  R4      # )r   r  r.  r   s   rJ   r^   r0  -  s    qzz"~rT   c                  .   < S P                  \        4      # rX   )r/  r   r   s   rJ   r^   r0  .  s    qzz"~rT   N)r   r   r   )r   r   r   )r   r   rw  r   )r$   r   r/  tupler  r*   r   r  r(   r+   r   r   r   )r   srF   r\   r   s       @rJ   test_diagonalr5     s   q!U1XA	

A

18y   A6)))B F***A4'''

a(((QFA;'A

a(((7d1g
:,-
:-.
:-.Q
Aqx(*(A d1::a=))(* +./0 0 0 *s   '$Gc                     \         P                  ^^4      \         P                  ^^R7      u;8X  dt   \         P                  ^^R7      u;8X  dW   \         P                  ^^RR7      u;8X  d9   \         P                  ^^^R7      u;8X  d   \        . RO. RO. RO.4      8X  g   Q h Q h\         P                  ^^RR7      \        . RO. RO. RO.4      8X  g   Q h\        \        R 4       \        \        R 4       \        \        R	 4       \        \        R
 4       \         P                  ^^R7      \         P                  ^^R7      8X  g   Q hR# )r   
eigenvalue)sizer8  upper)band)r9  eigenvalr8  lowerc                  ,    \         P                  ^4      # rw  r   jordan_blockr?   rT   rJ   r^   #test_jordan_block.<locals>.<lambda>D  s    0==a@rT   c                  .    \         P                  R ^4      # )g      @r?  r?   rT   rJ   r^   rA  F  s    0==c1ErT   c                  .    \         P                  ^R7      # )r   r7  r?  r?   rT   rJ   r^   rA  H  s    0===KrT   c                  0    \         P                  ^^R7      # )r   )r8  r<  r?  r?   rT   rJ   r^   rA  K  s    **q + "rT   )r9  r<  N)r   r   r   )r   r   r   r  )r   r   r   r  r   )r   r@  r$   r   r  r?   rT   rJ   test_jordan_blockrE  4  sV   ))!Q/3D3Q3QRS`a3Q3b  --1-C --a-A !--q . 2
       ))!QW)=I B       
 :@A
:EF
:KL
:"#
 ))qQ)?&&A&:; ; ;rT   c            	        a \        ^^.^^..4      p V P                  \        ^.^..4      4      \        ^.^..4      .8X  g   Q hV P                  \        ^.^..4      RR7      \        ^\        ^4      ,          ^,          .\        ^4      ^,          ..4      .8X  g   Q hV P                  \        ^.^..4      \        R.^..4      4      \        ^.^..4      \        \        R^4      .\        ^^4      ..4      .8X  g   Q hV P                  \        ^ .^ ..4      \        R.^..4      4      \        R.^..4      .8X  g   Q hV P                  \        ^ .^ ..4      4      . 8X  g   Q h\        . RO. R	O. R
O.4      p\        R.^..4      \        R.^..4      \        R.R..4      .oVP                  ! S!  \        R.^..4      \        \        ^^4      .\        ^^4      ..4      .8X  g   Q h\        . RO4      \        . RO4      \        . RO4      .o\	        \
        V3R l4       \        . RO4      \        . RO4      \        . RO4      .o\	        \
        V3R l4       R# )r   T)	normalizec                  0   < \         P                  ! S R R/ # 	rankcheckTr$   orthogonalizevecss   rJ   r^   $test_orthogonalize.<locals>.<lambda>d      v33TJTJrT   c                  0   < \         P                  ! S R R/ # rI  rK  rM  s   rJ   r^   rO  g  rP  rT   Nr   i)r   r   r   )r   r   r  )r   r   r   r   r   r  r   )r   r   r   r   r   )r$   rL  r   r   r   r  )r   rb   rN  s     @rJ   test_orthogonalizerR  S  s^   AA A??6A3*-.6A3*3E2FFFF??6A3*-?>	!DG)A+a,	-./ / /??6A3*-vtaSk/BC	!qc
	VhsA&6%7(1a.9I$JKLM M M??6A3*-vtaSk/BC	"s	  ??6A3*-."444	:y12ARD1#;"s!4frdRD\6JKD??D!	"s	fx2&7(2r:J9K%LMNO O O 9vi0&2CDD
:JK9vi0&2CDD
:JKrT   c                  n   \         P                  ! ^4      w  rV \        . RO. RO. RO.4      8X  g   Q hV\        . RO. RO. RO.4      8X  g   Q h\         P                  ! ^4      w  rV \        . RO. RO. RO. R	O. R
O. RO. RO.4      8X  g   Q hV\        . RO. RO. RO. R	O. R
O. RO. RO.4      8X  g   Q hR# )r   N)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   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   r   )r   r   r   r   r   r   r   )r$   	wilkinson)wminuswpluss     rJ   test_wilkinsonrW  i  s    $$Q'MFV * ) )+ , , , , F%%%' ( ( ( (
 $$Q'MFV 8 7 7 7 7 7         F11111113 4 4 4 4rT   c                      \        R 4      w  r\        ^^W.4      pVP                  V 4      \        ^^^^ .4      8X  g   Q hR# zx yN)r   r   diffr$   r3   r4   r   s      rJ   	test_diffr\    s@    5>DA1a!(A66!9q!aV,,,,rT   c                      \        R 4      w  r\        ^^W.4      pVP                  V 4      \        ^^V ^,          ^,          W,          .4      8X  g   Q hR# rY  )r   r   	integrater$   r[  s      rJ   test_integrater_    sJ    5>DA1a!(A;;q>VAq1a4613-8888rT   c            	        aa \        R 4      w  r\        ^^V \        V4      ,          V \        V4      ,          V ^,          .4      p\        ^^W.4      p\	        \        V4      V ) \        V4      ,          .\        V4      V \        V4      ,          .^V ,          ^ ..4      pVP                  V4      V8X  g   Q h\        ^^. RO4      o\        ^^. RO4      o\        \        V3R l4       \        \        VV3R l4       R# )zrho,phic                  <   < S P                  \        ^^.4      4      # r|  )jacobianr$   r   s   rJ   r^    test_jacobian2.<locals>.<lambda>  s    ajjA8rT   c                  &   < SP                  S 4      # rX   )rb  r'  s   rJ   r^   rc    s    bkk!nrT   NrX  )r   r   r   r   r$   rb  r   r  )rhophiXYJr   r   s        @@rJ   test_jacobian2rj    s    y!HC1a#c#h,CHc1f!EFA1a#,A	SC4C=!	SCCL!cEq! 	A
 ::a=A1a.A	Aq,	/B
989
9,-rT   c            	          \        R 4      w  r\        ^^^V ,          V.4      pVP                  V ^4      \        ^^\	        ^^4      V.4      8X  g   Q hR# rY  )r   r   limitr$   r   r[  s      rJ   
test_limitrm    sO    5>DA1a!A#q*A771a=F1a(1a.!)<====rT   c                     a a \        . RO. RO. RO.4      o . ROo\        \        V V3R l4       \        \        V V3R l4       R# )r   c                     < S S,          # rX   r?   rF   vs   rJ   r^   "test_issue_13774.<locals>.<lambda>  	    acrT   c                     < SS ,          # rX   r?   rp  s   rJ   r^   rr    rs  rT   Nr   r   r   r!  )r$   r   r  rp  s   @@rJ   test_issue_13774ru    s-    	9i01AA
9k"
9k"rT   c                  N  aa \        R 4      o\        R4      o\        \        R 4       \        \        V3R l4       \        \        V3R l4       \        \        VV3R l4       \        R4      w  rp\        P
                  ! \        ^V .S4      4      \	        V ) .4      8X  g   Q h\        P
                  ! \        ^W.S4      4      \	        ^ V ) .^V) ..4      8X  g   Q h\        P
                  ! \        ^W!V .S4      4      \	        ^ ^ V ) .^^ V) .^ ^V) ..4      8X  g   Q hR# )r3   r4   c                  .    \         P                  ! ^4      # r|  )r$   	companionr?   rT   rJ   r^    test_companion.<locals>.<lambda>  s    v//2rT   c                  F   < \         P                  ! \        ^.S 4      4      # r|  r$   rx  r0   r   s   rJ   r^   ry    s    v//aS!=rT   c                  H   < \         P                  ! \        ^^.S 4      4      # rw  r{  r   s   rJ   r^   ry    s    v//aVQ@rT   c                  V   < \         P                  ! \        S S,          S S.4      4      # rX   r{  )r3   r4   s   rJ   r^   ry    s    v//QqS1a&0ABrT   zc0:3N)r   r   r  r   r$   rx  r0   )c0c1r  r3   r4   s      @@rJ   test_companionr    s   sAsA
:23
:=>
:@A
:BCJBBD!R!,-">>>D!Ra01RC1rc(#$% % %D!RR!45AsaRC[1a"+678 8 8rT   c            	      H   \        R 4      w  rp\        WV.4      pVP                  \        WV.. RO4      4      pV\        ^.^.^..4      8X  g   Q h\        W W V .W W V .W W V ..4      pVP                  \        V .^.4      4      pV\        . RO. RO. RO.4      8X  g   Q hR# )zx, y zNr   )r   r   r   r   r   )r   r$   r  zip)r3   r4   r5   r)  r*  s        rJ   test_issue_10589r    s    hGA!	q		B	aAY	*	+B!qcA3((((	!a1q/A!?C	DB	aS1#	B/?KLLLLrT   c                       ! R  R\         4      p \        ^^. RO4      pV ! ^^. RO4      pW,          p\        W04      '       g   Q hV\        ^^
.^^..4      8X  g   Q hR# )c                   <    ] tR tRt]P
                  R,           tRtR# )test_rmul_pr19860.<locals>.Fooi  g{Gz?r?   N)rO   rP   rQ   rR   r,   _op_priorityrS   r?   rT   rJ   Foor    s    )66=rT   r  NrX  )r.   r$   rC   )r  r   r   r   s       rJ   test_rmul_pr19860r    sg    >" > 	q!\"AAq,A 	
AaB"b*++++rT   c                     a a \        ^^.^^..4      o \        ^^.^^..4      o\        \        V V3R l4       \        \        V V3R l4       R# )r   c                     < SS ,           # rX   r?   r   r   s   rJ   r^   "test_issue_18956.<locals>.<lambda>  	    a!erT   c                     < S S,           # rX   r?   r  s   rJ   r^   r    r  rT   N)Arrayr$   r   r  r  s   @@rJ   test_issue_18956r    sD    1v1vA1qe}A
9m$
9m$rT   c                       ! R  R\         4      p \        ^^^^.4      pW! 4       8w  g   Q h ! R RV 4      pW! 4       8X  g   Q hR# )c                   ,   a  ] tR tRt o R tR tRtV tR# )test__eq__.<locals>.Myi  c              3     "   ^x  ^x  R# 5ir   r?   selfs   &rJ   __iter__test__eq__.<locals>.My.__iter__  s     GGs   c                &    \        V 4      V,          # rX   )r   )r  r\   s   &&rJ   __getitem__"test__eq__.<locals>.My.__getitem__  s    :a= rT   r?   N)rO   rP   rQ   rR   r  r  rS   __classdictcell____classdict__s   @rJ   Myr    s     		! 	!rT   r  c                   &   a  ] tR tRt o R tRtV tR# )test__eq__.<locals>.My_sympyi  c                    \        V 4      # rX   r  r  s   &rJ   _sympy_$test__eq__.<locals>.My_sympy._sympy_  s    $<rT   r?   N)rO   rP   rQ   rR   r  rS   r  r  s   @rJ   My_sympyr    s     	  	 rT   r  N)objectr$   )r  r   r  s      rJ   
test__eq__r    sL    !V ! 	q!aVA99 2   
??rT   )sympy.testing.pytestr   r   r   sympy.assumptionsr   sympy.core.exprr   sympy.core.addr   sympy.core.functionr	   sympy.core.kindr
   r   sympy.core.numbersr   r   r   r   r   sympy.core.singletonr   sympy.core.symbolr   r   $sympy.functions.elementary.complexesr   &sympy.functions.elementary.exponentialr   (sympy.functions.elementary.miscellaneousr   (sympy.functions.elementary.trigonometricr   r   sympy.matrices.exceptionsr   r   sympy.matrices.kindr   r@   r   r   r   r   r    r!   r"   rA   r#   sympy.matricesr$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   sympy.polys.polytoolsr0   sympy.utilities.iterablesr1   #sympy.tensor.array.dense_ndim_arrayr2   r  	sympy.abcr3   r4   r5   rK   rM   rc   rh   rj   rp   rv   ry   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-  r4  r8  r<  r@  rH  rO  rS  rV  r[  r^  ra  rd  rf  rj  rn  rt  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+  r5  rE  rR  rW  r\  r_  rj  rm  ru  r  r  r  r  r  r?   rT   rJ   <module>r     sb   G F     ( 5 ; ; " - 4 6 9 = F *7 7 7 3    ' - P  :1B NO]  
=3 ~@P  
@6 ~@P  
@6 ~@P  
@6 NO]  
 ^_n  
?&P!5
M&, 
P/"N. 4'*',"@*3@#=$" 
%J0($$'9
'
:O9$	'&">HBBF
&Pf21 F6
7
?
@ABL^0(;>L,4D - -9.">#8M,%{#     
 sH   J,<K 'KK(=K<"L,J=	 K	K%	(K9	<L	L!	