First time here? Check out the FAQ!

Ask Your Question
1

Sturm polynomials with polynomial coefficients. How?

asked 3 years ago

vigna gravatar image

We are stuck with the following problem: we want Sage to compute Sturm polynomials for a polynomial with coefficients in a field of rational functions. As long as the coefficients are actually functions, no problem:

R.<k> = PolynomialRing(QQ)
S.<a> = PolynomialRing(R)
sturm((2*k+1)/(k-1) *a + 1)
=> [((2*k + 1)/(k - 1))*a + 1, (2*k + 1)/(k - 1)]

The problem is that unless the coeffients are actual functions, Sage refuses to do it:

R.<k> = PolynomialRing(QQ)
S.<a> = PolynomialRing(R)
sturm((2*k+1) *a + 1)
=> [...
~/Applications/SageMath/local/lib/python3.9/site-packages/sage/rings/polynomial/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial_generic_dense.quo_rem (build/cythonized/sage/rings/polynomial/polynomial_element.c:94403)()
  11434                     q = R(q)
  11435                 except TypeError:
> 11436                     raise ArithmeticError("division non exact (consider coercing to polynomials over the fraction field)")
  11437                 for j from n+k-2 >= j >= k:
  11438                     x[j] -= q * y[j-k]

ArithmeticError: division non exact (consider coercing to polynomials over the fraction field)

We tried several way to coerce, with no success. Suggestions welcome!

Preview: (hide)

Comments

1

What about using S.<a> = PolynomialRing(R.fraction_field()) ?

FrédéricC gravatar imageFrédéricC ( 3 years ago )

The coefficient (2*k+1)/(k-1) is not a polynomial but a rational function in k. So, "polynomial coefficients" are irrelevant here and the base ring should be a fraction field (not a polynomial ring) as FrédéricC suggested above.

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

vigna gravatar image

We tried a bit more and it turns out that dividing by a small irreducible polynomial will actually work:

sturm(((2*k+1) *a + 1)/(k^2+1))
=> [((2*k + 1)/(k^2 + 1))*a + 1/(k^2 + 1), (2*k + 1)/(k^2 + 1)]

The spurious factor cannot change the number of sign changes, so that's a workaround.

Preview: (hide)
link

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

Stats

Asked: 3 years ago

Seen: 247 times

Last updated: Sep 08 '21