Skip to content

OpenFE silently ignores SMIRNOFF LibraryCharges and applies AM1-BCC when molecule charges are absent #2062

Open
2 of 3 issues completed

Description

@jthorton

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: cole-group/presto#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

def assign_offmol_partial_charges(

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

Sub-issues

Sub-issues

2 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. IAlibay commented on Jul 2, 2026

    @IAlibay
    Member

    This is something we've explored a lot in pontibus - especially around the issue of virtual sites (where it's quite the headache to scale things appropriately).

    Essentially the current take is that OpenFE's force field assignment tooling (even in pontibus where it's going through Interchange) does not support library charges for small molecule components, so folks need to assign partial charges before Protocol creation.

    One way forward

    One of the medium/short term solution I've been thinking about for a while is to change the partial charge assignment utills to have a "assign partial charges according to this force field", where would pass a string / path for a smirnoff force field and roundtrip through Interchange to get the partial charges.

    This would fix both AshGC and LibraryCharge situations but would still leave charge increments as a painful edge case.

  2. jthorton commented on Aug 19, 2026

    @jthorton
    CollaboratorAuthor

    The changes in #2132 should now allow AshGC and Library charges to be used at runtime even if they are not set on the molecule by all protocols.
    The changes in #2152 will allow AshGC and Library charges defined in a force field to be assigned to a molecule's partial charge field via the CLI command or via the API by setting method="forcefield" and providing the force fields to use as a reference as forcefields=[ffs]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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