#9019: Full doctest coverage for sage.categories.map
--------------------------+-------------------------------------------------
   Reporter:  SimonKing   |       Owner:  nthiery                
       Type:  defect      |      Status:  new                    
   Priority:  major       |   Milestone:  sage-4.4.3             
  Component:  categories  |    Keywords:  doctest map composition
     Author:  Simon King  |    Upstream:  N/A                    
   Reviewer:              |      Merged:                         
Work_issues:              |  
--------------------------+-------------------------------------------------
 Apart from full doctest coverage for sage.categories.map, the patch
 provides the following:

 1. Test for injectivity and surjectivity of {{{MatrixMorphism}}}:
 {{{
 sage: V1 = QQ^2
 sage: V2 = QQ^3
 sage: phi = V1.hom(Matrix([[1,2],[3,4],[5,6]]),V2)
 sage: phi.is_injective()
 True
 sage: phi.is_surjective()
 False
 sage: psi = V2.hom(Matrix([[1,2,3],[4,5,6]]),V1)
 sage: psi.is_injective()
 False
 sage: psi.is_surjective()
 True
 }}}

 2. Composition of a {{{RingHomomorphism_im_gens}}} with another ring
 homomorphism (this used to return a {{{FormalCompositeMap}}}, which is not
 very efficient):
 {{{
 sage: R.<x,y> = QQ[]
 sage: S.<a,b> = QQ[]
 sage: f = R.hom([a+b,a-b])
 sage: g = S.hom(Frac(S))
 sage: g*f
 Ring morphism:
   From: Multivariate Polynomial Ring in x, y over Rational Field
   To:   Fraction Field of Multivariate Polynomial Ring in a, b over
 Rational Field
   Defn: x |--> a + b
         y |--> a - b
 sage: h = S.hom([x+y,x-y])
 sage: h*f
 Ring endomorphism of Multivariate Polynomial Ring in x, y over Rational
 Field
   Defn: x |--> 2*x
         y |--> 2*y
 }}}

 3. Comparison of {{{FormalCompositeMap}}}s:
 {{{
 sage: R.<x,y> = QQ[]
 sage: S.<a,b> = QQ[]
 sage: f = R.hom([a+b,a-b])
 sage: g = S.hom([x+y,x-y])
 sage: from sage.categories.map import FormalCompositeMap
 sage: H = Hom(R,R,Rings())
 sage: m = FormalCompositeMap(H,f,g)
 sage: m == loads(dumps(m))  # this used to be False!
 True
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9019>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to