openforcefield / openff-benchmark

Comparison benchmarks between public force fields and Open Force Field Initiative force fields
MIT License
11 stars 2 forks source link

Add heuristic check for connectivity changes in molecules post-QM #60

Closed dotsdl closed 3 years ago

dotsdl commented 3 years ago

It is sometimes (in practice, rarely) the case that atoms move around during QM optimization, and in this case creating an openff.toolkit.toplogy.Molecule could result in a molecule with coordinates mismatched on the wrong atoms.

The OpenFF Molecule object is created from the original CMILES attached to the QCElemental.models.Molecule (QCE Molecule) prior to the optimization, but the final geometry of the molecule, though always the same array size and shape, may have an ordering different than the starting geometry due to atom movements. This would proceed silently with the current implementation of creating an OpenFF Molecule from a QCE Molecule.

We need a way to identify these cases upon creating an OpenFF Molecule, and throwing appropriate exceptions and/or warnings. @jthorton has a heuristic he has put into openff-qcsubmit. It may also be possible to do checks on atom element identity matching against the CMILES-generated OpenFF Molecule and the QCE Molecule the geometry is being extracted from.

dotsdl commented 3 years ago

@jthorton noted that order of atoms is actually maintained by QCE Molecule even if atoms moved around, so the problem really comes down to interpreting connectivity for the OpenFF Molecule. This is difficult to do generally, but a filtering heuristic like the one he has proposed may be our best option in the interim.

j-wags commented 3 years ago

Closed by #65