JingHuangLab / openmm_deepmd_plugin

18 stars 5 forks source link

strange boxes when using the qdpi model #15

Open JohannesKarwou opened 1 year ago

JohannesKarwou commented 1 year ago

Thanks for this nice module!

I am trying to use the QDpi Model, for running a MD simulation describing the whole waterbox with the NNP, following this comment

Alternatively, are you specifically interested in running a simulation solely using the trained NNP model? If you want a simulation with NNP only, the Deepmd Plugin is enough to use.

If I run the NVT test script provided within this repository (https://github.com/JingHuangLab/openmm_deepmd_plugin/blob/master/python/tests/test_deepmd_nvt.py) I can run this test with the provided water.pb file and everything looks nice. If I now change the water.pb to the qdpi model (qdpi-1.0.pb), the waterbox is exploding:

#"Progress (%)" "Step"  "Time (ps)" "Potential Energy (kJ/mole)"    "Kinetic Energy (kJ/mole)"  "Total Energy (kJ/mole)"    "Temperature (K)"   "Density (g/mL)"    "Speed (ns/day)"    "Time Remaining"
10.0%   100 0.01999999999999999 -48617782.74773688  5991.949569741136   -48611790.79816714  625.5780260850828   0.9854098249994789  0   --
20.0%   200 0.03999999999999987 -48619461.151101604 8961.926531253604   -48610499.22457035  935.6527861404164   0.9854098249994789  0.243   0:56
30.0%   300 0.05999999999999975 -48621288.31182224  18550.951134558753  -48602737.36068769  1936.776546211729   0.9854098249994789  0.233   0:52
40.0%   400 0.08000000000000024 -48622517.24254719  24885.054267470026  -48597632.18827972  2598.0764601689757  0.9854098249994789  0.231   0:44

image

Am I doing something wrong or is this a problem of the used NNP model?

dingye18 commented 1 year ago

Hello. Based on my understanding, for reliable molecular dynamics (MD) simulations, it is recommended to use the QD-pi model in conjunction with DFTB3. While it is technically feasible to run simulations solely with the QD-pi model using the Deepmd Plugin, it is not considered reasonable.

Therefore, the cause of the water box exploding problem can be attributed to the unrealistic simulation setup that utilizes only the QD-pi model without incorporating DFTB3. It is important to acknowledge that the QD-pi model was developed as a correction for QM/MM simulations, and as such, the provided nvt scripts in this plugin might not be suitable for the specific usage scenarios of the QD-pi model.

For more appropriate usage, you may find the test_deepmd_dp_region.py script more suitable for your needs and requirements.

( Sorry for a late responding to this issue......

JohannesKarwou commented 1 year ago

Ok sorry for the confusion then I might have misunderstood something. Thank you for the clarification!

Using only part of the system with ML using this script test_deepmd_dp_region.py sseems to work fine (at least the box seems to be stable). But in this case, I would also not incorporate DFTB3, isn't that a problem? Or is in this case only the intramolecular interaction described on the ML level of theory and the rest from standard MM forces?

dingye18 commented 1 year ago

Yes, it's still a problem if you used the QD-pi model only without DFTB3 in test_deepmd_dp_region.py. In that case, only the intramolecular interaction are described on the ML level of theory.

Since QD-pi is trained with the energy and forces difference between DFTB3 and wB97x, running with QD-pi in the selected region solely is not a good idea. As I know, almost every machine learning potential (MLP) models in ML/MM scheme are used to describe the intramolecular interactions in simulation. Chodera used MLP to describe the ligand intramolecular interactions in a protein ligand system. QD-pi utilized MLP to boost the accuracy of semi-empirical QM/MM to a DFT level QM/MM with a $\Delta$-MLP scheme.

JohannesKarwou commented 1 year ago

For me having the intramolecular interactions described by a ML model would be already quite nice! I will try investigating this more thoroughly.