+
    ‹°³jÊ  ã                   óD   € R t ^ RIHtHt R tR tR tR tR tR t	R t
R	# )
zCImplementation of matrix FGLM Groebner basis conversion algorithm. )Úmonomial_mulÚmonomial_divc           	     ó8  aaaaaa€ VP                   oVP                  pVP                  SR7      p\        W4      p\	        WPV4      pVP
                  .oSP                  .SP                  .\        V4      ^,
          ,          ,           .p. p\        V4       U	u. uF  q™^ 3NK  	  p
p	V
P                  VV3R lRR7       V
P                  4       p\        \        V4      S4      p \        S4      p\        Wk^ ,          ,          W{^,          ,          4      p\        WÎ4      o\        ;QJ d3    VV3R l\        V\        V4      4       4       F  '       d   K   RM(	  RM$! VV3R l\        V\        V4      4       4       4      '       d§   VP                  \!        SV^,          ,          V^ ,          4      SP                  4      pTP#                  \        V4       U	u/ uF  p	SV	,          SV	,          bK  	  up	4      pVV,
          P%                  V4      pV'       d   VP'                  V4       M¥\)        VSV4      pSP'                  \!        SV^,          ,          V^ ,          4      4       VP'                  V4       T
P+                  \        V4       U	u. uF  q™V3NK  	  up	4       \-        \/        V
4      4      p
V
P                  VV3R lRR7       V
 UaUau. uFP  w  oo\        ;QJ d!    VVV3R lV 4       F  '       d   K   RM	  RM! VVV3R lV 4       4      '       g   KL  SS3NKR  	  p
ppV
'       g2   V Uu. uF  pVP1                  4       NK  	  pp\3        VV3R	 lRR7      # V
P                  4       pEKœ  u up	i u up	i u up	i u uppi u upi )
a6  
Converts the reduced Groebner basis ``F`` of a zero-dimensional
ideal w.r.t. ``O_from`` to a reduced Groebner basis
w.r.t. ``O_to``.

References
==========

.. [1] J.C. Faugere, P. Gianni, D. Lazard, T. Mora (1994). Efficient
       Computation of Zero-dimensional Groebner Bases by Change of
       Ordering
)Úorderc                 óR   <€ S! \        SV ^,          ,          V ^ ,          4      4      # ©é   ©Ú_incr_k©Úk_lÚO_toÚSs   &€€ÚV/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/polys/fglmtools.pyÚ<lambda>Úmatrix_fglm.<locals>.<lambda>!   s   ø€ ™4¤¨¨#¨a­&­	°3°qµ6Ó :Ô;ó    T©ÚkeyÚreversec              3   óP   <"  € T F  pSV,          SP                   8H  x € K  	  R # 5i©N)Úzero)Ú.0ÚiÚ_lambdaÚdomains   & €€r   Ú	<genexpr>Úmatrix_fglm.<locals>.<genexpr>+   s    øé € ÐKÑ2J¨Qˆw�q�z˜VŸ[™[Ö(Ó2Jùs   ƒ#&Fc                 óR   <€ S! \        SV ^,          ,          V ^ ,          4      4      # r   r	   r   s   &€€r   r   r   ;   s   ø€ ¡4¬°°#°aµ&µ	¸3¸q½6Ó(BÔ#Cr   c              3   óv   <"  € T F.  p\        \        SS,          S4      VP                  4      R J x € K0  	  R # 5ir   )r   r
   ÚLM)r   Úgr   ÚkÚls   & €€€r   r   r   =   s0   øé € Ð*cÑabÐ\]¬<¼ÀÀ!ÅÀaÓ8HÈ!Ï$É$Ó+OÐSWÕ+WÓabùs   ƒ69c                 ó(   <€ S! V P                   4      # r   )r!   )r"   r   s   &€r   r   r   A   s   ø€ ©4°·±¬:r   )r   ÚngensÚcloneÚ_basisÚ_representing_matricesÚ
zero_monomÚoner   ÚlenÚrangeÚsortÚpopÚ_identity_matrixÚ_matrix_mulÚallÚterm_newr
   Ú	from_dictÚset_ringÚappendÚ_updateÚextendÚlistÚsetÚmonicÚsorted)ÚFÚringr   r&   Úring_toÚ	old_basisÚMÚVÚGr   ÚLÚtÚPÚsÚvÚltÚrestr"   r#   r$   r   r   r   s   &&f               ``@@@r   Úmatrix_fglmrK      s£  ý€ ð �[‰[€FØ�J‰J€Eà�j‰j˜tˆjÓ$€Gä�q“€IÜ˜y¨TÓ2€Að 
�‰Ð€AØ
�*‰*ˆ˜Ÿ™˜¬¨Y«¸!Õ);Õ<Õ	<Ð=€AØ
€Aä˜uœÓ&™�AˆQ‹™€AÐ&Ø‡F�FÕ;ÀT€FÔJØ	�‰‹€Aäœ˜Y›¨Ó0€Aà
Ü�‹FˆÜ˜˜A�$�  Q¥4¥Ó)ˆÜ˜aÓ#ˆç‹3ÕK´%¸¼3¸y»>Ô2JÓK�3�3Š3ÕK´%¸¼3¸y»>Ô2JÓK×KÒKà—‘œw q¨¨1­¥w°°!µÓ5°v·z±zÓBˆBØ—>‘>¼UÀ1¼XÓ"F¹X¸ 1 Q¥4¨°­Ò#3¹XÑ"FÓGˆDà�d•×$Ñ$ WÓ-ˆAßØ—‘˜”øô ˜˜7 AÓ&ˆAØ�H‰H”W˜Q˜q �t�W a¨¥dÓ+Ô,Ø�H‰H�QŒKà�H‰H¤e¨E¤lÓ3¡l ˜!“f¡lÑ3Ô4Ü”S˜“V“ˆAØ�F‰FÕCÈTˆFÔRá"#Öd¡!™˜˜A§s£sÖ*cÑabÓ*c§s§s¢sÖ*cÑabÓ*c×'cŒVˆa�‹V¡!ˆÑdçÙ%&Ó(¡Q �!—'‘'–)¡QˆAÐ(Ü˜!Ô!5¸tÔDÐDà�E‰E‹G‹ùòG 	'ùò #Gùò 4ùó eùò )s0   ÂNÇNÊNËNË0NÌ	NÌ+NÍNc                 óŒ   € \        \        V R V 4      W,          ^,           .,           \        W^,           R  4      ,           4      # r   )Útupler9   )Úmr#   s   &&r   r
   r
   F   s5   € Ü”�a˜˜�e“ ¥ q¥˜zÕ)¬D°°qµ5°6°«OÕ;Ó<Ð<r   c                 ó´   € \        V 4       Uu. uF  q!P                  .V ,          NK  	  pp\        V 4       F  pVP                  W4,          V&   K  	  V# u upi r   )r-   r   r+   )Únr   Ú_rA   r   s   &&   r   r0   r0   J   sM   € Ü"'¨¤(Ó+¡(˜Q�+‰+ˆ�q�ˆ¡(€AÐ+ä�1ŽXˆØ—*‘*ˆ�ˆQ‹ñ ð €Hùò 	,s   ŽAc                 ó‚   aa€ V  Uau. uF+  o\        VV3R  l\        \        S4      4       4       4      NK-  	  up# u upi )c              3   óR   <"  € T F  pSV,          SV,          ,          x € K  	  R # 5ir   © )r   r   ÚrowrH   s   & €€r   r   Ú_matrix_mul.<locals>.<genexpr>T   s   øé € Ð5¡} !��A•˜˜1�—’£}ùs   ƒ$')Úsumr-   r,   )rA   rH   rU   s   &f`r   r1   r1   S   s.   ù€ ÙABÔCÁ¸#ŒCÕ5¤u¬S°«V¤}Ó5Ö5ÁÑCÐCùÒCs   ˆ1<c           	     ó<  a€ \        V3R l\        V \        S4      4       4       4      p\        \        S4      4       Ft  pWC8w  g   K  \        \        W$,          4      4       Uu. uFB  qRV,          V,          W#,          V,          SV,          ,          SV,          ,          ,
          NKD  	  upW$&   Kv  	  \        \        W#,          4      4       Uu. uF   qRV,          V,          SV,          ,          NK"  	  upW#&   W ,          W#,          uW#&   W &   V# u upi u upi )z=
Update ``P`` such that for the updated `P'` `P' v = e_{s}`.
c              3   óH   <"  € T F  pSV,          ^ 8w  g   K  Vx € K  	  R# 5i)é    NrT   )r   Újr   s   & €r   r   Ú_update.<locals>.<genexpr>[   s   øé € ÐAÑ-�!°¸µ¸q±�AŠAÓ-ùs   ƒ"˜
")Úminr-   r,   )rG   r   rF   r#   Úrr[   s   &f&   r   r7   r7   W   sÝ   ø€ ô 	ÔA”u˜Q¤ G£Ô-ÓAÓA€Aä”3�w“<Ö ˆØŽ6ÜKPÔQTÐUVÕUYÓQZÔK[Ó\ÑK[Àa�a•D˜•G˜q�t A�w¨°­Õ3°w¸qµzÕA×AÐAÑK[Ñ\ˆA‹Dñ !ô +0´°AµD³	Ô*:Ó;Ñ*: Qˆa�D��G�g˜a•j× Ð Ñ*:Ñ;€A�DØ•�q•t€J€A�Dˆ!‰$à€Hùò ]ùâ;s   Á%ADÃ&Dc                óÌ   a aaaa€ SP                   oSP                  ^,
          oV3R lpVV VV3R lp\        S^,           4       Uu. uF  qT! V! V4      4      NK  	  up# u upi )zb
Compute the matrices corresponding to the linear maps `m \mapsto
x_i m` for all variables `x_i`.
c                 óf   <€ \        ^ .V ,          ^.,           ^ .SV ,
          ,          ,           4      # )rZ   )rM   )r   Úus   &€r   ÚvarÚ#_representing_matrices.<locals>.varo   s)   ø€ Ü�a�S˜1•W ˜s•] a S¨A°­E¥]Õ2Ó3Ð3r   c                 óˆ  <€ \        \        S
4      4       Uu. uF   pSP                  .\        S
4      ,          NK"  	  pp\        S
4       Fn  w  r4SP	                  \        W4      SP                  4      P                  S	4      pVP                  4        F!  w  rgS
P                  V4      pWrV,          V&   K#  	  Kp  	  V# u upi r   )
r-   r,   r   Ú	enumerater3   r   r+   ÚremÚtermsÚindex)rN   rQ   rA   r   rH   r^   ÚmonomÚcoeffr[   rC   Úbasisr   r>   s   &        €€€€r   Úrepresenting_matrixÚ3_representing_matrices.<locals>.representing_matrixr   s¡   ø€ Ü16´s¸5³zÔ1BÓCÑ1B¨Aˆf�k‰kˆ]œS ›Z×'Ð'Ñ1BˆÐCä˜eÖ$‰DˆAØ—‘œl¨1Ó0°&·*±*Ó=×AÑAÀ!ÓDˆAà !§¡¦	‘�Ø—K‘K Ó&�Ø�!•�Q“ó !*ñ %ð ˆùò Ds   ˜&B?)r   r&   r-   )rk   rC   r>   rb   rl   r   r   ra   s   fff   @@r   r)   r)   g   sV   ü€ ð
 �[‰[€FØ�
‰
�1�€Aõ4÷
ð 
ô 27°q¸1µu´Ó>±¨AÐ¡ A£Ö'±Ñ>Ð>ùÒ>s   ÁA!c                óH  aa	€ VP                   pV  Uu. uF  q3P                  NK  	  ppVP                  .p. pV'       d»   VP                  4       o	VP	                  S	4       \        VP                  4       Uau. uFS  o\        ;QJ d     VV	3R lV 4       F  '       d   K   RM	  RM! VV	3R lV 4       4      '       g   KG  \        S	S4      NKU  	  ppVP                  V4       VP                  VRR7       KÂ  \        \        V4      4      p\        WbR7      # u upi u upi )z 
Computes a list of monomials which are not divisible by the leading
monomials wrt to ``O`` of ``G``. These monomials are a basis of
`K[X_1, \ldots, X_n]/(G)`.
c              3   óT   <"  € T F  p\        \        SS4      V4      R J x € K  	  R # 5ir   )r   r
   )r   Úlmgr#   rE   s   & €€r   r   Ú_basis.<locals>.<genexpr>’   s*   øé € ð *Ù(�ô  ¤¨¨1£¨sÓ3°tÕ;Û(ùs   ƒ%(FTr   )r   )r   r!   r*   r/   r6   r-   r&   r2   r
   r8   r.   r9   r:   r<   )
rC   r>   r   r"   Úleading_monomialsÚ
candidatesrk   r#   Únew_candidatesrE   s
   &&     ` @r   r(   r(   �   së   ù€ ð �J‰J€Eá'(Ó)¡q !Ÿœ¡qÐÐ)Ø—/‘/Ð"€JØ€Eç
Ø�N‰NÓˆØ�‰�QŒä16°t·z±zÔ1Bô +Ñ1B¨Aß‹sõ *Ù(ó*�s�sŠsõ *Ù(ó*÷ *ô (œ' ! Qž-Ñ1Bˆð +ð 	×Ñ˜.Ô)Ø�‰˜E¨4ˆÖ0ä”�U“Ó€Eä�%Ô#Ð#ùò! *ùò+s   “DÁ9DÂ	DÂ!DÃDN)Ú__doc__Úsympy.polys.monomialsr   r   rK   r
   r0   r1   r7   r)   r(   rT   r   r   Ú<module>rw      s2   ðÙ I÷ =ò=ò@=òòDòò ?ô4$r   