+
    i                     r    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 R]4      tR	# )
z.Implementation of :class:`QuotientRing` class.FreeModuleQuotientRing)Ring)NotReversibleCoercionFailed)publicc                   ~   a  ] tR t^t o RtR tR t]tR tR t	]	t
R tR tR tR	 t]tR
 tR tR tR tR tRtV tR# )QuotientRingElementz
Class representing elements of (commutative) quotient rings.

Attributes:

- ring - containing ring
- data - element of ring.ring (i.e. base ring) representing self
c                    Wn         W n        R # N)ringdata)selfr   r   s   &&&ڀ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/domains/quotientring.py__init__QuotientRingElement.__init__   s    		    c                    ^ RI Hp V P                  P                  P                  V P                  4      pV! V4      R,           \        V P                  P                  4      ,           # )    )sstrz + )sympy.printing.strr   r   to_sympyr   str
base_ideal)r   r   r   s   &  r   __str__QuotientRingElement.__str__   sD    +yy~~&&tyy1DzE!C		(<(<$===r   c                B    V P                   P                  V 4      '       * # r   )r   is_zeror   s   &r   __bool__QuotientRingElement.__bool__$   s    99$$T***r   c                8   \        WP                  4      '       d   VP                  V P                  8w  d    V P                  P                  V4      pV P                  V P                  VP                  ,           4      #   \        \
        3 d
    \        u # i ; ir   
isinstance	__class__r   convertNotImplementedErrorr   NotImplementedr   r   oms   &&r   __add__QuotientRingElement.__add__'   ss    "nn--DII1E&YY&&r* yyRWW,-- (8 &%%&s   A? ?BBc                    V P                  V P                  V P                   P                   P                  R4      ,          4      # )   )r   r   r%   r   s   &r   __neg__QuotientRingElement.__neg__1   s-    yy499>>#9#9"#==>>r   c                &    V P                  V) 4      # r   r*   r(   s   &&r   __sub__QuotientRingElement.__sub__4   s    ||RC  r   c                &    V ) P                  V4      # r   r2   r(   s   &&r   __rsub__QuotientRingElement.__rsub__7   s    r""r   c                   \        WP                  4      '       g    V P                  P                  V4      pV P                  V P                  VP                  ,          4      #   \        \
        3 d
    \        u # i ; ir   r"   r   os   &&r   __mul__QuotientRingElement.__mul__:   sd    !^^,,&II%%a( yy166)** (8 &%%&s   A$ $A>=A>c                F    V P                   P                  V 4      V,          # r   )r   revertr9   s   &&r   __rtruediv__ QuotientRingElement.__rtruediv__D   s    yy%a''r   c                    \        WP                  4      '       g    V P                  P                  V4      pV P                  P                  V4      V ,          #   \        \
        3 d
    \        u # i ; ir   )r#   r$   r   r%   r&   r   r'   r>   r9   s   &&r   __truediv__QuotientRingElement.__truediv__G   sb    !^^,,&II%%a( yy"4'' (8 &%%&s   A A43A4c                    V^ 8  d$   V P                   P                  V 4      V) ,          # V P                  V P                  V,          4      # )r   )r   r>   r   )r   oths   &&r   __pow__QuotientRingElement.__pow__O   s=    799##D)cT11yyc)**r   c                    \        WP                  4      '       d   VP                  V P                  8w  d   R # V P                  P                  W,
          4      # )F)r#   r$   r   r   r(   s   &&r   __eq__QuotientRingElement.__eq__T   s:    "nn--DII1Eyy  ++r   c                    W8X  * # r    r(   s   &&r   __ne__QuotientRingElement.__ne__Y   s
    ~r   )r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   __repr__r   r*   __radd__r/   r3   r6   r;   __rmul__r?   rB   rF   rI   rM   __static_attributes____classdictcell____classdict__s   @r   r	   r	      se     >
 H+. H?!#+ H((+
,
 r   r	   c                      a  ] tR t^]t o RtRtRt]tR t	R t
R tR tR tR	 t]t]t]t]t]t]t]tR
 tR tR tR tR tR tR tR tRtV tR# )QuotientRinga  
Class representing (commutative) quotient rings.

You should not usually instantiate this by hand, instead use the constructor
from the base ring in the construction.

>>> from sympy.abc import x
>>> from sympy import QQ
>>> I = QQ.old_poly_ring(x).ideal(x**3 + 1)
>>> QQ.old_poly_ring(x).quotient_ring(I)
QQ[x]/<x**3 + 1>

