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

Resultant for polynomials over RDF and CDF not implemented #10978

Closed
haikona mannequin opened this issue Mar 21, 2011 · 6 comments
Closed

Resultant for polynomials over RDF and CDF not implemented #10978

haikona mannequin opened this issue Mar 21, 2011 · 6 comments

Comments

@haikona
Copy link
Mannequin

haikona mannequin commented Mar 21, 2011

Calling the resultant method for a polynomial defined over RDF or CDF returns a NotImplementedError. It would appear that this results from it not being implemented in Singular.

sage: R.<x> = PolynomialRing(CDF)
sage: f = R(1 - I*x + (0.5)*x^2 + (1.7)*x^3)
sage: g = f.derivative()
sage: f.resultant(g)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/Users/simonspicer/<ipython console> in <module>()

/Users/simonspicer/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_singular_interface.pyc in resultant(self, other, variable)
    351         return lcm_func(self, singular, have_ring)
    352     def resultant(self, other, variable=None):
--> 353         return resultant_func(self, other, variable)
    354 
    355 def _singular_func(self, singular=singular_default, have_ring=False):

/Users/simonspicer/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_singular_interface.pyc in resultant_func(self, other, variable)
    499     if variable is None:
    500         variable = self.parent().gen(0)
--> 501     rt = self._singular_().resultant(other._singular_(), variable._singular_())
    502     r = rt.sage_poly(self.parent())
    503     if self.parent().ngens() <= 1 and r.degree() <= 0:

/Users/simonspicer/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc in __call__(self, *args, **kwds)
   1481 
   1482     def __call__(self, *args, **kwds):
-> 1483         return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
   1484     
   1485     def help(self):

/Users/simonspicer/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc in function_call(self, function, args, kwds)
   1380                                        [s.name() for s in args],
   1381                                        ['%s=%s'%(key,value.name()) for key, value in kwds.items()])
-> 1382         return self.new(s)
   1383 
   1384     def _function_call_string(self, function, args, kwds):

/Users/simonspicer/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc in new(self, code)
   1161 
   1162     def new(self, code):
-> 1163         return self(code)
   1164 
   1165     ###################################################################

/Users/simonspicer/sage/local/lib/python2.6/site-packages/sage/interfaces/singular.pyc in __call__(self, x, type)
    659             x = str(x)[1:-1]
    660 
--> 661         return SingularElement(self, type, x, False)
    662 
    663     def has_coerce_map_from_impl(self, S):

/Users/simonspicer/sage/local/lib/python2.6/site-packages/sage/interfaces/singular.pyc in __init__(self, parent, type, value, is_name)
   1122             except (RuntimeError, TypeError, KeyboardInterrupt), x:
   1123                 self._session_number = -1
-> 1124                 raise TypeError, x
   1125         else:
   1126             self._name = value

TypeError: Singular error:
   ? not implemented
   ? error occurred in or before STDIN line 94: `def sage19=resultant(sage17,sage18,sage15);`

Component: algebra

Keywords: polynomial, resultant

Reviewer: Bruno Grenet

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

@haikona haikona mannequin added this to the sage-5.11 milestone Mar 21, 2011
@haikona haikona mannequin added c: algebra labels Mar 21, 2011
@haikona haikona mannequin assigned aghitza Mar 21, 2011
@haikona
Copy link
Mannequin Author

haikona mannequin commented Mar 22, 2011

comment:1

I think I've tracked down the issue after some digging. From rings/polynomial/polynomial_singular_interface.py/, class Polynomial_singular_repr:
"Due to the incompatibility of Python extension classes and multiple inheritance, this just defers to module-level functions."

This appears to be a Cython multiple inheritance issue - polynomials over RDF and CDF are examples of the Polynomial_generic_field, which are subclasses of Polynomial_singular_repr. The .resultant() method there fails for these objects but the .resultant() method of the Polynomial parent class (which does work) gets skipped overdue to the multiple inheritance issue.

As such, this should be fixed in an upcoming version of Cython.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@rwst
Copy link
Contributor

rwst commented Mar 16, 2014

comment:4

Replying to @haikona:

As such, this should be fixed in an upcoming version of Cython.

The issue is unchanged 3 years later.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@fchapoton
Copy link
Contributor

comment:7

duplicate of #2693

@fchapoton fchapoton removed this from the sage-6.4 milestone May 1, 2019
@bgrenet
Copy link
Contributor

bgrenet commented Aug 22, 2019

Reviewer: Bruno Grenet

@bgrenet
Copy link
Contributor

bgrenet commented Aug 22, 2019

comment:8

I confirm the duplication, and the described behavior changed after #2693.

@bgrenet
Copy link
Contributor

bgrenet commented Aug 22, 2019

Changed author from Simon Spicer to none

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

5 participants