Potential energy minimization#
Relaxing molecular structures to local potential energy minima using molecular mechanics optimizers.
The function molsysmt.molecular_mechanics.potential_energy_minimization() relieves steric clashes and relaxes coordinates to a local energy minimum using gradient-based optimization algorithms (e.g. L-BFGS).
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.molecular_mechanics.potential_energy_minimization().
Note
Molecular Mechanics Backend Engine
Molecular mechanics and force evaluations in MolSysMT are executed using backend simulation engines (currently OpenMM by default). MolSysMT intentionally unifies the Pythonic interface and data structures while delegating energy evaluations, parameterizations, and gradient calculations to high-performance, battle-tested molecular simulation engines.
Basic usage#
Let’s load the Trp-Cage miniprotein and minimize its potential energy:
import molsysmt as msm
import pyunitwizard as puw
molsys = msm.convert(msm.systems['Trp-Cage']['1l2y.h5msm'], structure_indices=0)
Note
Demo Systems Catalog
This tutorial uses demonstration datasets provided by MolSysMT. To explore the full catalog of bundled systems, forms, and file paths, visit the Demo Systems guide.
We inspect the potential energy of the experimental model before and after energy minimization:
u_pre = msm.molecular_mechanics.get_potential_energy(molsys)
molsys_min = msm.molecular_mechanics.potential_energy_minimization(molsys)
u_post = msm.molecular_mechanics.get_potential_energy(molsys_min)
print('Energy before minimization:', u_pre)
print('Energy after minimization:', u_post)
Energy before minimization: -1233.2570634358794 kilojoule / mole
Energy after minimization: -2123.098243435527 kilojoule / mole
In-place coordinate minimization#
Setting in_place=True updates the input molecular system coordinates directly without returning a new copy:
msm.molecular_mechanics.potential_energy_minimization(molsys, in_place=True)
print('Minimized in-place energy:', msm.molecular_mechanics.get_potential_energy(molsys))
Minimized in-place energy: -2122.784023466525 kilojoule / mole
See also
Related Tools & References
Convert: Convert molecular systems with
molsysmt.basic.convert().Get potential energy: Calculate potential energy with
molsysmt.molecular_mechanics.get_potential_energy().Get forces: Extract atomic forces with
molsysmt.molecular_mechanics.get_forces().