Opened 8 years ago
Closed 8 years ago
#17399 closed defect (fixed)
fix coefficients for symbolic series
Reported by:  Ralf Stephan  Owned by:  

Priority:  major  Milestone:  sage6.5 
Component:  symbolics  Keywords:  
Cc:  KarlDieter Crisman  Merged in:  
Authors:  Ralf Stephan  Reviewers:  Bruno Grenet 
Report Upstream:  N/A  Work issues:  
Branch:  0b9914f (Commits, GitHub, GitLab)  Commit:  0b9914f8b6cd4cb0f885f0550bfd375d80495a71 
Dependencies:  #17438  Stopgaps: 
Description (last modified by )
There is no SR.function that gets the coefficients of SR.series; rather, coeffs()
etc give confusing results; truncate()
must be prepended manually.
sage: x=var('x') sage: s=(1/(1x)).series(x,6) sage: s.coeffs() [[x^5 + x^4 + x^3 + x^2 + x + Order(x^6) + 1, 0]] sage: s.coefficient(4) 0
Working around with s.truncate()
is only a fig leaf.
Extracted from http://ask.sagemath.org/question/24968/coefficientsinpolynomialringoversymbolicring/
Change History (12)
comment:1 Changed 8 years ago by
Description:  modified (diff) 

comment:2 Changed 8 years ago by
Cc:  KarlDieter Crisman added 

comment:3 Changed 8 years ago by
Branch:  → u/rws/fix_coefficients_for_symbolic_series 

comment:4 Changed 8 years ago by
Authors:  → Ralf Stephan 

Commit:  → 32ae67c2fe24800943b883fe7f591bea784e5789 
Status:  new → needs_review 
comment:5 Changed 8 years ago by
Dependencies:  → #17438 

Status:  needs_review → needs_work 
comment:6 Changed 8 years ago by
Commit:  32ae67c2fe24800943b883fe7f591bea784e5789 → 6cd5286d987cf944621fb7666f1756b7785bcd0b 

Branch pushed to git repo; I updated commit sha1. New commits:
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()

comment:7 Changed 8 years ago by
Status:  needs_work → needs_review 

comment:8 Changed 8 years ago by
Status:  needs_review → needs_work 

You have introduced lines made of blank symbols in src/sage/symbolic/expression.pyx
. Please replace them by empty lines. It seems to be the case also on the code introduced for the related ticket #17348. Maybe you could replace all of them in expression.pyx
at once.
Note. With sed
: sed i e "s/^ *$//" src/sage/symbolic/expression.pyx
.
comment:9 Changed 8 years ago by
Commit:  6cd5286d987cf944621fb7666f1756b7785bcd0b → 0b9914f8b6cd4cb0f885f0550bfd375d80495a71 

Branch pushed to git repo; I updated commit sha1. New commits:
0b9914f  17399: remove whitespace changes

comment:10 Changed 8 years ago by
Status:  needs_work → needs_review 

comment:11 Changed 8 years ago by
Reviewers:  → Bruno Grenet 

Status:  needs_review → positive_review 
Thanks, LGTM.
comment:12 Changed 8 years ago by
Branch:  u/rws/fix_coefficients_for_symbolic_series → 0b9914f8b6cd4cb0f885f0550bfd375d80495a71 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
17399: do not let maxima handle ex.series coefficients