Ask Your Question

Defining a power series with variable coefficients

asked 2018-07-31 19:50:28 +0100

Annie Carter gravatar image

It is not difficult to define a multivariate power series; for example, the following works:

R.<a,x,y> = PowerSeriesRing(ZZ,3)
f = a*x + y + x*y + O(a,x,y)^3

But what I would really like is to treat the series f as a series in x and y, with a acting as a variable coefficient, so that, for example, I could instead write f = a*x + y + x*y + O(x,y)^3. I tried the following:

M = PolynomialRing(ZZ,'a')
R.<x,y> = PowerSeriesRing(M,2)
f = a*x + y + x*y + O(x,y)^3

This generates the error "name a is not defined." What can I do to get a into the coefficient ring?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-08-01 17:44:46 +0100

slelievre gravatar image

updated 2018-08-01 17:49:10 +0100

To fix this, a needs to be defined as the generator of M.

The code in the question only sets a as the display value for this generator.

So, do one of the following.

M.<a> = PolynomialRing(ZZ)


M.<a> = ZZ[]


M = PolynomialRing(ZZ, 'a')
a = M.gen()


M = PolynomialRing(ZZ, 'a')

Note that there is also a shortcut with [[]] for defining a power series rings.

sage: M.<a> = ZZ[]
sage: M
Univariate Polynomial Ring in a over Integer Ring
sage: R.<x, y> = M[[]]
sage: R
Multivariate Power Series Ring in x, y over Univariate Polynomial Ring in a over Integer Ring
sage: f = a*x + y + x*y + O(x,y)^3
sage: f
a*x + y + x*y + O(x, y)^3
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-07-31 19:50:28 +0100

Seen: 250 times

Last updated: Aug 01 '18