OpenFreeEnergy / OpenFreeEnergy/openfe
OpenFE silently ignores SMIRNOFF LibraryCharges and applies AM1-BCC when molecule charges are absent
@jthorton is already working on this.
Since Aug 11, 2026.
- Dominant language
- Python
- Stars
- 332
- Forks
- 56
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 13
Description
Describe the bug
In workflows where users want custom partial charges, a recommended approach (e.g., discussed in related tooling) is to store those charges as SMIRNOFF LibraryCharges in the force field so the force field fully describes all applied parameters.
Related discussion: https://github.com/cole-group/presto/issues/64
OpenFE appears to assume molecules should always carry explicit charges and, when they do not, silently falls back to AM1-BCC charging.
As a result, molecules with valid LibraryCharges in the supplied SMIRNOFF force field may still be assigned AM1-BCC charges instead of the intended library charges see https://github.com/OpenFreeEnergy/openfe/blob/97bef39d3ccfabb259636728b7782490640f42ed/src/openfe/protocols/openmm_utils/charge_generation.py#L286
This is especially problematic because it is silent behavior: users may believe their force-field-defined charges are being used when they are not.
Expected behavior
If LibraryCharges are present and match the molecule, OpenFE should use them as the source of partial charges.
At minimum, OpenFE should not silently override intended charge sources.
To Reproduce
Steps to reproduce the behavior (ideally a minimally reproducible example):
Output
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.