sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.47k stars 486 forks source link

Divided power algebras #11979

Open BruceWestbury opened 13 years ago

BruceWestbury commented 13 years ago

The two attached files implement divided power algebra as a graded Hopf algebra and the quantum divided power algebra as a graded algebra. This is related to the ticket #11929 on quasisymmetric functions.

I have read

Walking Through the Development Process

but I am not clear on what the process is for me to submit these two files for review and inclusion in sage.

I would also like to add an algebra homomorphism from symmetric functions to the quantum divided power algebra and would appreciate any pointers.

CC: @tscrim @nthiery

Component: combinatorics

Keywords: divided powers

Author: Bruce Westbury

Branch/Commit: public/combinat/divided_power_alg @ 103a503

Issue created by migration from https://trac.sagemath.org/ticket/11979

BruceWestbury commented 13 years ago

Attachment: dividedpower.py.gz

Attachment: quantumdividedpower.py.gz

jdemeyer commented 13 years ago

Milestone sage-4.7.3 deleted

fchapoton commented 11 years ago
comment:2

here is a patch for the first file. To be continued

fchapoton commented 11 years ago
comment:3

Attachment: trac_11979_divided_power.patch.gz

Here is a patch including both files

fchapoton commented 10 years ago

Commit: f81a422

fchapoton commented 10 years ago
comment:4

Here is a git branch


New commits:

020f6c2trac 11979 divided power algebra and quantum version
f81a422trac #11979 details
fchapoton commented 10 years ago

Branch: u/chapoton/11979

fchapoton commented 10 years ago

Changed author from bruce to Bruce Westbury

darijgr commented 10 years ago

Changed branch from u/chapoton/11979 to public/combinat/divided_power_alg

darijgr commented 10 years ago
comment:7

Minor fixes made. Sorry, not a review. Don't have the time or skills for that (an example should highlight all that one needs to know about the respective categories; I'm not the right person to judge...).

Please note the branch change!


New commits:

e705235Merge branch 'u/chapoton/11979' of trac.sagemath.org:sage into divpow
eda919cminor improvements
darijgr commented 10 years ago

Changed commit from f81a422 to eda919c

rwst commented 10 years ago
comment:9

patchbot:

sage -t --long src/sage/algebras/divided_power_algebra.py  # 1 doctest failed
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

1f8e43fMerge branch 'public/combinat/divided_power_alg' of ssh://trac.sagemath.org:22/sage into 11979
9d056aftrac #11979 doctest correction and small cleanup (pep8)
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from eda919c to 9d056af

fchapoton commented 10 years ago
comment:11

I have corrected the doctest, and also cleaned a little bit (up to pep8 standard).

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from 9d056af to 30a6de5

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

7878c3cMerge branch 'public/combinat/divided_power_alg' of git://trac.sagemath.org/sage into divpow2
30a6de5review patch for divided power algebras
darijgr commented 10 years ago
comment:14

Reviewed the maths. This is a neat piece of example code that would be nice to have in sage, but someone else has to check if this is teaching good coding practices, if it is up to date, and if it isn't missing important parts (I don't see any coercions defined in the code, nor a dedicated element_class).

fchapoton commented 10 years ago
comment:15

Seems to need rebase.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from 30a6de5 to 2bc92ad

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2bc92admerge commit with 6.2.rc1: solve conflict in sage/algebras/all.py by removing the imports of the divided power algebras
darijgr commented 10 years ago
comment:18

Actually these imports that caused the conflicts were probably temporary, made for easier testing. The examples in the doctests all begin with an import instruction, so I suspect these algebras were not supposed to be in the global scope. So I've removed them now. Was this a good idea?

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from 2bc92ad to b68e76b

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

b68e76bfix imports in doctests, and add a tutorial on lazy import into global namespace
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from b68e76b to 103a503

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

103a503fix another doctest
darijgr commented 10 years ago
comment:21

I have gotten rid of all failing doctests, but there is a new one (I think, related to a doctest I added beforehand):

sage -t src/sage/algebras/divided_power_algebra.py
**********************************************************************
File "src/sage/algebras/divided_power_algebra.py", line 171, in sage.algebras.divided_power_algebra.UnivariateDividedPowerAlgebra.product_on_basis
Failed example:
    B = UnivariateDividedPowerAlgebra(Zmod(5)).basis()
Exception raised:
    Traceback (most recent call last):
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 488, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 851, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.algebras.divided_power_algebra.UnivariateDividedPowerAlgebra.product_on_basis[3]>", line 1, in <module>
        B = UnivariateDividedPowerAlgebra(Zmod(Integer(5))).basis()
      File "sage/misc/classcall_metaclass.pyx", line 330, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1176)
      File "sage/misc/cachefunc.pyx", line 1290, in sage.misc.cachefunc.WeakCachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:8031)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/unique_representation.py", line 1021, in __classcall__
        instance = typecall(cls, *args, **options)
      File "sage/misc/classcall_metaclass.pyx", line 518, in sage.misc.classcall_metaclass.typecall (build/cythonized/sage/misc/classcall_metaclass.c:1603)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/algebras/divided_power_algebra.py", line 125, in __init__
        GHWBR = GradedHopfAlgebrasWithBasis(R)
      File "sage/misc/classcall_metaclass.pyx", line 330, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1176)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/graded_modules.py", line 112, in __classcall__
        return base_category_class(category, *args).Graded()
      File "sage/misc/cachefunc.pyx", line 1874, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:11291)
      File "sage/misc/cachefunc.pyx", line 2490, in sage.misc.cachefunc.CachedMethod._instance_call (build/cythonized/sage/misc/cachefunc.c:14055)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/modules.py", line 379, in Graded
        return GradedModulesCategory.category_of(self)
      File "sage/misc/cachefunc.pyx", line 936, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:4969)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.py", line 279, in category_of
        return functor_category(category, *args)
      File "sage/misc/classcall_metaclass.pyx", line 330, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1176)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/graded_modules.py", line 110, in __classcall__
        return super(GradedModulesCategory, cls).__classcall__(cls, category, *args)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 442, in __classcall__
        return super(Category, cls).__classcall__(cls, *args, **options)
      File "sage/misc/cachefunc.pyx", line 1290, in sage.misc.cachefunc.WeakCachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:8031)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/unique_representation.py", line 1021, in __classcall__
        instance = typecall(cls, *args, **options)
      File "sage/misc/classcall_metaclass.pyx", line 518, in sage.misc.classcall_metaclass.typecall (build/cythonized/sage/misc/classcall_metaclass.c:1603)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/graded_modules.py", line 37, in __init__
        super(GradedModulesCategory, self).__init__(base_category, base_category.base_ring())
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.py", line 304, in __init__
        super(FunctorialConstructionCategory, self).__init__(*args)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_types.py", line 485, in __init__
        Category_over_base.__init__(self, base, name)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_types.py", line 243, in __init__
        Category.__init__(self, name)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 473, in __init__
        (self.__class__, self.subcategory_class, ),
      File "sage/misc/lazy_attribute.pyx", line 127, in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 1632, in subcategory_class
        cache=False, picklable=False)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 2793, in _make_named_class
        cache=cache, **options)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 1588, in _make_named_class
        tuple(getattr(cat,name) for cat in self._super_categories_for_classes),
      File "sage/misc/lazy_attribute.pyx", line 127, in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 1029, in _super_categories_for_classes
        self._all_super_categories
      File "sage/misc/lazy_attribute.pyx", line 127, in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 862, in _all_super_categories
        for cat in self._super_categories] +
      File "sage/misc/lazy_attribute.pyx", line 127, in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 1004, in _super_categories
        return sorted(_flatten_categories(self.super_categories(),JoinCategory), key = category_sort_key, reverse=True)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.py", line 347, in super_categories
        return Category.join([self.__class__.default_super_categories(self.base_category(), *self._args)] +
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.py", line 552, in default_super_categories
        return Category.join([category, super(RegressiveCovariantConstructionCategory, cls).default_super_categories(category, *args)])
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.py", line 443, in default_super_categories
        if hasattr(cat, cls._functor_category)])
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 2475, in join
        result = join_as_tuple(cache_key, axioms, ignore_axioms)
      File "sage/categories/category_cy_helper.pyx", line 117, in sage.categories.category_cy_helper.join_as_tuple (build/cythonized/sage/categories/category_cy_helper.c:3145)
      File "sage/categories/category_cy_helper.pyx", line 184, in sage.categories.category_cy_helper.join_as_tuple (build/cythonized/sage/categories/category_cy_helper.c:2425)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 1802, in is_subcategory
        subcat_hook = c._subcategory_hook_(self)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_types.py", line 434, in _subcategory_hook_
        if not issubclass(C.parent_class, self.parent_class):
      File "sage/misc/lazy_attribute.pyx", line 127, in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 1677, in parent_class
        return self._make_named_class('parent_class', 'ParentMethods')
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 2793, in _make_named_class
        cache=cache, **options)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py", line 1590, in _make_named_class
        reduction = reduction, cache = cache)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/dynamic_class.py", line 316, in dynamic_class
        return dynamic_class_internal.f(name, bases, cls, reduction, doccls, prepend_cls_bases)
      File "/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/dynamic_class.py", line 411, in dynamic_class_internal
        return metaclass(name, bases, methods)
    TypeError: Cannot create a consistent method resolution
    order (MRO) for bases Bialgebras.parent_class, CoalgebrasWithBasis.parent_class, Algebras.parent_class
