Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot optimize scale14 with DoubleExponential #36

Closed
pavankum opened this issue Aug 5, 2022 · 4 comments · Fixed by #37
Closed

cannot optimize scale14 with DoubleExponential #36

pavankum opened this issue Aug 5, 2022 · 4 comments · Fixed by #37

Comments

@pavankum
Copy link
Member

pavankum commented Aug 5, 2022

Attached a minimal FB input for reproducing the case. I can optimize scale14 in regular vdW non-bonded FF (Sage) but not with the DoubleExponential functional form. Edit: The gradient is always zero with DoubleExponential form for scale14.

The following additions to the file handlers/nonbonded.py fixed it, I don't know if both the changes are needed or just adding the parameter attribute is enough

at line397: scale14 = ParameterAttribute(default=0.5)
at line453: global_parameters = ["alpha", "beta", "scale14"]

dexp-opt-scale14.tar.gz

cc: @jthorton @j-wags

@mattwthompson
Copy link
Member

I would be curious if you only needed to add it to global_parameters; it seems like it should already be a ParameterAttribute by nature of importing from CustomNonbondedHandler?

class CustomNonbondedHandler(ParameterHandler, abc.ABC):
"""The base class for custom parameter handlers which apply nonbonded parameters."""
_OPENMMTYPE = openmm.CustomNonbondedForce
_DEPENDENCIES = [vdWHandler, VirtualSiteHandler]
scale14 = ParameterAttribute(default=0.5, converter=float)

@pavankum
Copy link
Member Author

pavankum commented Aug 5, 2022

Thank you @mattwthompson. Yeap, that works by just adding to global parameters list.

@mattwthompson
Copy link
Member

Could you open a PR that includes this change? I don't know how to the best behavior of it, though.

@pavankum
Copy link
Member Author

pavankum commented Aug 5, 2022

Yeah, just made the PR, will close this issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants