#13675: multivariate polynomials lack the inverse_mod(...) method
-------------------------------------------+--------------------------------
Reporter: Bouillaguet | Owner: malb
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-5.5
Component: commutative algebra | Resolution:
Keywords: inverse modulo an ideal | Work issues:
Report Upstream: N/A | Reviewers: Marco Streng
Authors: Charles Bouillaguet | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------+--------------------------------
Changes (by {'newvalue': u'Charles Bouillaguet', 'oldvalue': ''}):
* status: needs_review => needs_work
* reviewer: => Marco Streng
* author: => Charles Bouillaguet
Comment:
Hi Charles,
If I understand correctly, then after #13671 is fixed, the following code
will give {{{"ValueError: polynomial is not in the ideal"}}} rather than
{{{ArithmeticError: element is non-invertible}}}. (And until #13671 is
fixed, trying to invert non-invertible elements may trigger the corruption
from #13671.)
{{{
XY = P.one().lift((self,) + tuple(B))
if XY == [0]*len(XY):
raise ArithmeticError, "element is non-invertible"
}}}
How about changing it to the following?
{{{
if not P.one() in P.ideal([self] + B):
raise ArithmeticError, "element is non-invertible"
XY = P.one().lift((self,) + tuple(B))
}}}
Some other comments:
* The first block of examples misses the {{{"::"}}} needed for nice
formatting of the html documentation.
* The line {{{"returns an inverse of self modulo the ideal `I`"}}} could
use a little bit more information: that "I" should be an ideal of the
parent P of self, and that the output is an element of P, and I suppose a
capital letter at the start.
Best,
Marco
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13675#comment:2>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.