[MMTK] question on printing out all non-bonded interactions

Konrad Hinsen research at khinsen.fastmail.net
Mon Feb 6 08:41:31 UTC 2012

Naomi Fox writes:

 > included nonbonded pairs.   Using the NonbondedList seems a little
 > tricky.  It involves reading through the C code, and the script
 > (copying from your two examples) keeps getting seg faults.

You have to be very careful about the element types of the arrays
passed to the NobondedList constructor. They have to correspond
exactly to the types used at the C level. It is possible that the
rather old scripts from the mailing list discussions don't work
correctly with NumPy, or on 64-bit machines. As I said, this wasn't
originally meant for direct use in scrips.

 > I was wondering why when I sum the LJ-potentials over all atom
 > pairs which are non  excluded_pairs or one_four_pairs, I get a
 > total of 561 kJ/mol.  The LJ-potential for the system
 > from universe.energyTerms() is 31 kJ/mol.  This agrees with the
 > LJ-potential I get when I sum the LJ-potentials between each pair
 > of residues.  Why the discrepancy in the energies?

You should not exclude pairs on the 1-4 list, but add them with a
prefactor (0.5 for Amber94 and Amber99).

In pathological cases you can get a different result because of
different summation order. MMTK actually sums the LJ energy over all
pairs first, and then in a second pass adds the terms from the
exlusion list with a negative sign, and then those from the 1-4 list
with an appropriate (negative) prefactor. This is faster than checking
the two lists during the initial summation. For normal configurations
the result is the same, but if you two atoms at an unphysically close
distance (the case I have seen had 0.001 nm), their contribution can
be so large that it introduces roundoff errors into the procedure.

Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: research AT khinsen DOT fastmail DOT net

More information about the mmtk mailing list