ó
    Š*£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    ÚV/home/mande/repo/quber/.venv/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   € à�y‰yÐr   c                 ó"   • X-  U R                   4$ )z6Division of ``a`` and ``b``, implies ``__truediv__``. r    r   s      r   ÚdivÚ	Field.div#   s   € à‰u�d—i‘iÐÐ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ð �H‰H�T—Z‘Z “] D§J¡J¨q£MÓ2ˆØ�H‰H�T—Z‘Z “] D§J¡J¨q£MÓ2ˆà�|‰|˜AÓ$ QÑ&Ð&øô ó 	Ø—8‘8ŠOð	ú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   € ð �H‰H�Q‹Nˆà—	‘	‹>Ø—I‘I‹~Ø—y‘y $§(¡(¨D¯I©IÐ5Ð5à—y‘y !¡# 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ð �H‰H�T—Z‘Z “] D§J¡J¨q£MÓ2ˆØ�H‰H�T—Z‘Z “] D§J¡J¨q£MÓ2ˆà�|‰|˜AÓ$ QÑ&Ð&øô ó 	Ø‘3ŠJð	ú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   € æØ�Q‘3ˆJäÐ 8Ó9Ð9r   c                 ó   • [        U5      $ )z$Return true if ``a`` is a invertible)Úboolr;   s     r   Úis_unitÚField.is_unitt   s   € ä�A‹wˆ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   