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
make solve understand matrix equations #5201
Comments
comment:1
Which part of no non-ReST tickets against 3.4 is hard to understand? :p Cheers, Michael |
comment:2
argh! I looked at the list and thought "the first item is the ReST transition, so I have to pick the second item". Apparently I was thinking that the next release was already out and 3.3 was the ReST transition. |
comment:4
Could this be accomplished by overriding the comparison operator for the matrix class? for example def __richcmp__(self, other_matrix, cmptype):
if cmptype == 2: #this is the '==' operator
if is_Matrix(other_matrix):
if False in [i==j for i,j in zip(self.list(), other_matrix.list())]:
return False
else: return True I'm just not sure where the 'matrix class' is. This would allow comparisons like
|
comment:5
You bring up a good point, and make me doubt whether the feature request is even feasible. Certainly it's probably not a beginner ticket after all. The problem is that we already have an == operator:
That means that all solve will see is False. Instead, we want something like:
(i.e., we want the == in the solve to construct an equation, which it does for symbolic objects. One of the issues at heart here is that a symbolic object wrapping a Sage matrix is different from a Sage matrix containing symbolic objects. So I'm going to take off beginner status for this ticket here. It would still be nice if solve(SR(a)==SR(b)) worked in the above example. |
I think it would be a great thing if solve could recognize matrices and that two matrices are equal if each entry is equal. I believe MMA does this (but it's easier there; matrices are nothing more than nested lists). It'd certainly make certain things I do more natural if I could do:
solve(matrixA==matrixB)
and that was equivalent to:
solve([i==j for i,j in zip(matrixA.list(), matrixB.list())])
Okay, so now that I've written my piece, I suppose the next step is to open a trac ticket, write a patch to implement it, and post it for review :).
Component: calculus
Issue created by migration from https://trac.sagemath.org/ticket/5201
The text was updated successfully, but these errors were encountered: