Opened 5 years ago
Closed 4 years ago
#16203 closed defect (fixed)
conversion from SR.series to PowerSeries
Reported by:  rws  Owned by:  

Priority:  major  Milestone:  sage7.2 
Component:  algebra  Keywords:  series conversion days71 
Cc:  kcrisman  Merged in:  
Authors:  Ralf Stephan  Reviewers:  Maurizio Monge, Marc Mezzarobba 
Report Upstream:  N/A  Work issues:  
Branch:  aa9c05c (Commits)  Commit:  aa9c05c65a43fc26d947dfadcdc7fe77156a614e 
Dependencies:  #17399, #17438, #17659  Stopgaps: 
Description (last modified by )
sage: R.<x> = PowerSeriesRing(SR) sage: var('y') y sage: ex=1/(1y) sage: ex.series(y,20) 1 + 1*y + 1*y^2 + 1*y^3 + 1*y^4 + 1*y^5 + 1*y^6 + 1*y^7 + 1*y^8 + 1*y^9 + 1*y^10 + 1*y^11 + 1*y^12 + 1*y^13 + 1*y^14 + 1*y^15 + 1*y^16 + 1*y^17 + 1*y^18 + 1*y^19 + Order(y^20) sage: s=R(_); s 1 + y + y^2 + y^3 + y^4 + y^5 + y^6 + y^7 + y^8 + y^9 + y^10 + y^11 + y^12 + y^13 + y^14 + y^15 + y^16 + y^17 + y^18 + y^19 + Order(y^20) sage: type(s) <type 'sage.rings.power_series_poly.PowerSeries_poly'> sage: s.list() [1 + 1*y + 1*y^2 + 1*y^3 + 1*y^4 + 1*y^5 + 1*y^6 + 1*y^7 + 1*y^8 + 1*y^9 + 1*y^10 + 1*y^11 + 1*y^12 + 1*y^13 + 1*y^14 + 1*y^15 + 1*y^16 + 1*y^17 + 1*y^18 + 1*y^19 + Order(y^20)]
The correct result would be 1 + x + x^2...
. Obviously Order(20)
is not recognized as a marker for the existence of a power series. The whole symbolic expression is taken as a constant.
Also reported in http://ask.sagemath.org/question/24777/howtoconvertataylorpolynomialtoapowerseries/ and http://ask.sagemath.org/question/24968/coefficientsinpolynomialringoversymbolicring/
Change History (29)
comment:1 Changed 5 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:2 Changed 5 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:3 Changed 5 years ago by
 Description modified (diff)
comment:4 Changed 5 years ago by
 Description modified (diff)
comment:5 Changed 5 years ago by
 Cc kcrisman added
comment:6 Changed 5 years ago by
 Branch set to u/rws/conversion_from_sr_series___to_powerseries_sr__gives_unexpected_result
comment:7 Changed 5 years ago by
 Commit set to 0a43e2185b5a218184ee64dc2f2a3d6d4c4d0de6
 Dependencies set to #17399, #17438
comment:8 Changed 5 years ago by
 Branch u/rws/conversion_from_sr_series___to_powerseries_sr__gives_unexpected_result deleted
 Commit 0a43e2185b5a218184ee64dc2f2a3d6d4c4d0de6 deleted
comment:9 Changed 5 years ago by
 Branch set to public/16203
comment:10 Changed 5 years ago by
 Commit set to 53b2ca4e5f0c07c2c4e16d6fc6ee71f15ad29093
 Status changed from new to needs_review
 Summary changed from conversion from SR.series() to PowerSeries(SR) gives unexpected result to conversion from SR.series to PowerSeries
This also resolves #16198
New commits:
32ae67c  17399: do not let maxima handle ex.series coefficients

99820cf  17399: roll back previous commit to allow merge of 17428

d7da52c  17438: implement coeff list

9452fa9  17438: deprecate ex.coeff/coeffs()

0fec129  17438: implement ex.list()

168b659  Merge branch 'u/rws/coefficients_of_symbolic_expressions_revamp' of trac.sagemath.org:sage into t/17399/fix_coefficients_for_symbolic_series

6cd5286  17399: handle series in ex.coefficients()

53b2ca4  16203: implement conversion SR.series > PowerSeries

comment:11 followup: ↓ 12 Changed 5 years ago by
As currently stated in the description, this is the correct result as the variable for PowerSeriesRing
is x
, whereas we have some symbolic expression in y
(so is naturally an element in the coefficient ring). Having mismatched variable names automatically converting over seems fraught with problems and could lead to subtle bugs.
comment:12 in reply to: ↑ 11 Changed 5 years ago by
Replying to tscrim:
As currently stated in the description, this is the correct result as the variable for
PowerSeriesRing
isx
, whereas we have some symbolic expression iny
(so is naturally an element in the coefficient ring). Having mismatched variable names automatically converting over seems fraught with problems and could lead to subtle bugs.
I see. So, conversion to an existing power series ring should only be allowed if the series expansion variable has the same name as the ring var. Multiple vars aren't supported by SR.series anyway.
comment:13 Changed 5 years ago by
 Commit changed from 53b2ca4e5f0c07c2c4e16d6fc6ee71f15ad29093 to e1a90393ca47a2f057cd43231b8f67ec05443748
Branch pushed to git repo; I updated commit sha1. New commits:
e1a9039  16203: implement ex.series_variable; disallow ex.series conversion into mismatched PowerSeries ring element

comment:14 Changed 5 years ago by
comment:15 Changed 5 years ago by
 Branch changed from public/16203 to public/162031
comment:16 Changed 5 years ago by
 Commit changed from e1a90393ca47a2f057cd43231b8f67ec05443748 to 3ece975a59933edd7e742dbdc665ab85e1f9dafb
 Dependencies changed from #17399, #17438 to #17399, #17438, #17659
New commits:
3ece975  16203: conversion from SR.series to PowerSeries

comment:17 Changed 5 years ago by
 Commit changed from 3ece975a59933edd7e742dbdc665ab85e1f9dafb to 84bc4fb0a28b4094da5fc130d08de00e862bd2a0
comment:18 Changed 5 years ago by
 Commit changed from 84bc4fb0a28b4094da5fc130d08de00e862bd2a0 to 1d363e0f7758d02b6d36ad968016ce68a50919d1
Branch pushed to git repo; I updated commit sha1. New commits:
1d363e0  16203: fixes

comment:19 Changed 5 years ago by
 Commit changed from 1d363e0f7758d02b6d36ad968016ce68a50919d1 to 50cb33cc5e93de8679d7b4c7e2134320ca462a6f
Branch pushed to git repo; I updated commit sha1. New commits:
50cb33c  Merge branch 'develop' into t/16203/public/162031

comment:20 Changed 4 years ago by
 Milestone changed from sage6.4 to sagepending
Pending because #17659 is pending.
comment:21 Changed 4 years ago by
 Branch changed from public/162031 to public/162032
comment:22 Changed 4 years ago by
 Commit changed from 50cb33cc5e93de8679d7b4c7e2134320ca462a6f to 9cb0cc909988327b9a4a94e20743e95fbccae11c
 Milestone changed from sagepending to sage7.2
New commits:
9cb0cc9  Merge branch 'public/162031' of trac.sagemath.org:sage into tmp06

comment:23 Changed 4 years ago by
 Keywords days71 added
 Reviewers set to Maurizio Monge
 Status changed from needs_review to needs_work
"is" should be "==". The changes to ring.pyx are unrelated and should be removed. Everything else looks alright.
comment:24 Changed 4 years ago by
 Branch changed from public/162032 to public/162033
comment:25 Changed 4 years ago by
 Commit changed from 9cb0cc909988327b9a4a94e20743e95fbccae11c to ec8c797a4c57ac144d23c93749ad2e6f7ca5f9c7
 Status changed from needs_work to needs_review
New commits:
ec8c797  16203: conversion from SR.series to PowerSeries

comment:26 Changed 4 years ago by
 Commit changed from ec8c797a4c57ac144d23c93749ad2e6f7ca5f9c7 to aa9c05c65a43fc26d947dfadcdc7fe77156a614e
Branch pushed to git repo; I updated commit sha1. New commits:
aa9c05c  16203: fix string cmp

comment:27 Changed 4 years ago by
 Reviewers changed from Maurizio Monge to Maurizio Monge, Marc Mezzarobba
 Status changed from needs_review to positive_review
comment:28 Changed 4 years ago by
Thanks!
comment:29 Changed 4 years ago by
 Branch changed from public/162033 to aa9c05c65a43fc26d947dfadcdc7fe77156a614e
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
17399: do not let maxima handle ex.series coefficients
16203: preliminary implementation, dependent on 17399, 17438