+
    ‹°³jH  ã                   ó  € R t ^ RIHtHt ^ RIHt ^ RIHt ^ RI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Ht ]RR
 l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 R4      t$] ! R R]4      4       t%R	# )z@Tools and arithmetics for monomials of distributed polynomials. )Úcombinations_with_replacementÚproduct)Údedent)Úcacheit)ÚMulÚSÚTupleÚsympify)ÚExactQuotientFailed)ÚPicklableWithSlotsÚdict_from_expr)Úpublic)Úis_sequenceÚiterableNc              #  ó   aa"  € \        S4      '       Ed~   \        V 4      p\        S4      V8w  d   \        R4      hSf   ^ .V,          oM|\        S4      '       g   \        R4      h\        S4      V8w  d   \        R4      h\        ;QJ d    R S 4       F  '       g   K   RM	  RM! R S 4       4      '       d   \        R4      h\        ;QJ d)    VV3R l\	        V4       4       F  '       g   K   RM	  RM! VV3R l\	        V4       4       4      '       d   \        R	4      h. p\        V SS4       F=  w  rVpTP                  \	        Wg^,           4       Uu. uF  q…V,          NK  	  up4       K?  	  \        V!   F  p	\        V	!  x € K  	  R# Sp
V
^ 8  d   \        R
4      hSf   ^ pMS^ 8  d   \        R4      hSpWº8”  d   R# V '       d   V
^ 8X  d   \        P                  x € R# \        V 4      \        P                  .,           p \        ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       d   \        W
4      pM\        W
R7      p\        4       pW«,
          pV FB  p^ pV F  pV^8X  g   K  V^,          pVV8  g   K   K(  	  VP                  \        V!  4       KD  	  T Rj  x€L
  R# u upi  L5i)aª
  
``max_degrees`` and ``min_degrees`` are either both integers or both lists.
Unless otherwise specified, ``min_degrees`` is either ``0`` or
``[0, ..., 0]``.

A generator of all monomials ``monom`` is returned, such that
either
``min_degree <= total_degree(monom) <= max_degree``,
or
``min_degrees[i] <= degree_list(monom)[i] <= max_degrees[i]``,
for all ``i``.

Case I. ``max_degrees`` and ``min_degrees`` are both integers
=============================================================

Given a set of variables $V$ and a min_degree $N$ and a max_degree $M$
generate a set of monomials of degree less than or equal to $N$ and greater
than or equal to $M$. The total number of monomials in commutative
variables is huge and is given by the following formula if $M = 0$:

    .. math::
        \frac{(\#V + N)!}{\#V! N!}

For example if we would like to generate a dense polynomial of
a total degree $N = 50$ and $M = 0$, which is the worst case, in 5
variables, assuming that exponents and all of coefficients are 32-bit long
and stored in an array we would need almost 80 GiB of memory! Fortunately
most polynomials, that we will encounter, are sparse.

Consider monomials in commutative variables $x$ and $y$
and non-commutative variables $a$ and $b$::

    >>> from sympy import symbols
    >>> from sympy.polys.monomials import itermonomials
    >>> from sympy.polys.orderings import monomial_key
    >>> from sympy.abc import x, y

    >>> sorted(itermonomials([x, y], 2), key=monomial_key('grlex', [y, x]))
    [1, x, y, x**2, x*y, y**2]

    >>> sorted(itermonomials([x, y], 3), key=monomial_key('grlex', [y, x]))
    [1, x, y, x**2, x*y, y**2, x**3, x**2*y, x*y**2, y**3]

    >>> a, b = symbols('a, b', commutative=False)
    >>> set(itermonomials([a, b, x], 2))
    {1, a, a**2, b, b**2, x, x**2, a*b, b*a, x*a, x*b}

    >>> sorted(itermonomials([x, y], 2, 1), key=monomial_key('grlex', [y, x]))
    [x, y, x**2, x*y, y**2]

Case II. ``max_degrees`` and ``min_degrees`` are both lists
===========================================================

If ``max_degrees = [d_1, ..., d_n]`` and
``min_degrees = [e_1, ..., e_n]``, the number of monomials generated
is:

.. math::
    (d_1 - e_1 + 1) (d_2 - e_2 + 1) \cdots (d_n - e_n + 1)

Let us generate all monomials ``monom`` in variables $x$ and $y$
such that ``[1, 2][i] <= degree_list(monom)[i] <= [2, 4][i]``,
``i = 0, 1`` ::

    >>> from sympy import symbols
    >>> from sympy.polys.monomials import itermonomials
    >>> from sympy.polys.orderings import monomial_key
    >>> from sympy.abc import x, y

    >>> sorted(itermonomials([x, y], [2, 4], [1, 2]), reverse=True, key=monomial_key('lex', [x, y]))
    [x**2*y**4, x**2*y**3, x**2*y**2, x*y**4, x*y**3, x*y**2]
zArgument sizes do not matchNzmin_degrees is not a listc              3   ó*   "  € T F	  q^ 8  x € K  	  R# 5i©é    N© )Ú.0Úis   & ÚV/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/polys/monomials.pyÚ	<genexpr>Ú itermonomials.<locals>.<genexpr>c   s   é € Ð.¡+˜Q�q–5£+ùó   ‚TFz+min_degrees cannot contain negative numbersc              3   óJ   <"  € T F  pSV,          SV,          8„  x € K  	  R # 5i©Nr   )r   r   Úmax_degreesÚmin_degreess   & €€r   r   r   e   s   øé € ÐA¹°1ˆ{˜1�~ ¨A¥Ö.»ùs   ƒ #z2min_degrees[i] must be <= max_degrees[i] for all izmax_degrees cannot be negativezmin_degrees cannot be negativec              3   ó8   "  € T F  qP                   x € K  	  R # 5ir   )Úis_commutative)r   Úvariables   & r   r   r   }   s   é € ÐA±y¨8×&Ö&³yùs   ‚)Úrepeat)r   ÚlenÚ
ValueErrorÚanyÚrangeÚzipÚappendr   r   r   ÚOneÚlistÚallr   ÚsetÚadd)Ú	variablesr   r   ÚnÚpower_listsÚvarÚmin_dÚmax_dr   ÚpowersÚ
max_degreeÚ
min_degreeÚitÚmonomials_setÚdÚitemÚcountr!   s   &ff               r   Úitermonomialsr<      sN  ùé € ôT �;×ÓÜ�	‹NˆÜˆ{Ó˜qÔ ÜÐ:Ó;Ð;ØÒØ˜#˜a�%‰KÜ˜[×)Ò)ÜÐ8Ó9Ð9ä�;Ó 1Ô$Ü Ð!>Ó?Ð?ß‹sÑ.¡+Ó.�s�sŠsÑ.¡+Ó.×.Ò.Ü Ð!NÓOÐOß‹3ÕA¼¸a¼ÓA�3�3Š3ÕA¼¸a¼ÓA×AÒAÜÐQÓRÐRØˆÜ!$ Y°¸[Ö!IÑˆC˜Ø×Ñ´°eÀQ½YÔ0GÓHÑ0G¨1 Q§ Ñ0GÑHÖIñ "Jä˜{Ô+ˆFÜ�v‘,Ôó ,ð !ˆ
Ø˜Œ>ÜÐ=Ó>Ð>ØÒØ‰Jà˜QŒÜ Ð!AÓBÐBØ$ˆJØÔ"Ùß˜J¨!œOÜ—%‘%ŠKÙä˜“O¤q§u¡u gÕ-ˆ	ß‹3ÑA±yÓA�3�3Š3ÑA±yÓA×AÒAÜ.¨yÓE‰Bä˜Ô6ˆBÜ›ˆØÕ#ˆÛˆDØˆEÛ �Ø˜q–=Ø˜Q•J�EØ˜5–yÚñ	 !ð ×!Ñ!¤# t¡*Ö-ñ ð !× Ò ùòG  IñF 	!ùsb   „B	KÂKÂ"KÂ=KÃKÃ4'KÄ?KÅK
Å,A&KÇAKÈ.KÉ	:KÊKÊ&KË KËKc                ó^   € ^ RI Hp V! W,           4      V! V 4      ,          V! V4      ,          # )a  
Computes the number of monomials.

The number of monomials is given by the following formula:

.. math::

    \frac{(\#V + N)!}{\#V! N!}

where `N` is a total degree and `V` is a set of variables.

Examples
========

>>> from sympy.polys.monomials import itermonomials, monomial_count
>>> from sympy.polys.orderings import monomial_key
>>> from sympy.abc import x, y

>>> monomial_count(2, 2)
6

>>> M = list(itermonomials([x, y], 2))

>>> sorted(M, key=monomial_key('grlex', [y, x]))
[1, x, y, x**2, x*y, y**2]
>>> len(M)
6

)Ú	factorial)Ú(sympy.functions.combinatorial.factorialsr>   )ÚVÚNr>   s   && r   Úmonomial_countrB   Ž   s'   € õ< CÙ�Q•UÓ™i¨›lÕ*©Y°q«\Õ9Ð9ó    c                ój   € \        \        W4       UUu. uF  w  r#W#,           NK  	  upp4      # u uppi )a  
Multiplication of tuples representing monomials.

Examples
========

Lets multiply `x**3*y**4*z` with `x*y**2`::

    >>> from sympy.polys.monomials import monomial_mul

    >>> monomial_mul((3, 4, 1), (1, 2, 0))
    (4, 6, 1)

which gives `x**4*y**5*z`.

©Útupler'   ©ÚAÚBÚaÚbs   &&  r   Úmonomial_mulrL   ¯   s+   € ô" ¤S¨¤YÔ0¡Y™T˜Q�1—5�5¡YÒ0Ó1Ð1ùÓ0ó   ”/
c                ó¦   € \        W4      p\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       d   \        V4      # R# )al  
Division of tuples representing monomials.

Examples
========

Lets divide `x**3*y**4*z` by `x*y**2`::

    >>> from sympy.polys.monomials import monomial_div

    >>> monomial_div((3, 4, 1), (1, 2, 0))
    (2, 2, 1)

which gives `x**2*y**2*z`. However::

    >>> monomial_div((3, 4, 1), (1, 2, 2)) is None
    True

`x*y**2*z**2` does not divide `x**3*y**4*z`.

c              3   ó*   "  € T F	  q^ 8¬  x € K  	  R# 5ir   r   )r   Úcs   & r   r   Úmonomial_div.<locals>.<genexpr>Ú   s   é € Ð
™1�a�Ž6›1ùr   FTN)Úmonomial_ldivr+   rF   )rH   rI   ÚCs   && r   Úmonomial_divrT   Â   s;   € ô, 	�aÓ€Aç
ƒsÑ
™1Ó
‡s‡s‚sÑ
™1Ó
×ÒÜ�Q‹xˆárC   c                ój   € \        \        W4       UUu. uF  w  r#W#,
          NK  	  upp4      # u uppi )aU  
Division of tuples representing monomials.

Examples
========

Lets divide `x**3*y**4*z` by `x*y**2`::

    >>> from sympy.polys.monomials import monomial_ldiv

    >>> monomial_ldiv((3, 4, 1), (1, 2, 0))
    (2, 2, 1)

which gives `x**2*y**2*z`.

    >>> monomial_ldiv((3, 4, 1), (1, 2, 2))
    (2, 2, -1)

which gives `x**2*y**2*z**-1`.

rE   rG   s   &&  r   rR   rR   ß   s+   € ô, ¤S¨¤YÔ0¡Y™T˜Q�1—5�5¡YÒ0Ó1Ð1ùÓ0rM   c                óN   € \        V  Uu. uF  q"V,          NK  	  up4      # u upi )z%Return the n-th pow of the monomial. )rF   )rH   r/   rJ   s   && r   Úmonomial_powrW   ÷   s#   € ä¡Ó#¡˜1�Q—3�3¡Ñ#Ó$Ð$ùÒ#s   Š"c           
     óp   € \        \        W4       UUu. uF  w  r#\        W#4      NK  	  upp4      # u uppi )a
  
Greatest common divisor of tuples representing monomials.

Examples
========

Lets compute GCD of `x*y**4*z` and `x**3*y**2`::

    >>> from sympy.polys.monomials import monomial_gcd

    >>> monomial_gcd((1, 4, 1), (3, 2, 0))
    (1, 2, 0)

which gives `x*y**2`.

)rF   r'   ÚminrG   s   &&  r   Úmonomial_gcdrZ   û   ó+   € ô" ¬¨Q¬Ô4©¡ ”3�q–9©Ò4Ó5Ð5ùÓ4ó   ”2
c           
     óp   € \        \        W4       UUu. uF  w  r#\        W#4      NK  	  upp4      # u uppi )a  
