-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Mixing of different domains for symbolic variables #6862
Comments
comment:1
See http://groups.google.com/group/sage-devel/browse_thread/thread/e25e03c9dba88a93 Also, based on the hint there from Robert Dodier, here is the eventual way a fix will have to occur, perhaps as outlined in the thread:
|
comment:2
See also this closely related ask.sagemath.org question, where the following example occurs.
I think this is a little weird, though, since in Maxima
and sadly, the Maxima manual says that all this is expected to do is
William says in the thread above that
and perhaps that could be part of the initialization process of any variable - without actually calling Maxima at that time, of course! |
comment:3
#14628 is somewhat related, though this would not fix it, as far as I can tell. |
comment:4
Let's make sure to also test #11656, which was a dup, when (?!) we fix this:
|
comment:5
see also #14305 Paul |
comment:7
The result reported in the description is correct :
//unless
which is also correct. ==> marking as invalid and requesting review in order to get this bug closed... |
comment:8
The problem is Maxima, not Sage. (Or rather, the fact that we don't have a good way to make sure that Maxima variables are complex by default, or didn't at the time.)
|
comment:9
Replying to @kcrisman:
Unless BTW, at least the "Computational mathematics with SageMath" book states that SR variables behave, by default, as complex variables, but, IIRC, no formal assertion is made in the documentation about this. AFAICT, we use a"domain:complex" assertion in our uses of Maxima. So what should be the behavior you expect ? OIn fact, I'm having troubleperceivng the point of this ticket... ==> re-asking review ; possibly after discussion on |
comment:10
I thought you said this one was correct:
So you can see that the Maxima (
The problem is that Anyway, perhaps we need a third party to adjudicate; I did try to suss out the right behavior after your comment:7 but I have been known to make sign errors in my life :-) But I hope I clarified the exact status in this comment.
and I don't think those can both be correct. |
comment:11
Replying to @kcrisman:
Indeed; I'd say that the problem diagnosed in the ticket is spot on. I also don't know what the best solution is. Note that the two results are both correct if A minimal solution would be to document (in simplify and/or in real_part, imag_part, and conjugate) that for |
comment:12
Replying to @nbruin: [ Snip... ]
Indeed...
At the (accepted) risk of lampooning the British Commons : No, no, no, no, no, no, no, no. And no... This assumption is a way too large limitation of Sage's algebraic abilities. And can't be enforced by checks... Finding the source of the problem is necessary. It might help to show that the problem is alleviated by renaming the variables :
However :
This behaviour let us think that somehow,
which is correct. This suggests a direction for debugging the source (which is probably in However, the real problem is probably not in Maxima itself :
Notwithstanding the
Maxima's HTH, |
comment:13
Replying to @EmmanuelCharpentier:
Nice find! That is consistent with "maxima by default assumes variables are real-valued as far as conjugate, real_part, imag_part as concerned", so there's a mismatch between sage/pynac and maxima what the default assumptions about variables is, and indeed the appropriate work-around is to sync up those assumptions to match (one way or the other). I'm not so sure if we should bracket each simplify call with an I'd also be fine with changing the assumption that variables are by default real unless declared otherwise. If we want to change our default assumption about variables, we may need to change pynac. Otherwise, I think it's a matter of changing the maxima interface (mainly the maxima_calculus one). |
comment:14
Correct. As I mention above,
Yes, we should be sending the correct thing to Maxima. The problem is that it might be hard to parse out every symbol and make sure it has all the right extra assumptions, or at least in the past that seems to have led into a rat's nest. We do prepend
I think that changing all variables to real by default probably would be a bad move in many ways. (I don't think you're suggesting that, but the way you phrased it sounds like that.) |
comment:15
The |
Upstream: Reported upstream. No feedback yet. |
comment:16
Priority set to |
comment:17
Replying to @kcrisman:
That should actually be dead-easy. This is not about sending strings over that need to be parsed for variables; this is about sending expressions over. They are already parsed. Especially if you do that in the way that maxima_lib works, the symbol needs to be created on the maxima side. If we assume our variables to be complex by default, then that assumption should be inserted at that time. If assumptions change, we just need to do whatever dance we do already to change them on the maxima side as well. The main problem I expect is that inserting the assumption will probably lead to other side-effects we didn't anticipate. That's why I figured documenting the current "simplify" behaviour is the easier way out (but I wouldn't trust non-trivial SR computations for publication-quality work anyway). |
comment:18
Good. And I certainly only care about the
True.
I expect they will say this is user error or won't implement, since the documentation makes it pretty clear that |
comment:19
According to Stavros Macrakis, We should therefore fox it at Sage's level... |
Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers deny it's a bug. |
comment:20
Related ticket: #30793. |
comment:21
Moving to 9.4, as 9.3 has been released. |
From suge-support
On Sep 1, 11:35 pm, Mani chandra mchan...@iitk.ac.in wrote:
This seems to be happening because maxima(via simplify)
treats variables as real whereas pynac treats as
complex.
Upstream: Reported upstream. Developers deny it's a bug.
Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/6862
The text was updated successfully, but these errors were encountered: