Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta-ticket: Modules with basis: We need to separate ABC from implementation #19346

Open
darijgr opened this issue Oct 4, 2015 · 10 comments
Open

Comments

@darijgr
Copy link
Contributor

darijgr commented Oct 4, 2015

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?

Depends on #18066

CC: @tscrim @nthiery @sagetrac-sage-combinat

Component: categories

Keywords: combinatorial free module, basis, vectors, modules, sage-combinat

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

@darijgr darijgr added this to the sage-6.9 milestone Oct 4, 2015
@tscrim
Copy link
Collaborator

tscrim commented Oct 11, 2015

comment:1

I think a good part of this is taken care of by #18066, but there will probably be some remaining things related to filtered/graded modules that we will need to address.

@tscrim
Copy link
Collaborator

tscrim commented Oct 11, 2015

Dependencies: #18066

@tscrim tscrim modified the milestones: sage-6.9, sage-6.10 Oct 11, 2015
@mkoeppe
Copy link
Member

mkoeppe commented Jul 17, 2020

comment:2

Is this ticket still relevant?

@mkoeppe mkoeppe modified the milestones: sage-6.10, sage-9.2 Jul 17, 2020
@mwageringel
Copy link

comment:3

Yes, I think it is. It is still quite difficult to implement a module with basis without inheriting from CombinatorialFreeModule, as the existence of some methods is implicitly assumed (especially _indices). For example, if one wants to turn polynomial rings (or a wrapper thereof) into a module with basis (possibly filtered or graded), it is not convenient to inherit from CombinatorialFreeModule.

@mkoeppe
Copy link
Member

mkoeppe commented Jul 18, 2020

comment:4

So what's missing is a few abstract methods and perhaps _test methods in sage.categories.modules_with_basis?

@nthiery
Copy link
Contributor

nthiery commented Jul 19, 2020

comment:5

Yes. And to resolve some conflicts in the current API; e.g. what idiom to use to iterate over pairs (indicies, coefficients), etc.

@nthiery
Copy link
Contributor

nthiery commented Jul 19, 2020

comment:6

For a package of mine, I needed these uniform accessors that would work over various kinds
of vector spaces in Sage (polymomials, ...):

https://github.com/nthiery/harmonic-modules/

See: utilitiles.py, matrix_of_vectors.py and subspace.py there.

With Darij, we made an attempt at extracting a dedicated package out of it,
with the idea of integrating it into Sage once stabilized. But we did not get
to push this further.

https://github.com/darijgr/sage-subspace/blob/master/vectors.pyx

@mkoeppe mkoeppe changed the title Modules with basis: We need to separate ABC from implementation Meta-ticket: Modules with basis: We need to separate ABC from implementation Jul 19, 2020
@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Member

mkoeppe commented Mar 15, 2021

comment:9

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 15, 2021
@mkoeppe
Copy link
Member

mkoeppe commented Jul 19, 2021

comment:10

Setting a new milestone for this ticket based on a cursory review.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe
Copy link
Member

mkoeppe commented Dec 18, 2021

comment:11

Stalled in needs_review or needs_info; likely won't make it into Sage 9.5.

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants