These are chat archives for symengine/symengine

24th
Feb 2016
Ralf Stephan
@rwst
Feb 24 2016 06:42
@isuruf @certik This is about 3.5x faster than Sage+Pynac
Ondřej Čertík
@certik
Feb 24 2016 16:13
@rwst are you talking about #651?
Did you benchmark the piranha int or flint int?
@isuruf can you update me on what the current status of polynomials and series expansion is? We have Piranha and Flint ones. Then we have classes of our own, like UnivariatePolynomial. What is the status and the plan forward? Let's document it on the wiki, probably here: https://github.com/symengine/symengine/wiki/En-route-to-Polynomial
@rwst I guess that was a question for you too. Do you prefer the Flint or Piranha polynomials?
Which one should we use to get the capabilities comparable to sympy?
Isuru Fernando
@isuruf
Feb 24 2016 16:18
First of all, the series expansions we have now are univariate power series
URatPSeriesFlint can do only rational coefficient power series.
URatPSeriesPiranha can do rational coefficient power series (possibly laurent)
UPSeriesPiranha can do Expression coefficient power series (possibly laurent)
Ondřej Čertík
@certik
Feb 24 2016 16:20
I see. I assume we don't have integer power series, since those are very rare?
Isuru Fernando
@isuruf
Feb 24 2016 16:20
UnivariatePolynomial is an integer coefficient polynomial that is not fully integrated
UnivariateSeries is a series based on UnivariatePolynomial and has limited functionality
@certik, yes. If we want a integer series it's very easy to do, but it's very rare
Ondřej Čertík
@certik
Feb 24 2016 16:21
I see, thanks. What is the best way forward?
We want the ones that deliver maximum speed, but we need to add functionality so that it can be used by sympy and Sage.
Also, UnivariateSeries should be using SeriesBase to have the same interface, shouldn't it?
So that we can have multiple implementations but the same interface.
Isuru Fernando
@isuruf
Feb 24 2016 16:25
Have a UPSeries which would just use SymEngine and have Expression coefficients.
This is what @irislq and the team are doing.
Also we need to have multivariate support for Piranha as well. To do that few changes are needed. sin, cos and other functions implementations are the same as the univariate ones, but series_invert, series_root needs to be handled carefully.
Yes, UnivariateSeries is an isolated class, which needs to be done correctly.
Ondřej Čertík
@certik
Feb 24 2016 17:16
Will UPSeries subclass SeriesBase?
Why not to just use Piranha? That should be faster than what we can do, wouldn't it?
I mean, why not just use URatPSeriesPiranha and UPSeriesPiranha.
Isuru Fernando
@isuruf
Feb 24 2016 17:18
Piranha is an optional dependency. Right now there is no series that can be run without optional dependencies.
Yes UPSeries will subclass SeriesBase
I like the fact that piranha uses templates for everything and we can easily use Expression as a coefficient type, but considering piranha has boost, mpfr, gmp and bzip2 as dependencies and cannot be built on MSVC, I think we should have an implementation even if it is slower
Ondřej Čertík
@certik
Feb 24 2016 17:21
We should have a "reference" implementation ourselves, no doubt.
But will it be possible to switch to Piranha if the user wants to get maximum speed?
I would hope that the SeriesBase approach would allow that.
Isuru Fernando
@isuruf
Feb 24 2016 17:24
Yes. It's just a matter of replacing UPSeries::series calls to UPSeriesPiranha::series calls.
Also series method will always prefer Piranha implementation over SymEngine if Piranha is installed.
Right now URatPSeriesFlint is preferred over URatPSeriesPiranha due to performance
Ondřej Čertík
@certik
Feb 24 2016 17:25
I see, that's perfect.
In order to implement UPSeries we need a polynomial.
Will that use UnivariatePolynomial?
Isuru Fernando
@isuruf
Feb 24 2016 17:30
No, UnivariatePolynomial handles only integer coefficients. (Name is misleading, I know). @chenchfort is writing one that can handle Expressions as coefficients
Ondřej Čertík
@certik
Feb 24 2016 17:30
I see. I think that's good for a reference implementation.
Obviously, for speed, one always has to use the fastest / most specialized types, so rational coefficients for series. That gets you pretty far, but of course, you can't so sin(x) around x=1 and such stuff. But you can do most other series. So our reference implementation, even though slow due to using an Expression, by being a polynomial, the data structures would still allow fast operations like multiplication (compared to just using Basic expressions and multiplying them).
Isuru Fernando
@isuruf
Feb 24 2016 17:33
Exactly
Ondřej Čertík
@certik
Feb 24 2016 17:33
Ok, I like this plan. Thanks for clarifying it.
Will you have time to stay on top of their project?
Isuru Fernando
@isuruf
Feb 24 2016 17:34
Yes, sure
Ondřej Čertík
@certik
Feb 24 2016 17:36
Thank you. That would be really helpful. In projects like this one, we need to make sure the design choices are made right.
Iris Lui
@irislq
Feb 24 2016 19:57
@certik & @isuruf Since UnivariatePolynomial seems to be a misleading name, Charles and I were wondering if we could rename it to something else. I was also thinking of renaming the current UnivariateSeries into UPSeries and use the name UnivariateSeries for the new polynomial with Expression coefficients
Just want to be consistent is all