Ticket #10564 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

bug in symbolic sums

Reported by: zimmerma Owned by: burcin
Priority: major Milestone: sage-4.6.2
Component: calculus Keywords:
Cc: jpflori Work issues:
Report Upstream: N/A Reviewers: André Apitzsch
Authors: Jean-Pierre Flori Merged in: sage-4.6.2.alpha3
Dependencies: Stopgaps:

Description

This was reported by Alexandre Casamayou:

sage: var('n')
n
sage: sum (n^3 * x^n, n, 0, infinity)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: unable to make sense of Maxima expression '(limit(x^?g3641*(x^4-3*x^3+3*x^2-x)*?g3641^3+x^?g3641*(-3*x^3+6*x^2-3*x)*?g3641^2+x^?g3641*(3*x^3-3*x)*?g3641+x^3+x^?g3641*(-x^3-4*x^2-x)+4*x^2+x,?g3641,inf))/(x^4-4*x^3+6*x^2-4*x+1)' in Sage

Attachments

trac_10564_non_regression_test.patch Download (826 bytes) - added by jpflori 2 years ago.
Removed TAB character

Change History

comment:1 Changed 2 years ago by jpflori

This seem to have been fixed between Sage 4.6.0 and Sage 4.6.1 (Maxima was updated meanwhile)

On 4.6.0 I've got a similar problem, but everything is fine on 4.6.1:

sage: var('n')
n
sage: sum (n^3 * x^n, n, 0, infinity)
-(x^3 + 4*x^2 + x)/(-x^4 + 4*x^3 - 6*x^2 + 4*x - 1)

If someone could confirm that, I guess the ticket can be closed.

comment:2 Changed 2 years ago by aapitzsch

I can confirm that, tested on 4.6.2.alpha0. So ticket can be closed.

comment:3 Changed 2 years ago by zimmerma

I would like a non-regression test to be added before the ticket is closed.

Paul

comment:4 Changed 2 years ago by jpflori

  • Cc jpflori added
  • Status changed from new to needs_review

I just added a minimal patch to perform such a test.

Feel free to review it.

comment:5 follow-up: ↓ 6 Changed 2 years ago by aapitzsch

Tested on 4.6.2.alpha0.

File "/scratch/sage-4.6.1/devel/sage/sage/calculus/calculus.py", line 513:
    sage: sum (n^3 * x^n, n, 0, infinity)
Expected:
    -(x^3 + 4*x^2 + x)/(-x^4 + 4*x^3 - 6*x^2 + 4*x - 1)
Got:
    (x^3 + 4*x^2 + x)/(x^4 - 4*x^3 + 6*x^2 - 4*x + 1)

comment:6 in reply to: ↑ 5 Changed 2 years ago by jpflori

Replying to aapitzsch:

Tested on 4.6.2.alpha0. File "/scratch/sage-4.6.1/devel/sage/sage/calculus/calculus.py", line 513: sage: sum (n^3 * x^n, n, 0, infinity) Expected: -(x^3 + 4*x^2 + x)/(-x^4 + 4*x^3 - 6*x^2 + 4*x - 1) Got: (x^3 + 4*x^2 + x)/(x^4 - 4*x^3 + 6*x^2 - 4*x + 1)

Oops, my patch is indeed wrong because I use a modified version of pynac.

I just checked with the standard spkg and got the same result as you.

So you got the correct expression and I'll attach a correct patch right now.

comment:7 Changed 2 years ago by aapitzsch

  • Status changed from needs_review to needs_work
sage -t -long "devel/sage/sage/calculus/calculus.py"
******************************************************
Error: TAB character found.

comment:8 Changed 2 years ago by jpflori

Removed TAB character:

[jp@napoleon]% ./sage -t -long "devel/sage/sage/calculus/calculus.py"                             ~/boulot/sage/sage-current
sage -t -long "devel/sage/sage/calculus/calculus.py"        
         [18.6 s]
 
----------------------------------------------------------------------
All tests passed!
Total time for all tests: 18.6 seconds

Changed 2 years ago by jpflori

Removed TAB character

comment:9 Changed 2 years ago by aapitzsch

  • Status changed from needs_work to positive_review
  • Reviewers set to André Apitzsch
  • Authors set to Jean-Pierre Flori

comment:10 Changed 2 years ago by zimmerma

thank you Jean-Pierre for the non-regression test.

Paul

comment:11 Changed 2 years ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.6.2.alpha3
Note: See TracTickets for help on using tickets.