Least common multiple of tuples representing monomials.

Examples
========

Lets compute LCM of `x*y**4*z` and `x**3*y**2`::

    >>> from sympy.polys.monomials import monomial_lcm

    >>> monomial_lcm((1, 4, 1), (3, 2, 0))
    (3, 4, 1)

which gives `x**3*y**4*z`.

)rF   r'   ÚmaxrG   s   &&  r   Úmonomial_lcmr_     r[   r\   c                óŽ   € \         ;QJ d%    R \        W4       4       F  '       d   K   R# 	  R# ! R \        W4       4       4      # )zÒ
Does there exist a monomial X such that XA == B?

Examples
========

>>> from sympy.polys.monomials import monomial_divides
>>> monomial_divides((1, 2), (3, 4))
True
>>> monomial_divides((1, 2), (0, 2))
False
c              3   ó.   "  € T F  w  rW8*  x € K  	  R # 5ir   r   )r   rJ   rK   s   &  r   r   Ú#monomial_divides.<locals>.<genexpr>.  s   é € Ð,¡)™$˜!ˆqŽv£)ùs   ‚FT)r+   r'   )rH   rI   s   &&r   Úmonomial_dividesrc   !  s5   € ÷ ‹3Ñ,¤# a¤)Ó,�3Œ3Ð,Š3Ð,ˆ3Ñ,¤# a¤)Ó,Ó,Ð,rC   c                 ó¬   € \        V ^ ,          4      pV R,           F+  p\        V4       F  w  r4\        W,          V4      W&   K  	  K-  	  \        V4      # )ai  
Returns maximal degree for each variable in a set of monomials.