**********************************************************************

I have no buggering idea what is going wrong here, but I've got a hunch that it might be the same issue as #15475.

darijgr commented 10 years ago
comment:22

Here is a minimal counterexample:

darij@travis-virtualbox:~/gitsage$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.4.rc0, Release Date: 2014-10-30                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: from sage.algebras.divided_power_algebra import UnivariateDividedPowerAlgebra
sage: A = UnivariateDividedPowerAlgebra(Zmod(9)); A
The divided power algebra over Ring of integers modulo 9
sage: A = UnivariateDividedPowerAlgebra(Zmod(5)); A
/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py:867: UserWarning: Inconsistent sorting results for all super categories of <class 'sage.categories.hopf_algebras.HopfAlgebras_with_category'>
  self.__class__))
/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py:867: UserWarning: Inconsistent sorting results for all super categories of <class 'sage.categories.hopf_algebras_with_basis.HopfAlgebrasWithBasis'>
  self.__class__))
/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.py:867: UserWarning: Inconsistent sorting results for all super categories of <class 'sage.categories.category.JoinCategory'>
  self.__class__))
Exception TypeError: 'Cannot create a consistent method resolution\norder (MRO) for bases Bialgebras.parent_class, Algebras.parent_class, CoalgebrasWithBasis.parent_class' in 'sage.categories.category_cy_helper.is_supercategory_of_done' ignored
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-008c24a8840f> in <module>()
----> 1 A = UnivariateDividedPowerAlgebra(Zmod(Integer(5))); A

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/classcall_metaclass.so in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1176)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/cachefunc.so in sage.misc.cachefunc.WeakCachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:8031)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/unique_representation.pyc in __classcall__(cls, *args, **options)
   1019             True
   1020         """
-> 1021         instance = typecall(cls, *args, **options)
   1022         assert isinstance( instance, cls )
   1023         if instance.__class__.__reduce__ == CachedRepresentation.__reduce__:

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/classcall_metaclass.so in sage.misc.classcall_metaclass.typecall (build/cythonized/sage/misc/classcall_metaclass.c:1603)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/algebras/divided_power_algebra.pyc in __init__(self, R)
    123         if not R in Rings():
    124             raise ValueError('R is not a ring')
--> 125         GHWBR = GradedHopfAlgebrasWithBasis(R)
    126         CombinatorialFreeModule.__init__(self, R, NonNegativeIntegers(),
    127                                          category=GHWBR)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/classcall_metaclass.so in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1176)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/graded_modules.pyc in __classcall__(cls, category, *args)
    110             return super(GradedModulesCategory, cls).__classcall__(cls, category, *args)
    111         else:
--> 112             return base_category_class(category, *args).Graded()
    113 
    114     def _repr_object_names(self):

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/cachefunc.so in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:11291)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/cachefunc.so in sage.misc.cachefunc.CachedMethod._instance_call (build/cythonized/sage/misc/cachefunc.c:14055)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/modules.pyc in Graded(self, base_ring)
    377             assert base_ring is None or base_ring is self.base_ring()
    378             from sage.categories.graded_modules import GradedModulesCategory
--> 379             return GradedModulesCategory.category_of(self)
    380 
    381         @cached_method

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/cachefunc.so in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:4969)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.pyc in category_of(cls, category, *args)
    277         functor_category = getattr(category.__class__, cls._functor_category)
    278         if isinstance(functor_category, type) and issubclass(functor_category, Category):
--> 279             return functor_category(category, *args)
    280         else:
    281             return cls.default_super_categories(category, *args)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/classcall_metaclass.so in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1176)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/graded_modules.pyc in __classcall__(cls, category, *args)
    108         base_category_class = cls._base_category_class[0]
    109         if isinstance(category, base_category_class):
--> 110             return super(GradedModulesCategory, cls).__classcall__(cls, category, *args)
    111         else:
    112             return base_category_class(category, *args).Graded()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in __classcall__(cls, *args, **options)
    440         if isinstance(cls, DynamicMetaclass):
    441             cls = cls.__base__
--> 442         return super(Category, cls).__classcall__(cls, *args, **options)
    443 
    444     def __init__(self, s=None):

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/cachefunc.so in sage.misc.cachefunc.WeakCachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:8031)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/unique_representation.pyc in __classcall__(cls, *args, **options)
   1019             True
   1020         """
