Opened 4 years ago

Closed 4 years ago

#17399 closed defect (fixed)

fix coefficients for symbolic series

Reported by: rws Owned by:
Priority: major Milestone: sage-6.5
Component: symbolics Keywords:
Cc: kcrisman Merged in:
Authors: Ralf Stephan Reviewers: Bruno Grenet
Report Upstream: N/A Work issues:
Branch: 0b9914f (Commits) Commit: 0b9914f8b6cd4cb0f885f0550bfd375d80495a71
Dependencies: #17438 Stopgaps:

Description (last modified by rws)

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/(1-x)).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/coefficients-in-polynomial-ring-over-symbolic-ring/

Change History (12)

comment:1 Changed 4 years ago by rws

  • Description modified (diff)

comment:2 Changed 4 years ago by kcrisman

  • Cc kcrisman added

comment:3 Changed 4 years ago by rws

  • Branch set to u/rws/fix_coefficients_for_symbolic_series

comment:4 Changed 4 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 32ae67c2fe24800943b883fe7f591bea784e5789
  • Status changed from new to needs_review

New commits:

32ae67c17399: do not let maxima handle ex.series coefficients

comment:5 Changed 4 years ago by rws

  • Dependencies set to #17438
  • Status changed from needs_review to needs_work

comment:6 Changed 4 years ago by git

  • Commit changed from 32ae67c2fe24800943b883fe7f591bea784e5789 to 6cd5286d987cf944621fb7666f1756b7785bcd0b

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

99820cf17399: roll back previous commit to allow merge of 17428
d7da52c17438: implement coeff list
9452fa917438: deprecate ex.coeff/coeffs()
0fec12917438: implement ex.list()
168b659Merge branch 'u/rws/coefficients_of_symbolic_expressions_revamp' of trac.sagemath.org:sage into t/17399/fix_coefficients_for_symbolic_series
6cd528617399: handle series in ex.coefficients()

comment:7 Changed 4 years ago by rws

  • Status changed from needs_work to needs_review

comment:8 Changed 4 years ago by bruno

  • Status changed from needs_review to 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 4 years ago by git

  • Commit changed from 6cd5286d987cf944621fb7666f1756b7785bcd0b to 0b9914f8b6cd4cb0f885f0550bfd375d80495a71

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

0b9914f17399: remove whitespace changes

comment:10 Changed 4 years ago by rws

  • Status changed from needs_work to needs_review

comment:11 Changed 4 years ago by bruno

  • Reviewers set to Bruno Grenet
  • Status changed from needs_review to positive_review

Thanks, LGTM.

comment:12 Changed 4 years ago by vbraun

  • Branch changed from u/rws/fix_coefficients_for_symbolic_series to 0b9914f8b6cd4cb0f885f0550bfd375d80495a71
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.