Incorrect order for some PCFF class2 terms

I’ve been having some trouble running stable monomer systems generated using EMC, even with small time steps (0.1 fs). The behavior was consistent with bad parameters, so myself and @jrgissing compared a EMC generated file equivalent to the LAMMPS example examples/PACKAGES/reaction/tiny_epoxy/tiny_epoxy.data (which was generated using msi2lmp I believe).

There are several instances where class2 energy and r coefficients are mismatched. (e.g. C1 C2 C3 energies is listed first, followed by B1 B2 B3). The parameters that differ between the LAMMPS epoxy example (LMP) and the EMC file are listed below:

The bond-angle energies are in reverse order in the EMC file for these angle types:
EMC: Coeff(type=13, coeffs=(110.77, 41.453, -10.604, 5.129), comment='c3h,c,hc', class2_coeffs={'BondBond': (3.3872, 1.53, 1.101), 'BondAngle': (11.421, 20.754, 1.53, 1.101)})
LMP: Coeff(type=1,  coeffs=(110.77, 41.453, -10.604, 5.129), label='c3m-c2-hc',  class2_coeffs={'BondBond': (3.3872, 1.53, 1.101), 'BondAngle': (20.754, 11.421, 1.53, 1.101)})

EMC: Coeff(type=14, coeffs=(111.27, 54.5381, -8.3642, -13.0838), comment='c3h,c,o3e', class2_coeffs={'BondBond': (11.4318, 1.53, 1.42), 'BondAngle': (20.4033, 2.6868, 1.53, 1.42)})
LMP: Coeff(type=4,  coeffs=(111.27, 54.5381, -8.3642, -13.0838), label='c3m-c2-oc',   class2_coeffs={'BondBond': (11.4318, 1.53, 1.42), 'BondAngle': (2.6868, 20.4033, 1.53, 1.42)})

EMC: Coeff(type=18, coeffs=(117.94, 35.1558, -12.4682, 0.0), comment='cp,cp,hc', class2_coeffs={'BondBond': (1.0795, 1.417, 1.0982), 'BondAngle': (24.2183, 20.0033, 1.417, 1.0982)})
LMP: Coeff(type=15, coeffs=(117.94, 35.1558, -12.4682, 0.0), label='cp-cp-hc'    class2_coeffs={'BondBond': (1.0795, 1.417, 1.0982), 'BondAngle': (20.0033, 24.2183, 1.417, 1.0982)})

EMC: Coeff(type=19, coeffs=(123.42, 73.6781, -21.6787, 0.0), comment='cp,cp,oc', class2_coeffs={'BondBond': (48.4754, 1.417, 1.3768), 'BondAngle': (107.6806, 58.479, 1.417, 1.3768)})
LMP: Coeff(type=14, coeffs=(123.42, 73.6781, -21.6787, 0.0), label='cp-cp-oc',   class2_coeffs={'BondBond': (48.4754, 1.417, 1.3768), 'BondAngle': (58.479, 107.6806, 1.417, 1.3768)})


End-bond-torsion and angle-torsion energies are swapped:
EMC: Coeff(type=8, coeffs=(-0.5203, 0.0, -0.3028, 0.0, -0.345, 0.0), comment='c,c3h,o3e,c', class2_coeffs={'MiddleBondTorsion': (-5.9288, -2.7007, -0.3175, 1.42), 'EndBondTorsion': (0.4741, 1.2635, 0.5576, -0.2456, 1.0517, -0.7795, 1.53, 1.42), 'AngleTorsion': (0.5676, 0.945, 0.0703, -2.7466, 1.4877, -0.8955, 111.27, 104.5), 'AngleAngleTorsion': (-19.0059, 111.27, 104.5), 'BondBond13': (0.0, 1.53, 1.42)})
LMP: Coeff(type=9, coeffs=(-0.5203, 0.0, -0.3028, 0.0, -0.345, 0.0), label='c2-c3m-o3e-c3m',class2_coeffs={'MiddleBondTorsion': (-5.9288, -2.7007, -0.3175, 1.42), 'EndBondTorsion': (-0.2456, 1.0517, -0.7795, 0.4741, 1.2635, 0.5576, 1.53, 1.42), 'AngleTorsion': (-2.7466, 1.4877, -0.8955, 0.5676, 0.945, 0.0703, 111.27, 104.5), 'AngleAngleTorsion': (-19.0059, 111.27, 104.5), 'BondBond13': (0.0, 1.53, 1.42)})

