Thank you for such a detailed description. I think this is a good basis for an enhancement ticket. I don't think there is a fundamental reason why polynomial construction from a dictionary shouldn't do something efficient itself already. As an example of the kind of code we can benchmark on:
sage: R.<x,y,z>=QQ[] sage: f=(x+y+z)^20 sage: D=f.dict() sage: L=[{k:v} for k,v in D.items()] sage: %timeit R(D) 1000 loops, best of 3: 244 µs per loop sage: %timeit sum(R(t) for t in L) 1000 loops, best of 3: 1.32 ms per loop clearly you found that if f has sufficiently many terms, the time for R(D) gets out of control, whereas the second construction should remain reasonable (or perhaps things need to be chunked a little bigger that term-by-term). Drilling down on where that happens should show how to improve the libsingular interface. There's a clear reason to optimize this path: pickle uses it and that should be the method of choice to store the result of very large results. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.