Closed mattwthompson closed 1 week ago
Here's another way of representing the same problem - just water, using a rigid model:
from openff.toolkit import ForceField, Molecule
from openff.units import Quantity, unit
from openff.interchange.components._packmol import UNIT_CUBE, pack_box
from openff.interchange.drivers import get_amber_energies, get_openmm_energies
water = Molecule.from_mapped_smiles("[H:2][O:1][H:3]")
topology = pack_box(
molecules=[water],
number_of_copies=[2000],
mass_density=Quantity(1.0, unit.gram / unit.milliliter),
box_shape=UNIT_CUBE,
)
out = ForceField("tip3p.offxml").create_interchange(topology)
get_openmm_energies(out)
"""
EnergyReport(energies={'Nonbonded': <Quantity(104273.423, 'kilojoule / mole')>})
"""
get_amber_energies(out)
"""
LookupError: Could not find component Bonds. This object has the following collections registered:
['Constraints', 'vdW', 'Electrostatics']
"""
The writer can't write out the topological bonds since there's no physics associated with them. As far as I can tell, prmtop files merge this information, making one impossible without the other.
I believe ParmEd dealt with this in the "correct" AMBER way which is to actually provide bond details for water even if they aren't intended to be used. Ah yes, you caught this above:
ParmEd works around this by assigning a (presumably) arbitrary force constant of 50,000 to these bonds, including an H-H "bond."
I don't like this solution but I think it's the best one for AMBER.
(I'm in a rush so let me know if I missed soemthing important.)
I guess this is about as good as it's going to get
Description
Consider starting from GROMACS files of something containing a fixed three-site water model. These files include sufficient information to construct a chemical graph that includes information about which atoms are bonded to which atoms and which atom pairs are constrained and at what distance. This information is stored:
and, since the force constant of the H-O bond is not specified for rigid water models, there is no associated harmonic bond interaction:
This is not an issue for OpenMM or GROMACS evaluation, since they accurately understand that they don't need a bond force constant:
But Amber, which mixes the topology (which atoms are bonded to which) and parameters (what is the force constant of each harmonic bond) chokes:
This traceback is not super useful; the issue is that
BONDS_INC_HYDROGEN
needs to be populated to describe the bond graph but can't be populated with defined parameters.ParmEd works around this by assigning a (presumably) arbitrary force constant of 50,000 $\frac{kJ}{{nm}^2}$ to these bonds, including an H-H "bond."