+
    -åûj±U  ã                   óŽ   € R t ^ RIHtHtHtHtHt ^ RIHt  ! R R4      t	 ! R R]	4      t
 ! R R]
4      t ! R	 R
]
4      tR tR# )a   
Computations with homomorphisms of modules and rings.

This module implements classes for representing homomorphisms of rings and
their modules. Instead of instantiating the classes directly, you should use
the function ``homomorphism(from, to, matrix)`` to create homomorphism objects.
)ÚModuleÚ
FreeModuleÚQuotientModuleÚ	SubModuleÚSubQuotientModule)ÚCoercionFailedc                   óÖ   a € ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR t]tR tR tR tR tR tR tR t R t!R t"Rt#V t$R # )!ÚModuleHomomorphisma²  
Abstract base class for module homomoprhisms. Do not instantiate.

Instead, use the ``homomorphism`` function:

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> homomorphism(F, F, [[1, 0], [0, 1]])
Matrix([
[1, 0], : QQ[x]**2 -> QQ[x]**2
[0, 1]])

Attributes:

- ring - the ring over which we are considering modules
- domain - the domain module
- codomain - the codomain module
- _ker - cached kernel
- _img - cached image

Non-implemented methods:

- _kernel
- _image
- _restrict_domain
- _restrict_codomain
- _quotient_domain
- _quotient_codomain
- _apply
- _mul_scalar
- _compose
- _add
c                óX  € \        V\        4      '       g   \        R V,          4      h\        V\        4      '       g   \        RV,          4      hVP                  VP                  8w  d   \	        RV: RV: 24      hWn        W n        VP                  V n        RV n        RV n        R# )zSource must be a module, got %szTarget must be a module, got %sz0Source and codomain must be over same ring, got z != N)	Ú
isinstancer   Ú	TypeErrorÚringÚ
ValueErrorÚdomainÚcodomainÚ_kerÚ_img)Úselfr   r   s   &&&ÚZC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\sympy\polys\agca\homomorphisms.pyÚ__init__ÚModuleHomomorphism.__init__8   s‹   € Ü˜&¤&×)Ò)ÜÐ=ÀÕFÓGÐGÜ˜(¤F×+Ò+ÜÐ=ÀÕHÓIÐIØ�;‰;˜(Ÿ-™-Ô'ÝÛ/5²xðAó Bð BàŒØ ŒØ—K‘KˆŒ	ØˆŒ	ØˆŽ	ó    c                ó`   € V P                   f   V P                  4       V n         V P                   # )aŽ  
Compute the kernel of ``self``.

That is, if ``self`` is the homomorphism `\phi: M \to N`, then compute
`ker(\phi) = \{x \in M | \phi(x) = 0\}`.  This is a submodule of `M`.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> homomorphism(F, F, [[1, 0], [x, 0]]).kernel()
<[x, -1]>
)r   Ú_kernel©r   s   &r   ÚkernelÚModuleHomomorphism.kernelF   s%   € ð$ �9‰9ÒØŸ™›ˆDŒIØ�y‰yÐr   c                ó`   € V P                   f   V P                  4       V n         V P                   # )aš  
Compute the image of ``self``.

That is, if ``self`` is the homomorphism `\phi: M \to N`, then compute
`im(\phi) = \{\phi(x) | x \in M \}`.  This is a submodule of `N`.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> homomorphism(F, F, [[1, 0], [x, 0]]).image() == F.submodule([1, 0])
True
)r   Ú_imager   s   &r   ÚimageÚModuleHomomorphism.image\   s%   € ð$ �9‰9ÒØŸ™›ˆDŒIØ�y‰yÐr   c                ó   € \         h)zCompute the kernel of ``self``.©ÚNotImplementedErrorr   s   &r   r   ÚModuleHomomorphism._kernelr   ó   € ä!Ð!r   c                ó   € \         h)zCompute the image of ``self``.r"   r   s   &r   r   ÚModuleHomomorphism._imagev   r%   r   c                ó   € \         h©z%Implementation of domain restriction.r"   ©r   Úsms   &&r   Ú_restrict_domainÚ#ModuleHomomorphism._restrict_domainz   r%   r   c                ó   € \         h©z'Implementation of codomain restriction.r"   r*   s   &&r   Ú_restrict_codomainÚ%ModuleHomomorphism._restrict_codomain~   r%   r   c                ó   € \         h©z"Implementation of domain quotient.r"   r*   s   &&r   Ú_quotient_domainÚ#ModuleHomomorphism._quotient_domain‚   r%   r   c                ó   € \         h©z$Implementation of codomain quotient.r"   r*   s   &&r   Ú_quotient_codomainÚ%ModuleHomomorphism._quotient_codomain†   r%   r   c                óÄ   € V P                   P                  V4      '       g   \        RV P                   : RV: 24      hWP                   8X  d   V # V P                  V4      # )a  
Return ``self``, with the domain restricted to ``sm``.

Here ``sm`` has to be a submodule of ``self.domain``.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.restrict_domain(F.submodule([1, 0]))
Matrix([
[1, x], : <[1, 0]> -> QQ[x]**2
[0, 0]])

This is the same as just composing on the right with the submodule
inclusion:

>>> h * F.submodule([1, 0]).inclusion_hom()
Matrix([
[1, x], : <[1, 0]> -> QQ[x]**2
[0, 0]])
zsm must be a submodule of ú, got )r   Úis_submoduler   r,   r*   s   &&r   Úrestrict_domainÚ"ModuleHomomorphism.restrict_domainŠ   sU   € ð@ �{‰{×'Ñ'¨×+Ò+ÝØ $§¤ªRð1ó 2ð 2à—‘ÔØˆKØ×$Ñ$ RÓ(Ð(r   c                óÔ   € VP                  V P                  4       4      '       g"   \        RV P                  4       : RV: 24      hWP                  8X  d   V # V P	                  V4      # )aì  
Return ``self``, with codomain restricted to to ``sm``.

Here ``sm`` has to be a submodule of ``self.codomain`` containing the
image.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.restrict_codomain(F.submodule([1, 0]))
Matrix([
[1, x], : QQ[x]**2 -> <[1, 0]>
[0, 0]])
z
the image ú must contain sm, got )r<   r   r   r   r0   r*   s   &&r   Úrestrict_codomainÚ$ModuleHomomorphism.restrict_codomain±   sV   € ð2 �‰˜tŸz™z›|×,Ò,ÝØ $§
¡
¦ªbð2ó 3ð 3à—‘ÔØˆKØ×&Ñ& rÓ*Ð*r   c                óà   € V P                  4       P                  V4      '       g"   \        RV P                  4       : RV: 24      hVP                  4       '       d   V # V P	                  V4      # )aÝ  
Return ``self`` with domain replaced by ``domain/sm``.

Here ``sm`` must be a submodule of ``self.kernel()``.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.quotient_domain(F.submodule([-x, 1]))
Matrix([
[1, x], : QQ[x]**2/<[-x, 1]> -> QQ[x]**2
[0, 0]])
zkernel r@   )r   r<   r   Úis_zeror4   r*   s   &&r   Úquotient_domainÚ"ModuleHomomorphism.quotient_domainÑ   sY   € ð0 �{‰{‹}×)Ñ)¨"×-Ò-ÝØ"Ÿk™kžmªRð1ó 2ð 2à�:‰:�<Š<ØˆKØ×$Ñ$ RÓ(Ð(r   c                óÐ   € V P                   P                  V4      '       g   \        RV P                   : RV: 24      hVP                  4       '       d   V # V P	                  V4      # )a‚  
Return ``self`` with codomain replaced by ``codomain/sm``.

Here ``sm`` must be a submodule of ``self.codomain``.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.quotient_codomain(F.submodule([1, 1]))
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2/<[1, 1]>
[0, 0]])

This is the same as composing with the quotient map on the left:

>>> (F/[(1, 1)]).quotient_hom() * h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2/<[1, 1]>
[0, 0]])
z#sm must be a submodule of codomain r;   )r   r<   r   rD   r8   r*   s   &&r   Úquotient_codomainÚ$ModuleHomomorphism.quotient_codomainð   sU   € ð> �}‰}×)Ñ)¨"×-Ò-ÝØ $§¤ªrð3ó 4ð 4à�:‰:�<Š<ØˆKØ×&Ñ& rÓ*Ð*r   c                ó   € \         h)zApply ``self`` to ``elem``.r"   ©r   Úelems   &&r   Ú_applyÚModuleHomomorphism._apply  r%   r   c                óˆ   € V P                   P                  V P                  V P                  P                  V4      4      4      # ©N)r   ÚconvertrM   r   rK   s   &&r   Ú__call__ÚModuleHomomorphism.__call__  s/   € Ø�}‰}×$Ñ$ T§[¡[°·±×1DÑ1DÀTÓ1JÓ%KÓLÐLr   c                ó   € \         h)zá
Compose ``self`` with ``oth``, that is, return the homomorphism
obtained by first applying then ``self``, then ``oth``.

(This method is private since in this syntax, it is non-obvious which
homomorphism is executed first.)
r"   ©r   Úoths   &&r   Ú_composeÚModuleHomomorphism._compose  s
   € ô "Ð!r   c                ó   € \         h)z8Scalar multiplication. ``c`` is guaranteed in self.ring.r"   )r   Úcs   &&r   Ú_mul_scalarÚModuleHomomorphism._mul_scalar'  r%   r   c                ó   € \         h)z^
Homomorphism addition.
``oth`` is guaranteed to be a homomorphism with same domain/codomain.
r"   rU   s   &&r   Ú_addÚModuleHomomorphism._add+  s
   € ô
 "Ð!r   c                ó¦   € \        V\        4      '       g   R# VP                  V P                  8H  ;'       d    VP                  V P                  8H  # )zEHelper to check that oth is a homomorphism with same domain/codomain.F)r   r	   r   r   rU   s   &&r   Ú
_check_homÚModuleHomomorphism._check_hom2  s;   € ä˜#Ô1×2Ò2ÙØ�z‰z˜TŸ[™[Ñ(×JÐJ¨S¯\©\¸T¿]¹]Ñ-JÐJr   c                ó
  € \        V\        4      '       d-   V P                  VP                  8X  d   VP	                  V 4      #  V P                  V P                  P                  V4      4      #   \         d
    \        u # i ; irP   )
r   r	   r   r   rW   r[   r   rQ   r   ÚNotImplementedrU   s   &&r   Ú__mul__ÚModuleHomomorphism.__mul__8  sh   € Ü�cÔ-×.Ò.°4·;±;À#Ç,Á,Ô3NØ—<‘< Ó%Ð%ð	"Ø×#Ñ# D§I¡I×$5Ñ$5°cÓ$:Ó;Ð;øÜô 	"Ü!Ò!ð	"ús   Á)A. Á.BÂBc                ó”   €  V P                  ^V P                  P                  V4      ,          4      #   \         d
    \        u # i ; i)é   )r[   r   rQ   r   rd   rU   s   &&r   Ú__truediv__ÚModuleHomomorphism.__truediv__C  sA   € ð	"Ø×#Ñ# A d§i¡i×&7Ñ&7¸Ó&<Õ$<Ó=Ð=øÜô 	"Ü!Ò!ð	"ús   ‚03 ³AÁAc                ó^   € V P                  V4      '       d   V P                  V4      # \        # rP   )ra   r^   rd   rU   s   &&r   Ú__add__ÚModuleHomomorphism.__add__I  s%   € Ø�?‰?˜3×ÒØ—9‘9˜S“>Ð!ÜÐr   c                ó®   € V P                  V4      '       d:   V P                  VP                  V P                  P	                  R4      4      4      # \
        # )rh   éÿÿÿÿ)ra   r^   r[   r   rQ   rd   rU   s   &&r   Ú__sub__ÚModuleHomomorphism.__sub__N  s>   € Ø�?‰?˜3×ÒØ—9‘9˜SŸ_™_¨T¯Y©Y×->Ñ->¸rÓ-BÓCÓDÐDÜÐr   c                ó>   € V P                  4       P                  4       # )aŸ  
Return True if ``self`` is injective.

That is, check if the elements of the domain are mapped to the same
codomain element.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h.is_injective()
False
>>> h.quotient_domain(h.kernel()).is_injective()
True
)r   rD   r   s   &r   Úis_injectiveÚModuleHomomorphism.is_injectiveS  s   € ð* �{‰{‹}×$Ñ$Ó&Ð&r   c                ó<   € V P                  4       V P                  8H  # )a˜  
Return True if ``self`` is surjective.

That is, check if every element of the codomain has at least one
preimage.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h.is_surjective()
False
>>> h.restrict_codomain(h.image()).is_surjective()
True
)r   r   r   s   &r   Úis_surjectiveÚ ModuleHomomorphism.is_surjectivej  s   € ð* �z‰z‹|˜tŸ}™}Ñ,Ð,r   c                óR   € V P                  4       ;'       d    V P                  4       # )aþ  
Return True if ``self`` is an isomorphism.

That is, check if every element of the codomain has precisely one
preimage. Equivalently, ``self`` is both injective and surjective.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h = h.restrict_codomain(h.image())
>>> h.is_isomorphism()
False
>>> h.quotient_domain(h.kernel()).is_isomorphism()
True
)rs   rv   r   s   &r   Úis_isomorphismÚ!ModuleHomomorphism.is_isomorphism�  s$   € ð, × Ñ Ó"×;Ð; t×'9Ñ'9Ó';Ð;r   c                ó>   € V P                  4       P                  4       # )aÆ  
Return True if ``self`` is a zero morphism.

That is, check if every element of the domain is mapped to zero
under self.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h.is_zero()
False
>>> h.restrict_domain(F.submodule()).is_zero()
True
>>> h.quotient_codomain(h.image()).is_zero()
True
)r   rD   r   s   &r   rD   ÚModuleHomomorphism.is_zero™  s   € ð. �z‰z‹|×#Ñ#Ó%Ð%r   c                óT   €  W,
          P                  4       #   \         d     R # i ; i)F)rD   r   rU   s   &&r   Ú__eq__ÚModuleHomomorphism.__eq__²  s*   € ð	Ø•J×'Ñ'Ó)Ð)øÜô 	Úð	ús   ‚ ˜'¦'c                ó   € W8X  * # rP   © rU   s   &&r   Ú__ne__ÚModuleHomomorphism.__ne__¸  s   € ØÒ Ð r   )r   r   r   r   r   N)%Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r   r   r,   r0   r4   r8   r=   rA   rE   rH   rM   rR   rW   r[   r^   ra   re   Ú__rmul__ri   rl   rp   rs   rv   ry   rD   r~   r‚   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r	   r	      s­   ø‡ € ñ#òJòò,ò,"ò"ò"ò"ò"ò"ò%)òN+ò@)ò>$+òL"òMò"ò"ò"òKò"ð €Hò"òò
ò
'ò.-ò.<ò0&ò2÷!ð !r   r	   c                   ó`   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )ÚMatrixHomomorphismi¼  a�  
Helper class for all homomoprhisms which are expressed via a matrix.

That is, for such homomorphisms ``domain`` is contained in a module
generated by finitely many elements `e_1, \ldots, e_n`, so that the
homomorphism is determined uniquely by its action on the `e_i`. It
can thus be represented as a vector of elements of the codomain module,
or potentially a supermodule of the codomain module
(and hence conventionally as a matrix, if there is a similar interpretation
for elements of the codomain module).

Note that this class does *not* assume that the `e_i` freely generate a
submodule, nor that ``domain`` is even all of this submodule. It exists
only to unify the interface.

Do not instantiate.

Attributes:

- matrix - the list of images determining the homomorphism.
NOTE: the elements of matrix belong to either self.codomain or
      self.codomain.container

Still non-implemented methods:

- kernel
- _apply
c                óè  a€ \         P                  WV4       \        V4      VP                  8w  d'   \	        R VP                  : R\        V4      : 24      hV P
                  P                  o\        V P
                  \        \        34      '       d!   V P
                  P                  P                  o\        ;QJ d    . V3R lV 4       F  NK  	  5V n        R# ! V3R lV 4       4      V n        R# )zNeed to provide z elements, got c              3   ó4   <"  € T F  pS! V4      x € K  	  R # 5irP   r�   )Ú.0ÚxÚ	converters   & €r   Ú	<genexpr>Ú.MatrixHomomorphism.__init__.<locals>.<genexpr>ã  s   øé € Ð9±&¨Q™I aŸL˜L³&ùs   ƒN)r	   r   ÚlenÚrankr   r   rQ   r   r   r   Ú	containerÚtupleÚmatrix)r   r   r   r›   r”   s   &&&&@r   r   ÚMatrixHomomorphism.__init__Ú  s£   ø€ Ü×#Ñ# D°(Ô;Üˆv‹;˜&Ÿ+™+Ô%ÝØ &§¤¬S°­[ð:ó ;ð ;ð —M‘M×)Ñ)ˆ	Ü�d—m‘m¤iÔ1BÐ%C×DÒDØŸ™×/Ñ/×7Ñ7ˆIß”eÔ9±&Ó9—eˆŽ�eÔ9±&Ó9Ó9ˆŽr   c                ó2  € ^ RI Hp R p\        V P                  \        \
        34      '       d   R pT! V P                   UUu. uF2  q2! V4       Uu. uF  q@P                  P                  V4      NK  	  upNK4  	  upp4      P                  # u upi u uppi )z=Helper function which returns a SymPy matrix ``self.matrix``.)ÚMatrixc                 ó   € V # rP   r�   ©r“   s   &r   Ú<lambda>Ú2MatrixHomomorphism._sympy_matrix.<locals>.<lambda>è  s   € ‘ar   c                 ó   € V P                   # rP   )Údatar    s   &r   r¡   r¢   ê  s   € ˜!Ÿ&š&r   )
Úsympy.matricesrž   r   r   r   r   r›   r   Úto_sympyÚT)r   rž   rZ   r“   Úys   &    r   Ú_sympy_matrixÚ MatrixHomomorphism._sympy_matrixå  sp   € å)ÙˆÜ�d—m‘m¤nÔ6GÐ%H×IÒIÙ ˆAÙÀdÇkÂkÔRÁkÀ°q¸´tÓ<±t°!Ÿ	™	×*Ñ*¨1Ö-±tÔ<ÁkÒRÓS×UÑUÐUùÒ<ùÓRs   ÁB
Á#BÁ5B
ÂB
c                óä  € \        V P                  4       4      P                  R 4      pRV P                  : RV P                  : 2pR\        V4      ,          p\        V4      p\        V^,          4       F  pW;;,          V,          uu&   K  	  W^,          ;;,          V,          uu&   \        V^,          ^,           V4       F  pW;;,          V,          uu&   K  	  R P                  V4      # )Ú
z : z -> Ú )Úreprr©   Úsplitr   r   r—   ÚrangeÚjoin)r   ÚlinesÚtÚsÚnÚis   &     r   Ú__repr__ÚMatrixHomomorphism.__repr__í  s¨   € Ü�T×'Ñ'Ó)Ó*×0Ñ0°Ó6‰Ø!Ÿ[œ[¨$¯-«-Ð8ˆØ”�A“�JˆÜ�‹JˆÜ�q˜A•v–ˆAØ�H˜�M�Hñ à�1�f�˜Õ‹Ü�q˜!•t˜a•x Ö#ˆAØ�H˜�M�Hñ $à�y‰y˜ÓÐr   c                óB   € \        WP                  V P                  4      # r)   )ÚSubModuleHomomorphismr   r›   r*   s   &&r   r,   Ú#MatrixHomomorphism._restrict_domainù  s   € ä$ R¯©¸¿¹ÓDÐDr   c                óN   € V P                  V P                  WP                  4      # r/   )Ú	__class__r   r›   r*   s   &&r   r0   Ú%MatrixHomomorphism._restrict_codomainý  s   € à�~‰~˜dŸk™k¨2¯{©{Ó;Ð;r   c                ór   € V P                  V P                  V,          V P                  V P                  4      # r3   ©r½   r   r   r›   r*   s   &&r   r4   Ú#MatrixHomomorphism._quotient_domain  s%   € à�~‰~˜dŸk™k¨"�n¨d¯m©m¸T¿[¹[ÓIÐIr   c           
     óP  € V P                   V,          pVP                  p\        V P                   \        4      '       d   VP                  P                  pT P                  V P                  V P                   V,          V P                   Uu. uF
  qC! V4      NK  	  up4      # u upi r7   )r   rQ   r   r   r™   r½   r   r›   )r   r+   ÚQr”   r“   s   &&   r   r8   Ú%MatrixHomomorphism._quotient_codomain  sx   € à�M‰M˜"ÕˆØ—I‘Iˆ	Ü�d—m‘m¤Y×/Ò/ØŸ™×+Ñ+ˆIØ�~‰~˜dŸk™k¨4¯=©=¸Õ+;Ø#'§;¢;Ó/¡;˜aˆY�qŽ\¡;Ñ/ó1ð 	1ùÚ/s   ÂB#c           
     óÌ   € T P                  V P                  V P                  \        V P                  VP                  4       UUu. uF  w  r#W#,           NK  	  upp4      # u uppi rP   )r½   r   r   Úzipr›   )r   rV   r“   r¨   s   &&  r   r^   ÚMatrixHomomorphism._add  sM   € Ø�~‰~˜dŸk™k¨4¯=©=Ü14°T·[±[À#Ç*Á*Ô1MÔNÑ1M©¨˜qŸu˜uÑ1MÒNóPð 	PùÛNs   ÁA c           	     óš   € T P                  V P                  V P                  V P                   Uu. uF  q!V,          NK  	  up4      # u upi rP   rÀ   )r   rZ   r“   s   && r   r[   ÚMatrixHomomorphism._mul_scalar  s7   € Ø�~‰~˜dŸk™k¨4¯=©=ÈÏÊÓ:TÉÀ1¸Q¿3¸3ÉÑ:TÓUÐUùÒ:Ts   °Ac           
     ó˜   € T P                  V P                  VP                  V P                   Uu. uF
  q!! V4      NK  	  up4      # u upi rP   rÀ   )r   rV   r“   s   && r   rW   ÚMatrixHomomorphism._compose  s7   € Ø�~‰~˜dŸk™k¨3¯<©<È$Ï+Ê+Ó9VÉ+ÀQ¸#¸a¾&É+Ñ9VÓWÐWùÒ9Vs   °A)r›   N)r„   r…   r†   r‡   rˆ   r   r©   r·   r,   r0   r4   r8   r^   r[   rW   rŠ   r‹   rŒ   s   @r   r�   r�   ¼  sH   ø‡ € ñò:	:òVò
 òEò<òJò1òPòV÷Xð Xr   r�   c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )ÚFreeModuleHomomorphismi  a¼  
Concrete class for homomorphisms with domain a free module or a quotient
thereof.

Do not instantiate; the constructor does not check that your data is well
defined. Use the ``homomorphism`` function instead:

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> F = QQ.old_poly_ring(x).free_module(2)
>>> homomorphism(F, F, [[1, 0], [0, 1]])
Matrix([
[1, 0], : QQ[x]**2 -> QQ[x]**2
[0, 1]])
c                ó¤   € \        V P                  \        4      '       d   VP                  p\	        R  \        WP                  4       4       4      # )c              3   ó6   "  € T F  w  rW,          x € K  	  R # 5irP   r�   ©r’   r“   Úes   &  r   r•   Ú0FreeModuleHomomorphism._apply.<locals>.<genexpr>/  ó   é € Ð<Ñ%;™T˜Q�1—5’5Ó%;ùó   ‚)r   r   r   r¤   ÚsumrÆ   r›   rK   s   &&r   rM   ÚFreeModuleHomomorphism._apply,  s6   € Ü�d—k‘k¤>×2Ò2Ø—9‘9ˆDÜÑ<¤S¨¯{©{Ô%;Ó<Ó<Ð<r   c                óJ   € V P                   P                  ! V P                  !  # rP   )r   Ú	submoduler›   r   s   &r   r   ÚFreeModuleHomomorphism._image1  s   € Ø�}‰}×&Ò&¨¯©Ñ4Ð4r   c                ó†   € V P                  4       P                  4       pV P                  P                  ! VP                  !  # rP   )r   Úsyzygy_moduler   rØ   Úgens)r   Úsyzs   & r   r   ÚFreeModuleHomomorphism._kernel4  s1   € ð �j‰j‹l×(Ñ(Ó*ˆØ�{‰{×$Ò$ c§h¡hÑ/Ð/r   r�   N©
r„   r…   r†   r‡   rˆ   rM   r   r   rŠ   r‹   rŒ   s   @r   rÍ   rÍ     s   ø‡ € ñò$=ò
5÷0ð 0r   rÍ   c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )rº   i>  aÜ  
Concrete class for homomorphism with domain a submodule of a free module
or a quotient thereof.

