Skip to content
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

Add Julia matrix exponential? #44

Open
sdewaele opened this issue Mar 1, 2019 · 7 comments
Open

Add Julia matrix exponential? #44

sdewaele opened this issue Mar 1, 2019 · 7 comments

Comments

@sdewaele
Copy link

sdewaele commented Mar 1, 2019

I needed a pure Julia implementation of matrix exponentiation, so I updated an old 2012 gist to Julia 1.0, see here. I am happy to contribute it to this repo if desired. Probably a better implementation can be made that is closer to the current Julia implementation. After all, it only uses LAPACK.gebal! and LAPACK.gesv! as far as I can tell.

@andreasnoack
Copy link
Member

That would be great. There is absolutely no reason why the base implementation uses gesv! directly. Instead of LAPACK.gesv!(V-U, X) is should just do ldiv!(lu!(V-U), X). It would be great if you could prepare such a PR for for the julia repo. I'd also be happy to accept a PR with a generic gebal implementation in this repo.

@sdewaele
Copy link
Author

Thanks for the pointer for the replacement of LAPACK.gesv, that is a good start. I have made this replacement and did some performance testing on it. I do find some increase in execution time, typically around 1% or so. I get occasional larger increases, up to ~30%, which seem to occur when there is a competing process running. This would all be fine if it would give us a fully generic matrix exponential, however, there is still the call to LAPACK.gebal!. In all, I don't think it is worthwhile submitting a PR for the Julia repo. It appears that creating a generic version for gebal is not that simple.

@sdewaele
Copy link
Author

sdewaele commented Mar 31, 2019

I created a generic matrix exponential based on the current Julia matrix exponential, but without matrix balancing, see here for the added code. I think it is valuable to have this as a starting point. Please let me know if you would like to include it in this repository.

@sdewaele
Copy link
Author

Is there an interest in adding the generic matrix exponential?

@andreasnoack
Copy link
Member

Yes. Did you get around looking into a generic gebal or is your version still not balancing?

@timholy
Copy link
Member

timholy commented Oct 22, 2020

We are quite interested in this. @sdewaele, your link for your code is broken, is there some place we can see it and perhaps help get this done?

@sdewaele
Copy link
Author

I am sorry to say I have deleted my fork of the repo.

Anyway, not too much is lost: all I did compared the the current implementation is replace LAPACK.gesv!(V-U, X) by ldiv!(lu!(V-U), X). and skipped balancing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants