#19538: Fix LaurentPolynomialRing coercion issues
-------------------------+-------------------------------------------------
Reporter: | Owner:
etn40ff | Status: needs_review
Type: | Milestone: sage-6.10
defect | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
algebra | Work issues:
Keywords: | Commit:
Authors: | 76ac4339b195762106d406516400f8468de844ef
Salvatore Stella | Stopgaps:
Report Upstream: N/A |
Branch: |
u/etn40ff/19358 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by etn40ff):
@stumpc5
- {{{x.parent().gens()}}} should return {{{x.parent()._gens}}} which is a
tuple
so the order should be fixed.
- {{{x.parent().gens()}}} and also {{{parent}}} are in general different,
the
whole purpose of this patch is to make sure that, when they differ, some
natural coercion can still be implemented.
- I did not run precise tests but I expect the new version to be slower
than the
old one (maybe even significantly slower); the point though is that the
current version is not working as it should. I could make a much faster
function that returns some hardcoded nonsense but it would clearly not
be the
right function. More seriously I should run some benchmark, any idea on
which?
@vdelecroix
I agree that the behaviour of {{{LaurentPolynomialRing}}} and that of
{{{PolynomialRing}}} should be the same. The point is that currently they
are
not.
For example the same code in the ticket description evaluates to
{{{
sage: L = PolynomialRing(ZZ, 'x0,x1,x2,y0,y1,y2')
sage: P = PolynomialRing(ZZ, 'y0,y1,y2')
sage: P.inject_variables()
Defining y0, y1, y2
sage: y0 in L
True
sage: L = PolynomialRing(ZZ, 'x', 4)
sage: R = PolynomialRing(ZZ, 'x3,x2,t,s')
sage: R.inject_variables()
Defining x3, x2, t, s
sage: L(x3)
x0
sage: L(t)
x2
}}}
I do not know how to fix the first issue in the ticket description while
leaving the second one as is. This patch just exchange one inconsistent
behavior for another. Any Idea on how to deal with this in a more
elegant/consistent/efficient way is extremely welcome.
--
Ticket URL: <http://trac.sagemath.org/ticket/19538#comment:7>
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.