Clicky

Fortran Wiki
Expokit (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Expokit is a software package by Roger B. Sidje that provides matrix exponential routines for small dense or very large sparse matrices, real or complex.

Expokit is free for non-commercial use.

Examples

The following function provides a Fortran 90 interface for computing (削除) \\mathrm{e}^{tH} (削除ここまで)(追記) e tH\mathrm{e}^{tH} (追記ここまで) for a dense, square, real matrix H(削除) \\H (削除ここまで)(追記) H (追記ここまで) via Expokit:

 ! double precision kind constant
 integer, parameter :: dp = kind(1.d0)
 ! Calculate exp(t*H) for an N-by-N matrix H using Expokit.
 function expm(t, H) result(expH)
 real(dp), intent(in) :: t
 real(dp), dimension(:,:), intent(in) :: H
 real(dp), dimension(size(H,1),size(H,2)) :: expH
 ! Expokit variables
 external :: DGPADM
 integer, parameter :: ideg = 6
 real(dp), dimension(4*size(H,1)*size(H,2) + ideg + 1) :: wsp
 integer, dimension(size(H,1)) :: iwsp
 integer :: iexp, ns, iflag, n
 if (size(H,1) /= size(H,2)) then
 stop 'expm: matrix must be square'
 end if
 n = size(H,1)
 call DGPADM(ideg, n, t, H, n, wsp, size(wsp,1), iwsp, iexp, ns, iflag)
 expH = reshape(wsp(iexp:iexp+n*n-1), shape(expH))
 end function expm

References

Revised on March 1, 2023 13:03:09 by Jason Blevins (23.245.217.121) (1584 characters / 0.0 pages)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | TeX | Source | Linked from: Libraries, 2009

AltStyle によって変換されたページ (->オリジナル) /