Comment #1 on issue 2031 by mattpap: Add field option to Poly.operation() functions
http://code.google.com/p/sympy/issues/detail?id=2031

It does not make much sens to add field option to Poly's method, because the same thing can be achieved with to_field() method, e.g.:

In [1]: Poly(x, x).quo(Poly(2, x))
(...)
ExactQuotientFailed: 2 does not divide x

In [2]: Poly(x, x).to_field().quo(Poly(2, x))
Out[2]: Poly(1/2*x, x, domain='QQ')

(you don't have to use to_field() on both polynomials, because auto unification of polynomials will do the job).

If the domain is already a field, then to_field() is noop, so no cost is associated.

What we can do is to add auto flag to div() and friends, as it was done to gcdex(), invert(), sturm() etc., to automatically choose the best domain for the particular operation. This makes sense because would have field for Euclidean division (div()) and ring for primitive division (pdiv()) (no auto flag in this case).

If we add auto flag, then another issue is: if the input polynomials are divisible over a ring (the initial domain was a ring) and auto=True (which means we are going to convert to a field), then should we convert the result back to a ring or leave it as is?

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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/sympy-issues?hl=en.

Reply via email to