+
    iS8                        ^ 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 ^ RIHt ^ RIHt ^ R	IHtHtHtHt ^ R
IHtHtHt ^ RIHtHt ^ RIHt R tR t R t!R t"R t#R t$R t%R t&R t'R t(R t)]R 4       t*R# )    )
expand_mul)IRational)S)Symbol)sqrt)Abs)simplify)NonSquareMatrixError)MatrixzeroseyeSparseMatrix)xyz)raisesslow)allclosec                  4  a \        . RO. RO. R	O. R
O.4      p V P                  4       w  rpVP                  '       g   Q hVP                  '       g   Q hW,          P	                  VR4      V ,
          \        ^4      8X  g   Q h\        . RO. RO. RO. RO.4      p V P                  4       w  rpVP                  '       g   Q hVP                  '       g   Q hW,          P	                  VR4      V ,
          \        ^4      8X  g   Q h\        . RO. RO. RO. RO.4      p V P                  RR7      w  rpVP                  '       g   Q hVP                  '       g   Q hW,          P	                  VR4      V ,
          \        ^^4      8X  g   Q h\        . RO. RO. RO.4      p V P                  RR7      w  rpVP                  '       g   Q hVP                  '       g   Q hW,          P	                  VR4      V ,
          \        ^4      8X  g   Q h\        ^\        ^3^\        ^ 3\        ^ \        334      oSP                  4       w  rpVP                  '       g   Q hVP                  '       g   Q hW,          P	                  VR4      S,
          \        ^4      8X  g   Q h\        R4      pVP                  RJ g   Q hVP                  RJ g   Q h\        R4      pVP                  RJ g   Q hVP                  RJ g   Q h\        . RO. RO. RO.4      oSP                  4       w  rarrVS,          WP                  4       ,          V,          8X  g   Q h\        . RO. RO. RO. RO.4      oSP                  4       w  rarrVS,          WP                  4       ,          V,          8X  g   Q h\        . RO. RO. RO.4      oSP                  4       w  rarrVS,          WP                  4       ,          V,          8X  g   Q h\        . RO. RO. RO.4      o\        \        V3R l4       R# ) r   backwardF	rankcheckTc                  (   < S P                  R R7      # )Tr   )LUdecomposition_Simple)Ms   f/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/matrices/tests/test_decompositions.py<lambda>test_LUdecomp.<locals>.<lambda>b   s     8 84 8 H    N)r            )r#   r#         )   r%   r   r!   )   r#   r%   )r(   r'   r$   r%   )r   r#   r(   r$   )   r'   r$   r%   )ir!   r(   r#   r)   r!   r#   r%   r"   r(   r$   r&   	   )
         )r!   r%   r(   r!   r#   r   )r)   r   r   r1   )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   r   r!   )r   r   r)   )r#   r)   r%   )r   LUdecompositionis_loweris_upperpermute_rowsr   r   r   r   LUdecompositionFFinvr   
ValueError)	testmatLUpmLmUPDeer   s	           @r   test_LUdecomprD      s   l""#% &G %%'GA!::::::::Ca,w6%(BBBm"##% &G %%'GA!::::::::Ca,w6%(BBB i"$ %G %%%6GA!::::::::Ca,w6%1+EEE i! "G %%%6GA!::::::::Ca,w6%(BBBAq	Aq!9q!Qi01A!GA!::::::::Ca,q0E!H<<<	  
B ;;$;;%	  
B ;;%;;$ 		 	A &&(LA#Q3!GGI+a-  	!A &&(LA#Q3!GGI+a-	 	A &&(LA#Q3!GGI+a- 				A
 :HIr    c                  l   \        ^^.^^..4      p V P                  4       w  rpW,          VP                  ,          V 8X  g   Q hVP                  V,          \        VP                  4      8X  g   Q hVP                  V,          \        VP                  4      8X  g   Q h\        ^^..4      pVP                  4       w  rpW,          VP                  ,          V8X  g   Q hVP                  V,          \        VP                  4      8X  g   Q hVP                  V,          \        VP                  4      8X  g   Q h\        . RO. RO. RO. RO.4      pVP                  4       w  rpW,          VP                  ,          V8X  g   Q hVP                  V,          \        VP                  4      8X  g   Q hVP                  V,          \        VP                  4      8X  g   Q h\        \        ^^4      \        ^4      .^ \        ^^4      ..4      pVP                  4       w  rp\        VP                  V,          4      \        VP                  4      8X  g   Q h\        VP                  V,          4      \        VP                  4      8X  g   Q h\        W,          VP                  ,          4      V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   singular_value_decompositionTr   colsr   r   r
   )Ar>   r   VBCDs          r   "test_singular_value_decompositionDrN   d   s   AA A,,.GA!5133;!337c!&&k!!!337c!&&k!!!AxA,,.GA!5133;!337c!&&k!!!337c!&&k!!!	 	A ,,.GA!5133;!337c!&&k!!!337c!&&k!!!!Qa)Ax1~+>?@A,,.GA!ACC!GAFF+++ACC!GAFF+++AEACCK A%%%r    c                  6   \        ^^.^^..4      p V P                  4       w  r\        pV\        ^V! R^4      ,          V! ^4      ^,          V! ^4      ^,          V! R^4      ,          ,          .^^V! R^4      ,          ,          V! ^4      ) ^,          V! ^4      ^,          V! R^4      ,          ,          ..4      8X  g   Q hV\        ^V! ^^4      ,          ^^V! R^4      ,          ,          .^ V! ^4      ^,          V! ^^4      ,          ..4      8X  g   Q hW,          V 8X  g   Q hVP                  V,          \	        ^4      8X  g   Q h\        . RO. RO. RO.4      p V P                  4       w  rVP                  V,          \	        VP
                  4      8X  g   Q hVP                  '       g   Q hWV,          8X  g   Q h\        . RO. RO. R	O.4      p V P                  4       w  rVP                  V,          \	        VP
                  4      8X  g   Q hVP                  '       g   Q hWV,          8X  g   Q h\        R4      p\        V.4      p V P                  4       w  rV\        V\        V4      ,          .4      8X  g   Q hV\        \        V4      .4      8X  g   Q h\        V^ .^ V..4      p V P                  4       w  rW\        V4      ,          \        ^^ .^ ^..4      ,          8X  g   Q hV\        V4      \        ^^ .^ ^..4      ,          8X  g   Q hR# )
