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
another broken square root simplification #8659
Comments
comment:1
This problem might not be in symbolics, but in number fields:
|
comment:2
Interestingly, these all work (starting from the above example in my post):
So it seems that b^(1/2) is the only problem? |
comment:3
On the other hand, it seems like the problem is in try_symbolic_power. When I change that function to:
then I get:
|
comment:4
Unsurprisingly, I get the same error traceback if I do |
comment:5
Now that we have the This ticket depends on #9879. |
Author: Burcin Erocal |
comment:7
Attachment: trac_8659-hold_powers.patch.gz At first I thought I minded this discrepancy, but I think that maybe that's okay, given they really do live in different places. At the same time, in theory then we should be holding anything that might ever be multivalued. Like a square root.
In particular, what do we want here?
|
comment:8
Also, is
intended to test
But the powers weren't multiplied, because Similarly,
can't be to test the change in that file, because 8 isn't rational. Or am I missing something? Sorry if I've misinterpreted something; otherwise this is a good fix, it seems. |
Attachment: trac_8659-hold_powers.take2.patch.gz |
comment:9
attachment: trac_8659-hold_powers.take2.patch should address the issues in comment:7 at the cost of magically changing the type of the coefficients to rational. The test
does test the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:11
I uploaded a new patch which should finally fix this. Please review. |
Dependencies: #12511 |
comment:12
[[[ |
comment:13
Hmm, that didn't format right. I meant to say, there are two occurrences of
I think it would be helpful to have a doctest or two for each branch of the number field code. Some are no doubt already in there, but all? For instance, I would have thought that Also, can you think of a place where putting the rational power in the denominator could cause something to break? Is that standard practice in this kind of computer algebra? For instance, Maxima does not do this.
Sorry if these are dumb questions. |
Attachment: trac_8659-hold_powers.take3.patch.gz |
comment:14
Replying to @kcrisman:
I updated the patch to fix the typos.
That branch is tested by these:
AFAICT, GiNaC assumes this normal form. On another note... IMHO, a simple typo in comments within source code, or not documenting which doctest corresponds to which branch in the code is justification to switch a ticket to |
comment:15
Fair enough! Though I do think typos are 'needs work', often I can update them on a refresh. The doctest thing was just wanting to check that we did check all branches. Maybe 'needs info' is better? The point is that I want to make sure the comment gets seen; a lot of times I see questions on 'needs review' that are then never actually addressed. I don't really care what the status itself is.
Well, it's apparently been |
Reviewer: Karl-Dieter Crisman |
comment:16
Okay, I now get all the branches, and it makes sense. Thanks for hanging in there with me! Also, good catch and test on the powers less than -1. I'm not putting 'needs work' :) but also not yet positive review. In comment:7, we see the equivalent of this inconsistency:
I thought that maybe this was because (for reasons unclear to me) we had entered
but
so I must be missing something obvious. Anyway, I can't see why these should return different things, and we still have the switch to rational that should take care of this:
Also, the documentation in rational.pyx still says
though I think this code has been used for non-integer powers for quite a while. But perhaps another reviewer will see what is going on in these cases, my apologies if I'm wasting time. |
comment:17
Apply trac_8659-hold_powers.take3.patch (for the patchbot, which is trying to apply all three patches simultaneously) |
comment:18
Patch does not apply (either to 5.0.beta7, or to 4.8 with #12511 installed). |
Changed reviewer from Karl-Dieter Crisman to Karl-Dieter Crisman, PatchBot |
Attachment: trac_8659-hold_powers.take4.patch.gz |
Changed reviewer from Karl-Dieter Crisman, PatchBot to Karl-Dieter Crisman |
comment:19
I rebased the patch to 5.0. Apply only attachment: trac_8659-hold_powers.take4.patch. |
This comment has been minimized.
This comment has been minimized.
comment:20
For the patchbot, apply trac_8659-hold_powers.take4.patch |
Changed keywords from none to sd40.5 |
comment:21
Looks good to me. |
Changed reviewer from Karl-Dieter Crisman to Karl-Dieter Crisman, Mike Hansen |
Merged: sage-5.1.beta5 |
Reported by Alex Raichev on sage-support:
Here is the thread:
http://groups.google.com/group/sage-support/t/3e8ae9f6b7c44e7c
This looks similar to #8540, though it is a long standing issue, not caused by that ticket:
Apply attachment: trac_8659-hold_powers.take4.patch
Depends on #12511
CC: @kcrisman
Component: symbolics
Keywords: sd40.5
Author: Burcin Erocal
Reviewer: Karl-Dieter Crisman, Mike Hansen
Merged: sage-5.1.beta5
Issue created by migration from https://trac.sagemath.org/ticket/8659
The text was updated successfully, but these errors were encountered: