+
    i%                     H   R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ]! R4      w  tt]! R4      w  tt]],          ],           t]]],          ,           t]
! ]].]].R7      t]! ]].]].R7      tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R# )z*Tests for Dixon's and Macaulay's classes. )Matrix)factor)symbols)IndexedBase)DixonResultantMacaulayResultantza, bx, ypolynomials	variablesc                 J   \        R4      p \        P                  \        \        .8X  g   Q h\        P
                  \        \        .8X  g   Q h\        P                  ^8X  g   Q h\        P                  ^8X  g   Q h\        P                  V ^ ,          V ^,          .8X  g   Q hR# )z#Test init method of DixonResultant.alphaN)r   dixonr
   pqr   xynmdummy_variables)as    l/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/polys/tests/test_multivariate_resultants.pytest_dixon_resultant_initr      sz    GAA&&&??q!f$$$77a<<77a<<  QqT1Q4L000    c                 f   \        R4      p \        \        ,           p\        ^,          \        ^,          ,           p\        ^,          \        ,           p\        WV.\        \        .4      p\        ) \        ^,          ,          V ^ ,          ,          \        \        ^,          ,          V ^,          ,          ,
          \        \        ,          V ^ ,          ,          V ^,          ,          ,
          \        \        ,          V ^,          ^,          ,          ,
          \        V ^ ,          ,          V ^,          ^,          ,          ,
          \        V ^ ,          ,          ,           \        ^,          V ^ ,          ,          V ^,          ,          ,
          \        ^,          V ^,          ,          ,           \        V ^ ,          ,          V ^,          ^,          ,          ,
          \        V ^,          ^,          ,          ,           pVP	                  4       P                  4       P                  4       V8X  g   Q hR# )z0Test Dixon's polynomial for a numerical example.r   N)r   r   r   r   get_dixon_polynomialas_exprexpand)r   r   r   hr   
polynomials         r   #test_get_dixon_polynomial_numericalr       sn   GA	AA	QQA	Q
AA!9q!f-Ea1fqt#a!q&j1Q4&77!a%!A$,d; UQqTQY!"QqTAaDAI!5689AaDAFQqTMAaD6AaD=)+,qt8adai+?@BCaDAICJ
 %%'//188:jHHHr   c                    \         \        ,           p \         ^,          \        ^,          ,           p\         ^,          \        ,           p\        WV.\         \        .R7      pVP                  4       pVP	                  V4      ^^.8X  g   Q hR# )zTests max degrees function.r	   N)r   r   r   r   get_max_degrees)r   r   r   r   dixon_polynomials        r   test_get_max_degreesr$   .   sl     	
AA	QQA	Q
AayQFCE113  !12q!f<<<r   c                    \        R4      w  rW,           pV ^,          V^,          ,           pV ^,          V,           p\        W#V.W.4      pVP                  4       pVP                  V4      P	                  4       ^ 8X  g   Q hR# )z/Test Dixon's resultant for a numerical example.r   N)r   r   r   get_dixon_matrixdet)r   r   r   r   r   r   r   s          r   test_get_dixon_matrixr(   :   sv     6?DA	A	QaA	Q
AA!9qf-E++-J!!*-113q888r   c                 r   \        R4      w  rpV ^,          V^,          ,           ^,
          V^ ,          ,           pV ^,          V^,          ,           ^,
          V^ ,          ,           pV^,          V^,          ,           ^,
          p\        W4V.W.4      pVP                  4       pVP                  V4      p^^V ^,          ,          ,
          ^V ^,          ,          ,           ^ V ^,          ,          ,
          ^V ^,          ,          ,           p	VP	                  4       V	,
          P                  4       ^ 8X  g   Q hR# )z2Test Dixon's matrix for example from [Palancz08]_.x, y, zN)r   r   r   r&   r'   r   )
r   r   zfgr   example_twopolymatrixexprs
             r   !test_get_dixon_matrix_example_twor2   H   s    i GA!	Qa!a!e#A	Qa!a!e#A	Qa!A !QF3K++-D))$/Fq16z>BaK'"qAv+5Q!VCDJJL4'')Q...r   c                 B   \        R4      w  rp\        . RO. RO. RO.4      p\        ^ V^,          .RV,          V^,          ) ..4      p\        ^^ .^ ^..4      p\        V ^,          ^ ^.V ^^V ,          ..4      p\        ^^.^V.^ ^.^ ^ ..4      p\        P                  V4      R8X  g   Q h\        P                  V4      R8X  g   Q h\        P                  V4      R8X  g   Q h\        P                  V4      R8X  g   Q h\        P                  V4      R8X  g   Q hR# )	z%Tests precondition for KSY Resultant.A, B, CFTN         )         )         )r   r   r   KSY_precondition)ABCm1m2m3m4m5s           r   test_KSY_preconditionrI   W   sG   i GA!	 
B 
!QTq&16'"$ 
%B 
!QQ 
B 
!Q$1QA  
!B 
!QQQQ 
B
 !!"%...!!"%---!!"%---!!"%...!!"%---r   c                 2   \        R4      w  rp\        ^ ^ .^ ^ .^^..4      p\        . RO. RO. RO.4      p\        . RO. RO. RO. RO.4      p\        . R	O. R
O. RO.4      p\        . RO. RO. RO. RO.4      p\        ^ ^ V .V^ ^ .^ ^ V..4      p\        P                  V4      \        ^^..4      8X  g   Q h\        P                  V4      \        ^^.^^.^^..4      8X  g   Q h\        P                  V4      \        ^^.^^..4      8X  g   Q h\        P                  V4      \        ^^.^^..4      8X  g   Q h\        P                  V4      \        ^.^.^.^..4      8X  g   Q h\        P                  V4      \        ^ V .V^ .^ V..4      8X  g   Q hR# )zATests method for deleting rows and columns containing only zeros.r4   N)    r6   r7   )rK   r8   r9   )rK   r:   r<   )rK   rK   rK   rK   )rK   r6   r7   rK   )rK   r8   r9   rK   )r6   rK   r7   rK   rK   rK   )r8   rK   r9   )rK   rK   rK   r6   )rK   rK   rK   r7   )rK   rK   rK   r8   )rK   rK   rK   r9   )r   r   r   delete_zero_rows_and_columns)	rA   rB   rC   rD   rE   rF   rG   rH   m6s	            r   !test_delete_zero_rows_and_columnsrO   s   s1   i GA!	!QQQ 
B 
 
B 
 
 B
 
 
B 
 
 B
 
!QQQ 
B --b1VaVH5EEEE--b1VaV>?V>?V=E 6F F F F --b1VaV>?V=E 6F F F F --b1VaV>?V=E 6F F F F --b1VaS>?S>?S>?S=B 6C C C C
 --b1VaV>?V>?V=E 6F F F Fr   c                    \        R4      w  r\        . RO. RO. RO.4      p\        . RO. RO.4      p\        . RO. RO. RO.4      p\        ^ ^ V .. ROV^ ^ ..4      p\        P                  V4      ^8X  g   Q h\        P                  V4      ^8X  g   Q h\        P                  V4      ^8X  g   Q h\        P                  V4      W,          8X  g   Q hR# )	z(Tests product of leading entries method.zA, BNr5   )rK   r9   r:   )rK   rK   r<   )rK   rK   r6   )r7   rK   r8   rL   )r   r   r   product_leading_entries)rA   rB   rD   rE   rF   rG   s         r   test_product_leading_entriesrR      s    6?DA	 
B 
 
B 
 
