#19346: Modules with basis: We need to separate ABC from implementation
-------------------------+-------------------------------------------------
Reporter: darij | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.9
Component: PLEASE | Keywords: combinatorial free module,
CHANGE | basis, vectors, modules, sage-combinat
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-------------------------+-------------------------------------------------
From what I recall from the discussion at
https://groups.google.com/forum/#!topic/sage-combinat-devel/_dtk67RaTFA ,
the `ModulesWithBasis` and `CombinatorialFreeModule` classes are supposed
to be an ABC (abstract base class) and a concrete implementation,
respectively. However, in practice, the former provides too little
abstract interface to be useful, and so a lot of code that uses a module-
with-basis as input (explicitly or implicitly) expects to be given a
`CombinatorialFreeModule` instead. Usually this kind of code fails when
being passed a `ModulesWithBasis` instance.
I am posting this here right now because #17096 got positive review, and
in that review some issues have been left aside. These issues are
essentially a natural second step after cleaning up the
`ModulesWithBasis`-vs-`CombinatorialFreeModule` mess, and
-------------------------------------------------------
TODO: Formulate an interface and a contract for
`FilteredModulesWithBasis` objects. Is a `CombinatorialFreeModule` with a
`degree_on_basis` method enough? Or is `basis` still needed? (See the
FIXME in `src/sage/categories/examples/filtered_modules_with_basis.py`.)
TODO: Make sense of `A.basis(d)` for `A` a filtered module and `d` an
integer. This has always been broken.
TODO: doctesting `A.basis(d)` for `A` graded. Very easy once above is
fixed.
About why I think `FilteredModulesWithBasis` needs a contract:
Here are the methods on `F` that are used in the implementations of the
methods of `FilteredModulesWithBasis` when `F` is cast as a
`FilteredModulesWithBasis`:
{{{
ParentMethods:
degree_on_basis
sum_of_terms
monomial
_indices
ElementMethods:
support
leading_support
is_homogeneous
is_zero
}}}
I hear the quacking of a `CombinatorialFreeModule` duck here (except for
`degree_on_basis` which should be explicitly required). Are there any
more general categories which offer these methods?
--
Ticket URL: <http://trac.sagemath.org/ticket/19346>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.