
    \h                     P    S r SSKJr  SSKJrJr  SSKJr  \ " S S\5      5       rg)z(Implementation of :class:`Field` class.     )Ring)NotReversibleDomainError)publicc                   b    \ rS rSrSrSrSrS rS rS r	S r
S rS	 rS
 rS rS rS rS rSrg)Field   zRepresents a field domain. Tc                     [        SU -  5      e)z)Returns a ring associated with ``self``. z#there is no ring associated with %s)r   selfs    Q/var/www/auris/envauris/lib/python3.13/site-packages/sympy/polys/domains/field.pyget_ringField.get_ring   s    ?$FGG    c                     U $ )z*Returns a field associated with ``self``.  r   s    r   	get_fieldField.get_field   s    r   c                 
    X-  $ )z=Exact quotient of ``a`` and ``b``, implies ``__truediv__``.  r   r   abs      r   exquoField.exquo   	    ur   c                 
    X-  $ )z6Quotient of ``a`` and ``b``, implies ``__truediv__``. r   r   s      r   quo	Field.quo   r   r   c                     U R                   $ )z0Remainder of ``a`` and ``b``, implies nothing.  zeror   s      r   rem	Field.rem   s    yyr   c                 "    X-  U R                   4$ )z6Division of ``a`` and ``b``, implies ``__truediv__``. r    r   s      r   div	Field.div#   s    udiir   c                 D    U R                  5       nUR                  U R	                  U5      U R	                  U5      5      nUR                  U R                  U5      U R                  U5      5      nU R                  XC5      U-  $ ! [         a    U R                  s $ f = f)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                     U R                  X5      nXR                  :X  aC  X R                  :X  a#  U R                  U R                  U R                  4$ U R                  X2-  U4$ X1-  U R                  U4$ )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                 4    U R                  5       nUR                  U R                  U5      U R                  U5      5      nUR	                  U R                  U5      U R                  U5      5      nU R                  XC5      U-  $ ! [         a    X-  s $ f = f)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                 0    U(       a  SU-  $ [        S5      e)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                     [        U5      $ )z$Return true if ``a`` is a invertible)boolr;   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)   r5   r+   r<   r@   __static_attributes__r   r   r   r   r      sH    %HFH '@%'0:r   r   N)	rF   sympy.polys.domains.ringr   sympy.polys.polyerrorsr   r   sympy.utilitiesr   r   r   r   r   <module>rM      s/    . * = "mD m mr   