Examples
========

Consider monomials `x**3*y**4*z**5`, `y**5*z` and `x**6*y**3*z**9`.
We wish to find out what is the maximal degree for each of `x`, `y`
and `z` variables::

    >>> from sympy.polys.monomials import monomial_max

    >>> monomial_max((3,4,5), (0,5,1), (6,3,9))
    (6, 5, 9)

ºé   NN)r*   Ú	enumerater^   rF   ©ÚmonomsÚMrA   r   r/   s   *    r   Úmonomial_maxrk   0  óK   € ô" 	ˆV�A�Y‹€Aà�B�ZˆZˆÜ˜a–L‰DˆAÜ�q•t˜Q“<ˆA‹Dó !ñ ô �‹8€OrC   c                 ó¬   € \        V ^ ,          4      pV R,           F+  p\        V4       F  w  r4\        W,          V4      W&   K  	  K-  	  \        V4      # )ai  
Returns minimal degree for each variable in a set of monomials.

Examples
========

Consider monomials `x**3*y**4*z**5`, `y**5*z` and `x**6*y**3*z**9`.
We wish to find out what is the minimal degree for each of `x`, `y`
and `z` variables::

    >>> from sympy.polys.monomials import monomial_min

    >>> monomial_min((3,4,5), (0,5,1), (6,3,9))
    (0, 3, 1)

