Hi Christian,

On 22 Mai, 11:37, Christian Nassau <nas...@nullhomotopie.de> wrote:
> (I did notice that there already is a category for graded modules, but
> it seems to be largely empty. I suppose that framework is still in the
> making.)

It depends on what you want to do with the categories.

Perhaps you are already happy if you have a container for all graded
modules? Then, having an "empty" category (meaning: there is almost no
special code) is just fine.

The existing code mainly declares

    @cached_method
    def super_categories(self):
        """
        EXAMPLES::

            sage: GradedModules(QQ).super_categories()
            [Category of vector spaces over Rational Field]
            sage: GradedModules(ZZ).super_categories()
            [Category of modules over Integer Ring]
        """
        R = self.base_ring()
        return [Modules(R)]

That is already enough to ensure that all objects in GradedModules(QQ)
inherit methods such as sum, zero_element, cartesian_product.

Of course, it could easily be beefed up, say, by adding an abstract
element method "degree". Then, if you have an object that is declared
to belong to GradedModules(QQ), running the test suite would complain
if you forgot to implement "degree" for its elements.

Or you could add some parent method (say, "degree_n_part") that
provides actual code, based on the "degree" method of elements. Hence,
if you use the category, you would only need to implement "degree"
yourself, but then "degree_n_part" would already work.

If you have a method that is written in a way that does not depend on
implementation details and makes sense for *all* objects of a category
or elements of such objects, then I think it would be a good  idea to
implement it in sage/categories/...

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

Reply via email to