EMC: Coeff(type=19, coeffs=(0.0, 0.0, 3.9661, 0.0, 0.0, 0.0), comment='cp,cp,cp,hc', class2_coeffs={'MiddleBondTorsion': (0.0, -1.1521, 0.0, 1.417), 'EndBondTorsion': (0.0, -0.4669, 0.0, 0.0, -6.8958, 0.0, 1.417, 1.0982), 'AngleTorsion': (0.0, 2.7147, 0.0, 0.0, 2.5014, 0.0, 118.9, 117.94), 'AngleAngleTorsion': (-4.8141, 118.9, 117.94), 'BondBond13': (-6.2741, 1.417, 1.0982)})
LMP: Coeff(type=16, coeffs=(0.0, 0.0, 3.9661, 0.0, 0.0, 0.0), label='cp-cp-cp-hc',   class2_coeffs={'MiddleBondTorsion': (0.0, -1.1521, 0.0, 1.417), 'EndBondTorsion': (0.0, -6.8958, 0.0, 0.0, -0.4669, 0.0, 1.417, 1.0982), 'AngleTorsion': (0.0, 2.5014, 0.0, 0.0, 2.7147, 0.0, 118.9, 117.94), 'AngleAngleTorsion': (-4.8141, 118.9, 117.94), 'BondBond13': (-6.2741, 1.417, 1.0982)})

EMC: Coeff(type=20, coeffs=(0.0, 0.0, 4.8498, 0.0, 0.0, 0.0), comment='cp,cp,cp,oc', class2_coeffs={'MiddleBondTorsion': (0.0, 4.8255, 0.0, 1.417), 'EndBondTorsion': (0.0, 4.8905, 0.0, 0.0, 0.2655, 0.0, 1.417, 1.3768), 'AngleTorsion': (0.0, 1.7404, 0.0, 0.0, 10.0155, 0.0, 118.9, 123.42), 'AngleAngleTorsion': (-21.0247, 118.9, 123.42), 'BondBond13': (-2.2436, 1.417, 1.3768)})
LMP: Coeff(type=17, coeffs=(0.0, 0.0, 4.8498, 0.0, 0.0, 0.0), label='cp-cp-cp-oc',   class2_coeffs={'MiddleBondTorsion': (0.0, 4.8255, 0.0, 1.417), 'EndBondTorsion': (0.0, 0.2655, 0.0, 0.0, 4.8905, 0.0, 1.417, 1.3768), 'AngleTorsion': (0.0, 10.0155, 0.0, 0.0, 1.7404, 0.0, 118.9, 123.42), 'AngleAngleTorsion': (-21.0247, 118.9, 123.42), 'BondBond13': (-2.2436, 1.417, 1.3768)})


End-bond-torsion and angle-torsion r values are swapped:
EMC: Coeff(type=15, coeffs=(0.5302, 0.0, 0.0, 0.0, -0.3966, 0.0), comment='c3h,o3e,c,hc', class2_coeffs={'MiddleBondTorsion': (-6.8007, -4.6546, -1.4101, 1.42), 'EndBondTorsion': (-0.6054, 1.3339, 0.9648, -0.162, 0.1564, -1.1408, 1.42, 1.101), 'AngleTorsion': (-1.8234, 1.6393, 0.5144, -0.7777, 0.434, -0.6653, 104.5, 108.728), 'AngleAngleTorsion': (-16.4438, 104.5, 108.728), 'BondBond13': (0.0, 1.42, 1.101)})
LMP: Coeff(type=10, coeffs=(0.5302, 0.0, 0.0, 0.0, -0.3966, 0.0), label='hc-c3m-o3e-c3m', class2_coeffs={'MiddleBondTorsion': (-6.8007, -4.6546, -1.4101, 1.42), 'EndBondTorsion': (-0.6054, 1.3339, 0.9648, -0.162, 0.1564, -1.1408, 1.101, 1.42), 'AngleTorsion': (-1.8234, 1.6393, 0.5144, -0.7777, 0.434, -0.6653, 108.728, 104.5), 'AngleAngleTorsion': (-16.4438, 108.728, 104.5), 'BondBond13': (0.0, 1.101, 1.42)})```

Thank you for finding and reporting the discrepancy. Could you attach your .esh with which you generated your structures? This helps with pinpointing down the issue.

Please find those files attached.

import.esh (373 Bytes)
backtest_epoxy.psf (29.8 KB)
backtest_epoxy.pdb (9.2 KB)

With the help of your report I was able to pinpoint the issue. It turned out, that an ordering error was made by EMC internally. I fixed the issue successfully. The next published version of EMC will include this but fix. Thank you again for the time you spend in tracing this bug down!

That’s great to hear. Glad you were able to track that down. We’ll try out the updated version when it gets posted. Thanks again.

I have uploaded a new EMC v9.4.4 of August 1, 2023, which remedies this issue.