re   )r*   rg   rY   rF   rh   s   *    r   Úmonomial_minrn   I  rl   rC   c                ó   € \        V 4      # )z­
Returns the total degree of a monomial.

Examples
========

The total degree of `xy^2` is 3:

>>> from sympy.polys.monomials import monomial_deg
>>> monomial_deg((1, 2))
3
)Úsum)rj   s   &r   Úmonomial_degrq   b  s   € ô ˆq‹6€MrC   c                óÈ   € V w  r4Vw  rV\        W54      pVP                  '       d   Ve   WrP                  WF4      3# R# Ve!   WF,          '       g   WrP                  WF4      3# R# )z,Division of two terms in over a ring/field. N)rT   Úis_FieldÚquo)rJ   rK   ÚdomainÚa_lmÚa_lcÚb_lmÚb_lcÚmonoms   &&&     r   Úterm_divr{   q  s^   € à�J€DØ�J€Dä˜Ó$€Eà‡‡€ØÒØŸ*™* TÓ0Ð0Ð0áà’ §¤ØŸ*™* TÓ0Ð0Ð0árC   c                   óÂ   a a€ ] tR tRt oRt]V 3R l4       tR tR tR t	]R 4       t
]R 4       t]R	 4       t]R
 4       t]R 4       t]R 4       t]R 4       tRtVtV ;t# )ÚMonomialOpsiƒ  z6Code generator of fast monomial arithmetic functions. c                ó2   <€ \         SV `  V 4      pWn        V# r   )ÚsuperÚ__new__Úngens)Úclsr�   ÚobjÚ	__class__s   && €r   r€   ÚMonomialOps.__new__†  s   ø€ ä‰g‰o˜cÓ"ˆØŒ	Øˆ
