deepmodeling/dpdata

[BUG] dpdata support cp2k v2023.1

PolyuWeldingSpock opened this issue · 4 comments

Summary

dpdata cannot convert AIMD output into format deepmd needed. I run AIMD for 100 steps with cp2k 2023.1. Then I tried to use dpdata with commands:

import dpdata
dp = dpdata.LabeledSystem(cp2kmd_dir, cp2k_output_name=cp2kmd_output_name, fmt="cp2k/aimd_output")
print(dp)
Data Summary
Labeled System
-------------------
Frame Numbers      : 0
Atom Numbers       : 0
Including Virials  : No
Element List       :
-------------------

Then I also tried to use cp2kdata. I have mentioned in robinzyb/cp2kdata#15.

I will upload my file for your need (https://1drv.ms/u/s!AtO91yh6_pLhg7BB7OnE5Cl8p7Cwbw?e=02Z6dW). I also want to know which file need to be revised to support newer version of cp2k such as dpdata/cp2k/output.py or some other files? I would like to revise the codes. Thank you.

link89 commented

I have the same issue. Turn out it is because the start line of coords are change from Atom Kind Element to Atom Kind Element (double space to single space), and a blank line is also removed from output.

 MODULE QUICKSTEP: ATOMIC COORDINATES IN ANGSTROM

   Atom Kind Element         X             Y             Z       Z(eff)     Mass
      1    1 C     6     11.785100     12.639100      1.169170   4.0000  12.0107
      2    1 C     6      6.166980     14.380200      2.107480   4.0000  12.0107
      3    1 C     6      4.759370     14.659200      1.440760   4.0000  12.0107
      4    1 C     6      9.100670     14.474100      2.998590   4.0000  12.0107
      5    1 C     6      3.482180     14.252100      2.258550   4.0000  12.0107
njzjz commented

After #533 is merged, the issue can still be reproduced.

link89 commented

@njzjz I think I confused this issue with another one. The fix works for cp2k/output but not cp2k/aimd_output. Anyway, I just fix the AIMD parse issue in cp2kdata project: https://github.com/link89/cp2kdata/commits/fix-2023-support

Maybe you can consider to deprecate cp2k/aimd_output and use cp2kdata/md instead in dpdata.

cp2k/output and cp2k/aimd_output are different impelementation. Fixing the one doesn't fix the other. In addition,cp2k/aimd_output requires outputing forces into the cp2k stdout, which is not the common practice of CP2K MD Users. I will in general recommend the style used in fmt=cp2kdata/md where it parses -pos-,-frc-,ener files generated by CP2K by default.