These are chat archives for symengine/symengine

26th
Feb 2015
Ondřej Čertík
@certik
Feb 26 2015 17:44

I wrote to @shivamvats in private email, but it is of interest to any of you thinking of applying for GSoC for polynomials or series expansion:

I played a little bit with polynomials and I started implementing faster Integer class
as well as some benchmarks to see what it takes to be as fast as
Piranha. My code is here:

https://github.com/certik/csympy/tree/polys
https://github.com/certik/csympy/tree/polys-flint
https://github.com/certik/csympy/tree/int

and I also implemented a simple C++ class for integer, using

machine int: https://github.com/certik/piranha/tree/myint
GMP's mpz: https://github.com/certik/piranha/tree/mpz
and a work in progress that uses both machine int and mpz:
https://github.com/certik/piranha/tree/intmpz

Once it is finished, we should use the fast integer class in CSymPy
instead of mpzclass. That will speed up things.

Ultimately, I think we should have sparse polynomial implementation in
CSymPy itself, I think we can make it as fast as Piranha (some problems with Piranha is that it doesn't compile with older compilers, i.e. on Travis, takes at least 3x more time to compile per file than CSymPy and also the code seems quite complicated with heavy usage of templates --- it's unclear to me whether this is needed to achieve performance yet, but I think we should try to match the performance with simpler code). For that, we
need a fast integer implementation (see above), then the Kronecker
packing of the exponents (see my explanation on gitter) as well as
faster hashtable and std::vector. That should do it.

For SymPy, there is not much that can be done, as one really has to
use the Python dictionary and gmpy or Python int. The exponent packing
can probably be done.

There is plenty of work, even for several GSoC students just working
on polynomials only. So the goal for the summer would be to get a
minimal implementation working and show that it is as fast as Piranha.

The series expansion should then be implemented using it. That will provide optimal speed.

Aaron Meurer
@asmeurer
Feb 26 2015 17:45
I disagree that there's nothing to be done in the polys for sympy
Ondřej Čertík
@certik
Feb 26 2015 19:08
I posted here about sympy polys: https://groups.google.com/d/msg/sympy/hiRuIHa8ImA/2Y__l-hB-cEJ, there is plenty of work to be done (i.e. finish the low level subroutines and then use those in series expansion). But you can't easily improve upon the Python's dictionary, integers and memory management. That's what I meant.
Shivam Vats
@shivamvats
Feb 26 2015 19:54
@certik Should I start work on polynomials using mpz and when you are done with your integer class, I can make changes?
Ondřej Čertík
@certik
Feb 26 2015 19:54
@shivamvats yes, you can do that.