quacc icon indicating copy to clipboard operation
quacc copied to clipboard

NewtonNet model settings do not always get correctly passed to `_add_stdev_and_hess` or `_get_hessian`

Open Andrew-S-Rosen opened this issue 1 year ago • 1 comments

Details about the quacc environment

  • quacc version: 0.9.1
  • Python version: 3.11

What is the issue?

In the NewtonNet recipes, the model path and settings paths for the NewtonNet model architecture are (by default) pulled from the global quacc settings. However, if the user passes model_path or settings_path as **calc_kwargs to the recipe, it will override the defaults.

https://github.com/Quantum-Accelerators/quacc/blob/a73891d4ff9aeed89594060f92fe3b9d57970c08/src/quacc/recipes/newtonnet/core.py#L64-L68

This is all perfectly fine, but if a user passes a custom model_path or settings_path, this is not used by _add_stdev_and_hess because that function is hard-coded to use only the global settings:

https://github.com/Quantum-Accelerators/quacc/blob/a73891d4ff9aeed89594060f92fe3b9d57970c08/src/quacc/recipes/newtonnet/core.py#L212-L215

This can cause a potential conflict. Note that the same is true for _get_hessian():

https://github.com/Quantum-Accelerators/quacc/blob/a73891d4ff9aeed89594060f92fe3b9d57970c08/src/quacc/recipes/newtonnet/ts.py#L286-L289

Tagging @samblau and @kumaranu.

How can we easily reproduce the issue?

from quacc.recipes.newtonnet.core import relax_job
from ase.build import molecule

atoms = molecule("CH4")
model_path = "/my/custom/model/path" # not in settings
relax_job(atoms, model_path=model_path)

Andrew-S-Rosen avatar Jun 05 '24 01:06 Andrew-S-Rosen

I have address it for _get_hessian. Not sure if anything else is remaining as well.

kumaranu avatar Jul 24 '24 22:07 kumaranu