On Mar 25, 6:52 pm, Ben Hutz <bn4...@gmail.com> wrote: > The resultant of two homogeneous polynomials can return an incorrect > value: > R.<x,y>=PolynomialRing(ZZ) > f=6*x^2 + x*y + y^2 > g=y^2 > print f.resultant(g) > m=matrix([[6,1,1,0],[0,6,1,1],[0,0,1,0],[0,0,0,1]]) > m.determinant() > > notice that the coefficient of the f.resultant(g) does not match the > integer determinant (they should be the same). I believe this is > because the .resultant function is actually calling the pari library, > which is interpreting y^2 as a single variable polynomial. Thus it > builds the wrong matrix > > m=matrix([[6,1,1,0],[0,6,1,1],[1,0,0,0],[0,1,0,0]]) > m.determinant() > > which is the value Sage is returning. The correct value is returned in > Sage from > > m=f.sylvester_matrix(g,x) > m.determinant()
According to the documentation, f.resultant(g) should be computing f.resultant(g,parent(f)), which is exactly m.determinant(). If you want to compute the resultant of the two *homogeneous forms*, you'd need another method, say form_resultant(f,g) that throws an error if f,g are not both homogeneous bivariate polynomials. The implementation would probably dehomogenize and compute the appropriate polynomial resultant, while compensating for degree-drop by multiplying by the appropriate powers of leading coefficients (resultants can be computed much more efficiently than constructing sylvester matrices). -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org