ó
    Š*£h¤M  ã                   ól  • S r SSKJrJrJrJrJrJrJrJ	r	J
r
Jr  SSKJrJrJrJrJrJrJrJrJrJrJrJr  SSKJrJrJrJrJrJrJ r J!r!J"r"  SSK#J$r$J%r%J&r&J'r'J(r(J)r)  SSK*J+r+J,r,  SSK-J.r.J/r/  S r0S	 r1S
 r2S r3S r4S r5S r6S r7S r8S r9S r:S r;SS jr<SS jr=SS jr>SS jr?SS jr@SS jrAS rBS rCg)z8Square-free decomposition algorithms and related tools. é    )
Údup_negÚdmp_negÚdup_subÚdmp_subÚdup_mulÚdmp_mulÚdup_quoÚdmp_quoÚdup_mul_groundÚdmp_mul_ground)Ú	dup_stripÚdup_LCÚdmp_ground_LCÚ
dmp_zero_pÚ
dmp_groundÚ
dup_degreeÚ
dmp_degreeÚdmp_degree_inÚdmp_degree_listÚ	dmp_raiseÚ
dmp_injectÚdup_convert)	Údup_diffÚdmp_diffÚdmp_diff_inÚ	dup_shiftÚ	dmp_shiftÚ	dup_monicÚdmp_ground_monicÚdup_primitiveÚdmp_ground_primitive)Údup_inner_gcdÚdmp_inner_gcdÚdup_gcdÚdmp_gcdÚdmp_resultantÚdmp_primitive)Úgf_sqf_listÚgf_sqf_part)ÚMultivariatePolynomialErrorÚDomainErrorc                 óJ   • [        S U 5       5      nU[        U 5      :X  d   eg)z=Sanity check the degrees of a computed factorization in K[x].c              3   óB   #   • U  H  u  pU[        U5      -  v •  M     g 7f)N)r   )Ú.0ÚfacÚks      ÚT/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sympy/polys/sqfreetools.pyÚ	<genexpr>Ú%_dup_check_degrees.<locals>.<genexpr>$   s   é € Ð9²&¡h sˆa”*˜S“/Ö!²&ùs   ‚N)Úsumr   )ÚfÚresultÚdegs      r1   Ú_dup_check_degreesr8   "   s$   € ä
Ñ9±&Ó9Ó
9€CØ”*˜Q“-ÓÐÑó    c                 óÊ   • S/US-   -  nU H4  u  pE[        XA5      n[        X65       VVs/ s H  u  pxXuU-  -   PM     nnnM6     [        U5      [        X5      :X  d   egs  snnf )z=Sanity check the degrees of a computed factorization in K[X].r   é   N)r   ÚzipÚtuple)	r5   Úur6   Údegsr/   r0   Údegs_facÚd1Úd2s	            r1   Ú_dmp_check_degreesrC   (   sj   € àˆ3�!�a‘%‰=€DÛ‰ˆÜ" 3Ó*ˆÜ*-¨dÔ*=Ô>Ò*=¡ �˜‘V”Ñ*=ˆÑ>‰ñ ô �‹;œ/¨!Ó/Ó/Ð/Ñ/ùó ?s   ªAc           
      ó^   • U (       d  g[        [        U [        U SU5      U5      5      (       + $ )zÜ
Return ``True`` if ``f`` is a square-free polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_sqf_p(x**2 - 2*x + 1)
False
>>> R.dup_sqf_p(x**2 - 1)
True

Tr;   )r   r$   r   )r5   ÚKs     r1   Ú	dup_sqf_prF   1   s*   € ö  Øäœg a¬°!°Q¸Ó):¸AÓ>Ó?Ô?Ð?r9   c                 óÌ   • [        X5      (       a  g[        US-   5       HA  n[        U SX1U5      n[        XA5      (       a  M#  [        XX5      n[	        XSU5      S:w  d  MA    g   g)zè
Return ``True`` if ``f`` is a square-free polynomial in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_sqf_p(x**2 + 2*x*y + y**2)
False
>>> R.dmp_sqf_p(x**2 + y**2)
True

Tr;   r   F)r   Úranger   r%   r   )r5   r>   rE   ÚiÚfpÚgcds         r1   Ú	dmp_sqf_prL   G   se   € ô  �!×ÑØä�1�Q‘3ŽZˆä˜˜A˜q QÓ'ˆä�b×ÑÙä�a˜QÓ"ˆä˜ Ó# qÕ(Ùñ ð r9   c                 ó`  • UR                   (       d  [        S5      eS[        UR                  R	                  5       SSUR
                  5      p2 [        U SUSS9u  pE[        X4SUR
                  5      n[        XaR
                  5      (       a  O[        XR                  * U5      US-   p M]  X U4$ )a«  
Find a shift of `f` in `K[x]` that has square-free norm.

The domain `K` must be an algebraic number field `k(a)` (see :ref:`QQ(a)`).

Returns `(s,g,r)`, such that `g(x)=f(x-sa)`, `r(x)=\text{Norm}(g(x))` and
`r` is a square-free polynomial over `k`.

Examples
========

We first create the algebraic number field `K=k(a)=\mathbb{Q}(\sqrt{3})`
and rings `K[x]` and `k[x]`:

>>> from sympy.polys import ring, QQ
>>> from sympy import sqrt

>>> K = QQ.algebraic_field(sqrt(3))
>>> R, x = ring("x", K)
>>> _, X = ring("x", QQ)

We can now find a square free norm for a shift of `f`:

>>> f = x**2 - 1
>>> s, g, r = R.dup_sqf_norm(f)

The choice of shift `s` is arbitrary and the particular values returned for
`g` and `r` are determined by `s`.

>>> s == 1
True
>>> g == x**2 - 2*sqrt(3)*x + 2
True
>>> r == X**4 - 8*X**2 + 4
True

The invariants are:

>>> g == f.shift(-s*K.unit)
True
>>> g.norm() == r
True
>>> r.is_squarefree
True

Explanation
===========

This is part of Trager's algorithm for factorizing polynomials over
algebraic number fields. In particular this function is algorithm
``sqfr_norm`` from [Trager76]_.

See Also
========

dmp_sqf_norm:
    Analogous function for multivariate polynomials over ``k(a)``.
dmp_norm:
    Computes the norm of `f` directly without any shift.
dup_ext_factor:
    Function implementing Trager's algorithm that uses this.
sympy.polys.polytools.sqf_norm:
    High-level interface for using this function.
úground domain must be algebraicr   r;   T©Úfront)Úis_Algebraicr+   r   ÚmodÚto_listÚdomr   r&   rF   r   Úunit)r5   rE   ÚsÚgÚhÚ_Úrs          r1   Údup_sqf_normr[   i   s™   € ðB �>�>ÜÐ;Ó<Ð<àŒi˜Ÿ™Ÿ™›¨¨A¨q¯u©uÓ5€qà
Ü˜!˜Q ¨Ñ.‰ˆÜ˜!  1§5¡5Ó)ˆä�QŸ™×ÑØä˜Q§¡ ¨Ó+¨Q°©Uˆqñ ð �ˆ7€Nr9   c           	   #   óÈ  #   • US-   nS/U-  nX@4v •  UR                   n[        X5      n[        [        U[	        US-   5      5      5       VVs/ s H  u  pxUS:”  d  M  UPM     n	nnU	 H=  nUR                  5       n
SX¨'   U
 Vs/ s H  oµ* U-  PM
     nn[        XX5      nX­4v •  M?     Sn US-  nU/U-  nU* U-  /U-  n[        U UX5      nUU4v •  M*  s  snnf s  snf 7f)z9Generate a sequence of candidate shifts for dmp_sqf_norm.r;   r   )rU   r   Úsortedr<   rH   Úcopyr   )r5   r>   rE   ÚnÚs0ÚaÚdÚdirI   Úvar_indicesÚs1Ús1iÚa1Úf1ÚjÚsjÚajÚfjs                     r1   Ú_dmp_sqf_norm_shiftsrm   »   s
  é € ð 	
ˆA‰€AØ
ˆˆq‰€BØ
ˆ%‚Kð 	
�‰€Aô 	˜Ó€AÜ"(¬¨Q´°a¸±c³
Ó);Ô"<ÔGÒ"<™˜ÀÀQÁ—1Ñ"<€KÑGó ˆØ�W‰W‹YˆØˆ‰Ù "Ó#¢˜ˆb�Œf¡ˆÐ#Ü�q˜aÓ#ˆØˆfŒñ ð 	
€AØ
Ø	ˆQ‰ˆØˆS�1‰WˆØˆb�‰dˆV�a‰ZˆÜ�q˜"˜aÓ#ˆØ�"ˆfŠñ ùó Hùò $ùs%   ‚AC"ÁCÁCÁ$ C"ÂCÂAC"c                 ó�  • U(       d  [        X5      u  p4nU/XE4$ UR                  (       d  [        S5      e[        UR                  R                  5       US-   SUR                  5      n[        XU5       HI  u  p0[        XUSS9u  pg[        XFUS-   UR                  5      n[        XQUR                  5      (       d  MI    O   WU W4$ )aD  
Find a shift of ``f`` in ``K[X]`` that has square-free norm.

The domain `K` must be an algebraic number field `k(a)` (see :ref:`QQ(a)`).

Returns `(s,g,r)`, such that `g(x_1,x_2,\cdots)=f(x_1-s_1 a, x_2 - s_2 a,
\cdots)`, `r(x)=\text{Norm}(g(x))` and `r` is a square-free polynomial over
`k`.

Examples
========

We first create the algebraic number field `K=k(a)=\mathbb{Q}(i)` and rings
`K[x,y]` and `k[x,y]`:

>>> from sympy.polys import ring, QQ
>>> from sympy import I

>>> K = QQ.algebraic_field(I)
>>> R, x, y = ring("x,y", K)
>>> _, X, Y = ring("x,y", QQ)

We can now find a square free norm for a shift of `f`:

>>> f = x*y + y**2
>>> s, g, r = R.dmp_sqf_norm(f)

The choice of shifts ``s`` is arbitrary and the particular values returned
for ``g`` and ``r`` are determined by ``s``.

>>> s
[0, 1]
>>> g == x*y - I*x + y**2 - 2*I*y - 1
True
>>> r == X**2*Y**2 + X**2 + 2*X*Y**3 + 2*X*Y + Y**4 + 2*Y**2 + 1
True

The required invariants are:

>>> g == f.shift_list([-si*K.unit for si in s])
True
>>> g.norm() == r
True
>>> r.is_squarefree
True

Explanation
===========

This is part of Trager's algorithm for factorizing polynomials over
algebraic number fields. In particular this function is a multivariate
generalization of algorithm ``sqfr_norm`` from [Trager76]_.

See Also
========

dup_sqf_norm:
    Analogous function for univariate polynomials over ``k(a)``.
dmp_norm:
    Computes the norm of `f` directly without any shift.
dmp_ext_factor:
    Function implementing Trager's algorithm that uses this.
sympy.polys.polytools.sqf_norm:
    High-level interface for using this function.
rN   r;   r   TrO   )r[   rQ   r+   r   rR   rS   rT   rm   r   r&   rL   )r5   r>   rE   rV   rW   rZ   rX   rY   s           r1   Údmp_sqf_normro   ã   s±   € öD Ü˜qÓ$‰ˆˆaØˆs�AˆyÐà�>�>ÜÐ;Ó<Ð<ä�!—%‘%—-‘-“/ 1 q¡5¨!¨Q¯U©UÓ3€Aä$ Q¨1Ö-‰ˆä˜! ¨Ñ.‰ˆÜ˜!  A¡ q§u¡uÓ-ˆä�Q˜1Ÿ5™5×!Ó!Ùñ .ð ˆa�ˆ7€Nr9   c                 óî   • UR                   (       d  [        S5      e[        UR                  R	                  5       US-   SUR
                  5      n[        XUSS9u  pE[        X4US-   UR
                  5      $ )ai  
Norm of ``f`` in ``K[X]``, often not square-free.

The domain `K` must be an algebraic number field `k(a)` (see :ref:`QQ(a)`).

Examples
========

We first define the algebraic number field `K = k(a) = \mathbb{Q}(\sqrt{2})`:

>>> from sympy import QQ, sqrt
>>> from sympy.polys.sqfreetools import dmp_norm
>>> k = QQ
>>> K = k.algebraic_field(sqrt(2))

We can now compute the norm of a polynomial `p` in `K[x,y]`:

>>> p = [[K(1)], [K(1),K.unit]]                  # x + y + sqrt(2)
>>> N = [[k(1)], [k(2),k(0)], [k(1),k(0),k(-2)]] # x**2 + 2*x*y + y**2 - 2
>>> dmp_norm(p, 1, K) == N
True

In higher level functions that is:

>>> from sympy import expand, roots, minpoly
>>> from sympy.abc import x, y
>>> from math import prod
>>> a = sqrt(2)
>>> e = (x + y + a)
>>> e.as_poly([x, y], extension=a).norm()
Poly(x**2 + 2*x*y + y**2 - 2, x, y, domain='QQ')

This is equal to the product of the expressions `x + y + a_i` where the
`a_i` are the conjugates of `a`:

>>> pa = minpoly(a)
>>> pa
_x**2 - 2
>>> rs = roots(pa, multiple=True)
>>> rs
[sqrt(2), -sqrt(2)]
>>> n = prod(e.subs(a, r) for r in rs)
>>> n
(x + y - sqrt(2))*(x + y + sqrt(2))
>>> expand(n)
x**2 + 2*x*y + y**2 - 2

Explanation
===========

Given an algebraic number field `K = k(a)` any element `b` of `K` can be
represented as polynomial function `b=g(a)` where `g` is in `k[x]`. If the
minimal polynomial of `a` over `k` is `p_a` then the roots `a_1`, `a_2`,
`\cdots` of `p_a(x)` are the conjugates of `a`. The norm of `b` is the
product `g(a1) \times g(a2) \times \cdots` and is an element of `k`.

As in [Trager76]_ we extend this norm to multivariate polynomials over `K`.
If `b(x)` is a polynomial in `k(a)[X]` then we can think of `b` as being
alternately a function `g_X(a)` where `g_X` is an element of `k[X][y]` i.e.
a polynomial function with coefficients that are elements of `k[X]`. Then
the norm of `b` is the product `g_X(a1) \times g_X(a2) \times \cdots` and
will be an element of `k[X]`.

See Also
========

dmp_sqf_norm:
    Compute a shift of `f` so that the `\text{Norm}(f)` is square-free.
sympy.polys.polytools.Poly.norm:
    Higher-level function that calls this.
rN   r;   r   TrO   )rQ   r+   r   rR   rS   rT   r   r&   )r5   r>   rE   rW   rX   rY   s         r1   Údmp_normrq   9  sa   € ðP �>�>ÜÐ;Ó<Ð<ä�!—%‘%—-‘-“/ 1 q¡5¨!¨Q¯U©UÓ3€AÜ�a˜A TÑ*�D€Aä˜˜q 1™u a§e¡eÓ,Ð,r9   c                 óš   • [        XUR                  5      n [        XR                  UR                  5      n[        X!R                  U5      $ )z3Compute square-free part of ``f`` in ``GF(p)[x]``. )r   rT   r)   rR   )r5   rE   rW   s      r1   Údup_gf_sqf_partrs   Š  s7   € ä�A˜!Ÿ%™%Ó €AÜ�A—u‘u˜aŸe™eÓ$€AÜ�qŸ%™% Ó#Ð#r9   c                 ó   • [        S5      e)z3Compute square-free part of ``f`` in ``GF(p)[X]``. ú+multivariate polynomials over finite fields©ÚNotImplementedError©r5   r>   rE   s      r1   Údmp_gf_sqf_partry   ‘  ó   € ä
ÐKÓ
LÐLr9   c                 ó<  • UR                   (       a  [        X5      $ U (       d  U $ UR                  [        X5      5      (       a  [	        X5      n [        U [        U SU5      U5      n[        XU5      nUR                  (       a  [        X15      $ [        X15      S   $ )zò
Returns square-free part of a polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_sqf_part(x**3 - 3*x - 2)
x**2 - x - 2

See Also
========

sympy.polys.polytools.Poly.sqf_part
r;   )Úis_FiniteFieldrs   Úis_negativer   r   r$   r   r	   Úis_Fieldr   r    )r5   rE   rK   Úsqfs       r1   Údup_sqf_partr€   –  s�   € ð$ 	××Ü˜qÓ$Ð$æØˆà‡}�}”V˜A“\×"Ñ"Ü�A‹Mˆä
�!”X˜a  AÓ&¨Ó
*€CÜ
�!˜!Ó
€Cà‡z‡zÜ˜Ó Ð ä˜SÓ$ QÑ'Ð'r9   c                 ó¬  • U(       d  [        X5      $ UR                  (       a  [        XU5      $ [        X5      (       a  U $ UR	                  [        XU5      5      (       a  [        XU5      n U n[        US-   5       H  n[        U[        U SXAU5      X5      nM     [        XX5      nUR                  (       a  [        XQU5      $ [        XQU5      S   $ )zÇ
Returns square-free part of a polynomial in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_sqf_part(x**3 + 2*x**2*y + x*y**2)
x**2 + x*y

r;   )r€   r|   ry   r   r}   r   r   rH   r%   r   r
   r~   r   r!   )r5   r>   rE   rK   rI   r   s         r1   Údmp_sqf_partr‚   º  s¼   € ö Ü˜AÓ!Ð!à××Ü˜q QÓ'Ð'ä�!×ÑØˆà‡}�}”] 1¨Ó+×,Ñ,Ü�A˜!Óˆà
€CÜ�1�Q‘3ŽZˆÜ�cœ; q¨!¨Q°1Ó5°qÓ<Šñ ä
�!˜!Ó
€Cà‡z‡zÜ ¨Ó*Ð*ä# C¨AÓ.¨qÑ1Ð1r9   c                 ó&  • U n[        XUR                  5      n [        XR                  UR                  US9u  pE[	        U5       H"  u  nu  p[        XR                  U5      U4XV'   M$     [        X55        UR                  XAR                  5      U4$ )z<Compute square-free decomposition of ``f`` in ``GF(p)[x]``. ©Úall)r   rT   r(   rR   Ú	enumerater8   Úconvert)r5   rE   r…   Úf_origÚcoeffÚfactorsrI   r0   s           r1   Údup_gf_sqf_listr‹   ß  s}   € à€Fä�A˜!Ÿ%™%Ó €Aä  §E¡E¨1¯5©5°cÑ:�N€Eä˜wÖ'‰	ˆ‰6ˆAÜ! !§U¡U¨AÓ.°Ð2ˆ‹
ñ (ô �vÔ'à�9‰9�UŸE™EÓ" GÐ+Ð+r9   c                 ó   • [        S5      e)z<Compute square-free decomposition of ``f`` in ``GF(p)[X]``. ru   rv   )r5   r>   rE   r…   s       r1   Údmp_gf_sqf_listr�   ï  rz   r9   c                 ód  • UR                   (       a
  [        XUS9$ U nUR                  (       a  [        X5      n[	        X5      n O:[        X5      u  p@UR                  [        X5      5      (       a  [        X5      n U* n[        U 5      S::  a  U/ 4$ / Spe[        U SU5      n[        XU5      u  p‰n
 [        U	SU5      n[        X«U5      nU(       d  UR                  X–45        O>[        X—U5      u  p‰n
U(       d  [        U5      S:”  a  UR                  X†45        US-  nMq  [        X55        XE4$ )a›  
Return square-free decomposition of a polynomial in ``K[x]``.

Uses Yun's algorithm from [Yun76]_.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> f = 2*x**5 + 16*x**4 + 50*x**3 + 76*x**2 + 56*x + 16

>>> R.dup_sqf_list(f)
(2, [(x + 1, 2), (x + 2, 3)])
>>> R.dup_sqf_list(f, all=True)
(2, [(1, 1), (x + 1, 2), (x + 2, 3)])

See Also
========

dmp_sqf_list:
    Corresponding function for multivariate polynomials.
sympy.polys.polytools.sqf_list:
    High-level function for square-free factorization of expressions.
sympy.polys.polytools.Poly.sqf_list:
    Analogous method on :class:`~.Poly`.

References
==========

[Yun76]_
r„   r   r;   )r|   r‹   r~   r   r   r    r}   r   r   r   r"   r   Úappendr8   )r5   rE   r…   rˆ   r‰   r6   rI   rX   rW   ÚpÚqrb   s               r1   Údup_sqf_listr’   ô  s   € ðD 	××Ü˜q¨Ñ-Ð-à€Fà‡z‡zÜ�q“ˆÜ�a‹O‰ä  Ó&‰ˆà�=‰=œ ›×&Ñ&Ü˜“ˆAØ�FˆEä�!ƒ}˜ÓØ�bˆyÐà�AˆAä��A�qÓ€AÜ˜A !Ó$�G€Aˆ!à
Ü�Q˜˜1ÓˆÜ�A˜!ÓˆæØ�M‰M˜1˜&Ô!Øä  aÓ(‰ˆˆaæ”*˜Q“- !Ó#Ø�M‰M˜1˜&Ô!à	ˆQ‰ˆñ ô �vÔ&àˆ=Ðr9   c                 ó¢   • [        XUS9u  p4U(       a)  US   S   S:X  a  [        US   S   X15      nUS4/USS -   $ [        U/5      nUS4/U-   $ )aU  
Return square-free decomposition of a polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> f = 2*x**5 + 16*x**4 + 50*x**3 + 76*x**2 + 56*x + 16

>>> R.dup_sqf_list_include(f)
[(2, 1), (x + 1, 2), (x + 2, 3)]
>>> R.dup_sqf_list_include(f, all=True)
[(2, 1), (x + 1, 2), (x + 2, 3)]

r„   r   r;   N)r’   r   r   )r5   rE   r…   r‰   rŠ   rW   s         r1   Údup_sqf_list_includer”   A  sl   € ô$ " !¨CÑ0�N€Eæ�7˜1‘:˜a‘= AÓ%Ü˜7 1™: a™=¨%Ó3ˆØ�A�ˆx˜' ! "˜+Ñ%Ð%ä�u�gÓˆØ�A�ˆx˜'Ñ!Ð!r9   c                 ó`  • U(       d
  [        XUS9$ UR                  (       a
  [        XX#S9$ U nUR                  (       a  [	        XU5      n[        XU5      n O=[        XU5      u  pPUR                  [	        XU5      5      (       a  [        XU5      n U* n[        X5      nUS:  a  U/ 4$ [        XU5      u  pp0 nUS:w  a}  [        U SX5      n	[        X	X5      u  p«nSn [        USX5      n[        XÎX5      n	[        X‘5      (       a  X¸U'   O0[        X¹X5      u  p«nU(       d  [        X¡5      S:”  a  X¨U'   US-  nM^  [        XqS-
  X#S9u  nnX_-  nU H%  u  nnU/nXØ;   a  [!        X�   UX5      X�'   M!  UX�'   M'     [#        U5       Vs/ s H	  oØU   U4PM     nn[%        XAU5        XX4$ s  snf )aÅ  
Return square-free decomposition of a polynomial in `K[X]`.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> f = x**5 + 2*x**4*y + x**3*y**2

>>> R.dmp_sqf_list(f)
(1, [(x + y, 2), (x, 3)])
>>> R.dmp_sqf_list(f, all=True)
(1, [(1, 1), (x + y, 2), (x, 3)])

Explanation
===========

Uses Yun's algorithm for univariate polynomials from [Yun76]_ recursively.
The multivariate polynomial is treated as a univariate polynomial in its
leading variable. Then Yun's algorithm computes the square-free
factorization of the primitive and the content is factored recursively.

It would be better to use a dedicated algorithm for multivariate
polynomials instead.

See Also
========

dup_sqf_list:
    Corresponding function for univariate polynomials.
sympy.polys.polytools.sqf_list:
    High-level function for square-free factorization of expressions.
sympy.polys.polytools.Poly.sqf_list:
    Analogous method on :class:`~.Poly`.
r„   r   r;   )r’   r|   r�   r~   r   r   r!   r}   r   r   r'   r   r#   r   r   Údmp_sqf_listr   r]   rC   )r5   r>   rE   r…   rˆ   r‰   r7   Úcontentr6   rX   rW   r�   r‘   rI   rb   Úcoeff_contentÚresult_contentr/   s                     r1   r–   r–   ]  sÑ  € öL Ü˜A cÑ*Ð*à××Ü˜q QÑ0Ð0à€Fà‡z‡zÜ˜a AÓ&ˆÜ˜Q 1Ó%‰ä'¨¨aÓ0‰ˆà�=‰=œ q¨QÓ/×0Ñ0Ü˜˜aÓ ˆAØ�FˆEä
�QÓ
€CØ
ˆQƒwØ�bˆyÐô ˜q QÓ'�J€Gà€Fà
ˆaƒxä�Q˜˜1Ó ˆÜ  aÓ+‰ˆˆaàˆàÜ˜˜A˜qÓ$ˆAÜ˜˜aÓ#ˆAä˜!×ÑØ�q‘	Øä# A¨!Ó/‰GˆA�!æ”j Ó&¨Ó*Ø�q‘	à�‰FˆAñ ô %1°¸A¹#¸qÑ$JÑ!€M�>à	Ñ€Eó !‰ˆˆQØˆeˆØ‹;Ü ¡	¨3°Ó5ˆF‹IàˆF‹Iñ !ô '-¨V¤nÓ5¢n �a‰y˜!‹n¡n€FÐ5ä�v &Ô)àˆ=Ðùò	 6s   Æ
F+c                 óÄ   • U(       d
  [        XUS9$ [        XX#S9u  pEU(       a*  US   S   S:X  a  [        US   S   XAU5      nUS4/USS -   $ [        XA5      nUS4/U-   $ )a<  
Return square-free decomposition of a polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> f = x**5 + 2*x**4*y + x**3*y**2

>>> R.dmp_sqf_list_include(f)
[(1, 1), (x + y, 2), (x, 3)]
>>> R.dmp_sqf_list_include(f, all=True)
[(1, 1), (x + y, 2), (x, 3)]

r„   r   r;   N)r”   r–   r   r   )r5   r>   rE   r…   r‰   rŠ   rW   s          r1   Údmp_sqf_list_includer›   É  s|   € ö$ Ü# A¨cÑ2Ð2ä! !¨Ñ3�N€Eæ�7˜1‘:˜a‘= AÓ%Ü˜7 1™: a™=¨%°AÓ6ˆØ�A�ˆx˜' ! "˜+Ñ%Ð%ä�uÓ ˆØ�A�ˆx˜'Ñ!Ð!r9   c           
      ó~  • U (       d  [        S5      e[        X5      n [        U 5      (       d  / $ [        U [	        XR
                  U5      U5      n[        X!5      n[        U5       H.  u  nu  pV[        U[	        XQ" U5      * U5      U5      nXVS-   4X4'   M0     [        XU5      n [        U 5      (       d  U$ U S4/U-   $ )zÛ
Compute greatest factorial factorization of ``f`` in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_gff_list(x**5 + 2*x**4 - x**3 - 2*x**2)
[(x, 1), (x + 2, 4)]

zDgreatest factorial factorization doesn't exist for a zero polynomialr;   )
Ú
ValueErrorr   r   r$   r   ÚoneÚdup_gff_listr†   r   r	   )r5   rE   rW   ÚHrI   rX   r0   s          r1   rŸ   rŸ   è  s·   € ö ÜÐ_Ó`Ð`ä�!‹€Aä�a�=‰=Øˆ	ä�A”y §E¡E¨1Ó-¨qÓ1ˆÜ˜Óˆä" 1ž‰IˆA‰v�Ü˜œ9 Q¨¨1«¨¨qÓ1°1Ó5ˆAØ˜1‘u�:ˆA‹Dñ &ô �A˜!Óˆä˜!�}‰}ØˆHà˜�F�8˜a‘<Ðr9   c                 ó<   • U(       d  [        X5      $ [        U 5      e)z—
Compute greatest factorial factorization of ``f`` in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

)rŸ   r*   rx   s      r1   Údmp_gff_listr¢     s   € ö Ü˜AÓ!Ð!ä)¨!Ó,Ð,r9   N)F)DÚ__doc__Úsympy.polys.densearithr   r   r   r   r   r   r	   r
   r   r   Úsympy.polys.densebasicr   r   r   r   r   r   r   r   r   r   r   r   Úsympy.polys.densetoolsr   r   r   r   r   r   r   r    r!   Úsympy.polys.euclidtoolsr"   r#   r$   r%   r&   r'   Úsympy.polys.galoistoolsr(   r)   Úsympy.polys.polyerrorsr*   r+   r8   rC   rF   rL   r[   rm   ro   rq   rs   ry   r€   r‚   r‹   r�   r’   r”   r–   r›   rŸ   r¢   © r9   r1   Ú<module>r«      sÄ   ðÙ >÷$÷ $÷ $÷÷ ÷ ó ÷)÷ )õ )÷
"÷ "÷÷ò
 ò0ò@ò,òDOòd%òPSòlN-òb$òMò
!(òH"2ôJ,ô Mô
JôZ"ô8iôX"ò>" óJ-r9   