r)   r   Nr4   r)   r)   r)   )r)   r)   r#   )r!   r#   r%   )r0   r   i)r(   r      )r      )	r   QRdecompositionr   rG   r   rH   r7   r   r	   )rI   Qr   Rr   s        r   test_QRrW      s   AA ADAAaAh;!A$q&1Q46Ab!H"445	
1aAh;!A$q1Q46Ab!H"4457 8 8 8 8 AaGQq!B({]3a!A$q&1Q79J5KLMMMM3!8O8337c!f	9i01ADA337c!&&k!!!::::!8O8k;78ADA337c!&&k!!!::::!8O8sAsADACF
|$$$$Ax    AA ADACF
VaVaV$455555A!Q!Q 011111r    c                     \        . RO. RO. RO. RO.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . RO. RO. RO. R	O.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        ^^^^.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R
O. RO.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . RO. RO. RO.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        ^^^^.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q hR# )r-   N)r-   r      )r0   r   )r   r%   r%   )r   r[   )r)   r4   r%   )r)   r%   r'   )r)   r%   r!   )r)   r4   r   r*   r+   r3   )r)   r%   r-      )r)   r&      @   r   rT   rG   r   rH   r7   rI   rU   rV   s      r   test_QR_non_squarera      s$   
KK@AADA337c!&&k!!!::::!8O8
J	:>?ADA337c!&&k!!!::::!8O8q!aVADA337c!&&k!!!::::!8O8 		9%&ADA337c!&&k!!!::::!8O8m^<=ADA337c!&&k!!!::::!8O8q!aVADA337c!&&k!!!::::!8O8r    c                  
   \        . RO. RO. RO.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . RO. RO. RO. RO.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . RO. RO. RO. RO.4      P                  p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R	O.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R	O.4      P                  p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R	O. R	O.4      p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R	O. R	O.4      P                  p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R	O. RO.4      P                  p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R
