+
    ‹°³jl  ã                   ó2   € ^ RI Ht ^ RIHt RR ltRR ltR# )é    )ÚS)ÚPolyNc                ó€  € Ve   RMRpV'       d   T p\        V .VO5/ VB p \        V.VO5/ VB pV P                  '       d   VP                  '       g   \        R4      hV P                  VP                  8X  g   \        R4      hV P                  pV P	                  4       ^8  g   VP	                  4       ^8  d   ^ 0# V P                  4       pV'       g   VP                  4       MTp\        4       pV^,           EF=  w  ršV^,           EF)  w  rºV	P	                  4       pVP	                  4       pWÜ8w  d   K.  V	P                  4       pVP                  4       pWï,
          P                  '       g   Kh  V	P                  W\^,
          ,          4      pVP                  W]^,
          ,          4      pVV,
          \        Wß,          4      ,          pVP                  '       g   K×  V^ 8  g   VV9   d   Kç  V^8”  d+   W›P                  V4      ,
          P                  '       g   EK  VP                  V4       EK,  	  EK@  	  V# )ai  Compute the *dispersion set* of two polynomials.

For two polynomials `f(x)` and `g(x)` with `\deg f > 0`
and `\deg g > 0` the dispersion set `\operatorname{J}(f, g)` is defined as:

.. math::
    \operatorname{J}(f, g)
    & := \{a \in \mathbb{N}_0 | \gcd(f(x), g(x+a)) \neq 1\} \\
    &  = \{a \in \mathbb{N}_0 | \deg \gcd(f(x), g(x+a)) \geq 1\}

For a single polynomial one defines `\operatorname{J}(f) := \operatorname{J}(f, f)`.

Examples
========

>>> from sympy import poly
>>> from sympy.polys.dispersion import dispersion, dispersionset
>>> from sympy.abc import x

Dispersion set and dispersion of a simple polynomial:

>>> fp = poly((x - 3)*(x + 3), x)
>>> sorted(dispersionset(fp))
[0, 6]
>>> dispersion(fp)
6

Note that the definition of the dispersion is not symmetric:

>>> fp = poly(x**4 - 3*x**2 + 1, x)
>>> gp = fp.shift(-3)
>>> sorted(dispersionset(fp, gp))
[2, 3, 4]
>>> dispersion(fp, gp)
4
>>> sorted(dispersionset(gp, fp))
[]
>>> dispersion(gp, fp)
-oo

Computing the dispersion also works over field extensions:

>>> from sympy import sqrt
>>> fp = poly(x**2 + sqrt(5)*x - 1, x, domain='QQ<sqrt(5)>')
>>> gp = poly(x**2 + (2 + sqrt(5))*x + sqrt(5), x, domain='QQ<sqrt(5)>')
>>> sorted(dispersionset(fp, gp))
[2]
>>> sorted(dispersionset(gp, fp))
[1, 4]

We can even perform the computations for polynomials
having symbolic coefficients:

>>> from sympy.abc import a
>>> fp = poly(4*x**4 + (4*a + 8)*x**3 + (a**2 + 6*a + 4)*x**2 + (a**2 + 2*a)*x, x)
>>> sorted(dispersionset(fp))
[0, 1]

See Also
========

dispersion

References
==========

.. [1] [ManWright94]_
.. [2] [Koepf98]_
.. [3] [Abramov71]_
.. [4] [Man93]_
FTz!Polynomials need to be univariatez(Polynomials must have the same generator)r   Úis_univariateÚ
ValueErrorÚgenÚdegreeÚfactor_listÚsetÚLCÚis_zeroÚcoeff_monomialr   Ú
is_integerÚshiftÚadd)ÚpÚqÚgensÚargsÚsamer   ÚfpÚfqÚJÚsÚunusedÚtÚmÚnÚanÚbnÚanm1Úbnm1Úalphas   &&*,               ÚW/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/polys/dispersion.pyÚdispersionsetr%      sÆ  € ðR ’M‰5 t€DßØˆäˆQÐ�Ò˜Ñ€AÜˆQÐ�Ò˜Ñ€Aà�?�?ˆ? !§/§/ /ÜÐ<Ó=Ð=ð �5‰5�A—E‘EŒ>ÜÐCÓDÐDØ
�%‰%€Cð 	‡x�xƒz�A„~˜Ÿ™› aœØˆsˆ
ð 
�‰‹€Bß $ˆ�‰Œ¨"€Bô 	‹€AØ˜—U‘U‰	ˆØ˜AŸ™‰IˆAØ—‘“
ˆAØ—‘“
ˆAØŒvÙØ—‘“ˆBØ—‘“ˆBØ•G×$×$Ð$Ùð ×#Ñ# C¨A­#¥JÓ/ˆDØ×#Ñ# C¨A­#¥JÓ/ˆDØ˜D•[¤A a¥d£GÕ+ˆEØ×#×#Ð#ÙØ�qŒy˜E QœJÙØ�1Œu˜a§'¡'¨%£.Õ0×9×9Ð9ÚØ�E‰E�%�Lô+ ñ ð0 €Hó    c                ón   € \        W.VO5/ VB pV'       g   \        P                  pV# \        V4      pV# )aà  Compute the *dispersion* of polynomials.

For two polynomials `f(x)` and `g(x)` with `\deg f > 0`
and `\deg g > 0` the dispersion `\operatorname{dis}(f, g)` is defined as:

.. math::
    \operatorname{dis}(f, g)
    & := \max\{ J(f,g) \cup \{0\} \} \\
    &  = \max\{ \{a \in \mathbb{N} | \gcd(f(x), g(x+a)) \neq 1\} \cup \{0\} \}

and for a single polynomial `\operatorname{dis}(f) := \operatorname{dis}(f, f)`.
Note that we make the definition `\max\{\} := -\infty`.

Examples
========

>>> from sympy import poly
>>> from sympy.polys.dispersion import dispersion, dispersionset
>>> from sympy.abc import x

Dispersion set and dispersion of a simple polynomial:

>>> fp = poly((x - 3)*(x + 3), x)
>>> sorted(dispersionset(fp))
[0, 6]
>>> dispersion(fp)
6

Note that the definition of the dispersion is not symmetric:

>>> fp = poly(x**4 - 3*x**2 + 1, x)
>>> gp = fp.shift(-3)
>>> sorted(dispersionset(fp, gp))
[2, 3, 4]
>>> dispersion(fp, gp)
4
>>> sorted(dispersionset(gp, fp))
[]
>>> dispersion(gp, fp)
-oo

The maximum of an empty set is defined to be `-\infty`
as seen in this example.

Computing the dispersion also works over field extensions:

>>> from sympy import sqrt
>>> fp = poly(x**2 + sqrt(5)*x - 1, x, domain='QQ<sqrt(5)>')
>>> gp = poly(x**2 + (2 + sqrt(5))*x + sqrt(5), x, domain='QQ<sqrt(5)>')
>>> sorted(dispersionset(fp, gp))
[2]
>>> sorted(dispersionset(gp, fp))
[1, 4]

We can even perform the computations for polynomials
having symbolic coefficients:

>>> from sympy.abc import a
>>> fp = poly(4*x**4 + (4*a + 8)*x**3 + (a**2 + 6*a + 4)*x**2 + (a**2 + 2*a)*x, x)
>>> sorted(dispersionset(fp))
[0, 1]

See Also
========

dispersionset

References
==========

.. [1] [ManWright94]_
.. [2] [Koepf98]_
.. [3] [Abramov71]_
.. [4] [Man93]_
)r%   r   ÚNegativeInfinityÚmax)r   r   r   r   r   Újs   &&*,  r$   Ú
dispersionr+   ‚   s>   € ôX 	�aÐ*˜TÒ* TÑ*€Aßä×Ñˆð €Hô �‹FˆØ€Hr&   )N)Ú
sympy.corer   Úsympy.polysr   r%   r+   © r&   r$   Ú<module>r/      s   ðÝ Ý ôzözRr&   