@@ -199,57 +199,6 @@ cdef class SymbolicSeries(Expression):
199
199
cdef Expression ex = new_Expression_from_GEx(self ._parent, x)
200
200
return ex
201
201
202
- def coefficients (self , x = None , sparse = True ):
203
- r """
204
- Return the coefficients of this symbolic series as a list of pairs.
205
-
206
- INPUT:
207
-
208
- - ``x`` -- ( optional) variable
209
-
210
- - ``sparse`` -- boolean ( default: ``True``) ; if ``False`` return a list
211
- with as much entries as the order of the series
212
-
213
- OUTPUT: depending on the value of ``sparse``,
214
-
215
- - A list of pairs ``( expr, n) ``, where ``expr`` is a symbolic
216
- expression and ``n`` is a power ( ``sparse=True``, default)
217
-
218
- - A list of expressions where the ``n``-th element is the coefficient of
219
- ``x^ n`` when ``self`` is seen as polynomial in ``x`` ( ``sparse=False``) .
220
-
221
- EXAMPLES::
222
-
223
- sage: s = ( 1/( 1-x)) . series( x,6) ; s
224
- 1 + 1* x + 1* x^ 2 + 1* x^ 3 + 1* x^ 4 + 1* x^ 5 + Order( x^ 6)
225
- sage: s. coefficients( )
226
- [[1, 0 ], [1, 1 ], [1, 2 ], [1, 3 ], [1, 4 ], [1, 5 ]]
227
- sage: s. coefficients( x, sparse=False)
228
- [1, 1, 1, 1, 1, 1 ]
229
- sage: x,y = var( "x,y")
230
- sage: s = ( 1/( 1-y* x-x)) . series( x,3) ; s
231
- 1 + ( y + 1) * x + (( y + 1) ^ 2) * x^ 2 + Order( x^ 3)
232
- sage: s. coefficients( x, sparse=False)
233
- [1, y + 1, (y + 1)^2 ]
234
- """
235
- if x is None :
236
- x = self .default_variable()
237
- l = [[self .coefficient(x, d), d] for d in range (self .degree(x))]
238
- if sparse:
239
- return l
240
-
241
- from sage.rings.integer_ring import ZZ
242
- if any (not c[1 ] in ZZ for c in l):
243
- raise ValueError (" cannot return dense coefficient list with noninteger exponents" )
244
- val = l[0 ][1 ]
245
- if val < 0 :
246
- raise ValueError (" cannot return dense coefficient list with negative valuation" )
247
- deg = l[- 1 ][1 ]
248
- ret = [ZZ(0 )] * int (deg+ 1 )
249
- for c in l:
250
- ret[c[1 ]] = c[0 ]
251
- return ret
252
-
253
202
def power_series (self , base_ring ):
254
203
"""
255
204
Return the algebraic power series associated to this symbolic series.
0 commit comments