Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Made it so you must explicitly designate graded as a super category
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Apr 2, 2015
1 parent 0ce1cad commit b29650b
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 30 deletions.
3 changes: 2 additions & 1 deletion src/sage/algebras/clifford_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,8 @@ def __init__(self, R, names):
sage: E.<x,y,z> = ExteriorAlgebra(QQ)
sage: TestSuite(E).run()
"""
CliffordAlgebra.__init__(self, QuadraticForm(R, len(names)), names, HopfAlgebrasWithBasis(R).Super())
cat = HopfAlgebrasWithBasis(R).Super().Graded()
CliffordAlgebra.__init__(self, QuadraticForm(R, len(names)), names, cat)
# TestSuite will fail if the HopfAlgebra classes will ever have tests for
# the coproduct being an algebra morphism -- since this is really a
# Hopf superalgebra, not a Hopf algebra.
Expand Down
1 change: 1 addition & 0 deletions src/sage/categories/hopf_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def example(self, G = None):

FiniteDimensional = LazyImport('sage.categories.finite_dimensional_hopf_algebras_with_basis', 'FiniteDimensionalHopfAlgebrasWithBasis')
Graded = LazyImport('sage.categories.graded_hopf_algebras_with_basis', 'GradedHopfAlgebrasWithBasis')
Super = LazyImport('sage.categories.super_hopf_algebras_with_basis', 'SuperHopfAlgebrasWithBasis')

class ParentMethods:

Expand Down
17 changes: 14 additions & 3 deletions src/sage/categories/super_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#******************************************************************************

from sage.categories.super_modules import SuperModulesCategory
from sage.categories.algebras import Algebras
from sage.categories.modules import Modules
from sage.misc.lazy_import import LazyImport

class SuperAlgebras(SuperModulesCategory):
"""
Expand All @@ -18,14 +21,22 @@ class SuperAlgebras(SuperModulesCategory):
sage: Algebras(ZZ).Super()
Category of super algebras over Integer Ring
sage: Algebras(ZZ).Super().super_categories()
[Category of graded algebras over Integer Ring,
Category of super modules over Integer Ring]
TESTS::
sage: TestSuite(Algebras(ZZ).Super()).run()
"""
def super_categories(self):
"""
EXAMPLES::
sage: Algebras(ZZ).Super().super_categories()
[Category of graded algebras over Integer Ring,
Category of super modules over Integer Ring]
"""
R = self.base_ring()
return [Algebras(R).Graded(), Modules(R).Super()]

class ParentMethods:
pass

Expand Down
15 changes: 14 additions & 1 deletion src/sage/categories/super_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#******************************************************************************

from sage.categories.super_modules import SuperModulesCategory
from sage.categories.algebras import Algebras
from sage.categories.modules import Modules

class SuperAlgebrasWithBasis(SuperModulesCategory):
"""
Expand All @@ -20,13 +22,24 @@ class SuperAlgebrasWithBasis(SuperModulesCategory):
Category of super algebras with basis over Integer Ring
sage: sorted(C.super_categories(), key=str)
[Category of graded algebras with basis over Integer Ring,
Category of super algebras over Integer Ring,
Category of super modules with basis over Integer Ring]
TESTS::
sage: TestSuite(C).run()
"""
def super_categories(self):
"""
EXAMPLES::
sage: Algebras(ZZ).WithBasis().Super().super_categories()
[Category of graded algebras with basis over Integer Ring,
Category of super modules with basis over Integer Ring]
"""
R = self.base_ring()
return [Algebras(R).WithBasis().Graded(),
Modules(R).WithBasis().Super()]

class ParentMethods:
pass

Expand Down
35 changes: 35 additions & 0 deletions src/sage/categories/super_hopf_algebras_with_basis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
r"""
Super algebras with basis
"""
#*****************************************************************************
# Copyright (C) 2015 Travis Scrimshaw <tscrim at ucdavis.edu>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#******************************************************************************

from sage.categories.super_modules import SuperModulesCategory

class SuperHopfAlgebrasWithBasis(SuperModulesCategory):
"""
The category of super algebras with a distinguished basis
EXAMPLES::
sage: C = HopfAlgebras(ZZ).WithBasis().Super(); C
Category of super hopf algebras with basis over Integer Ring
sage: sorted(C.super_categories(), key=str)
[Category of hopf algebras with basis over Integer Ring,
Category of super algebras over Integer Ring,
Category of super algebras with basis over Integer Ring]
TESTS::
sage: TestSuite(C).run()
"""
class ParentMethods:
pass

class ElementMethods:
pass

41 changes: 16 additions & 25 deletions src/sage/categories/super_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,31 +124,6 @@ def _repr_object_names(self):
"""
return "super {}".format(self.base_category()._repr_object_names())

@classmethod
def default_super_categories(cls, category, *args):
"""
Returns the default super categories of ``category.Subobjects()``
Mathematical meaning: if `A` is a super version of `B`,
then `A` is also a graded version of `B`.
INPUT:
- ``cls`` -- the class ``SubobjectsCategory``
- ``category`` -- a category `Cat`
OUTPUT: a (join) category
In practice, this returns ``category.Subquotients()``, joined
together with the result of the method
:meth:`RegressiveCovariantConstructionCategory.default_super_categories() <sage.categories.covariant_functorial_construction.RegressiveCovariantConstructionCategory.default_super_categories>`
(that is the join of ``category`` and ``cat.Subobjects()`` for
each ``cat`` in the super categories of ``category``).
EXAMPLES::
"""
return Category.join([category.Graded(), super(SuperModulesCategory, cls).default_super_categories(category, *args)])

class SuperModules(SuperModulesCategory):
"""
The category of super modules.
Expand All @@ -170,6 +145,22 @@ class SuperModules(SuperModulesCategory):
sage: TestSuite(Modules(ZZ).Super()).run()
"""
def super_categories(self):
"""
EXAMPLES::
sage: Modules(ZZ).Super().super_categories()
[Category of graded modules over Integer Ring]
Nota bene::
sage: Modules(QQ).Super()
Category of super modules over Rational Field
sage: Modules(QQ).Super().super_categories()
[Category of graded modules over Rational Field]
"""
return [Modules(self.base_ring()).Graded()]

def extra_super_categories(self):
r"""
Adds :class:`VectorSpaces` to the super categories of ``self`` if
Expand Down

0 comments on commit b29650b

Please sign in to comment.