New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resulant of two polynomials returns incorrect value #12752
Comments
comment:1
See this sage-devel thread. The documented use of f.resultant(g,) is to take the resultant of f,g with respect to . This is useful for eliminating variables when doing computations with polynomials. As documented, f.resultant(g) takes the resultant relative to the first parameter. The resultant operation expected/requested in the ticket is a different one: It is the "bivariate form" resultant. You can compute it by taking a univariate polynomial resultant of dehomogenized forms and compensating for degree-drop by multiplying by the right power of some leading coefficients (if both forms drop in degree then they have a common root at infinity and the resultant is 0). Note that this routine should raise an error if any of its parameters is not homogeneous or not bivariate. The resultant method on multivariate polynomials basically has to be the ordinary polynomial resultant. If you really want to have the form-resultant you can implement it as a separate function:
If there is a class somewhere that symbolizes homogeneous bivariate forms, you could hang that function off it as "form_resultant". Note that in general, computing with bivariate forms is done most efficiently by representing them by a univariate polynomial together with a degree (to keep track of leading 0 coefficients). Univariate polynomials tend to have much more efficient implementations. Changing to "invalid". If you want to track an enhancement proposal to implement a "forms" class, it's probably better to open a new ticket. I think it will be tricky to come up with a useful design for that, though. |
comment:3
Since this ticket has been set to invalid, I believe this ticket can be |
Changed stopgaps from todo to none |
Reviewer: Nils Bruin |
The resultant of two homogeneous polynomials can return an incorrect value:
R.<x,y>=PolynomialRing(ZZ)
f=6x2 + xy + y2
g=y2
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 y2 as a single variable polynomial. Thus it builds the wrong matrix. Probably the following:
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()
Component: basic arithmetic
Keywords: polynomial resultant
Reviewer: Nils Bruin
Issue created by migration from https://trac.sagemath.org/ticket/12752
The text was updated successfully, but these errors were encountered: