Force Calculation

I would like to be able to calculate forces acting on atoms in a given configuration - is there any simple way to calculate the numerical hessian for computing forces?

Cheers!

Nick

You can use the following code snippet to generate geometries who’s energies will make up a Hessian:

molclone = molecule.clone()
molclone.reinterpret_coordentry(False)
molclone.fix_orientation(True)
molclone.fix_com(True)
energies = []
for geom in core.fd_geoms_freq_0(molecule, -1):
    molclone.set_geometry(geom)
    molclone.update_geometry()
    energies.append(compute_energy(molclone))

H = core.fd_freq_0(molecule, energies, -1) # The -1 is for all irreps

There is a lot of boiler plate code there to prevent the molecule from moving around, however. Use fd_geoms_freq_1 if you want to compute the Hessian via gradients rather than energy.

Dear Daniel,

Thank you for the response!

Is it possible to do this in parallel from within the psi4 python API?

Cheers,

Nick

Psi4 doesn’t offer any multiprocessing Python side. However there is the Python multiprocessing modules or you can write out geometries and thread at the OS layer.