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

Commit

Permalink
Merge branch 'public/categories/super_categories-18044' into 6.9.b1
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Aug 9, 2015
2 parents 83bef8d + 6051865 commit 570bc49
Show file tree
Hide file tree
Showing 16 changed files with 583 additions and 24 deletions.
12 changes: 7 additions & 5 deletions src/sage/algebras/clifford_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
from sage.categories.graded_hopf_algebras_with_basis import GradedHopfAlgebrasWithBasis
from sage.modules.with_basis.morphism import ModuleMorphismByLinearity
from sage.categories.hopf_algebras_with_basis import HopfAlgebrasWithBasis
from sage.categories.poor_man_map import PoorManMap
from sage.rings.all import ZZ
from sage.modules.free_module import FreeModule, FreeModule_generic
Expand Down Expand Up @@ -537,7 +538,7 @@ def __init__(self, Q, names, category=None):
self._quadratic_form = Q
R = Q.base_ring()
if category is None:
category = GradedAlgebrasWithBasis(R)
category = AlgebrasWithBasis(R).Super()
indices = SubsetsSorted(range(Q.dim()))
CombinatorialFreeModule.__init__(self, R, indices, category=category)
self._assign_names(names)
Expand Down Expand Up @@ -1051,7 +1052,7 @@ def lift_module_morphism(self, m, names=None):
remove_zeros=True )
for i in x)
return Cl.module_morphism(on_basis=f, codomain=self,
category=GradedAlgebrasWithBasis(self.base_ring()))
category=AlgebrasWithBasis(self.base_ring()).Super())

def lift_isometry(self, m, names=None):
r"""
Expand Down Expand Up @@ -1116,7 +1117,7 @@ def lift_isometry(self, m, names=None):
remove_zeros=True )
for i in x)
return self.module_morphism(on_basis=f, codomain=Cl,
category=GradedAlgebrasWithBasis(self.base_ring()))
category=AlgebrasWithBasis(self.base_ring()).Super())

# This is a general method for finite dimensional algebras with bases
# and should be moved to the corresponding category once there is
Expand Down Expand Up @@ -1419,7 +1420,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, GradedHopfAlgebrasWithBasis(R))
cat = HopfAlgebrasWithBasis(R).Super()
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 Expand Up @@ -1563,7 +1565,7 @@ def lift_morphism(self, phi, names=None):
f = lambda x: E.prod(E._from_dict( {(j,): phi[j,i] for j in range(n)},
remove_zeros=True )
for i in x)
return self.module_morphism(on_basis=f, codomain=E, category=GradedAlgebrasWithBasis(R))
return self.module_morphism(on_basis=f, codomain=E, category=AlgebrasWithBasis(R).Super())

def volume_form(self):
"""
Expand Down
6 changes: 5 additions & 1 deletion src/sage/algebras/weyl_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,11 @@ def __init__(self, R, names=None):
raise ValueError("variable names cannot differ by a leading 'd'")
# TODO: Make this into a filtered algebra under the natural grading of
# x_i and dx_i have degree 1
Algebra.__init__(self, R, names, category=AlgebrasWithBasis(R).NoZeroDivisors())
if R.is_field():
cat = AlgebrasWithBasis(R).NoZeroDivisors().Super()
else:
cat = AlgebrasWithBasis(R).Super()
Algebra.__init__(self, R, names, category=cat)

