#15947: Weaken types for _rmul_ and _lmul_
-------------------------------+------------------------
Reporter: tscrim | Owner: tscrim
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.2
Component: coercion | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------+------------------------
Comment (by tscrim):
So because of the mechanism for constructing element classes, I can't OOTB
just add `AlgebraElement` and have that be a part of the MRO. If I change
the mechanism, then it leads to a segfault (which admittedly I'm too lazy
to figure out as they seemed very non-trivial). It seems like the best
hack/patch solution is to have `CombinatorialFreeModuleElement` do the
same abuse as matrices and inherit from `AlgebraElement`. With this change
we get:
{{{
sage: C = CombinatorialFreeModule(QQ, ['a','b','c'])
sage: a,b,c = C.basis()
sage: a*b
...
TypeError: unsupported operand parent(s) for '*': 'Free module generated
by {'a', 'b', 'c'} over Rational Field' and 'Free module generated by
{'a', 'b', 'c'} over Rational Field'
sage: h = SymmetricFunctions(QQ).h()
sage: m = matrix(h, [[h[2,1], h[3,2]], [h[1], h[1]]])
sage: h[2,1] * m
[h[2, 2, 1, 1] h[3, 2, 2, 1]]
[ h[2, 1, 1] h[2, 1, 1]]
}}}
Although at some point we will need a category-based approach to this
problem, but I don't see how to do so
Although I've come across an independent bug with 1x1 matrices:
{{{
sage: matrix(h, [[h[2,1]]])
...
AttributeError: 'tuple' object has no attribute 'parent'
}}}
I can post branches/commits of the various attempts I mentioned above too.
--
Ticket URL: <http://trac.sagemath.org/ticket/15947#comment:6>
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.