Hi,

On Wed, May 25, 2022 at 12:03 AM Matthew Brett <matthew.br...@gmail.com> wrote:
>
> 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,

Just for reference, I have also just asked this question on StackOverflow:

https://stackoverflow.com/questions/72390408/control-print-order-of-matrix-terms-in-sympy

Cheers,

Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAH6Pt5o%3DSbkK84RYy1DH3uWd59nJ6Txv_zfJGA8ou6B4OiJCDg%40mail.gmail.com.

Reply via email to