deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.45k stars 499 forks source link

Type map issue in DeepmdData #920

Closed yhliu918 closed 3 years ago

yhliu918 commented 3 years ago

type map may be wrong in init of Deepmddata

In the init function of Deepmddata class, it read type.raw and cast it from local type map (which is read from a system's type_map.raw) to the global type map which is defined in the input.json file. The code is below: image

However, for example, in the Al Cu Mg alloy case, the global type map is [Mg, Al, Cu]. If a system only have one elements Al, and the local type_map.raw is [Al]. After process of init, self.type_map would be [Mg], which is incorrect logically.

my deepmd-kit version is v2.0.0.b3, and I print out the type map before and after init cast to identify want I'm trying to say. image

amcadmus commented 3 years ago

Could you plz provide the minimal dataset and input script that reproduces the issue?

njzjz commented 3 years ago

If I remember correctly, the type map in all systems should be the same...

yhliu918 commented 3 years ago

issue_920.zip It's the same now in a single case, but I mean it should be extend further when we deal with more cases