Skip to content

Fix LJInteractions qmmm

The LJInteractions class in qmmm.py has two main deficiencies: 1)One can only specify LJ parameters for atom types, where the type is the atomic symbol/number, preventing the assignment of different parameters to atoms of the same type but in different "configurations" (for example atoms of the same type but belonging to QM and MM, or atoms in different chemical configurations, such as sp2 or sp3); 2)The periodic boundary conditions are not applied molecule-wise. This has the shortcoming that molecules could be ripped apart before calculations of the LJ interactions take place if there is more than one interaction site per molecule. Also, this is inconsistent with the way periodic boundary conditions are applied in the electrostatic Embedding class used in QMMM calculations.

I have implemented a general LJInteractions class in qmmm.py. The class takes as inputs numpy arrays with the LJ parameters for the QM and MM parts respectively, as:

ljinteraction = LJInteractions_general(sigma_qm, epsilon_qm, sigma_mm, epsilon_mm)

Moreover, it applies periodic boundary conditions molecule-wise as it is already done in the electrostatic Embedding class.

I have tested the new class on the water s22 dimer with the TIP3P forcefield, which has only one interaction site per molecule. I attach the script used for the test and some figures showing that the forces and energy terms calculated by both LJInteractions classes are the same.

DimerScan_TIP3P.py

QMMMH2ODim_tzpPBE_0.18h_Benergy

QMMMH2ODim_tzpPBE_0.18h_Forces

QMMMH2ODim_tzpPBE_0.18h_LJ

Gianluca

Merge request reports