+
    i                     V    R t ^ RIHt ^ RIHtHtHt ^ RIHt ] ! R R]4      4       t	R# )z'Implementation of :class:`Ring` class. )Domain)ExactQuotientFailedNotInvertibleNotReversible)publicc                   |   a  ] tR t^	t o 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# )RingzRepresents a ring domain. Tc                    V # )z)Returns a ring associated with ``self``.  )selfs   &x/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/domains/ring.pyget_ringRing.get_ring   s        c                F    W,          '       d   \        WV 4      hW,          # )z>Exact quotient of ``a`` and ``b``, implies ``__floordiv__``.  )r   r   abs   &&&r   exquo
Ring.exquo   s    55%aD116Mr   c                    W,          # )z7Quotient of ``a`` and ``b``, implies ``__floordiv__``. r
   r   s   &&&r   quoRing.quo   s	    vr   c                    W,          # )z4Remainder of ``a`` and ``b``, implies ``__mod__``.  r
   r   s   &&&r   remRing.rem   s	    ur   c                    \        W4      # )z5Division of ``a`` and ``b``, implies ``__divmod__``. )divmodr   s   &&&r   divRing.div"   s    a|r   c                ~    V P                  W4      w  r4pV P                  V4      '       d	   W2,          # \        R4      h)z"Returns inversion of ``a mod b``. zzero divisor)gcdexis_oner   )r   r   r   sths   &&&   r   invertRing.invert&   s3    **Q"a;;q>>5L//r   c                z    V P                  V4      '       g   V P                  V) 4      '       d   V# \        R4      h)z!Returns ``a**(-1)`` if possible. z#only units are reversible in a ring)r"   r   r   r   s   &&r   revertRing.revert/   s.    ;;q>>T[[!__H EFFr   c                N     V P                  V4       R #   \         d     R# i ; i)TF)r*   r   r)   s   &&r   is_unitRing.is_unit6   s'    	KKN 		s    $$c                    V# )zReturns numerator of ``a``. r
   r)   s   &&r   numer
Ring.numer=   s    r   c                    V P                   # )zReturns denominator of `a`. )oner)   s   &&r   denom
Ring.denomA   s    xxr   c                    \         h)z
Generate a free module of rank ``rank`` over self.

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(2)
QQ[x]**2
)NotImplementedError)r   ranks   &&r   free_moduleRing.free_moduleE   s
     "!r   c           	         ^ RI Hp T! Y P                  ^4      P                  ! V Uu. uF  q3.NK  	  up!  4      # u upi )z
Generate an ideal of ``self``.

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).ideal(x**2)
<x**2>
)ModuleImplementedIdeal)sympy.polys.agca.idealsr<   r9   	submodule)r   gensr<   xs   &*  r   ideal
Ring.idealP   sB     	C%d,<,<Q,?,I,I 4ac4 -" # 	# s   <c                l    ^ RI Hp ^ RIHp \	        W4      '       g   V P
                  ! V!  pV! W4      # )av  
Form a quotient ring of ``self``.

Here ``e`` can be an ideal or an iterable.

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).quotient_ring(QQ.old_poly_ring(x).ideal(x**2))
QQ[x]/<x**2>
>>> QQ.old_poly_ring(x).quotient_ring([x**2])
QQ[x]/<x**2>

The division operator has been overloaded for this:

>>> QQ.old_poly_ring(x)/[x**2]
QQ[x]/<x**2>
)Ideal)QuotientRing)r=   rD    sympy.polys.domains.quotientringrE   
isinstancerA   )r   erD   rE   s   &&  r   quotient_ringRing.quotient_ring]   s-    $ 	2A!##

AAD$$r   c                $    V P                  V4      # )N)rI   )r   rH   s   &&r   __truediv__Ring.__truediv__u   s    !!!$$r   r
   N)__name__
__module____qualname____firstlineno____doc__is_Ringr   r   r   r   r   r&   r*   r-   r0   r4   r9   rA   rI   rL   __static_attributes____classdictcell__)__classdict__s   @r   r   r   	   sY     $G0G	"#%0% %r   r   N)
rR   sympy.polys.domains.domainr   sympy.polys.polyerrorsr   r   r   sympy.utilitiesr   r   r
   r   r   <module>rZ      s2    - . T T "l%6 l% l%r   