-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
ENH: Alex Leach's wrapper of Roger Sidje's EXPOKIT #2974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage remained the same when pulling df566b3ff30f589a2745371a4d376ec955b87389 on argriffing:alex-leach-expokit-wrapper into 70fd6ff on scipy:master. |
The interface should IMHO be Cleaned up + rebased branch here: https://github.com/pv/scipy-work/tree/pr-2974
With the other PR with the exact norm estimation, your implementation of Higham's algorithms seem to be within 20% of Expokit speed. Not bad :) The Krylov estimate part still needs some love; it shouldn't call |
[EDIT: fixed the git stuff] I'm probably not up for writing sparse matrix Fortran<->SciPy code if that's what would be required to make the EXPOKIT sparse expm_multiply work, but I might be up for a more detailed investigation of the accuracies of the expm implementations, which Alex Leach has begun in his PR thread. Regarding the organization of the code, I would be OK with either |
@argriffing: use |
@pv thanks, your commits are now added into this PR. |
Looking more closely into the accuracy differences, I see that for medium-sized (n=20) complex matrices constructed by taking the logm of matrices whose entries are independently standard normally distributed, the higham expm always seems to give closer (in norm) answers than does the expokit expm. For other matrix distributions and other ways of comparing accuracy, the higham expm still seems to be usually better, but not for every matrix. These comparisons still have the caveat that the accuracy calculations depend on the accuracy of logm, and the comparisons extend the earlier comparisons by @alexleach. expm accuracy testing code linalg.expm vs expokit expm for logm of entrywise standard random normal matrix linalg.expm vs expokit expm for logm of entrywise standard uniform random matrix |
I think the things that need to be decided before merging are:
The second option to stuffing |
maybe tag these with something like |
Chuck suggested |
Add the EXPOKIT wrapper, with some benchmark and testing code.
Through testing I've found that the expm provided by the wrapper fails for a matrix full of zeros (causing a fortran
stop
) and for the following matrix mentioned by Cleve Moler (returning a matrix full ofnan
s).http://blogs.mathworks.com/cleve/2012/07/23/a-balancing-act-for-the-matrix-exponential/
My benchmark times were a lot faster than the ones reported in #354. I'm on some 6-core Xeon with openblas, which I would have thought would be comparable to the system used for the other benchmarks. Maybe I am doing the timings wrong, or maybe the numbers reported in the other PR were using a fake BLAS or LAPACK instead of actually using MKL.
Sorry I screwed up the first commit message, and then I tried to go back and change it somehow, but this only added more commit messages and caused some merge to happen.