Hi Nicolas!
Thanks for taking time!
>
> So far all our morphisms have indeed been functions between sets; so
> it's well possible that Homset/Morphism have not yet been shaken
> enough to be usable in a higher generality.
>
> How strong is the above assumption? I mean, if you implement a stub
> _call_ method, does it actually get called if you don't explicitly
> use the morphism as a function?
>
>
Unfortunately, I don't even get that far, since it appears that
even Map wants parents... although, I am quite sure that I'm
doing something wrong and I shouldn't run into this problem at
all. An example of a (hopefully simple) category very cleanly
implemented in sage (with objects and morphisms) would be really
helpful. Let's try:
Let Cat be my category, Obj be my objects, Mor be my morphisms:
Obj = set of collections in FindStat
= {"Dyckwords", "Permutations", "IntegerPartitions", "Graphs", ...}
(they are really only labels, i.e., strings)
Mor = set of maps between collections in FindStat
= {"components": "Graphs" -> "IntegerPartitions", ...}
So, what should be my classes? I thought, I'd have:
class FindStatCollections(Parent, UniqueRepresentation)
as a container for the set of objects Obj,
class FindStatCollection(Element)
for the objects Obj themselves and
class FindStatMap(???)
for the morphisms. A nonworking example is on
http://trac.sagemath.org/ticket/17818. Please keep in mind that
what's there is really hacked together from other classes in the
sage codebase (in particular, PerfectMatchings and
AlternatingSignMatrices.)
In the nonworking example, I also have yet another class
FindStatMaps serving as a parent for *all* morphisms. But I
don't really need *this* specific setup. I "only" want to do
it "properly" and as simple as possible. It would be nice to be
able to
1) list all the collections
2) list all the maps and/or all maps between two collections
3) formally compose maps, if domain and codomain fit together.
What's really hard to understand for me is the relationship
between Elements and Parents and, say, CategoryObject. It would
seem more natural, if I had only three classes:
FindStatCollectionsWithMaps for the category
FindStatCollection for each object
FindStatMap for each map.
But it seems that this is not how things work, right?
Martin
--
You received this message because you are subscribed to the Google Groups
"sage-devel" 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-devel.
For more options, visit https://groups.google.com/d/optout.