+
    iO                     `    R t ^ RIHt ^ RIHt ^ RIHtHt ^ RIH	t	 ]	 ! R R]]4      4       t
R# )z1Implementation of :class:`PolynomialRing` class. )Ring)CompositeDomain)CoercionFailedGeneratorsError)publicc                   .  a  ] tR t^
t o RtR;ttRtRtR)R lt	R t
R t]R 4       t]R 4       t]R	 4       tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R t$R t%R  t&R! t'R" t(R# t)R$ t*R% t+R& t,R' t-R(t.V t/R# )*PolynomialRingz8A class for representing multivariate polynomial rings. TNc                   ^ RI Hp \        W4      '       d   Vf   Vf   TpM	V! W!V4      pWPn        VP                  V n        VP
                  V n        VP                  V n        VP                  V n        VP                  V n        V'       dP   VP                  P                  '       d4   VP                  P                  '       d   \        V4      ^8X  d   RV n        V P                  V n        R# )    )PolyRingNT)sympy.polys.ringsr   
isinstanceringdtypegensngenssymbolsdomainis_Fieldis_Exactlenis_PIDdom)selfdomain_or_ringr   orderr   r   s   &&&&  ڂ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/domains/polynomialring.py__init__PolynomialRing.__init__   s    .n//GO!DGU;D	ZZ
II	ZZ
||kk {{###(<(<(<Wq" ;;    c                8    V P                   P                  V4      # N)r   ring_newr   elements   &&r   newPolynomialRing.new+   s    yy!!'**r   c                8    V P                   P                  V4      # )z%Check if ``a`` is of type ``dtype``. )r   
is_elementr#   s   &&r   of_typePolynomialRing.of_type.   s    yy##G,,r   c                .    V P                   P                  # r!   )r   zeror   s   &r   r,   PolynomialRing.zero2   s    yy~~r   c                .    V P                   P                  # r!   )r   oner-   s   &r   r0   PolynomialRing.one6   s    yy}}r   c                .    V P                   P                  # r!   )r   r   r-   s   &r   r   PolynomialRing.order:   s    yyr   c                    \        V P                  4      R ,           RP                  \        \         V P                  4      4      ,           R,           # )[,])strr   joinmapr   r-   s   &r   __str__PolynomialRing.__str__>   s4    4;;#%S$,,1G(HH3NNr   c                    \        V P                  P                  V P                  V P                  V P
                  34      # r!   )hash	__class____name__r   r   r   r-   s   &r   __hash__PolynomialRing.__hash__A   s,    T^^,,diidllSTTr   c                l    \        V\        4      '       g   \        # V P                  VP                  8H  # )z.Returns `True` if two domains are equivalent. )r   r   NotImplementedr   )r   others   &&r   __eq__PolynomialRing.__eq__D   s(    %00!!yyEJJ&&r   c                    VP                   '       g   R# V P                  pVP                  VP                  W4      4      # )z/Returns ``True`` if ``a`` is a unit of ``self``F)	is_groundr   is_unitconvert_from)r   aKs   && r   rJ   PolynomialRing.is_unitJ   s/    {{{KKyy011r   c                    V P                   P                  VP                  4      pV P                  P	                  V4      # r!   )r   canonical_unitLCr   
ground_new)r   rL   us   && r   rP   PolynomialRing.canonical_unitQ   s/    KK&&qtt,yy##A&&r   c                "    VP                  4       # )zConvert `a` to a SymPy object. )as_exprr   rL   s   &&r   to_sympyPolynomialRing.to_sympyU   s    yy{r   c                8    V P                   P                  V4      # )z'Convert SymPy's expression to `dtype`. )r   	from_exprrW   s   &&r   
from_sympyPolynomialRing.from_sympyY   s    yy""1%%r   c                D    V ! V P                   P                  W4      4      # z*Convert a Python `int` object to `dtype`. r   convertK1rL   K0s   &&&r   from_ZZPolynomialRing.from_ZZ]       "))##A*++r   c                D    V ! V P                   P                  W4      4      # r_   r`   rb   s   &&&r   from_ZZ_pythonPolynomialRing.from_ZZ_pythona   rg   r   c                D    V ! V P                   P                  W4      4      # z/Convert a Python `Fraction` object to `dtype`. r`   rb   s   &&&r   from_QQPolynomialRing.from_QQe   rg   r   c                D    V ! V P                   P                  W4      4      # rl   r`   rb   s   &&&r   from_QQ_pythonPolynomialRing.from_QQ_pythoni   rg   r   c                D    V ! V P                   P                  W4      4      # )z(Convert a GMPY `mpz` object to `dtype`. r`   rb   s   &&&r   from_ZZ_gmpyPolynomialRing.from_ZZ_gmpym   rg   r   c                D    V ! V P                   P                  W4      4      # )z(Convert a GMPY `mpq` object to `dtype`. r`   rb   s   &&&r   from_QQ_gmpyPolynomialRing.from_QQ_gmpyq   rg   r   c                D    V ! V P                   P                  W4      4      # )z/Convert a `GaussianInteger` object to `dtype`. r`   rb   s   &&&r   from_GaussianIntegerRing'PolynomialRing.from_GaussianIntegerRingu   rg   r   c                D    V ! V P                   P                  W4      4      # )z0Convert a `GaussianRational` object to `dtype`. r`   rb   s   &&&r   from_GaussianRationalField)PolynomialRing.from_GaussianRationalFieldy   rg   r   c                D    V ! V P                   P                  W4      4      # z*Convert a mpmath `mpf` object to `dtype`. r`   rb   s   &&&r   from_RealFieldPolynomialRing.from_RealField}   rg   r   c                D    V ! V P                   P                  W4      4      # r   r`   rb   s   &&&r   from_ComplexField PolynomialRing.from_ComplexField   rg   r   c                    V P                   V8w  d   V P                   P                  W4      pVe   V P                  V4      # R# )z*Convert an algebraic number to ``dtype``. N)r   rK   r%   rb   s   &&&r   from_AlgebraicField"PolynomialRing.from_AlgebraicField   s9    99?		&&q-A=66!9 r   c                j     VP                  V P                  4      #   \        \        3 d     R# i ; i)z#Convert a polynomial to ``dtype``. N)set_ringr   r   r   rb   s   &&&r   from_PolynomialRing"PolynomialRing.from_PolynomialRing   s1    	::bgg&&0 		s    22c                L   V P                   V8X  d   V P                  P                  V.4      # VP                  V4      P	                  VP                  V4      4      w  r4VP                  '       d4   V P                  W2P                  P                  P                  4       4      # R# )z*Convert a rational function to ``dtype``. N)
r   r   	from_listnumerdivdenomis_zeror   field	to_domain)rc   rL   rd   qrs   &&&  r   from_FractionField!PolynomialRing.from_FractionField   sr    99?77$$aS))xx{rxx{+999))!XX]]-D-D-FGGr   c                   V P                   VP                  8X  dp   VP                  4       pV P                  VP                  8w  d=   VP	                  4        UUu/ uF   w  rEW@P                  P                  V4      bK"  	  pppV ! V4      # VP                  '       dE   VP                  V 8X  d2   V P                  VP                  4       ^ ,          VP                  4      # R# R# u uppi )z)Convert from old poly ring to ``dtype``. N)	r   r   to_dictr   itemsra   rI   rK   to_list)rc   rL   rd   admcs   &&&   r   from_GlobalPolynomialRing(PolynomialRing.from_GlobalPolynomialRing   s    :: ByyBII%:<((*E*$!a**1--*Eb6M[[[RYY"_??199;q>299== -[ Fs   &C#c                R    V P                   P                  4       P                  4       # )z(Returns a field associated with `self`. )r   to_fieldr   r-   s   &r   	get_fieldPolynomialRing.get_field   s    yy!!#--//r   c                L    V P                   P                  VP                  4      # )z%Returns True if `LC(a)` is positive. )r   is_positiverQ   rW   s   &&r   r   PolynomialRing.is_positive       {{&&qtt,,r   c                L    V P                   P                  VP                  4      # )z%Returns True if `LC(a)` is negative. )r   is_negativerQ   rW   s   &&r   r   PolynomialRing.is_negative   r   r   c                L    V P                   P                  VP                  4      # )z)Returns True if `LC(a)` is non-positive. )r   is_nonpositiverQ   rW   s   &&r   r   PolynomialRing.is_nonpositive       {{))!$$//r   c                L    V P                   P                  VP                  4      # )z)Returns True if `LC(a)` is non-negative. )r   is_nonnegativerQ   rW   s   &&r   r   PolynomialRing.is_nonnegative   r   r   c                $    VP                  V4      # )zExtended GCD of `a` and `b`. )gcdexr   rL   bs   &&&r   r   PolynomialRing.gcdex   s    wwqzr   c                $    VP                  V4      # )zReturns GCD of `a` and `b`. )gcdr   s   &&&r   r   PolynomialRing.gcd       uuQxr   c                $    VP                  V4      # )zReturns LCM of `a` and `b`. )lcmr   s   &&&r   r   PolynomialRing.lcm   r   r   c                V    V P                  V P                  P                  V4      4      # )zReturns factorial of `a`. )r   r   	factorialrW   s   &&r   r   PolynomialRing.factorial   s     zz$++//233r   )r   r   r   r   r   r   r   r   )NN)0r@   
__module____qualname____firstlineno____doc__is_PolynomialRingis_Polyhas_assoc_Ringhas_assoc_Fieldr   r%   r)   propertyr,   r0   r   r;   rA   rF   rJ   rP   rX   r\   re   ri   rm   rp   rs   rv   ry   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r   
   s    B"&&NO0+-      OU'2'&,,,,,,,,,,
>0--004 4r   r   N)r   sympy.polys.domains.ringr   #sympy.polys.domains.compositedomainr   sympy.polys.polyerrorsr   r   sympy.utilitiesr   r    r   r   <module>r      s4    7 * ? B "@4T? @4 @4r   