#2952: Multivariate LaurentPolynomial can have coefficients in the wrong ring
-------------------------------------+-------------------------------------
Reporter: mhansen | Owner: roed
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.2
Component: algebra | Resolution:
Keywords: laurent | Merged in:
polynomials | Reviewers:
Authors: Peter Bruin | Work issues:
Report Upstream: N/A | Commit:
Branch: | e415cdb83e766a00b234cbec31835b6c20385833
u/pbruin/2952-LaurentPolynomial_pow| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Peter Bruin', 'oldvalue': ''}):
* status: needs_work => needs_review
* author: => Peter Bruin
* component: coercion => algebra
* priority: critical => major
* branch: => u/pbruin/2952-LaurentPolynomial_pow
* commit: => e415cdb83e766a00b234cbec31835b6c20385833
Old description:
> Currently
> {{{
> sage: R.<q>=QQ[]
> sage: L.<x,y,z> = LaurentPolynomialRing(R)
> sage: f=(x+y+z^-1)^2
> sage: f.substitute(z=1)
> }}}
> gives an error because it PolynomialRing isn't imported
> categories/pushout.py for the Laurent functor.
>
> Once, that it is fixed, the above commands give a coercion error between
> the fraction field of QQ['q'] and the Laurent polynomial ring over
> QQ['q']
New description:
This causes an error in the coercion system:
{{{
sage: R.<q>=QQ[]
sage: L.<x,y,z> = LaurentPolynomialRing(R)
sage: f=(x+y+z^-1)^2
sage: f.substitute(z=1)
}}}
This is because the coefficients of `f` (which has `L` as its parent) do
not lie in `R`, but in its fraction field, due to the `z^-1` and the way
`__pow__()` is implemented.
--
Comment:
The attached branch implements `LaurentPolynomial_mpair.__invert__()` from
scratch and uses this for `__pow__()` with a negative exponent.
--
Ticket URL: <http://trac.sagemath.org/ticket/2952#comment:10>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.