-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Bug in solve due to a bug in symbolic_expression_from_maxima_string #20755
Comments
comment:2
Well, The quick fix is to get the correct value of In the longer run, it would be preferable to do the conversion while avoiding strings altogether. See |
comment:3
seems to work in 8.9.b1 one needs to check and add a doctest |
Commit: |
comment:4
The bug seems indeed fixed. I've add a doctest. New commits:
|
Author: Bruno Grenet |
Branch: u/bruno/20755_bug_in_solve |
Reviewer: Vincent Delecroix |
Changed branch from u/bruno/20755_bug_in_solve to |
A bug in
sage.calculus.calculus.symbolic_expression_from_maxima_string
implies bugs insolve
androots
for symbolic expressions.Symptoms
The method
solve
for symbolic expressions is buggy (the list of multiplicities has size 2 instead of 4), as well asroots
as a (serious!) consequence:Diagnosis
The behavior of
roots
is easily explained by the behavior ofsolve
, sinceroots
assume that the length of the list of solutions is the same as the length of the list of multiplicities. This should clearly be the case so the bug is not inroots
.Given the parameter in the example,
solve
calls Maxima and parses the result. The multiplicities are obtained by invokingP.get('multiplicities')
. This is the right invocation to Maxima, no bug there.To parse the solutions returned by Maxima,
solve
callssage.symbolic.relation.string_to_list_of_solutions
, which itself callssage.calculus.symbolic_expression_from_maxima_string
. The bug occurs in this last function: Indeed, while there is no apparent reason for this, invoking this function changes the variablemultiplicities
of Maxima. Here is an example:The text was updated successfully, but these errors were encountered: