Ask Your Question

Revision history [back]

Using lagrange_polynomial() on points with variable coefficients

Is it possible to modify lagrange_polynomial so that it accepts points with variable entries? I was able to make it work on a small example, by disabling the coercion functions in the source file "polynomial_ring.py", but then the program failed on a finite field.

Documentation for lagrange_polynomial()

Using lagrange_polynomial() on points with variable coefficients

Is it possible to modify lagrange_polynomial so that it accepts points with variable entries? I was able to make it work on a small example, by disabling the coercion functions in the source file "polynomial_ring.py", but then the program failed on a finite field.

y = var("y")
T = PolynomialRing(QQ, 'x')
f = T.lagrange_polynomial([(0,y),(2,2)])
print(f)

Documentation for lagrange_polynomial()

Using lagrange_polynomial() on points with variable coefficients

Is it possible to modify lagrange_polynomial so that it accepts points with variable entries? I was able to make it work on a small example, by disabling the coercion functions in the source file "polynomial_ring.py", but then the program failed on a finite field.

y = var("y")
T = PolynomialRing(QQ, 'x')
f = T.lagrange_polynomial([(0,y),(2,2)])
print(f)

returns:

TypeError: unable to convert y to a rational

Documentation for lagrange_polynomial()