Do not instantiate; the constructor does not check that your data is well
defined. Use the ``homomorphism`` function instead:

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> M = QQ.old_poly_ring(x).free_module(2)*x
>>> homomorphism(M, M, [[1, 0], [0, 1]])
Matrix([
[1, 0], : <[x, 0], [0, x]> -> <[x, 0], [0, x]>
[0, 1]])
c                ó¤   € \        V P                  \        4      '       d   VP                  p\	        R  \        WP                  4       4       4      # )c              3   ó6   "  € T F  w  rW,          x € K  	  R # 5irP   r�   rÐ   s   &  r   r•   Ú/SubModuleHomomorphism._apply.<locals>.<genexpr>T  rÓ   rÔ   )r   r   r   r¤   rÕ   rÆ   r›   rK   s   &&r   rM   ÚSubModuleHomomorphism._applyQ  s7   € Ü�d—k‘kÔ#4×5Ò5Ø—9‘9ˆDÜÑ<¤S¨¯{©{Ô%;Ó<Ó<Ð<r   c                ó’   € V P                   P                  ! V P                  P                   Uu. uF
  q! V4      NK  	  up!  # u upi rP   )r   rØ   r   rÜ   )r   r“   s   & r   r   ÚSubModuleHomomorphism._imageV  s9   € Ø�}‰}×&Ò&¸$¿+¹+×:JÒ:JÓ(KÑ:J°Q¨¨a®Ñ:JÑ(KÑLÐLùÒ(Ks   ¯Ac                ó
  € V P                  4       P                  4       pV P                  P                  ! VP                   Uu. uF2  p\        R  \        W P                  P                  4       4       4      NK4  	  up!  # u upi )c              3   ó6   "  € T F  w  rW,          x € K  	  R # 5irP   r�   )r’   ÚxiÚgis   &  r   r•   Ú0SubModuleHomomorphism._kernel.<locals>.<genexpr>\  s   é € Ð?Ñ&>™F˜B�"—%’%Ó&>ùrÔ   )r   rÛ   r   rØ   rÜ   rÕ   rÆ   )r   rÝ   r´   s   &  r   r   ÚSubModuleHomomorphism._kernelY  sk   € Ø�j‰j‹l×(Ñ(Ó*ˆØ�{‰{×$Ò$à—x’xó!Ù�!ô Ñ?¤c¨!¯[©[×-=Ñ-=Ô&>Ó?Ö?Ùñ!ñ"ð 	"ùò!s   Á8B r�   Nrß   rŒ   s   @r   rº   rº   >  s   ø‡ € ñò$=ò
M÷"ð "r   rº   c           
     óø   € R pV! V 4      w  rErgV! V4      w  r‰r«\        YHV Uu. uF
  qË! V4      NK  	  up4      P                  V4      P                  V	4      P                  V
4      P	                  V4      # u upi )a‚  
Create a homomorphism object.

This function tries to build a homomorphism from ``domain`` to ``codomain``
via the matrix ``matrix``.

Examples
========

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism

>>> R = QQ.old_poly_ring(x)
>>> T = R.free_module(2)

If ``domain`` is a free module generated by `e_1, \ldots, e_n`, then
``matrix`` should be an n-element iterable `(b_1, \ldots, b_n)` where
the `b_i` are elements of ``codomain``. The constructed homomorphism is the
unique homomorphism sending `e_i` to `b_i`.

>>> F = R.free_module(2)
>>> h = homomorphism(F, T, [[1, x], [x**2, 0]])
>>> h
Matrix([
[1, x**2], : QQ[x]**2 -> QQ[x]**2
[x,    0]])
>>> h([1, 0])
[1, x]
>>> h([0, 1])
[x**2, 0]
>>> h([1, 1])
[x**2 + 1, x]

If ``domain`` is a submodule of a free module, them ``matrix`` determines
a homomoprhism from the containing free module to ``codomain``, and the
homomorphism returned is obtained by restriction to ``domain``.

