#17817: Error when taking resultant of polynomials over complicated base ring
-------------------------------------+-------------------------------------
Reporter: pbruin | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.6
Component: algebra | Resolution:
Keywords: polynomial | Merged in:
resultant | Reviewers:
Authors: Peter Bruin | Work issues:
Report Upstream: N/A | Commit:
Branch: | 02345b7e3490e356e351ef7bf4e3f89665f2de8c
u/pbruin/17817-resultant_variables | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Old description:
> 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.
New description:
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.
--
Comment (by pbruin):
Replying to [comment:2 mmezzarobba]:
> 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?
--
Ticket URL: <http://trac.sagemath.org/ticket/17817#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.