Hi Jonas, On 2015-11-27, Jonas Jermann <jjerma...@gmail.com> wrote: > It sometimes makes sense to view (homogeneous) elements of a graded > ring as module elements (because operations might be specific to that > module and not to the whole ring). > > On the other hand we still want to be able to multiply those *module* > elements of possibly different homogeneous parts. > > So if we inherit from CommutativeAlgebraElement we get the __mul__ > operation but we can still treat elements as module elements...
That's what I recommend to do. See the thematic tutorial on coercion and categories ("How to create new algebraic structures"). > Or what is the "modern" approach/solution for this? It is possible to do everything based on sage.combinat.free_module.CombinatorialFreeModule. It is a clean mathematical approach (for defining something like a multiplication on a module, it is enough to define what happens on a basis). But it is pure python code and it uses an amazing amount of indirections. So, I would recommend against using it for time-critical applications. And that's part of the motivation for the two tickets that I mentioned before: I want to make it possible to define a multiplication action in some Cython file, and let the categoy framework (written in Python) put the appropriate fast Cython methods into the parent's action cache. Best regards, Simon -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.