parmed.openmm.utils module

This package contains some useful functionality for common tasks in OpenMM

parmed.openmm.utils.energy_decomposition(structure, context, nrg=Unit({BaseUnit(base_dim=BaseDimension('amount'), name='mole', symbol='mol'): - 1.0, ScaledUnit(factor=4.184, master=kilojoule, name='kilocalorie', symbol='kcal'): 1.0}))[source]

This computes the energy of every force group in the given structure and computes the energy for each force group for the given Context. Note, the context must have positions already assigned.

Parameters
structureStructure

This should be the Structure object from which the System object in the Context was created

contextmm.Context

The OpenMM context set up for computing forces and energies

nrgenergy unit, optional

The unit to convert all energies into. Default is kcal/mol

Returns
dict {str:float}

A dictionary mapping the name of the force group (taken from the attribute names of the format XXX_FORCE_GROUP in the structure object) with the energy of that group in

parmed.openmm.utils.energy_decomposition_system(structure, system, platform=None, nrg=Unit({BaseUnit(base_dim=BaseDimension('amount'), name='mole', symbol='mol'): - 1.0, ScaledUnit(factor=4.184, master=kilojoule, name='kilocalorie', symbol='kcal'): 1.0}))[source]

This function computes the energy contribution for all of the different force groups.

Parameters
structureStructure

The Structure with the coordinates for this system

systemmm.System

The OpenMM System object to get decomposed energies from

platformstr

The platform to use. Options are None (default), ‘CPU’, ‘Reference’, ‘CUDA’, and ‘OpenCL’. None will pick default OpenMM platform for this installation and computer

nrgenergy unit, optional

The unit to convert all energies into. Default is kcal/mol

Returns
energieslist of tuple

Each entry is a tuple with the name of the force followed by its contribution