-> 1021         instance = typecall(cls, *args, **options)
   1022         assert isinstance( instance, cls )
   1023         if instance.__class__.__reduce__ == CachedRepresentation.__reduce__:

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/classcall_metaclass.so in sage.misc.classcall_metaclass.typecall (build/cythonized/sage/misc/classcall_metaclass.c:1603)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/graded_modules.pyc in __init__(self, base_category)
     35             Rational Field
     36         """
---> 37         super(GradedModulesCategory, self).__init__(base_category, base_category.base_ring())
     38 
     39     _functor_category = "Graded"

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.pyc in __init__(self, category, *args)
    302         self._base_category = category
    303         self._args = args
--> 304         super(FunctorialConstructionCategory, self).__init__(*args)
    305 
    306     def base_category(self):

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_types.pyc in __init__(self, base, name)
    483                 isinstance(base, Category) and base.is_subcategory(Rings())):
    484             raise ValueError("base must be a ring or a subcategory of Rings()")
--> 485         Category_over_base.__init__(self, base, name)
    486 
    487     def base_ring(self):

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_types.pyc in __init__(self, base, name)
    241         """
    242         self.__base = base
--> 243         Category.__init__(self, name)
    244 
    245     def _test_category_over_bases(self, **options):

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in __init__(self, s)
    471         assert s is None
    472         self.__class__ = dynamic_class("{}_with_category".format(self.__class__.__name__),
--> 473                                        (self.__class__, self.subcategory_class, ),
    474                                        cache = False, reduction = None,
    475                                        doccls=self.__class__)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/lazy_attribute.so in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in subcategory_class(self)
   1630         """
   1631         return self._make_named_class('subcategory_class', 'SubcategoryMethods',
-> 1632                                       cache=False, picklable=False)
   1633 
   1634     @lazy_attribute

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in _make_named_class(self, name, method_provider, cache, **options)
   2791             pass
   2792         result = Category._make_named_class(self, name, method_provider,
-> 2793                                             cache=cache, **options)
   2794         self._make_named_class_cache[key] = result
   2795         return result

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in _make_named_class(self, name, method_provider, cache, picklable)
   1586             reduction = None
   1587         return dynamic_class(class_name,
-> 1588                              tuple(getattr(cat,name) for cat in self._super_categories_for_classes),
   1589                              method_provider_cls, prepend_cls_bases = False, doccls = doccls,
   1590                              reduction = reduction, cache = cache)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/lazy_attribute.so in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in _super_categories_for_classes(self)
   1027             [Category of rngs, Category of semirings]
   1028         """
-> 1029         self._all_super_categories
   1030         return self._super_categories_for_classes
   1031 

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/lazy_attribute.so in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in _all_super_categories(self)
    860         """
    861         (result, bases) = C3_sorted_merge([cat._all_super_categories
--> 862                                            for cat in self._super_categories] +
    863                                           [self._super_categories],
    864                                           category_sort_key)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/lazy_attribute.so in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in _super_categories(self)
   1002             [Category of rngs, Category of semirings]
   1003         """
-> 1004         return sorted(_flatten_categories(self.super_categories(),JoinCategory), key = category_sort_key, reverse=True)
   1005 
   1006     @lazy_attribute

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.pyc in super_categories(self)
    345             [Category of subquotients of semigroups, Category of quotients of sets]
    346         """
--> 347         return Category.join([self.__class__.default_super_categories(self.base_category(), *self._args)] +
    348                              self.extra_super_categories(),
    349                              as_list = True)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.pyc in default_super_categories(cls, category, *args)
    550             Category of unital subquotients of semigroups
    551         """
--> 552         return Category.join([category, super(RegressiveCovariantConstructionCategory, cls).default_super_categories(category, *args)])

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/covariant_functorial_construction.pyc in default_super_categories(cls, category, *args)
    441         return Category.join([getattr(cat, cls._functor_category)(*args)
    442                               for cat in category._super_categories
--> 443                               if hasattr(cat, cls._functor_category)])
    444 
    445     def is_construction_defined_by_base(self):

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in join(categories, as_list, ignore_axioms, axioms)
   2473 
   2474         # Handle axioms
-> 2475         result = join_as_tuple(cache_key, axioms, ignore_axioms)
   2476         if as_list:
   2477             return list(result)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_cy_helper.so in sage.categories.category_cy_helper.join_as_tuple (build/cythonized/sage/categories/category_cy_helper.c:3145)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_cy_helper.so in sage.categories.category_cy_helper.join_as_tuple (build/cythonized/sage/categories/category_cy_helper.c:2425)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in is_subcategory(self, c)
   1800         if c is self:
   1801             return True
-> 1802         subcat_hook = c._subcategory_hook_(self)
   1803         if subcat_hook is Unknown:
   1804             return c in self._set_of_super_categories

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category_types.pyc in _subcategory_hook_(self, C)
    432 
    433         """
--> 434         if not issubclass(C.parent_class, self.parent_class):
    435             return False
    436         if not isinstance(C, Category_over_base):

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/lazy_attribute.so in sage.misc.lazy_attribute._lazy_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:1276)()

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in parent_class(self)
   1675         :class:`sage.categories.category.JoinCategory`.
   1676         """
-> 1677         return self._make_named_class('parent_class', 'ParentMethods')
   1678 
   1679     @lazy_attribute

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in _make_named_class(self, name, method_provider, cache, **options)
   2791             pass
   2792         result = Category._make_named_class(self, name, method_provider,
-> 2793                                             cache=cache, **options)
   2794         self._make_named_class_cache[key] = result
   2795         return result

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/categories/category.pyc in _make_named_class(self, name, method_provider, cache, picklable)
   1588                              tuple(getattr(cat,name) for cat in self._super_categories_for_classes),
   1589                              method_provider_cls, prepend_cls_bases = False, doccls = doccls,
-> 1590                              reduction = reduction, cache = cache)
   1591 
   1592 

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/dynamic_class.pyc in dynamic_class(name, bases, cls, reduction, doccls, prepend_cls_bases, cache)
    314     elif cache is False:
    315         # bypass the cached method
--> 316         return dynamic_class_internal.f(name, bases, cls, reduction, doccls, prepend_cls_bases)
    317     else: # cache = "ignore_reduction"
    318         result = dynamic_class_internal(name, bases, cls, False, doccls, prepend_cls_bases)

/home/darij/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/structure/dynamic_class.pyc in dynamic_class_internal(name, bases, cls, reduction, doccls, prepend_cls_bases)
    409         if isinstance(base, ClasscallMetaclass):
    410             metaclass = DynamicClasscallMetaclass
--> 411     return metaclass(name, bases, methods)
    412 
    413 class DynamicMetaclass(type):

TypeError: Cannot create a consistent method resolution
order (MRO) for bases Bialgebras.parent_class, Algebras.parent_class, CoalgebrasWithBasis.parent_class
sage: 

Compare with the following, which does not go wrong:

darij@travis-virtualbox:~/gitsage$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.4.rc0, Release Date: 2014-10-30                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage:  from sage.algebras.divided_power_algebra import UnivariateDividedPowerAlgbra
sage: A = UnivariateDividedPowerAlgebra(Zmod(5)); A
The divided power algebra over Ring of integers modulo 5
sage: A = UnivariateDividedPowerAlgebra(Zmod(9)); A
The divided power algebra over Ring of integers modulo 9
sage: 

(It says rc0, but it is rc1 which I have only compiled with ./sage -br instead of make build to avoid building atlas again.)

It seems that the category refinement for the bialgebra category goes wrong when first applied over a ring and then over a field, but goes fine the other way roud.

(No, this is not fixed by #17096.)

novoselt commented 7 years ago
comment:23

Looks like there are some failed tests and triggered deprecation warnings...