#18756: Use cython and coercion for CombinatorialFreeModule
-------------------------------------------------+-------------------------
Reporter: SimonKing | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.8
Component: algebra | Resolution:
Keywords: CombinatorialFreeModule, | Merged in:
cython, coercion | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | Stopgaps:
Dependencies: |
-------------------------------------------------+-------------------------
Comment (by nthiery):
Replying to [comment:1 SimonKing]:
> Here is how `CombinatorialFreeModuleElement` fails to use the coercion
framework properly.
>
> It uses the method `_acted_upon_` to implement multiplication by
scalars, and then does
> {{{
> # For backward compatibility
> _lmul_ = _acted_upon_
> _rmul_ = _acted_upon_
> }}}
>
> However, it is clearly the job of `_lmul_/_rmul_` to implement a scalar
multiplication---not just for backward compatibility! Moreover, in
`_lmul_/_rmul_` one can assume that the second argument comes from the
base ring---in the current implementation, this has to be explicitly
tested, simply since there is no such assumption for `_acted_upon_`.
>
> And what is worst: Using `_acted_upon_` is one way to implement a
general action that goes BEYOND the action of the base ring. If one wants
to implement an action of, say, a path algebra on a free module over a
path algebra, then one would "of course" use `_acted_upon_`---but by the
current design, it would break scalar multiplication.
I don't remember exactly the rationale behind this comment. It could well
be that it was the fact of implementing `_acted_upon_` rather than
`_lmul_` / `_rmul_` which was for backward compatibility. Feel free to
clean this up.
--
Ticket URL: <http://trac.sagemath.org/ticket/18756#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.