#18066: Cleanup of ModulesWithBasis and friends
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: tscrim
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.10
Component: categories | Resolution:
Keywords: | Merged in:
Authors: Travis Scrimshaw | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
public/categories/cleanup_CFM_modules_wBasis-18066|
f8bd45183a2894e9260073209ecd8b93b957f6c4
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by darij):
+1! This is the way to go, and thanks for doing it.
However, one thing I'm still missing is an explicit explanation of what
methods one needs to implement in order to inherit from
`ModulesWithBasis`. I suspect this is no longer up-to-date:
{{{
# To implement a module_with_basis you need to implement either
# basis() or an _indices attribute and monomial().
}}}
(as in, we probably need more now), right?
Coercion of coefficients into the base ring needs to be carefully thought
above. As of now, I am not sure if it works correctly. For instance,
`term` does no coercion, but `__invert__` does `self.parent().term(one,
~mcs[one])`, although the inversion operator `~` might produce an element
of a bigger ring (for example, `~(ZZ(2))` returns `1/2`).
One more thing, which is probably not your fault but just caught my eyes.
The docstring of `module_morphism` says:
{{{
- ``matrix`` -- a matrix of size `\dim X \times \dim Y`
or `\dim Y \times \dim X`
}}}
I don't see why the "or" is here. The doctests show that `\dim Y \times
\dim X` works, but does `\dim X \times \dim Y` work too? And if so,
*should* it? I think checking whether the matrix has the "wrong"
dimensions, and then trying to fix them by transposing it, would be a
brittle paradigm.
Also, could we have doctests proving that the `monomial_coefficients`
method works correctly (including not mutating the dictionary unless
explicitly required) on various instances of `ModulesWithBasis` (e.g.,
vector spaces)? Thank you!
--
Ticket URL: <http://trac.sagemath.org/ticket/18066#comment:3>
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.