Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can't re-fit virtual sites due to inability to identify them uniquely #726

Closed
Closed
Can't re-fit virtual sites due to inability to identify them uniquely#726
Assignees

Description

Describe the bug

Theoretically I should be able to re-fit virtual sites with Evaluator, but I can't because I can't retrieve a virtual site parameter by SMIRKS. This is by design as SMIRKS does not uniquely identify a VirtualSite parameter -- multiple are allowed to have the same SMIRKS. Therefore another solution is necessary. Interchange has VirtualSiteKeys.

To Reproduce

Apologies, I have no small MRE right now; I'm running into bugs while trialling a 4-site water model fit with ForceBalance. The problematic code is in system_subset:

parameter = (
handler
if parameter_key.smirks is None
else handler.parameters[parameter_key.smirks]
)

When the parameter key being fit is a virtual site, this triggers the NotImplementedError linked in the openff toolkit.

Additional context

While pushing through getting a 4-site fit off the ground, I quickly patched this code as shown here: aa77c20

This is hacky as ParameterKey.smirks was probably not intended to hold all these attributes, but there were no other fields in ParameterKey to easily slot this on. It's also hardcoded to match corresponding patches I put in ForceBalance here and here.

This hardecoded vsite key was constructed to broadly approximate the Interchange version. The best solution would actually somehow incorporate a more canonical version of Interchange's VirtualSiteKey. However, I'm not certain the best way to, especially if ParameterKey.smirks needs to be a str.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions