Page 1 of 1

Reporting subsets of the potential energy (i.e. dihedrals)

Posted: Tue Jun 19, 2018 6:12 pm
by lewiso1
Hi all,
Is it possible to report or access the value of a subset of the potential energy function, dihedrals for example?
I tried a couple of things - The PeriodicTorsionForce or CustomTorsionForce dont have a getPE (?) method, and the reporter functions only have total potentialEnergy.

This value is useful for calculating the boost energy used in dual accelerated MD.
Thanks

Re: Reporting subsets of the potential energy (i.e. dihedrals)

Posted: Tue Jun 19, 2018 6:24 pm
by peastman
You can do this by putting each force into its own force group. For example,

Code: Select all

torsions.setForceGroup(1)
Then when you call getState() on the Context, you can specify to include just that force group:

Code: Select all

print(context.getState(getEnergy=True, groups={1}).getPotentialEnergy()

Re: Reporting subsets of the potential energy (i.e. dihedrals)

Posted: Tue Jun 19, 2018 9:19 pm
by lewiso1
easy - cheers