I'm having trouble understanding when it would be better to use the sparse version of expm over the regular version.
If I take a dense matrix M,which happens to be sparse, of size 4000 x 4000 matrix and compute scipy.linalg.expm(M), this takes around 25 seconds. If I then do M_sparse = sparse.csc_matrix(M) and compute scipy.sparse.linalg.expm(M_sparse), this runs for at least 10 minutes.
What is the right use case for scipy.sparse.linalg.expm? Is it intended for much larger matrices?