JuliaSymbolics / Symbolics.jl

Symbolic programming for the next generation of numerical software
https://docs.sciml.ai/Symbolics/stable/
Other
1.36k stars 153 forks source link

Ordering polynomials with respect to each terms' degree #390

Open vini-fda opened 3 years ago

vini-fda commented 3 years ago

When we have a big polynomial as a result of some complicated symbolic expression, its terms tend to be "all over the place" in Pluto.jl. For example: image

I also looked into it in Jupyter, the polynomial is ordered according to an increasing order of each monomial's degree if the expression isn't too complicated:

But upon looking into a similarly-sized expression as the Pluto.jl example, the ordering isn't "perfect"(the x^1024 term is at the beginning):

It'd be great if there was a transparent way to sort and display the terms according to some criteria, maybe through multiple dispatch with the base sort function.

┆Issue is synchronized with this Trello card by Unito

rcheng15jhu commented 2 years ago

I also agree this feature would be great! It's not exactly the same, but I'm working with symbolic arrays right now, and the ordering of terms is a bit erratic.

image

bernardosulzbach commented 2 years ago

Yes, I think this is a good idea. Being able to sort the terms would help with visualization.