def _repr_(self):
r"""
Expand Down
1 change: 1 addition & 0 deletions src/sage/categories/algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def Semisimple(self):

Commutative = LazyImport('sage.categories.commutative_algebras', 'CommutativeAlgebras', at_startup=True)
Graded = LazyImport('sage.categories.graded_algebras', 'GradedAlgebras')
Super = LazyImport('sage.categories.super_algebras', 'SuperAlgebras')
WithBasis = LazyImport('sage.categories.algebras_with_basis', 'AlgebrasWithBasis')
#if/when Semisimple becomes an axiom
Semisimple = LazyImport('sage.categories.semisimple_algebras', 'SemisimpleAlgebras')
Expand Down
1 change: 1 addition & 0 deletions src/sage/categories/algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def example(self, alphabet = ('a','b','c')):

FiniteDimensional = LazyImport('sage.categories.finite_dimensional_algebras_with_basis', 'FiniteDimensionalAlgebrasWithBasis')
Graded = LazyImport('sage.categories.graded_algebras_with_basis', 'GradedAlgebrasWithBasis')
Super = LazyImport('sage.categories.super_algebras_with_basis', 'SuperAlgebrasWithBasis')

class ParentMethods:

Expand Down
5 changes: 2 additions & 3 deletions src/sage/categories/bialgebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from sage.categories.category_types import Category_over_base_ring
from sage.categories.all import Algebras, Coalgebras
from sage.categories.super_modules import SuperModulesCategory

class Bialgebras(Category_over_base_ring):
"""
Expand Down Expand Up @@ -56,8 +57,6 @@ def additional_structure(self):
"""
return None

class ParentMethods:
class Super(SuperModulesCategory):
pass

class ElementMethods:
pass
39 changes: 26 additions & 13 deletions src/sage/categories/coalgebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from sage.categories.all import Modules
from sage.categories.tensor import TensorProductsCategory, tensor
from sage.categories.dual import DualObjectsCategory
from sage.categories.super_modules import SuperModulesCategory
from sage.categories.realizations import RealizationsCategory
from sage.categories.with_realizations import WithRealizationsCategory
from sage.misc.abstract_method import abstract_method
Expand Down Expand Up @@ -50,19 +51,6 @@ class ParentMethods:
# # Will declare the coproduct of self to the coercion mechanism when it exists
# pass

@cached_method
def tensor_square(self):
"""
Returns the tensor square of ``self``
EXAMPLES::
sage: A = HopfAlgebrasWithBasis(QQ).example()
sage: A.tensor_square()
An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field # An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field
"""
return tensor([self, self])

@abstract_method
def counit(self, x):
"""
Expand Down Expand Up @@ -192,6 +180,31 @@ def extra_super_categories(self):
from sage.categories.algebras import Algebras
return [Algebras(self.base_category().base_ring())]

class Super(SuperModulesCategory):
def extra_super_categories(self):
"""
EXAMPLES::
sage: Coalgebras(ZZ).Super().extra_super_categories()
[Join of Category of graded modules over Integer Ring
and Category of coalgebras over Integer Ring]
sage: Coalgebras(ZZ).Super().super_categories()
[Category of super modules over Integer Ring,
Category of coalgebras over Integer Ring]
Compare this with the situation for bialgebras::
sage: Bialgebras(ZZ).Super().extra_super_categories()
[]
sage: Bialgebras(ZZ).Super().super_categories()
[Category of super algebras over Integer Ring,
Category of super coalgebras over Integer Ring]
The category of bialgebras does not occur in these results,
since super bialgebras are not bialgebras.
"""
return [self.base_category().Graded()]

class WithRealizations(WithRealizationsCategory):

class ParentMethods:
Expand Down
3 changes: 3 additions & 0 deletions src/sage/categories/coalgebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from sage.misc.lazy_attribute import lazy_attribute
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from sage.categories.all import ModulesWithBasis, tensor, Hom
from sage.categories.super_modules import SuperModulesCategory

class CoalgebrasWithBasis(CategoryWithAxiom_over_base_ring):
"""
Expand Down Expand Up @@ -129,3 +130,5 @@ def counit(self):
class ElementMethods:
pass

class Super(SuperModulesCategory):
pass
3 changes: 3 additions & 0 deletions src/sage/categories/hopf_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from sage.categories.bialgebras import Bialgebras
from sage.categories.tensor import TensorProductsCategory # tensor
from sage.categories.realizations import RealizationsCategory
from sage.categories.super_modules import SuperModulesCategory
from sage.misc.cachefunc import cached_method
#from sage.misc.lazy_attribute import lazy_attribute

Expand Down Expand Up @@ -104,6 +105,8 @@ class Morphism(Category):
"""
pass

class Super(SuperModulesCategory):
pass

class TensorProducts(TensorProductsCategory):
"""
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 @@ -147,6 +147,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
49 changes: 47 additions & 2 deletions src/sage/categories/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sage.categories.homsets import HomsetsCategory
from category import Category, JoinCategory
from category_types import Category_module, Category_over_base_ring
from tensor import TensorProductsCategory
from sage.categories.tensor import TensorProductsCategory, tensor
from dual import DualObjectsCategory
from sage.categories.sets_cat import Sets
from sage.categories.bimodules import Bimodules
Expand Down Expand Up @@ -383,6 +383,39 @@ def Graded(self, base_ring=None):
from sage.categories.graded_modules import GradedModulesCategory
return GradedModulesCategory.category_of(self)

@cached_method
def Super(self, base_ring=None):
r"""
Return the super-analogue category of ``self``.
INPUT::
- ``base_ring`` -- this is ignored
EXAMPLES::
sage: Modules(ZZ).Super()
Category of super modules over Integer Ring
sage: Coalgebras(QQ).Super()
Category of super coalgebras over Rational Field
sage: AlgebrasWithBasis(QQ).Super()
Category of super algebras with basis over Rational Field
.. TODO::
Same as :meth:`Graded`.
TESTS::
sage: Coalgebras(QQ).Super.__module__
'sage.categories.modules'
"""
assert base_ring is None or base_ring is self.base_ring()
from sage.categories.super_modules import SuperModulesCategory
return SuperModulesCategory.category_of(self)

@cached_method
def WithBasis(self):
r"""
Expand Down Expand Up @@ -430,10 +463,22 @@ def extra_super_categories(self):
return []

Graded = LazyImport('sage.categories.graded_modules', 'GradedModules')
Super = LazyImport('sage.categories.super_modules', 'SuperModules')
WithBasis = LazyImport('sage.categories.modules_with_basis', 'ModulesWithBasis')

class ParentMethods:
pass
@cached_method
def tensor_square(self):
"""
Returns the tensor square of ``self``
EXAMPLES::
sage: A = HopfAlgebrasWithBasis(QQ).example()
sage: A.tensor_square()
An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field # An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field
"""
return tensor([self, self])

class ElementMethods:

Expand Down
1 change: 1 addition & 0 deletions src/sage/categories/modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def is_abelian(self):

FiniteDimensional = LazyImport('sage.categories.finite_dimensional_modules_with_basis', 'FiniteDimensionalModulesWithBasis')
Graded = LazyImport('sage.categories.graded_modules_with_basis', 'GradedModulesWithBasis')
Super = LazyImport('sage.categories.super_modules_with_basis', 'SuperModulesWithBasis')

class ParentMethods:
@cached_method
Expand Down
38 changes: 38 additions & 0 deletions src/sage/categories/super_algebras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
r"""
Super Algebras
"""
#*****************************************************************************
# 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
from sage.categories.algebras import Algebras
from sage.categories.modules import Modules
from sage.misc.lazy_import import LazyImport

class SuperAlgebras(SuperModulesCategory):
"""
The category of super algebras.
EXAMPLES::
sage: Algebras(ZZ).Super()
Category of super algebras over Integer Ring
TESTS::
sage: TestSuite(Algebras(ZZ).Super()).run()
"""
def extra_super_categories(self):
"""
EXAMPLES::
sage: Algebras(ZZ).Super().super_categories()
[Category of graded algebras over Integer Ring,
Category of super modules over Integer Ring]
"""
return [self.base_category().Graded()]

39 changes: 39 additions & 0 deletions src/sage/categories/super_algebras_with_basis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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
from sage.categories.algebras import Algebras
from sage.categories.modules import Modules

class SuperAlgebrasWithBasis(SuperModulesCategory):
"""
The category of super algebras with a distinguished basis
EXAMPLES::
sage: C = Algebras(ZZ).WithBasis().Super(); C
Category of super algebras with basis over Integer Ring
TESTS::
sage: TestSuite(C).run()
"""
def extra_super_categories(self):
"""
EXAMPLES::
sage: C = Algebras(ZZ).WithBasis().Super()
sage: sorted(C.super_categories(), key=str) # indirect doctest
[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]
"""
return [self.base_category().Graded()]

30 changes: 30 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,30 @@
r"""
Super Hopf 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 super algebras with basis over Integer Ring,
Category of super coalgebras with basis over Integer Ring,
Category of super hopf algebras over Integer Ring]
TESTS::
sage: TestSuite(C).run()
"""

0 comments on commit 570bc49

Please sign in to comment.