cgcmm.pair.cgcmm CMM coarse-grain model pair potential.


CGCMM pair potentials.

class hoomd.cgcmm.pair.cgcmm(r_cut, nlist)

CMM coarse-grain model pair potential.

  • r_cut (float) – Default cutoff radius (in distance units).
  • nlist ( – Neighbor list

cgcmm specifies that a special version of Lennard-Jones pair force should be added to every non-bonded particle pair in the simulation. This potential version is used in the CMM coarse grain model and uses a combination of Lennard-Jones potentials with different exponent pairs between different atom pairs.

B. Levine et. al. 2011 describes the CGCMM implementation details in HOOMD-blue. Cite it if you utilize the CGCMM potential in your work.

Multiple potential functions can be selected:

\[ \begin{align}\begin{aligned}V_{\mathrm{LJ}}(r) = 4 \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \alpha \left( \frac{\sigma}{r} \right)^{6} \right]\\V_{\mathrm{LJ}}(r) = \frac{27}{4} \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{9} - \alpha \left( \frac{\sigma}{r} \right)^{6} \right]\\V_{\mathrm{LJ}}(r) = \frac{3\sqrt{3}}{2} \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \alpha \left( \frac{\sigma}{r} \right)^{4} \right]\end{aligned}\end{align} \]

See for details on how forces are calculated and the available energy shifting and smoothing modes. Use pair_coeff.set to set potential coefficients.

The following coefficients must be set per unique pair of particle types:

  • \(\varepsilon\) - epsilon (in energy units)
  • \(\sigma\) - sigma (in distance units)
  • \(\alpha\) - alpha (unitless) - optional: defaults to 1.0
  • exponents, the choice of LJ-exponents, currently supported are 12-6, 9-6, and 12-4.

We support three keyword variants 124 (native), lj12_4 (LAMMPS), LJ12-4 (MPDyn).


nl = nlist.cell()
cg = pair.cgcmm(r_cut=3.0, nlist=nl)
cg.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0, exponents='LJ12-6')
cg.pair_coeff.set('W', 'W', epsilon=3.7605, sigma=1.285588, alpha=1.0, exponents='lj12_4')
cg.pair_coeff.set('OA', 'OA', epsilon=1.88697479, sigma=1.09205882, alpha=1.0, exponents='96')

Disable the force.

Parameters:log (bool) – Set to True if you plan to continue logging the potential energy associated with this force.



Executing the disable command will remove the force from the simulation. Any command executed after disabling a force will not calculate or use the force during the simulation. A disabled force can be re-enabled with enable().

By setting log to True, the values of the force can be logged even though the forces are not applied in the simulation. For forces that use cutoff radii, setting log=True will cause the correct r_cut values to be used throughout the simulation, and therefore possibly drive the neighbor list size larger than it otherwise would be. If log is left False, the potential energy associated with this force will not be available for logging.


Enable the force.



See disable().


Get the energy of a particle group.

Parameters:group ( – The particle group to query the energy for.
Returns:The last computed energy for the members in the group.


g = group.all()
energy = force.get_energy(g)