deepmodeling / dpdata

A Python package for manipulating atomistic data of software in computational science
https://docs.deepmodeling.com/projects/dpdata/
GNU Lesser General Public License v3.0
195 stars 130 forks source link

[Feature Request] We need another `LabeledSystem` input and output format, such as extxyz #708

Open QuantumMisaka opened 2 weeks ago

QuantumMisaka commented 2 weeks ago

Summary

We wanna transform a training set stored by deepmd/raw and deepmd/npy format to another format which can be parsed by ASE or Ovito. and we need Energy/Force label in the same time.

We've tried all output in dpdata, but there're no another output for LabeledSystem valid but only deepmd/npy and deepmd/raw, only system without label can be output in xyz format and another format which only include coordinates, but not label information.

I do consider that dpdata need another io-format for LabeledSystem (not just read-in, but alos write-out),

Extxyz format is a widely used LabeledSystem and MultiSystems format, which I do think dpdata should include

Detailed Description

extxyz format information: https://wiki.fysik.dtu.dk/ase/ase/io/formatoptions.html#extxyz

Further Information, Files, and Links

ABACUS MD_dump file and another trajectory output will also transform to extxyz format, see https://github.com/deepmodeling/abacus-develop/issues/5022

ZhouXY-PKU commented 2 weeks ago

Another related issue: I have tried LabeledSystem.to_quip_gap_xyz(), which is showed with pressing the tab key after "LabeledSystem.", but sadly it cannot be used at all with the error message like "QUIPXYZFORMAT do not support System.to". So why not try to ban it from being showed with pressing the tab key after "LabeledSystem."?

njzjz commented 1 week ago

We wanna transform a training set stored by deepmd/raw and deepmd/npy format to another format which can be parsed by ASE

Note that you can directly convert the dpdata.System to ase.Atoms, no need to have an intermediate format.

QuantumMisaka commented 1 week ago

Note that you can directly convert the dpdata.System to ase.Atoms, no need to have an intermediate format.

Is there an simple method/function for dpdata to convert dpdata.System to ase.Atoms in a high-thoughput way? From users' side, there is much better to have a once-for-all function, instead of coding when needed

robinzyb commented 1 week ago

What do you mean by "high-throughput way"? The Labeledsystem.to_ase_structures() should return a list of ase Atoms objects.

njzjz commented 1 week ago

Labeledsystem.to_ase_structures()

It's LabeledSystem.to_ase_structure().

I think the more important issue is that the documentation lacks maintenance and organization, so it is not easy to find all features in the dpdata package. I don't have enough time to write documentation, though.

ZhouXY-PKU commented 1 week ago

717

ZhouXY-PKU commented 1 week ago

What do you mean by "high-throughput way"? The Labeledsystem.to_ase_structures() should return a list of ase Atoms objects.

Thank you!

ZhouXY-PKU commented 1 week ago

Labeledsystem.to_ase_structures()

It's LabeledSystem.to_ase_structure().

I think the more important issue is that the documentation lacks maintenance and organization, so it is not easy to find all features in the dpdata package. I don't have enough time to write documentation, though.

Thank you! I have also fixed some small bugs(#717), and now it can work.

QuantumMisaka commented 1 week ago

Beside Labeledsystem.to_ase_structures(), is there a way read from ase Atoms to dpdata.LabeledSystems ?

ZhouXY-PKU commented 1 week ago

Beside Labeledsystem.to_ase_structures(), is there a way read from ase Atoms to dpdata.LabeledSystems ?

LS = dpdata.LabeledSystem().from_ase_structure(Atoms) can work.

ZhouXY-PKU commented 1 week ago

Labeledsystem.to_ase_structures()

It's LabeledSystem.to_ase_structure().

I think the more important issue is that the documentation lacks maintenance and organization, so it is not easy to find all features in the dpdata package. I don't have enough time to write documentation, though.

If possible, could you please add a column of "capabilities" to the table at https://docs.deepmodeling.com/projects/dpdata/en/master/formats.html, just like the table at https://wiki.fysik.dtu.dk/ase/ase/io/io.html?

njzjz commented 1 week ago

If possible, could you please add a column of "capabilities" to the table at https://docs.deepmodeling.com/projects/dpdata/en/master/formats.html, just like the table at https://wiki.fysik.dtu.dk/ase/ase/io/io.html?

There has already been a Supported Conversions column.