[Numpy-discussion] Polynomials

Travis Oliphant oliphant@enthought....
Tue Aug 24 09:58:54 CDT 2010

On Aug 23, 2010, at 10:30 PM, Charles R Harris wrote:

> Hi All,
> I've gone ahead and implemented the Laguerre and Hermite (H and He) polynomials, but at this point I'm loath to add them to numpy as the polynomial space is getting crowded. Scipy looks like a better spot to put these but there is already the orthogonal module there. OTOH, the orthogonal module uses poly1d for the representation and that is numerical poison. The versions I have use the direct series representations in the given basis for +, -, x,  /, integration, and differentiation as well as doing direct conversions between domains and basis without going through ordinary power series, so that is a plus. They are also usable with mpmath for extended precision but at the price of sticking to python for the implementation, so they could be speeded up by restricting to doubles and complex. They don't supply the points and weights for Gauss integration, I tend to think those things belong under integration, but they could be included.

Don't let the orthogonal module stop you from adding the polynomials to SciPy.   They would fit very nicely.     It would be nice to deprecate the current orthogonal polynomials over time as more numerically accurate implementations of them were included. 

You could put them in a module like: 


or another name.   You could even replace the laguerre and hermite functions in special.orthogonal assuming the behaviors are similar.  But, to be safe, it would probably be best to put them in a different module and deprecate the old names. 

Thanks for everything.


More information about the NumPy-Discussion mailing list