scipy/scipy — pull request #354 by alexleach (2012-11-16 00:17:17+00:00)
Title: Faster expm

Hi,

As per the discussions on the [Scipy-Dev](http://mail.scipy.org/pipermail/scipy-dev/2012-November/018073.html) and [Scipy-User](http://mail.scipy.org/pipermail/scipy-user/2012-November/033588.html) mailing lists, I've implemented a couple of the [EXPOKIT](http://www.maths.uq.edu.au/expokit/download.html) Fortran routines, as an alternative for [scipy.linalg.expm](https://github.com/scipy/scipy/blob/v0.11.0/scipy/linalg/matfuncs.py#L27).

Merging this into SciPy is still work in progress, but I hope someone can pick up where I left off, and fully integrate this into SciPy.

Work I think is left to be done:-
1. time_expm.py - Get the sparse matrix routines to agree with scipy.linalg.expm results. Currently, only getting a vector in return, when should be getting a sparse matrix..
2. expowrap.py - When time_expm.py works for sparse matrices, copy expmwrap function to expowrap.expm(), and delete time_expm.py
3. Put the EXPOKIT copyright somewhere? (See author's authorisation on [SciPy-user discussion](http://mail.scipy.org/pipermail/scipy-user/2012-November/033600.html).)
4. Get the appropriate unit tests in [scipy.linalg.tests.test_matfuncs](https://github.com/scipy/scipy/blob/v0.11.0/scipy/linalg/tests/test_matfuncs.py) to run on EXPOKIT wrapper functions.
5. Update scons and bento build systems.
6. Document the shared library API. I tried to do this in the signature files, but failed to add multi-line documentation to the pymethoddef table. Each function's .__doc__ attribute contains the required argument data-types, though.

And probably some other things...

There are Chebyshev routines in Expokit, which might provide speed improvements cf. the SciPy Chebyshev functions, but I haven't needed to use them, so haven't used or done anything with them. Some of these are used internally by the sparse matrix functions.

The signature file contains auto-generated signatures for all the functions in Expokit, including the ones I didn't use or modify wrappers for, too. It's probably safe to delete the signatures for these.

The only routines I think need to be accessible from Python, for expm to work, are:-

dgpadm - Padé approximation of dense, double precision matrix.
zgpadm - Padé approximation of dense, complex matrix
dgexpv - Krylov projection of general sparse, double precision matrix
zgexpv - Krylov projection of general sparse, complex matrix

However, there are routines optimised for other specific types of matrices, including symmetric and Hermitian dense and sparse matrices. It might be desirable to keep the wrappers for these routines, even though I don't think they are currently available in SciPy's expm[23] functions...

I hope this helps to get things moving along.

Kind regards,
Alex