Open Lactoria-cornuta opened 3 months ago
So ASH currently only does electrostatic embedding (mechanical embedding is actually not fully enabled yet) and the MM charges of the QM-region are then set to zero during the calculation of the MM-energy (by OpenMM) to avoid double-counting. Any defined pointcharges of the QM-atoms are thus never actually used.
During QM/MM, if the QM-region has a zero total charge:
During QM/MM, if the QM-region has non-zero total charge (e.g. -1 or +1) then you are right that this would cause a problem, since if the MM-charges of the QM-atoms have been set to zero (in order to avoid QM-MM electrostatic double-counting) then the total MM-system charge no longer sums to zero, which could cause an issue for the MM-part PME electrostatics (only if periodic electrostatics are turned on). OpenMM does deal with this automatically (outside ASH) by adding a uniform neutralizing charge distribution for non-zero charged systems. From an energetic point of view, this scenario would give a systematic shift in total MM energy and total QM/MM energy. However, the MM-energy is not that well-defined anyway and this systematic shift should have no effect when we calculate relative energies for systems with QM-regions set up in the same way (same charge). For an ionization energy (where the QM-region charge changes), one might have an issue and perhaps the MM-energy difference is not very physical then.
For the QM-part (with embedded pointcharges included and calculated by the QM-code), it would depend on how we do the calculation. Most QM-codes interfaced to ASH actually have no periodicity so the problem does not come up there (CP2K is the first one so far). On the other hand, the QM/MM energy expression is not consistent if the MM-part is periodic and the QM-part is not. Proper periodic QM/MM MD simulations in ASH is not really possible yet. I will take a look at the Amber paper.
From my cursory look into the code I couldn't tell if it is the case. I am talking about the situation when the sum of the MM charges of QM atoms does not equal an integer. Given that the QM region has an integer charge by definition, there would be a total charge difference between the full MM and QM/MM descriptions. This would violate the charge neutrality requirement of PME electrostatics for QM/MM simulation and is considered to be an issue for QM/MM energies (https://onlinelibrary.wiley.com/doi/10.1002/jcc.20857). For example, in Amber the charge difference could be redistributed between the MM2 atoms (atoms bonded to MM1 atom) or between the whole MM subsystem (excluding the MM1 atom) which is the default option for running QM/MM simulations.