+
    i                         ^ RI HtHt ^ RIHt ^ RIHt ^ RIHtH	t	H
t
 ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtHtHtHt ]! R	4      w  ttt]! R
]]4      t]! R]]4      t]! R]]4      t]! R]]4      tR tR tR t R t!R t"R t#R t$R t%R t&R# )    )Matrixeye)
ShapeError)MatAdd)Identity	OneMatrix
ZeroMatrix)symbols)raiseswarns_deprecated_sympy)MatrixSymbol)HadamardProducthadamard_productHadamardPowerhadamard_powerzn,m,kZABCc                     \        \        \        \        4      P                  \        P                  8X  g   Q h\	        \
        R  4       \	        \
        R 4       \        \        ^\        ,          \        ) 4      R,          R\        R,          ,          \        R,          ,          \        R,          ,          8X  g   Q h\        \        \        ,          \        4      \        ,          p V P                  \        \        38X  g   Q h\        \        \        \        \        4      P                  P                  4      \        P                  \        P                  \        P                  08X  g   Q hR# )c                  *    \        \        \        4      # N)r   r   n     l/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/matrices/expressions/tests/test_hadamard.py<lambda>&test_HadamardProduct.<locals>.<lambda>   s    q!4r   c                  "    \        \        ^4      # )   )r   r   r   r   r   r   r      s    q!4r   Nr    r    )r   r   r   shaper   	TypeErrorr   r   r   ksetTargs)mixs    r   test_HadamardProductr*      s    1a#))QWW444
945
9451acA2&t,4L1T7"QtW,- - - !A#q
!!
#C99Aq!Q'))../ACCacc?BBBr   c                  `    \        \        \        4      \        \        \        4      8w  g   Q hR # r   )r   r   r   r   r   r   %test_HadamardProduct_isnt_commutativer,   !   s    1a OAq$9999r   c                  .   \        R ^^4      p \        R^^4      p\        R^^4      pV \        W4      ,          R,          V R,          VR,          ,          VR,          ,          V R,          VR,          ,          VR,          ,          ,           8X  g   Q hR# )XYr   Nr   r   r   r    r    r   )r   r   )r.   r/   r   s      r   test_mixed_indexingr3   %   s    S!QAS!QAS!QAoa##T*dGAdGOAdG#agagoag&==> > >r   c                     \        R ^^4      p \        R^^4      p\        4       ;_uu_ 4        \        V RR7      pRRR4       \        X\        4      '       g   Q hVP	                  4       p\        V\         4      '       g   Q h\        ^^4      p\        ^^4      p\        W@4      P	                  4       V8X  g   Q h\        WPW4      P	                  4       \        V ^4      8X  g   Q h\        WV4      P	                  4       \        W4      8X  g   Q h\        WWQ4      P	                  4       V8X  g   Q hR#   + '       g   i     EL; i)r.   r/   F)checkN)r   r   r   
isinstancedoitr	   r   r   )r.   r/   exprexpr2r   Us         r   test_canonicalizer;   .   s   S!QAS!QA		!	!q. 
"dO,,,,IIKEe\****1aA!QA1 %%'1,,,1&++-q!1DDDD1#((*oa.CCCC1&++-222 
"	!	!s   D33E	c                     \        R RR7      w  rp\        RW4      p\        RW4      p\        RW 4      p\        V 4      p\        \        R 4       \        V4      V8X  g   Q h\        \        W44      \        4      '       g   Q h\        W44      P                  4       \        W44      8X  g   Q h\        WV4      \        We4      8X  g   Q h\        \        WV4      \        4      '       g   Q h\        R\        ^4      p\        \        \        ^4      \        \        ^4      4      p\        W4      pVP                  4       V8X  g   Q h\        \        R 4       R	# )
m, n, pTintegerr   r   r.   c                      \        4       # r   )r   r   r   r   r   test_hadamard.<locals>.<lambda>E   s    .0r   ac                      \        4       # r   r   r   r   r   r   rA   Q   s    0r   N)r
   r   r   r   r$   r   r6   r   r7   r%   r   r	   r   
