nwchemgit / nwchem

NWChem: Open Source High-Performance Computational Chemistry
http://nwchemgit.github.io
Other
513 stars 162 forks source link

VEM TDDFT optimizations fail after the first gradient #1030

Open edoapra opened 1 month ago

edoapra commented 1 month ago

Describe the bug VEM TDDFT optimizations all fail after the first gradient https://groups.google.com/g/nwchem-forum/c/E0iK63zBbSA since hnd_coschg tries to use g_vem(3) that was destroyed in the tddft_gradient

To Reproduce Input for reproducer

geometry
 c                     0.00000000     0.00000000     0.00000000
 h1                    0.62442915     0.62442915     0.62442915
 h1                   -0.62442915    -0.62442915     0.62442915
 h                    -0.62442915     0.62442915    -0.62442915
 h                     0.62442915    -0.62442915    -0.62442915
end

BASIS spherical
 * library 6-31G
END

dft
 xc xpbe96 cpbe96
end

cosmo
 do_cosmo_vem 1
 solvent dmso
end
driver
maxiter 20
end

tddft
 nroots 1
 algorithm 1
 notriplet
 target 1
 civecs
 grad
   root 1
 end
end
task tddft optimize
edoapra commented 2 weeks ago

The VEM method only applies to the vertical excitation and vertical emission and not to geometry optimizations. TDDFT gradients are just computed at one point to get the excited-state density to compute the updated charges. For the emission, the optimizations need to be performed (without VEM) and then the VEM can be switched on for the geometry at the excited-state minimum on the particular state.