-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Convert RootSum to SymPy #1136
Convert RootSum to SymPy #1136
Conversation
@davidar
This is not explicitly stated in Wolfram Reference now, but seems to still be true according to the content of |
I fixed the issue @mmatera noted, but I can't quite get mathics to sort the polynomial terms in a consistent order. In fact it behaves kind of strangely whenever the terms are anything more complicated than an atom: In[9]:= F^5+2F+1
Out[9]= 1 + 2 F + F ^ 5
In[10]:= F[]^5+2F[]+1
Out[10]= 1 + F[] ^ 5 + 2 F[] WMA sorts both of these in order of increasing powers (e.g. |
The problem with the ordering is something that should be addressed in boxing the expression for output. My expectation is that this would be fixed in the process of revising the way boxing works. |
@rocky Ok, I won't worry too much about it now then, I'll just adjust the ordering in the tests for now |
LGTM |
@rocky, @davidar, as I understand this, the result of a In any case, I am OK if we merge this as it is, and reformulate it later. |
I split this out into a separate PR as I think it's going to require some more work. We already had a SymPy -> Mathics conversion for RootSum, this adds one going the other way too. However, it results in some tests failing as it means that Simplify automatically expands RootSums now, not sure if we want to add some hints to prevent that from happening.