These are chat archives for symengine/symengine

4th
Mar 2015
Ondřej Čertík
@certik
Mar 04 2015 16:22
If any of you are interested in writing Ruby wrappers for CSymPy, there is an option for a GSoC project under the SciRuby organization, more details here: https://github.com/SciRuby/sciruby/wiki/Google-Summer-of-Code-2015-Ideas#ruby-bindings-to-the-csympy-c-symbolic-library
Shivam Vats
@shivamvats
Mar 04 2015 16:26
@certik Isn't the single dispatch we are using an alternative to visitor?
Ondřej Čertík
@certik
Mar 04 2015 16:28
@shivamvats yes, they are.
A much better alternative I should add.
Shivam Vats
@shivamvats
Mar 04 2015 16:36
Sage's ring/poly/series structure seems very interesting https://github.com/sagemath/sage/tree/master/src/sage/rings/polynomial
Though they don't seem to have Puiseux series
Ondřej Čertík
@certik
Mar 04 2015 16:39
Right. Note that GiNaC does not have Puiseux series either, but I think it is important to have it, both for limits (in SymPy) and in general.
It's easy to get buried in design, but the general structure that I would start with is very simple --- just a dictionary, keys are lists of exponents (start with integer, but allow rational as well), and values are the coefficients (integer, rational, symbolic).
Shivam Vats
@shivamvats
Mar 04 2015 16:41
the poly ring can't have rational exponents, can it?
Ondřej Čertík
@certik
Mar 04 2015 16:42
I know Piranha allows that, and Puiseux series has rational exponents.
Shivam Vats
@shivamvats
Mar 04 2015 16:44
Oh! I was going by the strict definition of poly, but then it has to be genereic
btw, we wouldn't need double dispatch for poly , or would we?
Ondřej Čertík
@certik
Mar 04 2015 16:45
Piranha templates everything, so you chose the types of coefficients and exponents in the main program. The price that you pay are very long compilation time and complex compiler error messages. We can try using templates if it is manageable, or just provide classes for the most common cases (there aren't that many really).
We might need double dispatch for hooking it up with operations like + in csympy, but the first step is to provide the + operation in polys, and there you don't need double dispatch. We can worry about this later.
Shivam Vats
@shivamvats
Mar 04 2015 16:47
I'm trying to add some basic operations on the basic poly class i wrote. When do you think I should start with series?
It seems difficult to get series class merged in Sympy before application deadline.
Ondřej Čertík
@certik
Mar 04 2015 16:54
You already got patches accepted in both sympy and csympy, so you already fulfilled your patch requirement, if that's what you are worried about. As to the project, I would start with SymPy and implement the series in it. It needs to work, and we need to like the design. It will get merged eventually. Once we like it, then we'll implement the necessary operations in csympy.
SymPy has all the infrastructure and we can experiment more quickly than in C++.
You probably already saw it, but check out the code + emails in this thread: https://groups.google.com/d/msg/sympy/hiRuIHa8ImA/2Y__l-hB-cEJ
Shivam Vats
@shivamvats
Mar 04 2015 16:57
Since, my project will focus primarily on series expansion, I was wondering how muchof the series class I need to implement, so that my application seems feasible.
ie. implement before the application deadline
Ondřej Čertík
@certik
Mar 04 2015 16:58
Enough, so that it works for basic expressions like (sin(x)*cos(x)).series()
So +, -, / , *, and few basic functions.
Ah, before the deadline ---- just try to implement what you can. Any prototype that you can show will strengthen your application.
Shivam Vats
@shivamvats
Mar 04 2015 17:01
Sure. Thanks!
Ondřej Čertík
@certik
Mar 04 2015 17:01
In the application you want to show that you thought carefully about all the details, and the best way is with actual code -- it doesn't have to be merged. For example you can just implement multiplication and show that it works for (sin(x)*cos(x)).series(), actually I've done this in the thread I posted above, so you can take it and polish it. For example.
Shivam Vats
@shivamvats
Mar 04 2015 17:02
Thanks a lot!
Ondřej Čertík
@certik
Mar 04 2015 23:29
Finally, you can also submit well targeted proposals to the "lmonade" organization. Best is to consult with me to see if it is withing the scope.