#6771: speed up pynac --> polynomials conversion, since it is really slow
-------------------------+--------------------------------------------------
Reporter: was | Owner: burcin
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.1.2
Component: calculus | Keywords:
Reviewer: | Author:
Merged: |
-------------------------+--------------------------------------------------
{{{
> sage: var("x y z")
> (x, y, z)
> sage: a = (x+y+z)**20
> sage: b = a.expand()
> sage: %time c = factor(b)
> CPU times: user 0.14 s, sys: 0.00 s, total: 0.15 s
> Wall time: 0.15 s
>
>
> 1) it uses pari, right?
NO. Pari has no functionality at all for doing anything nontrivial with
multivariate polynomials. Do b.factor?? to see the source. Sage tries
to convert b to a poly over QQ, this works, then it calls SINGULAR to
factor that. If conversion doesn't work, it falls back to Maxima right
now.
All the time is actually spent in converting b from Pynac to Singular:
sage: timeit('c = b.polynomial(QQ)')
5 loops, best of 3: 149 ms per loop
It is silly that this is slow. I don't know why it is so slow.
Mike Hansen wrote some really beautiful-looking clever code in
sage/symbolic/expression_conversions.py
The code that implements b.polynomial is some of this clever code.
When I read that code (when refereeing the symbolic switch), I think "wow,
this is beautiful, it is so simple to read/understand, it is short. Wow.
I bet this is going to be really slow..." Well, evidently it is really
slow. Somebody should do some profiling and speed this up -- a factor of
100 should be easily obtained.
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6771>
Sage <http://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 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/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---