> > Okay, now I have > > class SuperCommutativeAlgebrasWithBasis(SuperModulesCategory): > # Imitating topological_space.py: > _base_category_class = (SuperAlgebrasWithBasis,) > > def example(self, alphabet = ('a','b','c')): > from > sage.categories.examples.super_commutative_algebras_with_basis import > Example > return Example(self.base_ring(), alphabet) > > Then I have this problem: > > sage: SCAB = SuperCommutativeAlgebrasWithBasis(QQ) > sage: SCAB.example() > NotImplemented > > Why? >
That is because of this: sage: type(SCAB) <class 'sage.categories.super_algebras_with_basis.SuperAlgebrasWithBasis_with_category'> Now why that is happening, I do not exactly know. It probably has to do with the fact that you do not have a functor construction, e.g., a SuperCommutative attribute linking to this class, in SuperAlgebrasWithBasis. For instance, in Sets(), there is an attribute Topological that links to TopologicalSpaces. There is also a method Topological that calls return "TopologicalSpacesCategory.category_of(self)" in the SubcategoryMethods so all its subcategories can construct the appropriate subcategory, but that is a bit tangential. IMO, proper way to implement this is as a CategoryWithAxiom as a part of SuperAlgebras[WithBasis]. So you add a class "Commutative(CategoryWithAxiom_over_base_ring)" to the SuperAlgebras[WithBasis] category and do the normal category implementation stuff there. > > An implementation question: separately from having a category of super > commutative algebras, I could imagine wanting the option to use a tensor > product of graded algebras which includes a sign in the product: > > (x1 tensor y1) (x2 tensor y2) = (-1)^(deg y1 deg x2) (x1 x2 tensor y1 > y2) > > even if neither tensor factor is itself (graded) commutative. How would > this be implemented? Define a new tensor product? And then somehow label > the category in which the algebra lives to tell it to use that tensor > product? Or define an axiom? (Are axioms worth using? I have run into > problems with inheritance with axioms.) > > This is a bit of a tricky issue. Of course, you could define a new TensorProducts category that implements a product_on_basis with this version (see AlgebrasWithBasis.TensorProducts.ParentMethods). If the tensor product parent was in that category (likely just being a CombinatorialFreeModule), then it should work out of the box. I am not sure this fits the criteria to be an axiom (but they are definitely worth using in the appropriate circumstances). The can of worms comes out when you want a natural way to construct that parent in that category. Plus a good name will be needed, but I guess the natural place would be part of the SuperAlgebras.Commutative.TensorProducts category. Best, Travis -- 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.