Ticket #11600: trac_11600-alias-for-morphism-lift.patch

File trac_11600-alias-for-morphism-lift.patch, 1.7 KB (added by rbeezer, 10 years ago)
  • sage/modules/free_module_morphism.py

    # HG changeset patch
    # User Rob Beezer <beezer@ups.edu>
    # Date 1310684906 25200
    # Node ID 4d50cbf8e9a32deb8fc3046991c8ae229ff79188
    # Parent  4ad86990d7215498658440de04560aa028dcdeeb
    11600: alias for free module morphism lift
    
    diff --git a/sage/modules/free_module_morphism.py b/sage/modules/free_module_morphism.py
    a b  
    318318    def lift(self, x):
    319319        r"""
    320320        Given an element of the image, return an element of the codomain that maps onto it.
    321        
     321
     322        Note that ``lift`` and ``preimage_representative`` are
     323        equivalent names for this method, with the latter suggesting
     324        that the return value is a coset representative of the domain
     325        modulo the kernel of the morphism.
     326
    322327        EXAMPLE::
    323328
    324329            sage: X = QQ**2
     
    354359            sage: w = W((17, -2, 0))
    355360            sage: f(f.lift(w)) == w
    356361            True
     362
     363        This example illustrates the use of the ``preimage_representative``
     364        as an equivalent name for this method.  ::
     365
     366            sage: V = ZZ^3
     367            sage: W = ZZ^2
     368            sage: w = vector(ZZ, [1,2])
     369            sage: f = V.hom([w, w, w], W)
     370            sage: f.preimage_representative(vector(ZZ, [10, 20]))
     371            (0, 0, 10)
    357372        """
    358373        from free_module_element import vector
    359374        x = self.codomain()(x)
     
    377392            raise ValueError, "element is not in the image"
    378393        assert self(t) == x
    379394        return t
    380        
     395
     396    preimage_representative = lift
     397
    381398    def eigenvalues(self,extend=True):
    382399        r"""
    383400        Returns a list with the eigenvalues of the endomorphism of vector spaces.