Opened 3 years ago

Closed 3 years ago

#22004 closed enhancement (fixed)

Allow algorithm='sympy' in symbolic_sum function

Reported by: slabbe Owned by:
Priority: major Milestone: sage-7.5
Component: symbolics Keywords:
Cc: kcrisman Merged in:
Authors: Sébastien Labbé Reviewers: Ralf Stephan
Report Upstream: N/A Work issues:
Branch: 16acdcf (Commits) Commit: 16acdcf1e0c7bb444e848cf3f6df98a3a8d5715a
Dependencies: Stopgaps:

Description

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

Change History (12)

comment:1 Changed 3 years ago by kcrisman

  • Cc kcrisman added

comment:2 Changed 3 years ago by slabbe

  • Branch set to u/slabbe/22004
  • Commit set to aa2bcc1af9b5cd39c9be3206db95545c9f8fbb75
  • Status changed from new to needs_review

comment:3 Changed 3 years ago by git

  • Commit changed from aa2bcc1af9b5cd39c9be3206db95545c9f8fbb75 to a0f8d17acb8413b7d835fc7ae7fc47c4ac33706a

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

a0f8d1722004: Allow algorithm='sympy' in symbolic_sum function

comment:4 Changed 3 years ago by kcrisman

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

comment:5 Changed 3 years ago by kcrisman

  • Status changed from needs_review to needs_work

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!

comment:6 Changed 3 years ago by git

  • Commit changed from a0f8d17acb8413b7d835fc7ae7fc47c4ac33706a to 16acdcf1e0c7bb444e848cf3f6df98a3a8d5715a

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

16acdcf22004: fixing doc comment

comment:7 Changed 3 years ago by slabbe

  • Status changed from needs_work to needs_review

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

I wrote Maxima instead of Sage. Needs review!

comment:8 Changed 3 years ago by kcrisman

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!

comment:9 Changed 3 years ago by rws

  • Reviewers set to Ralf Stephan
  • Status changed from needs_review to positive_review

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.

comment:10 Changed 3 years ago by vbraun

  • Status changed from positive_review to needs_work

Author name is missing...

comment:11 Changed 3 years ago by tscrim

  • Authors set to Sébastien Labbé
  • Status changed from needs_work to positive_review

comment:12 Changed 3 years ago by vbraun

  • Branch changed from u/slabbe/22004 to 16acdcf1e0c7bb444e848cf3f6df98a3a8d5715a
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.