Virial computed by deepmd doesn't match lammps #230
Replies: 5 comments
-
Hi |
Beta Was this translation helpful? Give feedback.
-
Of course, sorry for not including that in the first place. To compute and print the virial tensor I used: compute virial all pressure NULL virial And I'm comparing the components of c_virial to the values printed in *.v.out by dp_test. Thanks for your attention! |
Beta Was this translation helpful? Give feedback.
-
In lammps the virial keyword in the compute pressure command means the "virial term" in the pressure tensor, i.e. \sum_i r_i f_i / V. In deepmd-kit, the virial is defined by \sum_i r_i f_i. The difference is 1/V. When I consider this difference, the lammps result and dp prediction match. |
Beta Was this translation helpful? Give feedback.
-
Great, thank you for looking into this for me! I was aware of the 1/V factor, but the first time I tried to account for it I must have made a mistake in the unit conversions. I'm getting agreement now. Could you please answer me two quick questions, to check I have understood everything?
|
Beta Was this translation helpful? Give feedback.
-
1, Yes, the label in the virial.raw dose not have the volume term. |
Beta Was this translation helpful? Give feedback.
-
Hello,
This might be a feature rather than a bug. I find that the virial computed for a given model by dp_test is very different to the virial computed by lammps for the same structure and same model. Each term in the lammps virial is at least 10x larger than the deepmd version (using metal units in lammps, which I think is correct).
I'm using periodic boundary conditions and I'm aware that lammps uses corrections to the virial formula in that case. Does deepmd use a similar correction, or does it use exactly the formula given in the appendix of the Comp. Phys. Comm.? I'm not sure whether that discrepancy would be large enough to account for the difference I'm seeing though. I'd be grateful for any suggestions of things to investigate!
Beta Was this translation helpful? Give feedback.
All reactions