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

Matrix Exponentiation #22

Open
matthagan15 opened this issue Apr 10, 2023 · 4 comments
Open

Matrix Exponentiation #22

matthagan15 opened this issue Apr 10, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@matthagan15
Copy link

Is your feature request related to a problem? Please describe.
Matrix exponentation utilizing the standard double precision algorithm by Al-Mohy and Higham.

Describe the solution you'd like
A simple function that takes in a reference or matrix view (of some sorts not familiar with this library just yet) and yields a Result< ,> containing the exponentiated matrix if it worked and an error if not.

Describe alternatives you've considered
n/a

Additional context
I have implemented this function for ndarray-linalg but the maintainers have taken months and still no word. I am using my implementation for research purposes, using ndarray I have an error one-norm of about 20x scipy at 200x200 dense matrices and an error of machine precision for 1-sparse matrices up to 1024x1024. It might take some time but I'd be willing to port it over to this library to help move it along, would like to hear how this should best be done.

@matthagan15 matthagan15 added the enhancement New feature or request label Apr 10, 2023
@sarah-quinones
Copy link
Owner

i'll look into it. right now i'm in the middle of a full rewrite of the library so i'm hesitant to start working on other stuff at the same time, but i should be done after a week or two hopefully. in the mean time, i could take a look at the algorithm if you have any references i can check out

@matthagan15
Copy link
Author

matthagan15 commented Apr 12, 2023

Ah sorry I think I miscommunicated, this is an offer for me to port the implemented algorithm from ndarray-linalg over to this project. All I'd need to learn how to do is multiplication and scaled addition, which I'd think shouldn't be too bad. I was mostly wondering what you think the best place to put this would be, it doesn't seem like a core contribution but doesn't quite fit in with the other "crates"/workspaces (still learning this type of organization). Let me know where and how you'd want it to be added and I'll get started on it.

@sarah-quinones
Copy link
Owner

i think it might make sense to create a new faer-math top level crate that contains math functions, kind of like eigen's matrix functions module https://eigen.tuxfamily.org/dox/unsupported/group__MatrixFunctions__Module.html

@ilayn
Copy link

ilayn commented Sep 26, 2024

I converted the SciPy version to C in case it makes things easier to convert https://github.com/scipy/scipy/blob/main/scipy/linalg/_matfuncs_expm.c

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

No branches or pull requests

3 participants