From 1a3e96c1d29d3bc5b954ada36cf6bfe7528df81a Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Fri, 27 Sep 2024 15:22:34 -0500 Subject: [PATCH 1/2] DOC: Document that charges on the topology are ignored --- openff/interchange/components/interchange.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openff/interchange/components/interchange.py b/openff/interchange/components/interchange.py index 4b3fd94e..98906750 100644 --- a/openff/interchange/components/interchange.py +++ b/openff/interchange/components/interchange.py @@ -109,7 +109,8 @@ def from_smirnoff( positions are taken from the molecules in topology, if present on all molecules. charge_from_molecules : `List[openff.toolkit.molecule.Molecule]`, optional If specified, partial charges will be taken from the given molecules - instead of being determined by the force field. + instead of being determined by the force field. In either case, charges + on the input topology are ignored. partial_bond_orders_from_molecules : List[openff.toolkit.molecule.Molecule], optional If specified, partial bond orders will be taken from the given molecules instead of being determined by the force field. @@ -121,6 +122,10 @@ def from_smirnoff( If the `Molecule` objects in the `topology` argument each contain conformers, the returned `Interchange` object will have its positions set via concatenating the 0th conformer of each `Molecule`. + If the `Molecule` objects in the `topology` argument have stored partial charges, these are ignored and charges + are assigned according to the contents of the force field. To override the force field and use preset charges, + use the `charge_from_molecules` argument. + Examples -------- Generate an Interchange object from a single-molecule (OpenFF) topology and From ca7ded61a2e45f61813cd65f524c6812476bbe6b Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Wed, 16 Oct 2024 08:34:41 -0500 Subject: [PATCH 2/2] DOC: Repeat topology charge ignorance in user guide --- docs/using/edges.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/using/edges.md b/docs/using/edges.md index b7c82d6c..135c1608 100644 --- a/docs/using/edges.md +++ b/docs/using/edges.md @@ -11,6 +11,10 @@ Currently, the `Interchange.topology` attribute is defined by the OpenFF Toolkit For example, `Interchange.topology.get_positions()` will never include positions of virtual sites. To get the positions of a system with virtual sites included, use `Interchange.get_positions()`. The default behavior of `Interchange.positions` is also to return positions without virtual sites, but this may change in the future. +### Existing charges are ignored by default + +`Molecule` and `Topology` objects can store partial charges, but these are ignored by default in methods like `Interchange.from_smirnoff`. This is because partial charges in SMIRNOFF force fields are defined by sections in the force field. To override this behavior, use the `charge_from_molecules` argument. Be aware that charges, and as a result most physics, differ from what's perscribed by the contents of the force field. + ## Quirks of `from_openmm` ### Modified masses are ignored