B 
!QQ 
B ((,222((,111((,111((,555r   c                 .   \        R4      w  rpW,          V,          pV ^,          V^,          ,
          pW,           V,           p\        W4V.W.4      pVP                  4       pVP                  V4      pVP	                  V4      p	W^,          ) 8X  g   Q hR# )z-Tests the KSY Dixon resultant for example oner*   N)r   r   r   r&   get_KSY_Dixon_resultant)
r   r   r+   r   r   r   r   
dixon_polydixon_matrixDs
             r   (test_get_KSY_Dixon_resultant_example_onerX      s    i GA!		A	1q!tA		AA!9qf-E++-J))*5L%%l3AA::r   c                    \        R4      w  rpW,          W,          ,           V ,           V^,          ,
          V,
          V^,          ,           V,           pV ^,          W,          ,           V ,
          W,          ,           W,          ,           V,
          pV ^,          W,          ,           ^V ,          ,           W,          ,
          W,          ,
          ^V,          ,
          p\        W4V.W.4      pVP                  4       pVP                  V4      p\	        VP                  V4      4      p	V	RV,          V^,
          ,          V^,           ,          ^V,          ^,
          ^,          ,          8X  g   Q hR# )z-Tests the KSY Dixon resultant for example twozx, y, ANi)r   r   r   r&   r   rT   )
r   r   rA   r   r   r   r   rU   rV   rW   s
             r   (test_get_KSY_Dixon_resultant_example_tworZ      s   i GA!	AqD 1$q!t+a/A	1quq15 15(1,A	1quq1uqu$qu,q1u4AA!9qf-E++-J))*5Lu,,\:;A1a!ea!e$acAg\1111r   c                 F   \         P                  \        \        .8X  g   Q h\         P                  \
        \        .8X  g   Q h\         P                  ^8X  g   Q h\         P                  ^^.8X  g   Q h\         P                  ^8X  g   Q h\         P                  ^8X  g   Q hR# )z&Test init method of MacaulayResultant.N)macaulayr
   r   r   r   r   r   r   degreesdegree_mmonomials_size r   r   test_macaulay_resultant_initra      s     Aq6)))!Q'''::??1v%%%!!!""a'''r   c                  <    \         P                  4       ^8X  g   Q hR# )r6   N)r\   _get_degree_mr`   r   r   test_get_degree_mrd      s    !!#q(((r   c                  <    \         P                  4       ^8X  g   Q hR# )r7   N)r\   get_sizer`   r   r   test_get_sizerg      s    !###r   c                    \        R4      w  rp\        R4      w  r4p\        R4      w  rgp\        R4      w  rp\        R4      w  rp\        R4      w  pppW0^,          ,          W@,          V,          ,           WP,          V,          ,           Wa^,          ,          ,           Wq,          V,          ,           W^,          ,          ,           pW^,          ,          W,          V,          ,           W,          V,          ,           W^,          ,          ,           W,          V,          ,           W^,          ,          ,           pW,          VV,          ,           VV,          ,           p\        VVV.WV.4      pVP                  . RO8X  g   Q hVP                  ^8X  g   Q hVP                  V ^,          V ^,          V,          V ^,          V,          W^,          ,          W,          V,          W^,          ,          V^,          V^,          V,          W^,          ,          V^,          .
8X  g   Q hVP
                  ^
8X  g   Q hVP                  4       WV.WV.W,          W,          W,          V^,          ..8X  g   Q hVP                  4       pVP                  VP
                  VP
                  38X  g   Q hVP                  V4      \        W6.W..4      8X  g   Q hR# )	z.Tests the Macaulay for example from [Bruce97]_r*   za_1_1, a_1_2, a_1_3za_2_2, a_2_3, a_3_3zb_1_1, b_1_2, b_1_3zb_2_2, b_2_3, b_3_3zc_1, c_2, c_3N)r7   r7   r6   )r   r   r]   r^   monomial_setr_   get_row_coefficients
get_matrixshapeget_submatrixr   )r   r   r+   a_1_1a_1_2a_1_3a_2_2a_2_3a_3_3b_1_1b_1_2b_1_3b_2_2b_2_3b_3_3c_1c_2c_3f_1f_2f_3macr0   s                          r   test_macaulay_example_oner      s    i GA!!"78E%!"78E%!"78E%!"78E%O,MCc
q&.59q=
(59q=
8
q&. 9q=)+06>:C
q&.59q=
(59q=
8
q&. 9q=)+06>:C
'C!G
cAg
%C
S#sOaAY
7C;;)###<<1QQ
AFQJ !F
 !	1Av:qAv !Q	1Av:qAv ? ? ? ? #####%1)aAY+,5!%Q*G*I I I I ^^F<<C..0B0BCCCCV$160@ )A A A Ar   c            
        \        R4      w  rp\        R4      w  r4p\        R4      w  rgp\        R4      w  rrpW1,          W@,          ,
          WR,          ,           pWp^,          ,          Wa^,          ,          ,           W^,          ,          ,
          pW,          W^,          ,          ,
          W^,          ,          V,          ,           W,          V^,          ,          ,
          W^,          ,          ,           p\        WV.WV.4      pVP                  . RO8X  g   Q hVP                  ^8X  g   Q hVP                  ^8X  g   Q h\        VP                  4       4      VP                  8X  g   Q hVP                  4       pVP                  VP                  VP                  38X  g   Q hVP                  V4      \        V) W5^ .^ V) ^ ^ .^ ^ V) ^ .^ ^ ^ V) ..4      8X  g   Q hR# )z=Tests the Macaulay formulation for example from [Stiller96]_.r*   za_0, a_1, a_2zb_0, b_1, b_2zc_0, c_1, c_2, c_3, c_4Nr5   )r   r   r]   r^   r_   lenrj   r   rk   rl   rm   r   )r   r   r+   a_0a_1a_2b_0b_1b_2c_0rz   r{   r|   c_4r,   r-   r   r   r0   s                      r   test_macaulay_example_twor     s    i GA!O,MCcO,MCc%&?@Cc37SW$A1fs!V|#cFl2A#Q,Av!11CGa1f4DD1f	A Q1Iay
1C;;)###<<1###s'')*cee333^^F<<C..0B0BCCCCV$#s0C12SD!Q12AtQ12Aq3$0A )B B B Br   N)#__doc__sympy.matrices.denser   sympy.polys.polytoolsr   
sympy.corer   sympy.tensor.indexedr   #sympy.polys.multivariate_resultantsr   r   cdr   r   r   r   r   r\   r   r    r$   r(   r2   rI   rO   rR   rX   rZ   ra   rd   rg   r   r   r`   r   r   <module>r      s    0 ' (  ,D v1v1UQYQYAq6aV<!QAq6B1I 
=9/.81Ff602()$ ADBr   