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

Powers of rectangular and exponential form of complex numbers are not equivalent for simplify #16797

Open
ghost opened this issue May 9, 2019 · 1 comment
Labels

Comments

@ghost
Copy link

ghost commented May 9, 2019

Hi! This code

import sympy as sym
sym.init_printing()
n = sym.symbols('n', integer=True)
a = sym.I**n
b = sym.E**(sym.I * sym.pi / 2 * n)
sym.simplify(a - b)

outputs

.

However, I would expect it to do the simplification and return instead.

Note that when is a constant instead of a symbol, it works:

import sympy as sym
sym.init_printing()
n = 2
a = sym.I**n
b = sym.E**(sym.I * sym.pi / 2 * n)
sym.simplify(a - b)

outputs

.

@sidhantnagpal
Copy link
Member

A workaround could be to use a.rewrite(exp) - b.

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

No branches or pull requests

1 participant