deepmodeling / reacnetgenerator

an automatic reaction network generator for reactive molecular dynamics simulation
https://docs.deepmodeling.com/projects/reacnetgenerator/
GNU Lesser General Public License v3.0
65 stars 39 forks source link

How does the program handle trajectories with variable cell parameters (NPT)? #2264

Open luzujiall opened 1 month ago

luzujiall commented 1 month ago

Original content:

感谢作者的卓越贡献。我在此有两个小问题想请教您。 首先,rng无疑是可以考虑周期性条件的,这从选项的设置上就可以看出,但我还是想确认一下,对于npt模拟这种晶胞可变的动力学过程,rng会更新每步的晶胞信息吗? 例如,在dump格式文件中,包含每一帧的晶胞参数,程序是否会逐帧读取,还是只读取第一帧的参数。 当输入文件为XYZ这种不包含晶胞参数的格式时,似乎需要利用--cell选项进行定义,是不是说明XYZ格式只能定义固定晶胞参数呢? 其次,当我想用reacnetgenerator.tools.calculate_rate时,也需要定义晶胞参数,此时是不是也无法考虑npt过程?只能当作nvt系综来处理?

Thank you for the author's outstanding contributions. I have two small questions to ask:

First, RNG can undoubtedly consider periodic boundary conditions, as evidenced by the options settings. However, I would like to confirm whether, for NPT simulations where the cell is variable, RNG updates the cell information at each step. For example, in a dump format file that contains cell parameters for each frame, does the program read frame-by-frame, or does it only read the parameters from the first frame? When the input file is in XYZ format, which does not include cell parameters, it seems necessary to use the --cell option to define them. Does this mean that XYZ format can only define fixed cell parameters?

Second, when I want to use reacnetgenerator.tools.calculate_rate, I also need to define cell parameters. At this point, is it still not possible to consider the NPT process, and must it be treated as an NVT ensemble instead?

njzjz commented 1 month ago

We use English for discussion. I translate the issue into English.

njzjz commented 1 month ago

does the program read frame-by-frame, or does it only read the parameters from the first frame?

It reads frame-by-frame.

Does this mean that XYZ format can only define fixed cell parameters?

Yes, and please tell me if you have any other ideas.

Second, when I want to use reacnetgenerator.tools.calculate_rate, I also need to define cell parameters. At this point, is it still not possible to consider the NPT process, and must it be treated as an NVT ensemble instead?

This is a good question. You may need to read https://doi.org/10.1002/jcc.25809 and re-derive the equations under a variable volume (which can be one part of your work). You can share how the equations change, and we can make calculate_rate support that situation.

luzujiall commented 1 month ago

I greatly appreciate your thoughtful response. Regarding the first question, I am already quite satisfied with the confirmation I received, and I will find a way to convert other trajectory formats into the LAMMPS format. If you seek my opinion, I believe that if it's convenient for you, adding support for the more commonly used PDB format, which can record cell information, might be a good idea. As for the second question, unfortunately, my mathematical foundation is not strong enough to carry out the specific derivation and verification work. However, perhaps we could consider using the concept of differentiation by selecting the volume within a certain time segment as the fixed volume of the system during that period and then substituting it into the original formula. But doing so might lead to significant errors, and I am not sure whether it is feasible.