#18360: SR(Matrix) fails operations minus and mul
-------------------------------------------------+-------------------------
Reporter: rws | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.8
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: Fixed upstream, in a later | Work issues:
stable release. | Commit:
Branch: | Stopgaps:
Dependencies: pynac-0.3.9.2 |
-------------------------------------------------+-------------------------
Changes (by rws):
* dependencies: => pynac-0.3.9.2
* upstream: N/A => Fixed upstream, in a later stable release.
Old description:
> In examples like this:
> {{{
> sage: f(x)=matrix()
> sage: bool(f(x)-f(x)==0)
> ...
> TypeError: mutable matrices are unhashable
> }}}
> the `f(x)` is expanded into a mutable matrix, but this prevents
> evaluation because Pynac is called by `Expression._sub_` and wants to do
> hashes on the matrix for comparison reasons. However, for the purpose of
> subtraction dealing with a mutable matrix is completely unnecessary. So a
> solution would be to turn mutable objects immutable before doing
> arithmetics in `Expression` or in Pynac.
>
> While the most elegant solution to the specific problem would be an
> expression converter, applied before calling Pynac's `relational_to_bool`
> this will not solve other instances like
> {{{
> sage: f(x)=matrix(ZZ, 8)
> sage: f(x)*1
> ...
> TypeError: mutable matrices are unhashable
> }}}
New description:
In examples like this:
{{{
sage: f(x)=matrix()
sage: bool(f(x)-f(x)==0)
...
TypeError: mutable matrices are unhashable
sage: f(x)*1
...
TypeError: mutable matrices are unhashable
}}}
a Pynac bug manifests, see https://github.com/pynac/pynac/issues/34
This ticket should provide doctests, it depends on pynac-0.4.2/0.3.9.2.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/18360#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.