-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lammps constraints #897
Lammps constraints #897
Conversation
Codecov Report
Additional details and impacted files |
I think I'm going about this wrong. I'm trying to use the
|
Yeah, it looks like it's trying to treat them all as the same cluster, which is not what one wants to do generally. Can you look at: https://docs.lammps.org/molecule.html in the "shake atoms" and "shake bond types" section? I think methane is actually a special case that isn't allowed, since there are 4 hydrogen bonds attached to one heavy atom. Try ethane, which should be supported. We need a LAMMPS expert on this . . . |
That's precisely it! (And, now that my memory is jogged like a student looking at the answer key, I remember this isn't the first time I've come across this corner case: openmm/openmm#3856) The idea of methane is that, since all of its bonds are constrained, the total bond energy should be zero. Ammonia handles that well enough, though. I haven't implemented rigid water yet, but this is looking okay for some simple molecules: In [16]: def run_lammps(smiles: str) -> EnergyReport:
...: molecule = MoleculeWithConformer.from_smiles(smiles)
...: molecule.name = "MOL"
...: topology = molecule.to_topology()
...: topology.box_vectors = Quantity([4, 4, 4], "nanometer")
...:
...: return smiles, get_lammps_energies(sage.create_interchange(topology)).energies
In [17]: [run_lammps(smiles) for smiles in ["N", "CCO", "CC(=O)OC1=CC=CC=C1C(=O)O"]]
Out[17]:
[('N',
{'Bond': 0.0 <Unit('kilocalorie_per_mole')>,
'Angle': 0.62354148 <Unit('kilocalorie_per_mole')>,
'Torsion': 0.0 <Unit('kilocalorie_per_mole')>,
'vdW': -7.6032464e-05 <Unit('kilocalorie_per_mole')>,
'Electrostatics': -0.01761300000000432 <Unit('kilocalorie_per_mole')>}),
('CCO',
{'Bond': 0.045460236 <Unit('kilocalorie_per_mole')>,
'Angle': 1.1155101 <Unit('kilocalorie_per_mole')>,
'Torsion': 1.4631677 <Unit('kilocalorie_per_mole')>,
'vdW': 0.15680472977 <Unit('kilocalorie_per_mole')>,
'Electrostatics': -4.220942000000001 <Unit('kilocalorie_per_mole')>}),
('CC(=O)OC1=CC=CC=C1C(=O)O',
{'Bond': 1.6112717 <Unit('kilocalorie_per_mole')>,
'Angle': 4.8003716 <Unit('kilocalorie_per_mole')>,
'Torsion': 11.484984206976 <Unit('kilocalorie_per_mole')>,
'vdW': 9.6975537526 <Unit('kilocalorie_per_mole')>,
'Electrostatics': -65.17742600000001 <Unit('kilocalorie_per_mole')>})] |
Description
Provide a brief description of the PR's purpose here.
Checklist