Get degrees of freedom#

Calculating mechanical degrees of freedom for parameterized molecular systems.

The function molsysmt.molecular_mechanics.get_degrees_of_freedom() computes the effective number of mechanical degrees of freedom (\(3 N_{\text{particles}} - N_{\text{constraints}}\)) accounting for force field constraints.

Added in version 1.0.0.

Basic usage#

Let’s determine the mechanical degrees of freedom for a parameterized molecular system:

import molsysmt as msm
prmtop_sys = msm.convert(msm.systems['pentalanine']['pentalanine.prmtop'])
omm_sys = msm.convert(prmtop_sys, to_form='openmm.System')

We calculate the degrees of freedom directly from the openmm.System object:

dof = msm.molecular_mechanics.get_degrees_of_freedom(omm_sys)
print('Total mechanical degrees of freedom:', dof)
Total mechanical degrees of freedom: 10444

Direct calculation from molecular topologies#

When providing molecular topologies or native MolSysMT objects, the system is automatically converted and parameterized using the specified force field to determine the number of constraints:

molsys = msm.build.build_peptide('AceAlaCysAspGluPheNme')
dof_peptide = msm.molecular_mechanics.get_degrees_of_freedom(molsys, forcefield='AMBER14')
print('Peptide degrees of freedom (AMBER14):', dof_peptide)
Peptide degrees of freedom (AMBER14): 204