#19397: Add support for homogeneous components of a filtered module
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: sage-combinat
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.10
Component: categories | Resolution:
Keywords: | Merged in:
Authors: Travis Scrimshaw | Reviewers: John Palmieri
Report Upstream: N/A | Work issues:
Branch: | Commit:
public/categories/homogeneous_components-19397|
46434a5a7ac5e0cf926e6b18d3e11323ce040e74
Dependencies: #17096 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jhpalmieri):
I don't know how to fix the underlying problem, but I have a few other
small changes to suggest. First, correct an error message:
{{{
#!diff
diff --git a/src/sage/categories/category.py
b/src/sage/categories/category.py
index 2d50eac..c022b00 100644
--- a/src/sage/categories/category.py
+++ b/src/sage/categories/category.py
@@ -1852,7 +1852,7 @@ class Category(UniqueRepresentation, SageObject):
if join:
return Category.join([self, category])
else:
- assert category.is_subcategory(self), "Subcategory of `{}`
required; got `{}`".format(category, self)
+ assert category.is_subcategory(self), "Subcategory of `{}`
required; got `{}`".format(self, category)
return category
def _is_subclass(self, c):
}}}
Second, fix a category (if we fix the MRO problem, this misdefined
category causes problems):
{{{
#!diff
diff --git a/src/sage/homology/homology_vector_space_with_basis.py
b/src/sage/homology/homology_vector_space_with_basis.py
index 00f8759..8cbf4f6 100644
--- a/src/sage/homology/homology_vector_space_with_basis.py
+++ b/src/sage/homology/homology_vector_space_with_basis.py
@@ -435,7 +435,7 @@ class CohomologyRing(HomologyVectorSpaceWithBasis):
sage: H = RP2.cohomology_ring(GF(5))
sage: TestSuite(H).run()
"""
- cat = Algebras(base_ring).WithBasis().Graded()
+ cat =
Algebras(base_ring).WithBasis().Graded().FiniteDimensional()
HomologyVectorSpaceWithBasis.__init__(self, base_ring,
cell_complex, True, cat)
def _repr_(self):
}}}
Finally, this one is cosmetic, but makes the signature of the method agree
with the docstring:
{{{
#!diff
diff --git a/src/sage/homology/homology_vector_space_with_basis.py
b/src/sage/homology/homology_vector_space_with_basis.py
index 00f8759..8cbf4f6 100644
--- a/src/sage/homology/homology_vector_space_with_basis.py
+++ b/src/sage/homology/homology_vector_space_with_basis.py
@@ -144,7 +144,7 @@ class
HomologyVectorSpaceWithBasis(CombinatorialFreeModule):
sage: b.cup_product(b)
h^{2,0}
"""
- def __init__(self, base_ring, cell_complex, cohomology=False,
cat=None):
+ def __init__(self, base_ring, cell_complex, cohomology=False,
category=None):
"""
Initialize ``self``.
@@ -170,7 +170,7 @@ class
HomologyVectorSpaceWithBasis(CombinatorialFreeModule):
# We only need the rank of M in each degree, and since
# we're working over a field, we don't need to dualize M
# if working with cohomology.
- cat = Modules(base_ring).WithBasis().Graded().or_subcategory(cat)
+ category =
Modules(base_ring).WithBasis().Graded().FiniteDimensional().or_subcategory(category)
self._contraction = phi
self._complex = cell_complex
self._cohomology = cohomology
@@ -178,7 +178,7 @@ class
HomologyVectorSpaceWithBasis(CombinatorialFreeModule):
for deg in
range(cell_complex.dimension()+1)}
indices = [(deg, i) for deg in self._graded_indices
for i in self._graded_indices[deg]]
- CombinatorialFreeModule.__init__(self, base_ring, indices,
category=cat)
+ CombinatorialFreeModule.__init__(self, base_ring, indices,
category=category)
def basis(self, d=None):
"""
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/19397#comment:30>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.