On Friday, June 15, 2018 at 2:36:55 AM UTC-7, Travis Scrimshaw wrote: > > Hey John, > > Okay, so how do I define a new category in Sage? There is some magic >> happening somewhere in the category stuff, and I don't know where it's >> documented. >> > >> I am in particular interested in creating two categories: >> >> - GradedCommutativeAlgebras >> - GradedCommutativeAlgebrasWithBasis >> >> (and then perhaps similarly for coalgebras and Hopf algebras). >> > > Yes, there is some magic going on in order to remove some boilerplate type > stuff (in this case, defining the base category). In part, because you are > doing a functorial construction, things are a little more complicated. > Actually, you will probably want to use the super modules/algebras as your > reference, maybe even as your base category. This probably has some of the > functionality you want and supercommutative algebras will benefit as well. > > Another question: is the categories primer still accurate? It says ( >> http://doc.sagemath.org/html/en/reference/categories/sage/categories/primer.html#writing-a-new-category >> >> <http://www.google.com/url?q=http%3A%2F%2Fdoc.sagemath.org%2Fhtml%2Fen%2Freference%2Fcategories%2Fsage%2Fcategories%2Fprimer.html%23writing-a-new-category&sa=D&sntz=1&usg=AFQjCNGnvXjlXmpV-Jc6ufZDEsGYPrPTxw>) >> >> that when defining new categories, you have to provide a method >> C.super_categories(), but many constructions in the categories directory >> (like graded_algebras_with_basis.py) do not explicitly do this. >> > > Yes, it is still implicitly accurate, but the necessity is only about > constructing a simple category. If you use an axiom or functorial > construction, then these provide a generic super_categories() by magic. > > Best, > Travis > > That leads me (or brings me back) to these questions: what is the magic that is going on, is it documented, and if so, where? If not, there must be a ticket for writing category documentation, right?
If I look at super_algebras.py, for example, I see class SuperAlgebras(SuperModulesCategory): and not much else. I don't see a lot more in super_modules.SuperModulesCategory. How is this "doing a functorial construction," as you put it? -- John -- 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 sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.