Skip to content
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

Error when taking resultant of polynomials over complicated base ring #17817

Closed
pjbruin opened this issue Feb 20, 2015 · 11 comments
Closed

Error when taking resultant of polynomials over complicated base ring #17817

pjbruin opened this issue Feb 20, 2015 · 11 comments

Comments

@pjbruin
Copy link
Contributor

pjbruin commented Feb 20, 2015

The following apparently tries to convert p and q into a wrong common ring (even though they already both have parent S):

A.<a,b,c> = Frac(PolynomialRing(QQ,'a,b,c'))
B.<d,e,f> = PolynomialRing(A,'d,e,f')
R.<x>= PolynomialRing(B,'x')
S.<y> = PolynomialRing(R,'y')
p = ((1/b^2*d^2+1/a)*x*y^2+a*b/c*y+e+x^2)
q = -4*c^2*y^3+1
print(p.resultant(q))
Traceback (most recent call last):
...
TypeError: not a constant polynomial

This ticket solves the bug by simply passing the variable with respect to which we want to take the resultant to PARI, instead of trying to change the variable names. The documentation is also updated.

See also #2693, #16749.

CC: @miguelmarco

Component: algebra

Keywords: polynomial resultant

Author: Peter Bruin

Branch/Commit: 02345b7

Reviewer: Marc Mezzarobba

Issue created by migration from https://trac.sagemath.org/ticket/17817

@pjbruin pjbruin added this to the sage-6.6 milestone Feb 20, 2015
@pjbruin

This comment has been minimized.

@pjbruin
Copy link
Contributor Author

pjbruin commented Mar 17, 2015

Branch: u/pbruin/17817-resultant_variables

@pjbruin
Copy link
Contributor Author

pjbruin commented Mar 17, 2015

Commit: 02345b7

@pjbruin
Copy link
Contributor Author

pjbruin commented Mar 17, 2015

Author: Peter Bruin

@mezzarobba
Copy link
Member

comment:2

So some resultants that used to be computed using Singular will now go through sylvester_matrix—is that correct? Do you know if it makes a significant difference in terms of speed?

@miguelmarco
Copy link
Contributor

comment:3

We would need to run benchmarks to make sure, but it is certainly possible that the sylvester matrix method would be faster than singular, at least in some cases.

@pjbruin
Copy link
Contributor Author

pjbruin commented Apr 13, 2015

comment:4

Replying to @mezzarobba:

So some resultants that used to be computed using Singular will now go through sylvester_matrix—is that correct?

Possibly, but this is only relevant when the polynomials are univariate polynomials over a multivariate polynomial ring. The Sylvester matrix is only used if the coefficients cannot be converted to PARI; what probably happens in most cases is that the resultant is computed through PARI rather than Singular. For genuine multivariate polynomials, Singular is still used via MPolynomial_libsingular.resultant().

Do you know if it makes a significant difference in terms of speed?

I don't know. How about adding an algorithm keyword (which could be pari, singular or sylvester for now) so that the user can easily choose an implementation and we can compare the speed of the implementations?

@pjbruin

This comment has been minimized.

@mezzarobba
Copy link
Member

Reviewer: Marc Mezzarobba

@mezzarobba
Copy link
Member

comment:5

Replying to @pjbruin:

I don't know. How about adding an algorithm keyword (which could be pari, singular or sylvester for now) so that the user can easily choose an implementation and we can compare the speed of the implementations?

Ok, but then let's not block this ticket in the meantime if there is no significant regression to be expected.

@vbraun
Copy link
Member

vbraun commented Apr 14, 2015

Changed branch from u/pbruin/17817-resultant_variables to 02345b7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants