Hi Robert, On 28 Dez., 01:27, Robert Bradshaw <rober...@math.washington.edu> wrote: > ... You're working on > moving modules over to the new coercion framework, right?
Yes. > > But how does one > > define an action? I guess that one is supposed to use > > sage.categories.action, but so far it has no example at all. > > http://hg.sagemath.org/sage-main/file/120c07be6358/sage/matrix/action... > is the most comprehensive example to date. Yes, I had looked at that example when I tried to understand how matrix action works. However, I couldn't see how it relates with functors, since it seems to me that it overrides all "typical" methods of functors. > > How are these two definitions related? > > Consider the category with a single object whose morphisms are the > element of G. Then the functor send the elements of G to morphisms in > Sets. That makes sense, but it does neither match the code nor the documentation. sage.categories.action.Action.__init__ is {{{ def __init__(self, G, S, bint is_left = 1, op=None): from groupoid import Groupoid Functor.__init__(self, Groupoid(G), S.category()) self.G = G self.S = S self._is_left = is_left self.op = op }}} and sage.categories.action.__doc__ states "A group action G x S rightarrow S is a functor from G to Sets." According to your post, it should be "A group action G x S rightarrow S is a functor from G (considered as a category) to the category of Morphisms of Sets", and in the code it should be Functor.__init__(self, Groupoid(G), S.category().hom_category()). Moreover, sage.matrix.action.MatrixMatrixAction is implemented by a _call_ method that has the signature cpdef Element _call_(self, g, s) Hence, essentially it is a map (not a functor) from GxS to S -- so, the implementation uses the category-free definition of an action, but pretends to be categorical. One crucial question is, IMO: Would it really be wise to use a categorical approach towards actions? Using the categorical definition would mean: To any given element g of G, create a morphism from S to S (very slow!), and apply it to a given element s of S. I guess caching the morphism from S to S would not really be a solution. So, the current approach to think of an action as a map from GxS to S probably yields a better implementation (speed- wise). But then, the question is what one should do with sage.categories.action? Should it be overhauled so that it really matches the categorical definition, just for completeness, even though it would not be used in Sage? Should there also be an "official" new framework for the non- categorical version of an action, say, in sage.structure.action? Then, actions that currently tacitly use the non-categorical definition (like MatrixMatrixAction) could finally be "officially non- categorical"? Cheers, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org