#17000: how to use SetMorphism?
--------------------------+---------------------------------------
   Reporter:  elixyre     |            Owner:
       Type:  defect      |           Status:  new
   Priority:  major       |        Milestone:  sage-6.4
  Component:  categories  |         Keywords:  morphism
  Merged in:              |          Authors:  Jean-Baptiste Priez
  Reviewers:              |  Report Upstream:  N/A
Work issues:              |           Branch:
     Commit:              |     Dependencies:
   Stopgaps:              |
--------------------------+---------------------------------------
 Hello every one,

 I want create set bijections in sage...

 {{{
 sage: U = Set({'a', 'b', 'c', 'd'})
 sage: V = Set({1,2,3,4})
 sage: from sage.categories.morphism import SetMorphism
 sage: bij = SetMorphism(
 ....:   Hom(U, V, Sets()),
 ....:   lambda l: {'a':1, 'b':2, 'c':3, 'd':4}[l]
 ....: )
 sage: bij('a')
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-4-c2a304e84b3a> in <module>()
 ----> 1 bij('a')

 /Users/elix/sage/newinst/cha/local/lib/python2.7/site-
 packages/sage/categories/map.so in sage.categories.map.Map.__call__
 (sage/categories/map.c:5346)()

 TypeError: a fails to convert into the map's domain {'a', 'c', 'b', 'd'},
 but a `pushforward` method is not properly implemented
 }}}

 How to do this.?

--
Ticket URL: <http://trac.sagemath.org/ticket/17000>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to