Skip to content

Can trajectory files, such as MD_dump, be converted to the .xyz format? #5022

Closed

Description

@qinrui-oss

Background

After running a Molecular Dynamics (MD) simulation, it is often necessary to parse the output files to calculate the Mean Square Displacement (MSD). The output file, MD_dump, contains essential information such as time, position, and velocity. However, most post-processing tools, such as VMD, GROMACS, and Python MDAnalysis, cannot directly read the MD_dump file, which makes further analysis inconvenient.

Describe the solution you'd like

It would be more convenient if the trajectory file could be generated in the .xyz format after the MD simulation. The .xyz file can be read by VMD and Python MDAnalysis, and it can be converted to the g96 format using ASE. This g96 format can then be further converted to the trr format using GROMACS for calculating the MSD.

Task list only for developers

  • Notice possible changes of behavior
  • Explain the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi

Notice Possible Changes of Behavior (Reminder only for developers)

No response

Notice any changes of core modules (Reminder only for developers)

No response

Notice Possible Changes of Core Modules (Reminder only for developers)

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Review and understand the proposed feature and its importance.
  • Research on the existing solutions and relevant research articles/resources.
  • Discuss with the team to evaluate the feasibility of implementing the feature.
  • Create a design document outlining the proposed solution and implementation details.
  • Get feedback from the team on the design document.
  • Develop the feature following the agreed design.
  • Write unit tests and integration tests for the feature.
  • Update the documentation to include the new feature.
  • Perform code review and address any issues.
  • Merge the feature into the main branch.
  • Monitor for any issues or bugs reported by users after the feature is released.
  • Address any issues or bugs reported by users and continuously improve the feature.

Activity

  1. QuantumMisaka commented on Aug 31, 2024

    @QuantumMisaka
    Collaborator

    I recommend extxyz format to store energy ,atom force, stress, atom velocity and other information, and which can be viewed in ASE and Ovito

    Introduction to extxyz
    https://wiki.fysik.dtu.dk/ase/ase/io/formatoptions.html#extxyz

    Also, if extxyz is too large, we can consider an binary format (like .npy in dpdata ?)

  2. qinrui-oss commented on Aug 31, 2024

    @qinrui-oss
    Author

    ,
    You're right, converting the trajectory file to the .extxyz format is better because it can store more information. It would also be great if ASE-Abacus could convert the MD_dump file to the .extxyz format.

  3. QuantumMisaka commented on Aug 31, 2024

    @QuantumMisaka
    Collaborator
  4. YuLiu98 commented on Sep 1, 2024

    @YuLiu98
    Collaborator

    I recommend extxyz format to store energy ,atom force, stress, atom velocity and other information, and which can be viewed in ASE and Ovito

    Introduction to extxyz https://wiki.fysik.dtu.dk/ase/ase/io/formatoptions.html#extxyz

    Also, if extxyz is too large, we can consider an binary format (like .npy in dpdata ?)

    We should be careful about changing the format of MD output files. We have changed it many times in the past few versions, which often leads to incompatibility of post-processing software such as dpdata. I agree with changing the format, but the premise is that everyone can reach a consensus before doing so.

  5. QuantumMisaka commented on Sep 1, 2024

    @QuantumMisaka
    Collaborator

    @YuLiu98 I think so, so change its format to a usually used format may help.
    ASE have the capability to deal with extxyz, also I've opened an issue in dpdata related to extxyz
    deepmodeling/dpdata#708

  6. QuantumMisaka commented on Sep 1, 2024

    @QuantumMisaka
    Collaborator

    @qinrui-oss ase can deal with extxyz format originally, but ASE-ABACUS cannot deal with MD_dump file. ASE-ABACUS interface have a very weird way to deal with MD data:

    After molecular dynamics calculations, the log file 'running_md.log' can be read. If the 'STRU_MD_*' files are not continuous (e.g. 'STRU_MD_0', 'STRU_MD_5', 'STRU_MD_10'...), the index parameter of read should be as a slice object. For example, when using the command read('running_md.log', index=slice(0, 15, 5), format='abacus-out') to parse 'running_md.log', 'STRU_MD_0', 'STRU_MD_5' and 'STRU_MD_10' will be read.

    I think that some change is needed

    @1041176461 any comments ?

  7. kirk0830 commented on Sep 1, 2024

    @kirk0830
    Collaborator

    I have read above discussion. I think a better idea is to give freedom to user to select format of file he/she wants, instead of changing one again and again. So in principle we can support extxyz, xyz, cif, md_dump, etc.

  8. 1041176461 commented on Sep 1, 2024

    @1041176461

    @QuantumMisaka ASE-ABACUS has already supported MD_dump 2 month ago, please see this issue(https://gitlab.com/1041176461/ase-abacus/-/issues/31)

  9. added
    Input&OutputSuitable for coders without knowing too many DFT details
    on Sep 11, 2024
  10. Liu-RX commented on Dec 24, 2024

    @Liu-RX

    We can conveniently convert ABACUS MD output files to XYZ, VASP, or LAMMPS format by very few Python codes using dpdata. Also, a number of codes dealing with ABACUS MD output rely on the format of MD output. If we change the format, all the codes have to be modified accordingly. In case of these issues, we think it better to keep the MD format unchanged at the current time.

  11. QuantumMisaka commented on Dec 25, 2024

    @QuantumMisaka
    Collaborator

    @Liu-RX I consider a extxyz-like trajectory format for store energy, force, virial (and even velocity) is needed in every task of ABACUS calculation. which means the MD_dump file will keep, but add a well-recognized trajectory output for trans-platform usage. which is surely needed

  12. Liu-RX commented on Dec 25, 2024

    @Liu-RX

    I think we can add an exyz interface to the dpdata software, so that we can convert ABACUS output to exyz with two lines of code. @QuantumMisaka

  13. QuantumMisaka commented on Dec 25, 2024

    @QuantumMisaka
    Collaborator

    dpdata does contain extxyz interfaces base on ase. but I do consider abacus can have a regular and well-recognized trajectroy output itself

  14. mohanchen commented on Jan 5, 2025

    @mohanchen
    Collaborator

    I will turn this issue into discussion

  15. locked and limited conversation to collaborators on Jan 5, 2025
  16. converted this issue into a discussion #5816 on Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Input&OutputSuitable for coders without knowing too many DFT detailsMD & LAMMD and Larege Atomic Models

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions