sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.48k stars 488 forks source link

Allow algorithm='sympy' in symbolic_sum function #22004

Closed seblabbe closed 8 years ago

seblabbe commented 8 years ago

I want this to work:

sage: n = var('n')
sage: sum(1/((2*n+1)^2-4)^2, n, 0, Infinity, algorithm='sympy')

See this question on ask.sagemath.org

CC: @kcrisman

Component: symbolics

Author: Sébastien Labbé

Branch/Commit: 16acdcf

Reviewer: Ralf Stephan

Issue created by migration from https://trac.sagemath.org/ticket/22004

seblabbe commented 8 years ago

Branch: u/slabbe/22004

seblabbe commented 8 years ago

Commit: aa2bcc1

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

a0f8d1722004: Allow algorithm='sympy' in symbolic_sum function
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from aa2bcc1 to a0f8d17

kcrisman commented 8 years ago
comment:4

(Incidentally, the example here, which doesn't work right with Maxima, may be related to https://sourceforge.net/p/maxima/bugs/3236/.)

kcrisman commented 8 years ago
comment:5

Also,

         sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm = 'giac')           # optional - giac
         (pi*e^(2*pi) - pi*e^(-2*pi))/(e^(2*pi) + e^(-2*pi) - 2)
+    SymPy can't solve that summation::
+

You will need an extra blank line for formatting. I'd also say that Maxima can't do the sum in this ticket, not that Sage per se can't - indeed, Sage can after this patch!

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

16acdcf22004: fixing doc comment
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from a0f8d17 to 16acdcf

seblabbe commented 8 years ago
comment:7

On my screen, the extra blank line is already there. Can you confirm this problem?

I wrote Maxima instead of Sage. Needs review!

kcrisman commented 8 years ago
comment:8

Huh, now it appears fine. Go figure.

Wish I had time to do proper review :( don't even have up-to-date Sage (compiling). These comments are what I could do for now, and as long as someone checks it works right and "corner cases" don't yield errors you haven't caught, I definitely say positive review!

rwst commented 8 years ago
comment:9

I really see no problem with this addition. Now that there is a symbolic sum in Sage the conversion of unsolved sums from SymPy will only need a small SymPy patch (in the SymPy repo or in build/pkgs/sympy) to work.

rwst commented 8 years ago

Reviewer: Ralf Stephan

vbraun commented 8 years ago
comment:10

Author name is missing...

tscrim commented 8 years ago

Author: Sébastien Labbé

vbraun commented 8 years ago

Changed branch from u/slabbe/22004 to 16acdcf