>>> S = F.submodule([1, 0], [0, x])
>>> homomorphism(S, T, [[1, x], [x**2, 0]])
Matrix([
[1, x**2], : <[1, 0], [0, x]> -> QQ[x]**2
[x,    0]])

If ``domain`` is a (sub)quotient `N/K`, then ``matrix`` determines a
homomorphism from `N` to ``codomain``. If the kernel contains `K`, this
homomorphism descends to ``domain`` and is returned; otherwise an exception
is raised.

>>> homomorphism(S/[(1, 0)], T, [0, [x**2, 0]])
Matrix([
[0, x**2], : <[1, 0] + <[1, 0]>, [0, x] + <[1, 0]>, [1, 0] + <[1, 0]>> -> QQ[x]**2
[0,    0]])
>>> homomorphism(S/[(0, x)], T, [0, [x**2, 0]])
Traceback (most recent call last):
...
ValueError: kernel <[1, 0], [0, 0]> must contain sm, got <[0,x]>

c                ó°  a € \        S \        4      '       d   S S S P                  4       V 3R l3# \        S \        4      '       d)   S P                  S P                  S P
                  V 3R l3# \        S \        4      '       d3   S P                  P                  S P                  S P
                  V 3R l3# S P                  S S P                  4       V 3R l3# )z¾
