This repository provides some Fortran routines and python wrappers to apply the imaginary exponential of a matrix (real tridiagonal or complex) to a vector. More precisely,
for a matrix
where
The matrix exponentials above have some relevance for the Lanczos or Arnoldi approximations to the action of large-dimensional matrix exponentials, e.g., for time-dependent Schrödinger-type problems. In this context,
The main code is written in Fortran, and can be used in Python using f2py.
To generate the main python module smallexpimv.so run
python3 -m numpy.f2py -c src/F_smallexpimv.F90 -m smallexpimv -lblas
optional, generate f2py header files:
python3 -m numpy.f2py -h smexp.pyf -m smallexpimv src/F_smallexpimv.F90
To handle working memory in Python (most relevant when applying the matrix exponential multiple times) we also provide the module smallexpimv_pyclass.py. Keep in mind that using this module requires smallexpimv.so
Makefile: use
make test
to run python and fortran tests and
make libs
to generate smallexpimv.so and smallexpimv_pyclass.pyc. To use the Makefile, first check if the compiler commands and the f2py filename extension are defined correctly therein for your system!