Skip to content

[BUG] Wrong cell shape when convert structure between vasp/poscar and lammps/lmp #651

Open
@ZLI-afk

Description

@ZLI-afk

Bug summary

When configuration converting between POSCAR and lammps/lmp via dpdata, I get a totally different resulted cell structure. Did I make a mistake or it appears to be a bug? please see details below

dpdata Version

0.2.18

Input Files, Running Commands, Error Log, etc.

Original POSCAR.orig:

Ag1
1.0
   2.5133954500000000    0.0000000100000000    1.4511086900000001
   0.8377991700000000    2.3696512300000001    1.4511086900000001
   0.0000000000000000   -0.0000000000000000    2.9022173800000002
Ag
1
direct
   0.0000000000000000   -0.0000000000000000   -0.0000000000000000 Ag

Convert script:

import dpdata

if __name__ == "__main__":
    print(f"dpdata version: {dpdata.__version__}\n")

    print("########## POSCAR to lmp ##########")
    sys_orig = dpdata.System("POSCAR.orig", fmt='vasp/poscar')
    print(sys_orig.data["cells"])
    sys_orig.to_lammps_lmp("conf.lmp")

    print("########## lmp to POSCAR ##########")
    sys_after = dpdata.System("conf.lmp", fmt='lammps/lmp')
    print(sys_after.data["cells"])
    sys_after.to_vasp_poscar("POSCAR.after")

output:

dpdata version: 0.2.18

########## POSCAR to lmp ##########
[[[ 2.51339545e+00  1.00000000e-08  1.45110869e+00]
  [ 8.37799170e-01  2.36965123e+00  1.45110869e+00]
  [ 0.00000000e+00 -0.00000000e+00  2.90221738e+00]]]
########## lmp to POSCAR ##########
[[[ 2.51339545  0.          0.        ]
  [ 0.83779917  2.36965123  0.        ]
  [ 0.         -0.          2.90221738]]]

POSCAR.after:

Type_01 
1.0
2.5133954500000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 
8.3779917000000004e-01 2.3696512300000001e+00 0.0000000000000000e+00 
0.0000000000000000e+00 -0.0000000000000000e+00 2.9022173800000002e+00 
Type_0 
1 
Cartesian
   0.0000000000    0.0000000000    0.0000000000

Steps to Reproduce

  1. prepare POSCAR.orig
  2. run the script
  3. get POSCAR.after

Further Information, Files, and Links

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglammps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions