CFEL-CMI / richmol

Richmol is for variational simulations of molecular nuclear motion dynamics in fields
https://www.controlled-molecule-imaging.org/research/software/
Other
7 stars 1 forks source link

Unable to tdse.initial_state #24

Open nidin1996 opened 11 months ago

nidin1996 commented 11 months ago

Unable to generate initial states for Jmax greater than 40. I can't take H_diag niehter sparse form of the matrix. The error file is attached below.

3655128.txt

nidin1996 commented 10 months ago

There is an option of using H_is_diag in init_state, it is not used. 3707876.txt

If h0 is convereted to a matirx using h0.tomat(form = 'block', cart = 0), attribute error is raised as init_state checks for type of H. 3748082.txt

yachmena commented 10 months ago

@nidin1996, I have updated the tdse.init_state() to work with a sparse-matrix representation of the initial state vectors, see https://github.com/CFEL-CMI/richmol/commit/628d8917c7c8c1c45dd3802a03d219378ee4f454 The function doesn't allocate anymore large dense arrays for the diagonal Hamiltonian. For high temperatures, i.e., if a large number of initial states gets populated, it makes sense to keep the output initial state vectors in a sparse-matrix representation. You can do it by passing sparse=True to the tdse.init_state() function.