#18282: Improve the default evaluation method for univariate polynomials
-------------------------------------+-------------------------------------
Reporter: mmezzarobba | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: commutative | Resolution:
algebra | Merged in:
Keywords: | Reviewers:
Authors: Marc Mezzarobba | Work issues:
Report Upstream: N/A | Commit:
Branch: | 89671731fdf80e827f11b120a6655659c28c0225
u/mmezzarobba/wip/pol_of_symb | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by nbruin):
{{{
sage: pol(y, 0)
1000*x^2*y^2 + 100*y + 10*x + 1
}}}
If I understand correctly, you now make this evaluate to `100*y+1`? In
which ring? You've evaluated `x`, so the answer should lie in QQ['y'],
which is not a ring that exists at this moment. What about `pol(y,I)`?
should that return an answer in `QuadraticField(-1,name="I")['y']`?
-1 on this: The method you're calling is evaluating a univariate
polynomial over an arbitrary ring. You don't know what "evaluation" of the
coefficient would mean and, more importantly, whether it's supported at
all. Furthermore, the rings in which the answer is supposed to lie likely
don't exist yet. Letting sage choose which rings should be constructed
likely leads to difficult to predict behaviour (you'd basically be relying
on the common parents the coercion framework cooks up, and then I think
it's better to let the user rely on it him/herself).
I think that `pol(y,0)` should be an error because there's an unhandled
coefficient `0` present. It's not clear at all that the *second* argument
should be used for the variable that gets mentioned *first* in
`QQ['x']['y']`. One might think that `pol(y0,x0)==pol(y0)(x0)`, but that's
not the case either. Error really is safer.
--
Ticket URL: <http://trac.sagemath.org/ticket/18282#comment:8>
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.