Define Category(Objects, Maps, Composition, Identity maps)
a. Objects
1. Category of sets
2. Category of sets with endomap
b. Maps
c. Composition
d. Identity maps

from sympy.categories import (Object, Morphism, 
IdentityMorphism,NamedMorphism, CompositeMorphism,Diagram, 
Category,DiagramGrid, XypicDiagramDrawer, xypic_draw_diagram)
from sympy.categories.diagram_drawing import _GrowableGrid, 
ArrowStringDescription
from sympy.categories.baseclasses import Class
from sympy.utilities.pytest import XFAIL, raises
from sympy import FiniteSet, EmptySet, Dict, Tuple
A = Object("A")
B = Object("B")
C = Object("C")
D = Object("D")
E = Object("E")
id_C = IdentityMorphism(C)
id_E= IdentityMorphism(E)
f = NamedMorphism(A, B, "f")
g = NamedMorphism(B, C, "g")
h = NamedMorphism(C, id_C, "g")
f2 = NamedMorphism(D, E, "f2")
g2 = NamedMorphism(E, id_E, "g2")
d1 = Diagram([f, g,h])
d2 = Diagram([f2, g2])
objects = d1.objects | d2.objects
K = Category("K", objects, commutative_diagrams=[d1, d2])
K.name == "K"
K.objects == Class(objects)
K.commutative_diagrams == FiniteSet(d1, d2)

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to