#18356: special resultants ``composed_sum`` and ``composed_product``
-------------------------------------+-------------------------------------
Reporter: pernici | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.7
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/pernici/ticket/18356 | 1898678cfccd18df76b57a015c03d96fb44542ae
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by vdelecroix):
* status: needs_review => needs_work
Comment:
Hello,
Thanks for using this ticket.
4. In the description of the function you wrote a very precise definition.
But then, in the `NOTE`, you claim that the two algorithms might behave
differently...
5. Why do you only check the parent for `p1`?
{{{
if p1.parent().base_ring() not in (ZZ, QQ):
raise ValueError('implemented only for polynomials on
integer or rational ring')
}}}
Moreover, why is it only in the case of `BFSS`?
6. What is this argument `_cached_QQ`!? You can certainly not use that.
Note that in `sage.rings.qqbar` there is already `QQxy`, `QQxy_x` and
`QQxy_y` defined. So either it is time critical in which case you could
create a function like
{{{
_QQxy = None
def QQxy_with_gens():
global _QQxy
if _QQxy is None:
from sage.rings.rational_field import QQ
R = QQ['x', 'y']
_QQxy = (R, R.gen(0), R.gen(1))
return _QQxy
}}}
and move it near the `PolynomialRing` function. Then this function
should be also used in `sage.ring.qqbar`. You can also try to see why
calling `PolynomialRing` is so slow.
7. It would be more natural to me if `op` would be an operator and not a
string. In other words, one of
{{{
sage: import operator
sage: operator.add
<built-in function add>
sage: operator.sub
<built-in function sub>
sage: operator.mul
<built-in function mul>
sage: operator.div
<built-in function div>
}}}
It can be checked in the method with
{{{
if op is operator.add:
...
elif op is operator.sub:
...
}}}
It is a very personal feeling, what do you think?
8. This takes time
{{{
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.big_oh import O as big_O
}}}
so you would better move it where it is used, i.e. in the case where
`algorithm=BFSS`. Similarly, in `newton_sum` you should move {{{from
sage.rings.power_series_ring import PowerSeriesRing}}}
9. You can use the fact that bool is a subtype of int when you decide the
algorithm
{{{
sage: sum(bool(i) for i in [0,1,3,0,2,0,4])
4
}}}
9. In `newton_sum` the argument `prec` and `R` are redundant. But I do not
know how to do better.
--
Ticket URL: <http://trac.sagemath.org/ticket/18356#comment:13>
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.