Skip to content

Polyring_FpT_coerce cannot handle polynomial_modn_dense_ntl #15954

@rwst

Description

@rwst
sage: R.<x> = PolynomialRing(Integers(101), implementation='NTL')
sage: 1/x
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-2-3e814ccafd34> in <module>()
----> 1 Integer(1)/x

/usr/local/src/sage-config/src/sage/rings/integer.pyx in sage.rings.integer.Integer.__div__ (build/cythonized/sage/rings/integer.c:13187)()
   1874             return y
   1875 
-> 1876         return coercion_model.bin_op(left, right, operator.div)
   1877 
   1878     cpdef _div_(self, right):

/usr/local/src/sage-config/src/sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op (build/cythonized/sage/structure/coerce.c:9515)()
   1079         try:
   1080             xy = self.canonical_coercion(x,y)
-> 1081             return PyObject_CallObject(op, xy)
   1082         except TypeError as err:
   1083             if xy is not None:

/usr/local/src/sage-config/src/sage/rings/polynomial/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial.__div__ (build/cythonized/sage/rings/polynomial/polynomial_element.c:23976)()
   2121 
   2122     def __div__(left, right):
-> 2123         return PyNumber_TrueDivide(left, right)
   2124 
   2125     def __pow__(left, right, modulus):

/usr/local/src/sage-config/src/sage/rings/polynomial/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial.__truediv__ (build/cythonized/sage/rings/polynomial/polynomial_element.c:23681)()
   2103         # Same parents => bypass coercion
   2104         if have_same_parent(left, right):
-> 2105             return (<Element>left)._div_(right)
   2106 
   2107         # Try division of polynomial by a scalar

/usr/local/src/sage-config/src/sage/structure/element.pyx in sage.structure.element.RingElement._div_ (build/cythonized/sage/structure/element.c:17628)()
   2476         except AttributeError:
   2477             raise bin_op_exception('/', self, other)
-> 2478         return frac(self, other)
   2479 
   2480     def __invert__(self):

/usr/local/src/sage-config/src/sage/structure/parent.pyx in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9433)()
    917                 return mor._call_(x)
    918             else:
--> 919                 return mor._call_with_args(x, args, kwds)
    920 
    921         raise TypeError("No conversion defined from %s to %s"%(R, self))

/usr/local/src/sage-config/src/sage/rings/fraction_field_FpT.pyx in sage.rings.fraction_field_FpT.Polyring_FpT_coerce._call_with_args (build/cythonized/sage/rings/fraction_field_FpT.cpp:12573)()
   1132             x = <Polynomial_zmod_flint?> _x
   1133         except TypeError:
-> 1134             raise NotImplementedError('Fraction fields not implemented for this type.')
   1135         cdef FpTElement ans = <FpTElement>FpTElement.__new__(FpTElement)
   1136         ans._parent = self.codomain()

NotImplementedError: Fraction fields not implemented for this type.

This makes NTL modpolys unusable in fractions.

Component: coercion

Author: Ralf Stephan

Branch/Commit: u/rws/polyring_fpt_coerce_cannot_handle_polynomial_modn_dense_ntl @ ded2b6d

Reviewer: Karl-Dieter Crisman

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions