Skip to content

Commit 5a4fca7

Browse files
committed
Update openmm example to use atom masses from the pdb
1 parent eede5d7 commit 5a4fca7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/openmm-integration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def forward(self, positions):
5151

5252
system = System()
5353
# Create an OpenMM system and add the TorchForce
54-
for i in range(pdb.topology.getNumAtoms()):
55-
system.addParticle(1.0)
54+
for atom in pdb.topology.atoms():
55+
system.addParticle(atom.element.mass)
5656
system.addForce(torch_force)
5757
integrator = LangevinMiddleIntegrator(298.15*kelvin, 1/picosecond, 2*femtosecond)
5858
platform = Platform.getPlatformByName('CPU')

0 commit comments

Comments
 (0)