Ask Your Question

Valuation error when composing power series

asked 2018-10-20 02:03:23 +0200

Annie Carter gravatar image

I'm trying to work with power series with coefficients in a ring consisting of elements $f/g$, where $f$ is a polynomial in several variables over the integers and g is a polynomial in one of those variables with unit constant coefficient. Ultimately, I'd like to be able to do all of the following:

  • Compose power series over this ring
  • Invert single-variable power series over this ring whose degree-1 coefficients are units
  • Reduce the coefficients of a power series modulo some ideal of the ring

I thought I would do this by starting with the Laurent series over $\mathbf{Z}$ in the variable that occurs in the denominator, constructing a polynomial ring over this by adjoining the other variables, and letting my power series take coefficients in this ring. But I'm getting an error I don't understand when I try to compose series. The following example illustrates the problem:

M1.<b> = LaurentSeriesRing(ZZ)
M.<a,c> = PolynomialRing(M1)
R.<t1,t2> = PowerSeriesRing(M)
X = t1 + t2 + O(t1,t2)^3
R1.<t> = PowerSeriesRing(M)
f = X(t,t^2); f

This returns the type error Substitution defined only for elements of positive valuation, unless self has infinite precision despite the fact that replacing the last line by t.valuation() or (t^2).valuation() returns 1 or 2, respectively.

The problem seems to result from a combination of factors. If I replace the second line with either

M.<a,c> = PolynomialRing(ZZ)


M.<a> = PolynomialRing(M1)

the error vanishes and the code returns the expected t + t^2 + O(t)^3. It also gives no error if I define R and R1 to be polynomial rings, rather than power series rings, over M (and correspondingly delete the big-O notation).

Any ideas about what is triggering the error, or another way to construct these power series?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-10-22 23:08:51 +0200

rburing gravatar image

Looking at the source of sage.rings.multi_power_series_ring_element.MPowerSeries.__call__ we find that Sage is parsing the arguments to X incorrectly. Namely it first tries to cast each argument to an element of X.parent() which is R. When doing this with t we would expect it to fail. There is no natural way in which t is an element of R, right? But according to Sage, there is:

sage: R(t)

I can only guess that it somehow finds a power series parent object (underlying R) which has a single generator, and maps to it. Furthermore:

sage: R(t).valuation()

This explains the error, and why the replacements succeed in removing the error: in those cases there is no power series parent object with a single generator underlying R which we can map t to:

sage: R(t)
TypeError: Cannot coerce input to polynomial ring.

In this case, X(t,t^2) evaluates correctly to X._subs_formal(t,t^2) which gives the result you want.

So a workaround is to call X._subs_formal(t,t^2) directly to avoid the faulty argument parsing.

This could also be reported as a bug. Maybe _subs_formal should be made public (with documentation).

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-10-20 02:03:23 +0200

Seen: 141 times

Last updated: Oct 22 '18