Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 30bd620

Browse files
committed
trac 2693 resultants for polynomials over inexact rings
1 parent d765ee2 commit 30bd620

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/sage/rings/polynomial/multi_polynomial_element.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#
5151
# The full text of the GPL is available at:
5252
#
53-
# http://www.gnu.org/licenses/
53+
# https://www.gnu.org/licenses/
5454
#*****************************************************************************
5555
from __future__ import absolute_import
5656
from six.moves import range
@@ -1880,6 +1880,9 @@ def resultant(self, other, variable=None):
18801880
If a second argument is not provided, the first variable of
18811881
``self.parent()`` is chosen.
18821882
1883+
For inexact rings or rings not available in Singular,
1884+
this computes the determinant of the Sylvester matrix.
1885+
18831886
INPUT:
18841887
18851888
- ``other`` -- polynomial in ``self.parent()``
@@ -1914,11 +1917,18 @@ def resultant(self, other, variable=None):
19141917
sage: (x^2 + 1).resultant(x^2 - y)
19151918
y^2 + 2*y + 1
19161919
1920+
Test for :trac:`2693`::
1921+
1922+
sage: R.<x,y> = RR[]
1923+
sage: p = x + y
1924+
sage: q = x*y
1925+
sage: p.resultant(q)
1926+
-y^2
19171927
"""
19181928
R = self.parent()
19191929
if variable is None:
19201930
variable = R.gen(0)
1921-
if R._has_singular:
1931+
if R._has_singular and R.is_exact():
19221932
rt = self._singular_().resultant(other._singular_(), variable._singular_())
19231933
r = rt.sage_poly(R)
19241934
else:

src/sage/rings/polynomial/polynomial_element.pyx

+8-1
Original file line numberDiff line numberDiff line change
@@ -6306,13 +6306,20 @@ cdef class Polynomial(CommutativeAlgebraElement):
63066306
63076307
sage: A.<a,b,c> = Frac(PolynomialRing(QQ,'a,b,c'))
63086308
sage: B.<d,e,f> = PolynomialRing(A,'d,e,f')
6309-
sage: R.<x>= PolynomialRing(B,'x')
6309+
sage: R.<x> = PolynomialRing(B,'x')
63106310
sage: S.<y> = PolynomialRing(R,'y')
63116311
sage: p = ((1/b^2*d^2+1/a)*x*y^2+a*b/c*y+e+x^2)
63126312
sage: q = -4*c^2*y^3+1
63136313
sage: p.resultant(q)
63146314
16*c^4*x^6 + 48*c^4*e*x^4 + (1/b^6*d^6 + 3/(a*b^4)*d^4 + ((-12*a^3*b*c + 3)/(a^2*b^2))*d^2 + (-12*a^3*b*c + 1)/a^3)*x^3 + 48*c^4*e^2*x^2 + (((-12*a*c)/b)*d^2*e + (-12*b*c)*e)*x + 16*c^4*e^3 + 4*a^3*b^3/c
63156315
6316+
Test for :trac:`10978`::
6317+
6318+
sage: R.<x> = PolynomialRing(CDF)
6319+
sage: f = R(1 - I*x + (0.5)*x^2 + (1.7)*x^3)
6320+
sage: g = f.derivative()
6321+
sage: f.resultant(g)
6322+
133.92599999999996 + 37.56999999999999*I
63166323
"""
63176324
variable = self.variable_name()
63186325
try:

0 commit comments

Comments
 (0)