I've found a couple of issues with differentiation in InfinitePolynomialRing

(ISSUE #1) Differentiation fails in InfinitePolynomialRing(QQ), e.g. the 
following code

R.<x> = InfinitePolynomialRing(QQ)
f = x[0] + x[1]
derivative(f,x[1])

gives an error
TypeError: Argument 'var' has incorrect type (expected 
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular, 
got InfinitePolynomial_dense)

However, if we replace QQ with something more sophisticated, 
differentiation starts suddenly work:

K.<u> = PolynomialRing(QQ)
R.<x> = InfinitePolynomialRing(K)
f = x[0] + x[1]
derivative(f,x[1])

gives 1 as expected.

(ISSUE #2) Slightly modifying the second example above:

K.<u> = PolynomialRing(QQ)
R.<x> = InfinitePolynomialRing(K)
f = x[0] + x[1]
derivative(f,x[2])

we get an error
ValueError: cannot differentiate with respect to x_2

However, if we try to execute the same 'derivative(f,x[2])' command again 
in the same Sage session, it will succeed.
So, it appears that if we differentiate with respect to a new variable, 
which was not accessed before, then differentiation would fail. I hope this 
is not an intended behavior and can be easily fixed.

Thanks,
Max

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/fff3d8a2-9cc5-415f-aed1-8c4e90e14420n%40googlegroups.com.

Reply via email to