Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

discriminant of multivariate polynomial

If I do

R.<x,z,I>=QQ[]
f_str = 'x**3 + x*z +1'
f = eval(f_str) 
f.discriminant(x)

this works out correctly, giving

-4*z^3 - 27

But if I instead replace the coefficient of any monomial with a rational, such as

R.<x,z,I>=QQ[]
f_str = 1.0*'x**3 + x*z +1'
f = eval(f_str) 
f.discriminant(x)

I get the following error:

AttributeError: 'MPolynomial_polydict' object has no attribute 'discriminant'

Can someone explain how to make it work?

discriminant of multivariate polynomial

If I do

R.<x,z,I>=QQ[]
f_str = 'x**3 + x*z +1'
f = eval(f_str) 
f.discriminant(x)

this works out correctly, giving

-4*z^3 - 27

But if I instead replace the coefficient of any monomial with a rational, such as

R.<x,z,I>=QQ[]
f_str = 1.0*'x**3 '1.0*x**3 + x*z +1'
f = eval(f_str) 
f.discriminant(x)

I get the following error:

AttributeError: 'MPolynomial_polydict' object has no attribute 'discriminant'

Can someone explain how to make it work?