+
    i                     R    R t ^ RIHt ^ RIHtHt ^ RIHt ] ! R R]4      4       tR# )z(Implementation of :class:`Field` class. )Ring)NotReversibleDomainError)publicc                   n   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V tR# )FieldzRepresents a field domain. Tc                &    \        RV ,          4      h)z)Returns a ring associated with ``self``. z#there is no ring associated with %s)r   selfs   &y/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/domains/field.pyget_ringField.get_ring   s    ?$FGG    c                    V # )z*Returns a field associated with ``self``.  r	   s   &r   	get_fieldField.get_field   s    r   c                    W,          # )z=Exact quotient of ``a`` and ``b``, implies ``__truediv__``.  r   r
   abs   &&&r   exquoField.exquo   	    ur   c                    W,          # )z6Quotient of ``a`` and ``b``, implies ``__truediv__``. r   r   s   &&&r   quo	Field.quo   r   r   c                    V P                   # )z0Remainder of ``a`` and ``b``, implies nothing.  zeror   s   &&&r   rem	Field.rem   s    yyr   c                *    W,          V P                   3# )z6Division of ``a`` and ``b``, implies ``__truediv__``. r   r   s   &&&r   div	Field.div#   s    udiir   c                N    V P                  4       pTP                  T P	                  T4      T P	                  T4      4      pTP                  T P                  T4      T P                  T4      4      pT P                  YC4      T,          #   \         d    T P                  u # i ; i)aa  
Returns GCD of ``a`` and ``b``.

This definition of GCD over fields allows to clear denominators
in `primitive()`.

Examples
========

>>> from sympy.polys.domains import QQ
>>> from sympy import S, gcd, primitive
>>> from sympy.abc import x

>>> QQ.gcd(QQ(2, 3), QQ(4, 9))
2/9
>>> gcd(S(2)/3, S(4)/9)
2/9
>>> primitive(2*x/3 + S(4)/9)
(2/9, 3*x + 2)

)r   r   onegcdnumerlcmdenomconvertr
   r   r   ringpqs   &&&   r   r'   	Field.gcd'   s    ,	==?D HHTZZ]DJJqM2HHTZZ]DJJqM2||A$Q&&  	88O	s   B
 
B$#B$c                    V P                  W4      pWP                  8X  dI   W P                  8X  d$   V P                  V P                  V P                  3# V P                  W2,          V3# W1,          V P                  V3# )z;
Returns x, y, g such that a * x + b * y == g == gcd(a, b)
)r'   r   r&   )r
   r   r   ds   &&& r   gcdexField.gcdexG   sb     HHQN		>II~yy$((DII55yy!#q((3		1$$r   c                F    V P                  4       pTP                  T P                  T4      T P                  T4      4      pTP	                  T P                  T4      T P                  T4      4      pT P                  YC4      T,          #   \         d    Y,          u # i ; i)z
Returns LCM of ``a`` and ``b``.

>>> from sympy.polys.domains import QQ
>>> from sympy import S, lcm

>>> QQ.lcm(QQ(2, 3), QQ(4, 9))
4/3
>>> lcm(S(2)/3, S(4)/9)
4/3

)r   r   r)   r(   r'   r*   r+   r,   s   &&&   r   r)   	Field.lcmU   s    	==?D HHTZZ]DJJqM2HHTZZ]DJJqM2||A$Q&&  	3J	s   B
 
B B c                :    V'       d
   ^V,          # \        R4      h)z!Returns ``a**(-1)`` if possible. zzero is not reversible)r   r
   r   s   &&r   revertField.revertm   s    Q3J 899r   c                    \        V4      # )z$Return true if ``a`` is a invertible)boolr8   s   &&r   is_unitField.is_unitt   s    Awr   r   N)__name__
__module____qualname____firstlineno____doc__is_Fieldis_PIDr   r   r   r   r    r#   r'   r3   r)   r9   r=   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sP     %HFH '@%'0: r   r   N)	rC   sympy.polys.domains.ringr   sympy.polys.polyerrorsr   r   sympy.utilitiesr   r   r   r   r   <module>rL      s/    . * = "mD m mr   