A computer algebra system written in pure Python http://sympy.org/ . To get started to with contributing https://github.com/sympy/sympy/wiki/Introduction-to-contributing
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Added expand to log rewrites (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
updated test for asin,atan,acot… (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
removed wrong test (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Modified test (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Fixed leading term for acos/ase… (compare)
anutosh491 on series_for_arg
Updated code (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Improved code quality (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Fixed code quality (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Added test for 21721 (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Fixed Failing tests (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Code Cleanup (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Fixed error in test_sums_produc… (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
Fixed all failing tests (compare)
anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method
prevent unnecessary hashing add type hints to printing/late… Merge pull request #23588 from … and 34 more (compare)
.subs
function is quite slow. When I have a long expression e
(can contain nonlinear terms like x**2
, y*x*z
), calling e.subs(some_dict)
takes quite sometime (a sec or so). In fact subs is often slower than solving for large equations. Am I using subs
correctly?
import sympy as sp
from sympy import exp, oo
sp.init_printing()
x = sp.Symbol("x")
a, m, h = sp.symbols("a, m, h", positive = True)
A = sp.Symbol("A")
f = exp(-2 * a * m * x**2 / h)
int_f = sp.integrate(f, (x, 0, oo))
eq1 = 2 * (abs(A))**2 * (int_f) - 1
print(sp.solve(eq1, A))
Sum((-1)**(x+1) + (-1)**(x+2) , (x, 1, oo)).is_convergent()
is not returning the expected result and raises a TypeError saying Invalid NaN comparison , is this a meaningful error or Am I missing something useful ?Maybe I could raise an issue ?
sym.simplify(sym.Sum((-1)**(x+1)+(-1)**(x+2),(x,1,sym.oo)))
Last year expansion was causing slowdowns in the .equals
method. In sympy/sympy#19673 we had
In [10]: e1 = 100*(x**3 + 1)**99
In [11]: e2 = 300*x**2*(x**3 + 1)**99
In [12]: %time e1.equals(e2)
CPU times: user 1.13 s, sys: 9.37 ms, total: 1.14 s
Wall time: 1.15 s
Out[12]: False
It seems like the .equals
method has gotten faster. Anyone know what's changed?
(1+x)**n
as a binomial expansion , not sure I could find one . I ask this because I'm working on an issue which involves something like (1+x)**n- x**n
, now the issue works perfectly when we use numbers like (1+x)**3 - x**3
and we could solve this through gammasimp()
giving 3*x**2 + 3*x + 1
but symbolically not sure how we could approach it . Maybe if we could expand the (1+x)**n
as a binomial expansion and cancel out the first term which would always be x**n
then the maybe the issue wouldn't be that tough to solve . Currently gammasimp() isn't of much help ! and returns back the same expression !
>>> k, n = symbols('k, n', positive=True, integer=True) >>> from sympy import oo
>>> limit((n+1)**k/((n+1)**(k+1) - (n)**(k+1)), n, oo)
oo
>>> limit((n+1)**2/((n+1)**(3) - (n)**(3)), n, oo)
1/3
>>> limit((n+1)**2/((n+1)**(3) - (n)**(3)).gammasimp(), n, oo)
1/3
>>> limit((n+1)**k/((n+1)**(k+1) - (n)**(k+1)).gammasimp(), n, oo)
0
gammasimp()
there, so have to get that case correctly too ! Never thought a gammasimp()
would alter limits from oo
to 0
but it does .Maybe if I find it too buggy and some more places where it the (n+1)**k - n**k
combo goes wrong , i'll raise this !
(n+1)**k -(n)**k
gives the correct answer . I am not sure why this may be happening but obviously it feels a bit strange if different arrangements of the same expression can lead to different answers! The gammasimp of that expression which returns 0 is (-n*n**k + n*(n + 1)**k + (n + 1)**k)