rC   c                ó   € V P                   3# r   )r�   ©Úselfs   &r   Ú__getnewargs__ÚMonomialOps.__getnewargs__Œ  s   € Ø—
‘
ˆ}ÐrC   c                ó,   € / p\        W4       W2,          # r   )Úexec)rˆ   ÚcodeÚnameÚnss   &&& r   Ú_buildÚMonomialOps._build�  s   € ØˆÜˆTŒØ�xˆrC   c                ó`   € \        V P                  4       Uu. uF
  q!: V: 2NK  	  up# u upi r   )r&   r�   )rˆ   rŽ   r   s   && r   Ú_varsÚMonomialOps._vars”  s*   € Ü-2°4·:±:Ô->Ó@Ñ->¨™4¢Ó#Ñ->Ñ@Ð@ùÒ@s   ˜+c                óT  € R p\        R4      pV P                  R4      pV P                  R4      p\        W44       UUu. uF  w  rVV: RV: 2NK  	  pppVRVRRP                  V4      RRP                  V4      R	RP                  V4      /,          pV P	                  W�4      # u uppi )
rL   ús        def %(name)s(A, B):
            (%(A)s,) = A
            (%(B)s,) = B
            return (%(AB)s,)
        rJ   rK   ú + rŽ   rH   ú, rI   ÚAB©r   r“   r'   Újoinr�   ©	rˆ   rŽ   ÚtemplaterH   rI   rJ   rK   r™   r�   s	   &        r   ÚmulÚMonomialOps.mul—  s�   € àˆÜð ó ˆð �J‰J�s‹OˆØ�J‰J�s‹OˆÜ.1°!¬iÔ9©i¡d a›AšqÓ!©iˆÑ9Ø˜6 4¨¨d¯i©i¸«l¸CÀÇÁÈ1ÃÈtÐUY×U^ÑU^Ð_aÓUbÐcÕcˆØ�{‰{˜4Ó&Ð&ùó :ó   ¾B$c           	     óô   € R p\        R4      pV P                  R4      pV Uu. uF  pRV,          NK  	  ppVRVRRP                  V4      RRP                  V4      /,          pV P                  Wa4      # u upi )rW   zZ        def %(name)s(A, k):
            (%(A)s,) = A
            return (%(Ak)s,)
        rJ   z%s*krŽ   rH   r˜   ÚAk)r   r“   r›   r�   )rˆ   rŽ   r�   rH   rJ   r¢   r�   s   &      r   ÚpowÚMonomialOps.pow¦  sz   € àˆÜð ó ˆð
 �J‰J�s‹OˆÙ#$Ó&¡1˜aˆv˜�zˆz¡1ˆÐ&Ø˜6 4¨¨d¯i©i¸«l¸DÀ$Ç)Á)ÈBÃ-ÐPÕPˆØ�{‰{˜4Ó&Ð&ùò 's   £A5c                óV  € R p\        R4      pV P                  R4      pV P                  R4      p\        W44       UUu. uF  w  rVV: RV: R2NK  	  pppVRVRRP                  V4      R	RP                  V4      R
RP                  V4      /,          pV P	                  W�4      # u uppi )Úmonomial_mulpowzw        def %(name)s(A, B, k):
            (%(A)s,) = A
            (%(B)s,) = B
            return (%(ABk)s,)
        rJ   rK   r—   z*krŽ   rH   r˜   rI   ÚABkrš   )	rˆ   rŽ   r�   rH   rI   rJ   rK   r§   r�   s	   &        r   ÚmulpowÚMonomialOps.mulpow³  s�   € à ˆÜð ó ˆð �J‰J�s‹OˆØ�J‰J�s‹OˆÜ14°Q´Ô<±©¨›q£!Ó$±ˆÑ<Ø˜6 4¨¨d¯i©i¸«l¸CÀÇÁÈ1ÃÈuÐVZ×V_ÑV_Ð`cÓVdÐeÕeˆØ�{‰{˜4Ó&Ð&ùó =s   ¾B%c                óT  € R p\        R4      pV P                  R4      pV P                  R4      p\        W44       UUu. uF  w  rVV: RV: 2NK  	  pppVRVRRP                  V4      RRP                  V4      R	RP                  V4      /,          pV P	                  W�4      # u uppi )
rR   r–   rJ   rK   z - rŽ   rH   r˜   rI   r™   rš   rœ   s	   &        r   ÚldivÚMonomialOps.ldivÂ  s�   € àˆÜð ó ˆð �J‰J�s‹OˆØ�J‰J�s‹OˆÜ.1°!¬iÔ9©i¡d a›AšqÓ!©iˆÑ9Ø˜6 4¨¨d¯i©i¸«l¸CÀÇÁÈ1ÃÈtÐUY×U^ÑU^Ð_aÓUbÐcÕcˆØ�{‰{˜4Ó&Ð&ùó :r    c                ó¦  € R p\        R4      pV P                  R4      pV P                  R4      p\        V P                  4       Uu. uF  pRRV/,          NK  	  ppV P                  R4      pVRVRR	P	                  V4      R
R	P	                  V4      RRP	                  V4      RR	P	                  V4      /,          pV P                  W�4      # u upi )rT   z†        def %(name)s(A, B):
            (%(A)s,) = A
            (%(B)s,) = B
            %(RAB)s
            return (%(R)s,)
        rJ   rK   z7r%(i)s = a%(i)s - b%(i)s
    if r%(i)s < 0: return Noner   ÚrrŽ   rH   r˜   rI   ÚRABz
    ÚR)r   r“   r&   r�   r›   r�   )	rˆ   rŽ   r�   rH   rI   r   r¯   r°   r�   s	   &        r   ÚdivÚMonomialOps.divÑ  sÏ   € àˆÜð ó ˆð �J‰J�s‹OˆØ�J‰J�s‹OˆÜ_dÐei×eoÑeoÔ_pÓrÑ_pÐZ[ÐJÈcÐSTÈX×UÐUÑ_pˆÐrØ�J‰J�s‹OˆØ˜6 4¨¨d¯i©i¸«l¸CÀÇÁÈ1ÃÈuÐV^×VcÑVcÐdgÓVhÐjmÐos×oxÑoxÐyzÓo{Ð|Õ|ˆØ�{‰{˜4Ó&Ð&ùò ss   ÁCc                ód  € R p\        R4      pV P                  R4      pV P                  R4      p\        W44       UUu. uF  w  rVV: RV: RV: RV: 2NK  	  pppVRVRR	P                  V4      R
R	P                  V4      RR	P                  V4      /,          pV P	                  W�4      # u uppi )r_   r–   rJ   rK   ú if z >= ú else rŽ   rH   r˜   rI   r™   rš   rœ   s	   &        r   ÚlcmÚMonomialOps.lcmâ  ó¢   € àˆÜð ó ˆð �J‰J�s‹OˆØ�J‰J�s‹OˆÜCFÀqÄ9ÔNÁ9¹4¸1«1«a³²AÓ6Á9ˆÑNØ˜6 4¨¨d¯i©i¸«l¸CÀÇÁÈ1ÃÈtÐUY×U^ÑU^Ð_aÓUbÐcÕcˆØ�{‰{˜4Ó&Ð&ùó Oó   ¾B,c                ód  € R p\        R4      pV P                  R4      pV P                  R4      p\        W44       UUu. uF  w  rVV: RV: RV: RV: 2NK  	  pppVRVRR	P                  V4      R
R	P                  V4      RR	P                  V4      /,          pV P	                  W�4      # u uppi )rZ   r–   rJ   rK   r´   z <= rµ   rŽ   rH   r˜   rI   r™   rš   rœ   s	   &        r   ÚgcdÚMonomialOps.gcdñ  r¸   r¹   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r€   r‰   r�   r“   rž   r£   r¨   r«   r±   r¶   r»   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r„   Ú__classdict__s   @@r   r}   r}   ƒ  s»   ù‡ € Ù@àôó ðò
òò
Að ñ'ó ð'ð ñ
'ó ð
'ð ñ'ó ð'ð ñ'ó ð'ð ñ'ó ð'ð  ñ'ó ð'ð ñ'ó ÷'ð 'rC   r}   c                   óŽ   a € ] tR tRt o RtRtRR ltRR ltR tR t	R t
R	 tR
 tR tR tR tR tR t]tR tR tR tRtV tR# )ÚMonomiali   z9Class representing a monomial, i.e. a product of powers. Nc                ó€  € \        V4      '       g‰   \        \        V4      VR 7      w  r2\        V4      ^8X  dG   \	        VP                  4       4      ^ ,          ^8X  d"   \	        VP                  4       4      ^ ,          pM\        RP                  V4      4      h\        \        \        V4      4      V n        W n        R# ))ÚgenszExpected a monomial got {}N)r   r   r	   r#   r*   ÚvaluesÚkeysr$   ÚformatrF   ÚmapÚintÚ	exponentsrÉ   )rˆ   rz   rÉ   Úreps   &&& r   Ú__init__ÚMonomial.__init__  s‚   € Ü˜�ŠÜ&¤w¨u£~¸DÔA‰IˆCÜ�3‹x˜1Œ}¤ c§j¡j£lÓ!3°AÕ!6¸!Ô!;Ü˜SŸX™X›ZÓ(¨Õ+‘ä Ð!=×!DÑ!DÀUÓ!KÓLÐLäœs¤3¨›Ó/ˆŒØŽ	rC   c                óL   € T P                  Y;'       g    V P                  4      # r   )r„   rÉ   )rˆ   rÏ   rÉ   s   &&&r   ÚrebuildÚMonomial.rebuild  s   € Ø�~‰~˜i×):Ð):°·±Ó;Ð;rC   c                ó,   € \        V P                  4      # r   )r#   rÏ   r‡   s   &r   Ú__len__ÚMonomial.__len__  s   € Ü�4—>‘>Ó"Ð"rC   c                ó,   € \        V P                  4      # r   )ÚiterrÏ   r‡   s   &r   Ú__iter__ÚMonomial.__iter__  s   € Ü�D—N‘NÓ#Ð#rC   c                ó(   € V P                   V,          # r   )rÏ   )rˆ   r:   s   &&r   Ú__getitem__ÚMonomial.__getitem__  s   € Ø�~‰~˜dÕ#Ð#rC   c                ón   € \        V P                  P                  V P                  V P                  34      # r   )Úhashr„   r½   rÏ   rÉ   r‡   s   &r   Ú__hash__ÚMonomial.__hash__  s&   € Ü�T—^‘^×,Ñ,¨d¯n©n¸d¿i¹iÐHÓIÐIrC   c           	     ó  € V P                   '       dK   R P                  \        V P                   V P                  4       UUu. uF  w  rV: RV: 2NK  	  upp4      # V P                  P
                  : RV P                  : R2# u uppi )Ú*z**Ú(Ú))rÉ   r›   r'   rÏ   r„   r½   )rˆ   ÚgenÚexps   &  r   Ú__str__ÚMonomial.__str__   sc   € Ø�9�9ˆ9Ø—8‘8ÄCÈÏ	É	ÐSW×SaÑSaÔDbÔdÑDb¹¸«#ªsÓ3ÑDbÒdÓeÐeà#Ÿ~™~×6Ô6¸¿¼ÐGÐGùó es   ÁB
c                óÚ   € T;'       g    V P                   pV'       g   \        RV ,          4      h\        \        WP                  4       UUu. uF  w  r#W#,          NK  	  upp!  # u uppi )z3Convert a monomial instance to a SymPy expression. z5Cannot convert %s to an expression without generators)rÉ   r$   r   r'   rÏ   )rˆ   rÉ   rè   ré   s   &*  r   Úas_exprÚMonomial.as_expr&  s]   € à× Ð �t—y‘yˆçÜØGÈ$ÕNóPð Pô ¬s°4¿¹Ô/HÔJÑ/H¡8 3�c—h�hÑ/HÒJÑKÐKùÓJs   ÁA'
c                ó¨   € \        V\        4      '       d   VP                  pM!\        V\        \        34      '       d   TpMR # V P                  V8H  # )F)Ú
isinstancerÇ   rÏ   rF   r   ©rˆ   ÚotherrÏ   s   && r   Ú__eq__ÚMonomial.__eq__0  s@   € Ü�eœX×&Ò&ØŸ™‰IÜ˜¤¤u˜~×.Ò.Ø‰Iáà�~‰~ Ñ*Ð*rC   c                ó   € W8X  * # r   r   )rˆ   rò   s   &&r   Ú__ne__ÚMonomial.__ne__:  s   € ØÒ Ð rC   c                óÜ   € \        V\        4      '       d   VP                  pM%\        V\        \        34      '       d   TpM\
        hV P                  \        V P                  V4      4      # r   )rð   rÇ   rÏ   rF   r   ÚNotImplementedErrorrÔ   rL   rñ   s   && r   Ú__mul__ÚMonomial.__mul__=  sN   € Ü�eœX×&Ò&ØŸ™‰IÜ˜¤¤u˜~×.Ò.Ø‰Iä%Ð%à�|‰|œL¨¯©¸ÓCÓDÐDrC   c                ó  € \        V\        4      '       d   VP                  pM%\        V\        \        34      '       d   TpM\
        h\        V P                  V4      pVe   V P                  V4      # \        V \        V4      4      hr   )	rð   rÇ   rÏ   rF   r   rù   rT   rÔ   r
   )rˆ   rò   rÏ   Úresults   &&  r   Ú__truediv__ÚMonomial.__truediv__G  sj   € Ü�eœX×&Ò&ØŸ™‰IÜ˜¤¤u˜~×.Ò.Ø‰Iä%Ð%ä˜dŸn™n¨iÓ8ˆàÒØ—<‘< Ó'Ð'ä% d¬H°U«OÓ<Ð<rC   c                ó”   € \        V4      pV^ 8  d   \        RV,          4      hV P                  \        V P                  V4      4      # )r   z'a non-negative integer expected, got %s)rÎ   r$   rÔ   rW   rÏ   )rˆ   rò   r/   s   && r   Ú__pow__ÚMonomial.__pow__X  s=   € Ü�‹JˆØˆqŒ5ÜÐFÈÕNÓOÐOØ�|‰|œL¨¯©¸Ó;Ó<Ð<rC   c                óô   € \        V\        4      '       d   VP                  pM1\        V\        \        34      '       d   TpM\        RV,          4      hV P                  \        V P                  V4      4      # )z&Greatest common divisor of monomials. ú.an instance of Monomial class expected, got %s)rð   rÇ   rÏ   rF   r   Ú	TypeErrorrÔ   rZ   rñ   s   && r   r»   ÚMonomial.gcd^  óa   € ä�eœX×&Ò&ØŸ™‰IÜ˜¤¤u˜~×.Ò.Ø‰IäØ@À5ÕHóJð Jð �|‰|œL¨¯©¸ÓCÓDÐDrC   c                óô   € \        V\        4      '       d   VP                  pM1\        V\        \        34      '       d   TpM\        RV,          4      hV P                  \        V P                  V4      4      # )z$Least common multiple of monomials. r  )rð   rÇ   rÏ   rF   r   r  rÔ   r_   rñ   s   && r   r¶   ÚMonomial.lcmj  r  rC   )rÏ   rÉ   r   )r½   r¾   r¿   rÀ   rÁ   Ú	__slots__rÑ   rÔ   r×   rÛ   rÞ   râ   rê   rí   ró   rö   rú   rþ   Ú__floordiv__r  r»   r¶   rÂ   rÃ   )rÅ   s   @r   rÇ   rÇ      sk   ø‡ € áCà%€Iô	ô<ò#ò$ò$òJòHòLò+ò!òEò=ð €Lò=ò
E÷
Eð 
ErC   rÇ   r   )&rÁ   Ú	itertoolsr   r   Útextwrapr   Úsympy.core.cacher   Ú
sympy.corer   r   r   r	   Úsympy.polys.polyerrorsr
   Úsympy.polys.polyutilsr   r   Úsympy.utilitiesr   Úsympy.utilities.iterablesr   r   r<   rB   rL   rT   rR   rW   rZ   r_   rc   rk   rn   rq   r{   r}   rÇ   r   rC   r   Ú<module>r     s¦   ðÙ F÷ =Ý å $ß -Ó -Ý 6ß DÝ "ß ;àó}!ó ð}!ò~:òB2ò&ò:2ò0%ò6ò&6ò&-òò2ò2ò÷${'ñ {'ðz ôsEÐ!ó sEó òsErC   