Return a tuple ``(F, S, Q, c)`` where ``F`` is a free module, ``S`` is a
submodule of ``F``, and ``Q`` a submodule of ``S``, such that
``module = S/Q``, and ``c`` is a conversion function.
c                 ó&   <€ SP                  V 4      # rP   )rQ   ©r“   Úmodules   &€r   r¡   Ú0homomorphism.<locals>.freepres.<locals>.<lambda>£  s   ø€ ÀÇÁÐPQÔARr   c                 ó:   <€ SP                  V 4      P                  # rP   )rQ   r¤   rð   s   &€r   r¡   rò   ¦  s   ø€ ˜fŸn™n¨QÓ/×4Ò4r   c                 óN   <€ SP                   P                  V 4      P                  # rP   )r™   rQ   r¤   rð   s   &€r   r¡   rò   ©  s   ø€ ˜f×.Ñ.×6Ñ6°qÓ9×>Ò>r   c                 ó:   <€ SP                   P                  V 4      # rP   )r™   rQ   rð   s   &€r   r¡   rò   ¬  s   ø€ ˜&×*Ñ*×2Ñ2°1Ô5r   )r   r   rØ   r   ÚbaseÚkilled_moduler   r™   )rñ   s   fr   ÚfreepresÚhomomorphism.<locals>.freepresœ  s·   ø€ ô �fœj×)Ò)Ø˜6 6×#3Ñ#3Ó#5Ô7RÐRÐRÜ�fœn×-Ò-Ø—K‘K §¡¨f×.BÑ.BÜ4ð6ð 6ä�fÔ/×0Ò0Ø—K‘K×)Ñ)¨6¯;©;¸×8LÑ8LÜ>ð@ð @ð × Ñ  &¨&×*:Ñ*:Ó*<Ü5ð7ð 	7r   )rÍ   r=   rA   rH   rE   )r   r   r›   rø   ÚSFÚSSÚSQÚ_ÚTFÚTSÚTQrZ   r“   s   &&&          r   Úhomomorphismr  `  sx   € òx7ñ$ ˜VÓ$�M€BˆBÙ˜XÓ&�M€BˆBä! "¹Ó*@¹°A¨1¨Q®4¹Ñ*@ó ß‰?˜2Ó×0Ñ0°ó  ßÑ˜RÓ §¡°Ó!4ð5ùÒ*@s   ¤A7N)rˆ   Úsympy.polys.agca.modulesr   r   r   r   r   Úsympy.polys.polyerrorsr   r	   r�   rÍ   rº   r  r�   r   r   Ú<module>r     sX   ðñ÷"õ "å 1÷g!ñ g!ôTZXÐ+ô ZXôz"0Ð/ô "0ôJ"Ð.ô "ôDS5r   