ValueError)	mr   pr   r   r.   IrB   r8   s	            r   test_hadamardrI   >   s   i.GA!S!AS!AS!AA
901A!###&q,o>>>>A!&&(,<Q,BBBBA!_Q%::::&q,o>>>>S!QA*Q"IaO4D4#D99;!
:01r   c            	      f   \        R ^^4      P                  4       p \        R^^4      P                  4       p\        R^^4      p\        W4      p\        \	        W4       UUu. uF  w  rEWE,          NK  	  upp4      P                  ^^4      pW68X  g   Q h\        WV4      pV\        Wb4      8X  g   Q h\        \        ^4      V 4      pV\        V R,          ^ ^ .^ V R,          ^ .^ ^ V R,          ..4      8X  g   Q h\        \        ^4      \        ^4      4      pV\        ^4      8X  g   Q hR# u uppi )r   r   r.   Nr0   r!   )   rK   )r   as_explicitr   r   zipreshaper   r   )r   r   r.   r8   ijrets          r   'test_hadamard_product_with_explicit_matrR   T   s   S!Q++-AS!Q++-AS!QAA!D
#a),)$!!##),
-
5
5a
;C;;A!$D?3****CFA&D6AdGQ?Q$OaAdG_MNNNNCFCF+D3q6>> -s   "D-
c                    a \        R RR7      w  rp\        RW4      o\        S^4      S8X  g   Q h\        \        S^4      \        4      '       g   Q h\        SV4      P
                  \        SP
                  V4      8X  g   Q h\        SV4      R,          SR,          V,          8X  g   Q h\        W4      W,          8X  g   Q h\        \        V3R l4       R# )r=   Tr>   r   c                     < \        S S 4      # r   )r   )r   s   r   r   %test_hadamard_power.<locals>.<lambda>l   s    ~a3r   Nr0   )r
   r   r   r6   r   r'   r   rE   )rF   r   rG   r   s      @r   test_hadamard_powerrV   c   s    i.GA!S!A!Q1$$$nQ*M::::!Q!!^ACC%;;;;!Q%4!333!14'''
:34r   c                     \        R ^^4      p \        R^^4      p\        R4      w  r#\        W#4      W#,          8X  g   Q h\        W!4      P                  4       \	        W!R,          ,          W!R,          ,          .W!R,          ,          W!R,          ,          ..4      8X  g   Q h\        W4      P                  4       \	        V R,          V,          V R,          V,          .V R,          V,          V R,          V,          ..4      8X  g   Q h\        W4      P                  4       \	        V R,          VR,          ,          V R,          VR,          ,          .V R,          VR,          ,          V R,          VR,          ,          ..4      8X  g   Q hR# )r   r   za bNr0   r1   r2   r!   )r   r
   r   rL   r   )r   r   rB   bs       r   test_hadamard_power_explicitrY   o   se   S!QAS!QA5>DA!$&&&**,$ZdG$$ZdG$& 	'' ' '
 **,tWaZ4!$tWaZ4!$& 	'' ' '
 **,tWagqw$/0tWagqw$/02 	33 3 3r   c                     a a \        R ^^4      o \        R^^4      o\        \        V V3R l4       \        \        V V3R l4       \        R ^^4      o \        \        V V3R l4       \        \        V V3R l4       R# )r   r   c                     < \        S S4      # r   rD   r   r   s   r   r   "test_shape_error.<locals>.<lambda>       q!4r   c                     < \        S S4      # r   r   r\   s   r   r   r]          }Q2r   c                     < \        S S4      # r   rD   r\   s   r   r   r]      r^   r   c                     < \        S S4      # r   r`   r\   s   r   r   r]      ra   r   N)r   r   r   r\   s   @@r   test_shape_errorrd      sY    S!QAS!QA
:45
:23S!QA
:45
:23r   N)'sympy.matrices.denser   r   sympy.matrices.exceptionsr   !sympy.matrices.expressions.mataddr   "sympy.matrices.expressions.specialr   r   r	   
sympy.corer
   sympy.testing.pytestr   r   sympy.matricesr   sympy.matrices.expressionsr   r   r   r   r   rF   r%   r   r   r   r   r*   r,   r3   r;   rI   rR   rV   rY   rd   r   r   r   <module>rm      s    , 0 4 N N  ? ' i i
'
1aaaaaC:>3 2,	53.4r   