#20963: __invert__ for Laurent polynomial is wrong
------------------------------+------------------------
Reporter: vdelecroix | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-7.3
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
------------------------------+------------------------
Old description:
> The parent of the inverse of a Laurent polynomial can be three different
> things
> {{{
> sage: R.<x> = LaurentPolynomialRing(ZZ)
> sage: parent(~x)
> Univariate Laurent Polynomial Ring in x over Integer Ring
> sage: parent(~(2*x))
> Univariate Laurent Polynomial Ring in x over Rational Field
> sage: parent(~(x+1))
> Fraction Field of Univariate Polynomial Ring in x over Integer Ring
> }}}
>
> This is against the principle: "the result of an arithmetic operation
> should only depend on the parent".
New description:
The parent of the inverse of a Laurent polynomial can be three different
things
{{{
sage: R.<x> = LaurentPolynomialRing(ZZ)
sage: parent(~x)
Univariate Laurent Polynomial Ring in x over Integer Ring
sage: parent(~(2*x))
Univariate Laurent Polynomial Ring in x over Rational Field
sage: parent(~(x+1))
Fraction Field of Univariate Polynomial Ring in x over Integer Ring
}}}
This is against the principle: "the result of an arithmetic operation
should only depend on the parent".
At the same time we provide a (partial) conversion from the fraction field
back to the original ring.
--
Comment (by vdelecroix):
Yes! We could also implement a specific function to inverse units as
{{{
sage: (-1).inverse_of_unit()
-1
sage: m._invert_unit()
[ 1 -1]
[-1 2]
}}}
Though, we would have to chose the name (see
https://groups.google.com/forum/#!topic/sage-devel/SLfWHJp4Apk).
--
Ticket URL: <https://trac.sagemath.org/ticket/20963#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 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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.