sharc-md / sharc

The SHARC molecular dynamics (MD) program suite is an ab initio MD software package developed to study the excited-state dynamics of molecules.
https://www.sharc-md.org
GNU General Public License v3.0
59 stars 31 forks source link

Two bugs in SHARC_MOLCAS.py related to RCID and gradient calculation #30

Closed lijingbai2009 closed 2 years ago

lijingbai2009 commented 2 years ago

Hi developers,

I want to report another two bugs in the SHARC_MOLCAS.py script.

1). At line 2348, it determines whether to run gradient calculations separately by checking QMin['ncpu']>0. However, this value is always larger than 0 because the minimum value of ncpu is 1, there is the following check on the state-specific gradient is never met. I suggest changing to QMin['ncpu']>1 following the idea of checking the number of available CPUs.

2). At line 2341, the script uses the keyword 'cholesky_analytical' to determine whether use numerical gradients or not. However, when using 'cholesky_analytical', the RICD option was not added in the MOLCAS.template. This is because at line 2594, if only checks the keyword 'cholesky', the check on 'cholesky_analytical' is missing. I suggest changing to if QMin['template']['cholesky'] or QMin['template']['cholesky_analytical']. Same for line 516, but this only affects the printing information.

Jingbai

maisebastian commented 2 years ago

Dear Jingbai, 1) It is possible that ncpu is smaller than 1 if such a value is entered in MOLCAS.resources. Note that there are some technical differences between running all gradients in the same job versus multiple jobs for the interface (output parsing, error checking, preparation of work directories, ...). The default mode of operation in the interface is to do separate gradient calculations, even on 1 CPU. The "all in one" mode is an old mode that should still work, but should be regarded a debug option.

2) Note that for analytical gradients with Cholesky, both "cholesky" and "cholesky_analytical" keywords must be used. Using only "cholesky" adds the RICD keyword, but runs gradients in numerical mode (old option from times where no RICD-SA-CASSCF gradients were available). Using only the "cholesky_analytical" keyword is not valid and in the future will automatically add "cholesky" to the list of options.

Best, Sebastian