Hi everyone,
I’m trying to use Julia’s ExponentialUtilities.jl package to perform matrix-exponential-matrix multiplication. I have a sparse NxN Hamiltonian H, a small time step dt, and an NxN matrix A. The goal is to compute exp(-idt*H)A. In order to do this using the ExponentialUtilities.jl package, I first pre-allocate a Krylov subspace Ks. Then, I loop over the columns aj of A. At each iteration, I use the arnoldi!() function, H, and aj to fill the pre-allocated Krylov subspace. Then, I call expv!() to write the output into a temporary workspace vector, and copy this workspace vector into the jth column of the output NxN matrix.
My issue is that the expv!() function seems to be allocating a lot of memory, about 100 KiB to perform each matrix-exponential-vector multiplication for a 997x997 matrix and a vector of length 997. Is this something that I should expect? I was under the impression that if I preallocated the Krylov subspace, I wouldn’t have to allocate a lot of extra memory. Thank you in advance for any guidance on this matter.