We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I see exponential equation solving is not implemented for rationals for negative or complex bases
from sympy import * x = Symbol('x') a = (-2*I)**2 b = (-2*I)**3 solveset(a**x - b, x, S.Rationals)
But it should be improved to give the solutions satisfying the diophantine problem like below
from sympy import * n1, n2 = symbols('n1 n2', integer=True) a = (-2*I)**2 b = (-2*I)**3 ratio = simplify(log(abs(a)) / log(abs(b))) assert ratio.is_Rational p, q = ratio.p, ratio.q angle_a = cancel(arg(a) / pi) angle_b = cancel(arg(b) / pi) assert angle_a.is_Rational assert angle_b.is_Rational eqn = q*(2*n1 + angle_a) - p*(2*n2 + angle_b) eqn = Poly(eqn, n1, n2) coeff_n1 = eqn.coeff_monomial(n1) coeff_n2 = eqn.coeff_monomial(n2) coeff_const = eqn.coeff_monomial([0, 0]) _, _, gcd = gcdex(coeff_n1, coeff_n2) assert (coeff_const % gcd) == 0 print(1/ratio)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I see exponential equation solving is not implemented for rationals for negative or complex bases
But it should be improved to give the solutions satisfying the diophantine problem like below
The text was updated successfully, but these errors were encountered: