dpdata icon indicating copy to clipboard operation
dpdata copied to clipboard

[BUG] Abnormal Box Definition after Conversion from ABACUS stru File to LAMMPS lmp File

Open YuanFeiyue20 opened this issue 1 year ago • 2 comments

Bug summary

I encountered a problem when converting an ABACUS structure file (stru) to a LAMMPS format (lmp) using dpdata. The resulting lmp file contains an invalid box definition, where zlo is greater than zhi. This causes abortion in the model_devi step in DP-Gen, which depends on LAMMPS to execute. I'm not sure if this is a bug. Thank you for your attention.

dpdata Version

dpdata v0.2.18

Input Files, Running Commands, Error Log, etc.

Input files: STRU, stru_to_lmp.py STRU.txt, stru_to_lmp.txt Running Command: python3 stru_to_lmp.py Output file: conf.lmp conf.txt Error Log(in DP-Gen): init.err init.txt

Problem Details zlo: -8.5312811800 zhi: 0.0000000000 This configuration is incorrect since zhi should always be greater than zlo.

Steps to Reproduce

  1. Use dpdata stru_to_lmp.txt to convert an ABACUS stru file STRU.txt to LAMMPS lmp format.
  2. Inspect the resulting lmp file for box definitions, which here actually refers to the z direction.

Further Information, Files, and Links

No response

YuanFeiyue20 avatar Oct 20 '24 16:10 YuanFeiyue20

Hi, I find this problem might comes from the box transformation in dpdata's lammps file, which assert a lower triangular cell format. While this is not always true, as is the case in your example.

Indeed the ase have a code that transform arbitrary cell format to lammps, it might be helpful to implement this in dpdata: https://github.com/qsnake/ase/blob/master/ase/calculators/lammps.py#L684

floatingCatty avatar Jul 02 '25 17:07 floatingCatty

I add a quick fix in my fork: https://github.com/floatingCatty/dpdata/blob/devel/dpdata/lammps/lmp.py

floatingCatty avatar Jul 02 '25 17:07 floatingCatty