Shorter versions are possible:

>>> QQ.old_poly_ring(x)/I
QQ[x]/<x**3 + 1>

>>> QQ.old_poly_ring(x)/[x**3 + 1]
QQ[x]/<x**3 + 1>

Attributes:

- ring - the base ring
- base_ideal - the ideal used to form the quotient
TFc                    VP                   V8X  g   \        R V: RV: 24      hWn         W n        V ! V P                   P                  4      V n        V ! V P                   P                  4      V n        R# )zIdeal must belong to z, got N)r   
ValueErrorr   zeroone)r   r   ideals   &&&r   r   QuotientRing.__init__|   sP    zzT!$NOO	(			&r   c                n    \        V P                  4      R ,           \        V P                  4      ,           # )/)r   r   r   r   s   &r   r   QuotientRing.__str__   s#    499~#c$//&:::r   c                    \        V P                  P                  V P                  V P                  V P
                  34      # r   )hashr$   rO   dtyper   r   r   s   &r   __hash__QuotientRing.__hash__   s,    T^^,,djj$))T__UVVr   c                    \        WP                  P                  4      '       g   V P                  V4      pV P                  W P                  P	                  V4      4      # )z4Construct an element of ``self`` domain from ``a``. )r#   r   rh   r   reduce_elementr   as   &&r   newQuotientRing.new   s@    !YY__--		!Azz$ > >q ABBr   c                    \        V\        4      ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # )z0Returns ``True`` if two domains are equivalent. )r#   r\   r   r   )r   others   &&r   rI   QuotientRing.__eq__   sL    %. L LII#L L(,5;K;K(K	Lr   c                D    V ! V P                   P                  W4      4      # )z.Convert a Python ``int`` object to ``dtype``. )r   r%   )K1rn   K0s   &&&r   from_ZZQuotientRing.from_ZZ   s    "''//!())r   c                D    V ! V P                   P                  V4      4      # r   )r   
from_sympyrm   s   &&r   rz   QuotientRing.from_sympy   s    DII((+,,r   c                L    V P                   P                  VP                  4      # r   )r   r   r   rm   s   &&r   r   QuotientRing.to_sympy   s    yy!!!&&))r   c                    W 8X  d   V# R # r   rL   )r   rn   rv   s   &&&r   from_QuotientRingQuotientRing.from_QuotientRing   s    :H r   c                    \        R4      h)z*Returns a polynomial ring, i.e. ``K[X]``. nested domains not allowedr&   r   genss   &*r   	poly_ringQuotientRing.poly_ring       !">??r   c                    \        R4      h)z)Returns a fraction field, i.e. ``K(X)``. r   r   r   s   &*r   
frac_fieldQuotientRing.frac_field   r   r   c                    V P                   P                  VP                  4      V P                  ,           p V ! VP	                  ^4      ^ ,          4      #   \
         d    \        T: RT : 24      hi ; i)z
Compute a**(-1), if possible.
z not a unit in )r   ra   r   r   in_terms_of_generatorsr^   r   )r   rn   Is   && r   r>   QuotientRing.revert   se     IIOOAFF#doo5	C003A677 	CD ABB	Cs   A A4c                L    V P                   P                  VP                  4      # r   )r   containsr   rm   s   &&r   r   QuotientRing.is_zero   s    ''//r   c                    \        W4      # )z
Generate a free module of rank ``rank`` over ``self``.

>>> from sympy.abc import x
>>> from sympy import QQ
>>> (QQ.old_poly_ring(x)/[x**2 + 1]).free_module(2)
(QQ[x]/<x**2 + 1>)**2
r   )r   ranks   &&r   free_moduleQuotientRing.free_module   s     &d11r   )r   r`   r   r_   N) rO   rP   rQ   rR   rS   has_assoc_Ringhas_assoc_Fieldr	   rh   r   r   ri   ro   rI   rw   from_ZZ_pythonfrom_QQ_pythonfrom_ZZ_gmpyfrom_QQ_gmpyfrom_RealFieldfrom_GlobalPolynomialRingfrom_FractionFieldrz   r   r   r   r   r>   r   r   rW   rX   rY   s   @r   r\   r\   ]   s     4 NOE';WCL
* N#N!L!L#N .'-*@@C0	2 	2r   r\   N)rS   sympy.polys.agca.modulesr   sympy.polys.domains.ringr   sympy.polys.polyerrorsr   r   sympy.utilitiesr   r	   r\   rL   r   r   <module>r      sA    4 < ) @ " K K K\m24 m2r   