Skip to content
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

Simplification of zero to the symbolic power n #36863

Open
2 tasks done
phul-ste opened this issue Dec 11, 2023 · 1 comment
Open
2 tasks done

Simplification of zero to the symbolic power n #36863

phul-ste opened this issue Dec 11, 2023 · 1 comment

Comments

@phul-ste
Copy link

phul-ste commented Dec 11, 2023

Steps To Reproduce

If we run
n=var('n')
a=0^n
b=a.simplify_full()
(a({n:0}),b({n:0}))
we get (1,0) as a result

Expected Behavior

I would expect that simplify_full applied at 0^n would not convert it to 0, since most (all?) mathematical formulas on non-negative integers are more compatible with 0^0=1 (as currently implemented, see the above-evaluation of a({n:0})).

I currently think that simplifications should preserve the form 0^n.

Actual Behavior

even with assumptions like
assume(n, 'integer')
assume(n>=0) or even assume(n==0), the simplification of 0^n yields to 0.

Additional Information

This is a more general issue than #36838 where we (yet) replaced 0^n by kronecker_delta(0, n).
Note that such basic replacement assumes n to be a non-negative integer.

Environment

- **OS**: Ubuntu 20.04
- **Sage Version**: 9.0
- Jupyter Notebook

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@RuchitJagodara
Copy link
Contributor

RuchitJagodara commented Dec 13, 2023

I worked on this, and found that the problem is with the maxima function, the function simplify_full() is calling maxima many times and when it is called for first time 0^n is resolved to 0 as you can see in below output.

sage: n = SR.var("n",domain="complex"); n
n
sage: maxima(0^n)
0

We had a same probelm with maxima function which can be found from the discussion in #36841. Where we had a problem that maxima function is simplifying conjugate(y) to y where y's domain is not defined. Here, I think this is also a problem with maxima function although we have defined the domain but here it is simplifying (0^n) to 0, no matter whatever the domain is. I think maxima does not have a condition to handle (0^n), I might be wrong but this was my observation.

I found another discussion based on this link .
So, I think this can be resolved only when maxima will change these things or sage implement its own system instead of maxima. But I think we can implement similar thing as we did in #36838.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants