Opened 4 years ago
Closed 3 years ago
#19439 closed defect (fixed)
Corrections to infinities returned by mpmath
Reported by:  rws  Owned by:  

Priority:  major  Milestone:  sage8.0 
Component:  symbolics  Keywords:  
Cc:  paulmasson  Merged in:  
Authors:  Ralf Stephan  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  5d2d860 (Commits)  Commit:  5d2d8604975fb8bd16159720ed3f45296ff88210 
Dependencies:  #22838  Stopgaps: 
Description (last modified by )
It seems in some cases the infinities returned from mpmath need to be changed by the function's evalf()
in order to be correct:
Before:
sage: zeta(SR(1)) Infinity sage: zeta(SR(1.)) < +infinity sage: type(zeta(SR(1))) <type 'sage.symbolic.expression.Expression'> sage: type(zeta(SR(1)).pyobject()) <class 'sage.rings.infinity.UnsignedInfinity'> sage: type(zeta(SR(1.))) <type 'sage.symbolic.expression.Expression'> sage: type(zeta(SR(1.)).pyobject()) <type 'sage.rings.real_mpfr.RealNumber'>
The ticket should result in:
sage: zeta(SR(1)) Infinity sage: zeta(SR(1.)) Infinity sage: type(zeta(SR(1))) <type 'sage.symbolic.expression.Expression'> sage: type(zeta(SR(1)).pyobject()) <class 'sage.rings.infinity.UnsignedInfinity'> sage: type(zeta(SR(1.))) <type 'sage.symbolic.expression.Expression'> sage: type(zeta(SR(1.)).pyobject()) <class 'sage.rings.infinity.UnsignedInfinity'>
Ideally, fix other such cases too in this ticket.
Change History (13)
comment:1 Changed 3 years ago by
comment:2 Changed 3 years ago by
 Description modified (diff)
 Milestone changed from sage6.10 to sage7.3
The problematic output is rather for the last lines, ie symbolic input, which should produce symbolic output. It does, by wrapping FP infinity into SR. It would be better if that would rather produce the infinity from the ring.
comment:3 Changed 3 years ago by
 Cc paulmasson added
comment:4 Changed 3 years ago by
 Description modified (diff)
comment:5 Changed 3 years ago by
 Description modified (diff)
 Milestone changed from sage7.3 to sage7.4
 Summary changed from Different infinities returned by zeta/polylog to Convert FP subpackage infinities and NaNs to ring inifinities and symbolic NaN
comment:6 Changed 3 years ago by
 Description modified (diff)
comment:7 Changed 3 years ago by
 Priority changed from minor to major
comment:8 Changed 3 years ago by
 Description modified (diff)
 Milestone changed from sage7.4 to sage8.0
 Summary changed from Convert FP subpackage infinities and NaNs to ring inifinities and symbolic NaN to Corrections to infinities returned by mpmath
comment:9 Changed 3 years ago by
 Branch set to u/rws/corrections_to_infinities_returned_by_mpmath
comment:10 Changed 3 years ago by
 Commit set to 5d2d8604975fb8bd16159720ed3f45296ff88210
 Dependencies set to pynac0.7.6
New commits:
5d2d860  19439: Corrections to infinities returned by mpmath

comment:11 Changed 3 years ago by
 Dependencies changed from pynac0.7.6 to #22838
 Status changed from new to needs_review
comment:12 Changed 3 years ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
LGTM.
comment:13 Changed 3 years ago by
 Branch changed from u/rws/corrections_to_infinities_returned_by_mpmath to 5d2d8604975fb8bd16159720ed3f45296ff88210
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Polylog uses zeta here, so it's mainly because of
RR(1).zeta()
not being converted insymbolic/function.pyx
or theRR
functions not using theInfinityRing
elements.