Matthew Brett
unread,May 24, 2022, 7:04:13 PM5/24/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Dear team,
I was trying to display an equation resulting from MatAdd, and noticed
that I could not control the order in which the Matrices appear in the
result.
For example, consider:
from sympy import MatAdd, Matrix
A = Matrix([1])
B = Matrix([0])
print(MatAdd(A, B, evaluate=False))
This gives
Matrix([[0]]) + Matrix([[1]])
I want to be able to control the order in which the Matrices appear.
What algorithm is Sympy using to sort the output? I guess it is
looking at the Matrix contents? Do you have any suggestions for
controlling the order?
Thanks for any suggestions,
Matthew