O. RO. R
O.4      P                  p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R
O. RO. R
O. RO.4      P                  p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q h\        . R	O. R	O. R	O. RO.4      P                  p V P                  4       w  rVP                  V,          \        VP                  4      8X  g   Q hVP
                  '       g   Q hWV,          8X  g   Q hR# )r)   Nr*   r+   r,   rP   )r!   r!   r!   )r#   r#   r#   )r%   r%   r%   )r   r   r   )r   r   r   r   r3   )r!   r%   r(   r&   r_   r`   s      r   test_QR_trivialrc      s   	9i01ADA337c!&&k!!!::::!8O8	9i;<ADA337c!&&k!!!::::!8O8	9i;<>>ADA337c!&&k!!!::::!8O8 		{ADA337c!&&k!!!::::!8O8	{ADA337c!&&k!!!::::!8O8	9%&ADA337c!&&k!!!::::!8O8	9%&((ADA337c!&&k!!!::::!8O8 		9%&((ADA337c!&&k!!!::::!8O8lL9:<<ADA337c!&&k!!!::::!8O8lL,GHJJADA337c!&&k!!!::::!8O8	9i;<>>ADA337c!&&k!!!::::!8O8r    c                     \        ^^.^R..4      p V P                  4       w  r\        W,          V 4      '       g   Q h\        WP                  ,          \         P                  ! ^4      4      '       g   Q h\        VP                  V,          \         P                  ! ^4      4      '       g   Q h\        ^^.^R..4      p V P                  4       w  r\        W,          V 4      '       g   Q h\        WP                  ,          \         P                  ! ^4      4      '       g   Q h\        VP                  V,          \         P                  ! ^4      4      '       g   Q hR# )r)   g)\(?gjt?N)r   rT   r   rG   r   r`   s      r   test_QR_floatre     s   AD	"#ADAAE1AGVZZ]++++ACC!GVZZ]++++AE
