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
(-1)^(2/3) evaluates to 1 #15605
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:4
Seems to be a problem about "even" powers:
|
This comment has been minimized.
This comment has been minimized.
Replying to @mezzarobba:
It is indeed a known issue since at least this ask answer, and i use this example in my presentations about Sage and the need to define objects within a reliable parent. I did not report that on trac because this is somehow a feature of the symbolic ring : no semantics. I remember a discussion with you at sd49 (Orsay) about that precise example and the benefits (or not!) of having such kind of symbolic expressions that are able to make all kind of simplifications/derivatives/evaluations without context. If one want to have something that both:
It would however be awesome to have a well-designed object to work with holomorphic functions, along the same lines that what is done with polynomials, i guess it is a very hard task, and i do not know whether there exists libraries for that. |
comment:8
Replying to @sagetrac-tmonteil:
I think that with |
comment:9
Replying to @sagetrac-tmonteil:
I agree in part only. Sure, general symbolic expressions have very weak semantics—essentially, I view them as straight-line programs that are just required to evaluate to what you'd expect when you assign values to free variables. Many operations on symbolic expressions, however, only make sense with stronger assumptions on the expressions. Typically, simplifications are supposed to transform these ”programs“ into ”equivalent“ ones, but of course whether two ”programs“ are equivalent depends on what the variables can represent. The sensible thing to do IMO is to view all variables as complex by default, and require simplifications to be valid for arbitrary complex values of all variables (or more accurately, for a generic choice of complex values: for example, we probably do want We'll still get nonsense in many cases when trying to simplify expressions containing constants from finite fields or other parents that do not fit well into this model, but I don't know how to avoid that. (Something that may be worth trying would be to define new symbolic ”rings“ parametrized by a parent. For instance, in
I don't think we want that. IMO this rule should be applied only if either assumptions on |
This comment has been minimized.
This comment has been minimized.
comment:12
Just to give some concrete motivations, in #16222 (and #17516) we need a rather small subsets of symbolic expressions that modelize (some) algebraic numbers. Namely:
An example of such expression is
Do you think this must be out of the symbolic ring? Vincent |
comment:13
Replying to @videlec:
I for one don't really see a problem with using the symbolic ring, but it depends if you have more use cases in mind. |
comment:14
Replying to @mezzarobba:
Here is one problem with using the symbolic ring for constants:
The answer should be a floating point real number! Vincent |
comment:15
Replying to @videlec:
Yes, perhaps, I'm not sure. Perhaps it should be a symbolic expression wrapping a FP number. Or perhaps it should just stay unevaluated. For instance, if |
comment:16
Replying to @mezzarobba:
This is why I am arguing for having a new intermediate world:
Having some Vincent |
comment:17
Replying to @mezzarobba:
But that would be then a different case? Anyway, the non-symbolic issue is now #18697. |
comment:18
Back to the original issue. The actual problem is in the Pynac logic for powers where usually the Python / Cython code for However, we cannot just say always use
i.e. both wrong results in the following are from independent bugs:
|
comment:19
The symbolic issue is pynac/pynac#221. We can then fix the Cython code in the rational ring, as well. |
Branch: u/rws/__1___2_3__evaluates_to_1 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
Author: Ralf Stephan |
comment:22
Actually fixing this in |
comment:23
Nice! Some more tests
|
comment:25
good enough. Thanks for the fix! |
Reviewer: Vincent Delecroix |
comment:26
Thanks for the review. |
Changed branch from u/rws/__1___2_3__evaluates_to_1 to |
Changed commit from |
comment:28
I disagree with the fix here. It seems to me that we really should catch more generally |
comment:29
See #26414 for a follow-up. |
Likely a duplicate, but I couldn't find it elsewhere...
Of course, this is inconsistent with virtually all interpretations and conversions of symbolic expressions...
Also:
but
CC: @videlec
Component: symbolics
Author: Ralf Stephan
Branch:
69f75ec
Reviewer: Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/15605
The text was updated successfully, but these errors were encountered: