Batch matrix exponential computation with CPU/GPU

버전 1.0.3 (79.7 KB) 작성자: Yi-Hao Chen
Calculate several matrix exponentials at a time with Pade approximation
다운로드 수: 146
업데이트 날짜: 2018/12/4

라이선스 보기

This code is based on Ken Johnson's "expm_". I extended it to compute with GPU. Besides, it can compute for several matrices at a time by using Pade approximation. The matrices should be stored in each page of a multidimensional array.
For CPU computation, please install Yuval's "mmx" for a faster matrix computation, otherwise, it uses a for-loop.

This code can be 400x faster than using for-loop Matlab "expm" when calculating 10000 5x5 randn matrices under GPU. It takes only 0.04s, while Matlab "expm" takes 20s.

Future plan: For Hermitian (or possibly anti-Hermitian) matrices, calculate the eigenvectors and eigenvalues for multiple matrices at once with GPU with householder transformation and QR decomposition, and then use them to calculate expm, which should be faster and this is what Matlab expm does when it's a hermitian matrix. This will take a long time since I'm not familiar with these two methods and I can only do it "if I have enough free time".

인용 양식

Yi-Hao Chen (2024). Batch matrix exponential computation with CPU/GPU (https://www.mathworks.com/matlabcentral/fileexchange/67668-batch-matrix-exponential-computation-with-cpu-gpu), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.3

Bug fixed. I compared a bunch of random matrices and it works well. It should be fine now.

1.0.1.2

Still has bugs

1.0.1.1

Bug fixed.
Besides, the previous comment on the bug is wrong. It's that the calculation of the number of terms of Pade approximation is wrong.

1.0.1

Please stop using this. I found a bug if the dimension of the input array is more than 4. That is to say, it can only deal with (n,n,num_matrix) cases

1.0.0.2

Put in the benchmark for the comparison of Matlab expm with for loop and this "myexpm_" function.

1.0.0.1

Fix a bug in multslash

1.0.0.0

Modify user information
Add some user information into the code.