#$ADAAE1AGVZZ]++++ACC!GVZZ]++++r    c                     a R oV3R lp  \        ^^ .^ ^..4      P                  V R7      w  rQ h  \         d&   pSTP                  ^ ,          8X  g   Q h Rp?R# Rp?ii ; i)I got passed in!c                    < \        S4      hNr;   valuemagic_strings   &r   goofyiszero;test_LUdecomposition_Simple_iszerofunc.<locals>.goofyiszero)      &&r    
iszerofuncN)r   r   r;   args)rn   lur?   errrm   s       @r   &test_LUdecomposition_Simple_iszerofuncrv   %  sm     &L'AA'(??;?W
 5	  sxx{***s   #0 A AA c                     a R oV3R lp  \        ^^ .^ ^..4      P                  V R7      w  rpQ h  \         d&   pSTP                  ^ ,          8X  g   Q h Rp?R# Rp?ii ; i)rg   c                    < \        S4      hri   rj   rk   s   &r   rn   4test_LUdecomposition_iszerofunc.<locals>.goofyiszero8  rp   r    rq   N)r   r5   r;   rs   )rn   lur?   ru   rm   s        @r   test_LUdecomposition_iszerofuncr|   4  so     &L'1a&1a&)*::k:Ra
 5	  sxx{***s   $1 A!AA!c            
      v	   \        \        R  4       \        \        R 4       \        \        R 4       \        \        R 4       \        \        R 4       \        R4      p V P	                  RR7      w  rW,          VP
                  ,          V 8X  g   Q h\        R4      p V P	                  4       w  rW,          VP
                  ,          V 8X  g   Q hVP                  '       g   Q hV\        . RO\        ^^4      ^^ .\        R^4      \        ^^4      ^..4      8X  g   Q hVP                  4       '       g   Q hV\        . RO. RO. RO.4      8X  g   Q h\        ^R\        ,          ^^\        ,          ,           3^\        ,          ^R\        ,           3^^\        ,          ,
          R\        ,
          ^334      p V P	                  4       w  r\        W,          VP                  ,          4      V 8X  g   Q hVP                  4       \        . RO\        ^,          ^^ .\        P                  \        ^,          ,
          ^ ^..4      8X  g   Q hVP                  4       \        R4      8X  g   Q h\        \        R 4       \        \        R 4       \        \        R	 4       \        \        R
 4       \        \        R 4       \        R4      p V P	                  RR7      w  rW,          VP
                  ,          V 8X  g   Q h\        R4      p V P	                  4       w  rW,          VP
                  ,          V 8X  g   Q hVP                  '       g   Q hV\        . RO\        ^^4      ^^ .\        R^4      \        ^^4      ^..4      8X  g   Q hVP                  4       '       g   Q hV\        . RO. RO. RO.4      8X  g   Q h\        ^R\        ,          ^^\        ,          ,           3^\        ,          ^R\        ,           3^^\        ,          ,
          R\        ,
          ^334      p V P	                  4       w  r\        W,          VP                  ,          4      V 8X  g   Q hV\        R\        ^,          ^^ 3\        P                  \        ^,          ,
          ^ ^334      8X  g   Q hV\        R4      8X  g   Q hR# )c                  4    \        R4      P                  4       # r)   r)   r!   r   LDLdecomposition r    r   r   'test_LDLdecomposition.<locals>.<lambda>D  s    )H)H)Jr    c                  4    \        R4      P                  4       # r)   r   )r#   r%   r   r   r    r   r   r   E      v&67HHJr    c                  R    \        ^\        ,           ^ 3R34      P                  4       # r"   )r   r)   )r   r   r   r   r    r   r   r   F  s    vAqz6&:;LLNr    c                  4    \        R4      P                  4       # r)   )r)   r"   )r"   r)   r   r   r    r   r   r   G  r   r    c                  8    \        R4      P                  RR7      # r)   F	hermitianr   r   r   r    r   r   r   H  s    v&67HHSXHYr    Fr   c                  4    \        R4      P                  4       # r   r   r   r   r    r   r   r   Y  s    f)=)N)N)Pr    c                  4    \        R4      P                  4       # r   r   r   r    r   r   r   Z      |,<=NNPr    c                  R    \        ^\        ,           ^ 3R34      P                  4       # r   )r   r   r   r   r    r   r   r   [  s    |a!eQZ,@ARRTr    c                  4    \        R4      P                  4       # r   r   r   r    r   r   r   \  r   r    c                  8    \        R4      P                  RR7      # r   r   r   r    r   r   r   ]  s    |,<=NNY^N_r    Nr   ))      )r      r   )r   r   r/   r2   r4   )r   r   r   )r   r-   r   r   r   r-   r'   ))r%   r   r   )r   r)   r   r   )r   r   r;   r   r   rG   r6   r   is_diagonalr   r   Hexpandr   Halfr   )rI   r=   rM   s      r   test_LDLdecompositionr   C  s   
!JK
:JK
:NO
:JK
:YZ A.DA5133;!78ADA5133;!::::	Xa^Q#:Xb!_hWXZ[n^_<`abbbb==???
Iy9::::BqD!ac'"QqS!R!V$4q1Q3wQ6KLMADAaeacck"a'''88:QqS!QK!&&1Q3,19M NOOOO88: ABBBB
!PQ
:PQ
:TU
:PQ
:_`%&A.DA5133;!=>ADA5133;!::::	Xa^Q#:Xb!_hWXZ[n^_<`abbbb==???
Iy9::::q"Q$AaC(1Q326*:Q1Wb1fb<QRSADAaeacck"a'''	AaCA;!A#q!0DEFFFF89999r    c            	      D   \        . RO. RO. RO. RO. RO. R	O.4      .p V  F{  pVP                  RR7      pW,          pW!,          p\        W1,          4      V8X  g   Q h\        WB,          4      V8X  g   Q hVP                  V8X  g   Q hVP                  V8X  d   K{  Q h	  R# )
=   RD)methodN)r   Y   7      G   r   )>   `   U   r   r\   r   )E   8      r%   6   r   )r.   r   [   )   r   r   )r$      r.   0   Z   r   )r   r   r   r   r   r   )r   pinvr
   r   )AsrI   A_pinvAApApAs        r   1test_pinv_succeeds_with_rank_decomposition_methodr   n  s    
  
B t$jj A%%%%///uu||uu|| r    c                     \        ^ ^ . 4      p V P                  4       w  rVP                  '       g   Q hVP                  VP                  u;8X  d   V P                  4       8X  g   Q h Q hW,          V 8X  g   Q h\        ^^^.4      p V P                  4       w  rVP                  '       g   Q hVP                  VP                  u;8X  d   V P                  4       8X  g   Q h Q hW,          V 8X  g   Q h\        ^^. RO4      p V P                  4       w  rVP                  '       g   Q hVP                  VP                  u;8X  d   V P                  4       8X  g   Q h Q hW,          V 8X  g   Q h\        . RO. RO. RO. RO.4      p V P                  4       w  rVP                  '       g   Q hVP                  VP                  u;8X  d   V P                  4       8X  g   Q h Q hW,          V 8X  g   Q hR# )r   N)	r)   r!   r#   r)   r!   r#   r)   r!   r#   )r   r   r)   r!   r!   r   r#   )r4   r"   r!   r!   r)   rZ   r"   )r   r   r'   r[   r[   r&   r   )r4   r"   r   r4   r'   r)   r   )r   rank_decomposition
is_echelonrH   rowsrank)acfs      r   test_rank_decompositionr     s   q!RA!DA<<<<66QVV'qvvx'''''5A::q!aSA!DA<<<<66QVV'qvvx'''''5A::q!01A!DA<<<<66QVV'qvvx'''''5A::! 	" 	#A
 !DA<<<<66QVV'qvvx'''''5A::r    c            
         \        ^^ \        ^4      .\        ^4      \        ^^4      ^.^\        ^^4      ^..4      p V P                  4       w  r\	        W"P
                  ,          4      \        VP                  4      8X  g   Q h\	        VP
                  V,          4      \        VP                  4      8X  g   Q hVP                  '       g   Q h\	        W!,          VP
                  ,          4      V 8X  g   Q h\        . RO. RO. RO.4      pVP                  4       w  r\	        W"P
                  ,          4      \        VP                  4      8X  g   Q h\	        VP
                  V,          4      \        VP                  4      8X  g   Q hVP                  '       g   Q h\	        W!,          VP
                  ,          4      V8X  g   Q h\        ^\        ^4      ^^.. RO^^^\        ^4      .. RO.4      pVP                  4       w  r\	        W"P
                  ,          4      \        VP                  4      8X  g   Q h\	        VP
                  V,          4      \        VP                  4      8X  g   Q hVP                  '       g   Q h\	        W!,          VP
                  ,          4      V8X  g   Q h\        . RO. RO. R	O.4      pVP                  4       w  r\	        W"P
                  ,          4      \        VP                  4      8X  g   Q h\	        VP
                  V,          4      \        VP                  4      8X  g   Q hVP                  '       g   Q h\	        W!,          VP
                  ,          4      V8X  g   Q h\        . R
O. RO. RO. RO.4      pVP                  4       w  r\	        W"P
                  ,          4      \        VP                  4      8X  g   Q h\	        VP
                  V,          4      \        VP                  4      8X  g   Q hVP                  '       g   Q h\	        W!,          VP
                  ,          4      V8X  g   Q hR# )r)   N)r)   r!   r.   )r&   r!   r"   )r#   r0   "   )r   r"   r#   r%   )r   r!   r!   r#   r*   )r[   r"   r(   )r%   ir-   )r)   r   r   r   )r   r)   r   r   )r)   r)   r   r)   )r)   r)   r)   r   )	r   r   r   upper_hessenberg_decompositionr
   r   r   rH   is_upper_hessenberg)rI   r   rB   rK   rL   rM   Es          r   #test_upper_hessenberg_decompositionr     s]   	
AtAw	a(1a.!$	
HQNA 	A
 ++-DAAGAFF+++ACC!GAFF+++     QUQSS[!a''' 	 	A
 ++-DAAGAFF+++ACC!GAFF+++     AEACCK A%%%	
DGQ	
Aq$q'	 	A ++-DAAGAFF+++ACC!GAFF+++     AEACCK A%%% 	A
 ++-DAAGAFF+++ACC!GAFF+++     AEACCK A%%%	 	A ++-DAAGAFF+++ACC!GAFF+++     AEACCK A%%%r    N)+sympy.core.functionr   sympy.core.numbersr   r   sympy.core.singletonr   sympy.core.symbolr   (sympy.functions.elementary.miscellaneousr   $sympy.functions.elementary.complexesr	   sympy.simplify.simplifyr
   sympy.matrices.exceptionsr   sympy.matricesr   r   r   r   	sympy.abcr   r   r   sympy.testing.pytestr   r   sympy.testing.matricesr   rD   rN   rW   ra   rc   re   rv   r|   r   r   r   r   r   r    r   <module>r      s    * * " $ 9 4 , : ; ;   - +SJj&D 2F%NDN,):V$< ;& ;&r    