aiidateam / aiida-pseudo

MIT License
5 stars 9 forks source link

Add converters from one pseudo format to the other #77

Open sphuber opened 3 years ago

sphuber commented 3 years ago

Certain codes only have support for a number of pseudopotential format, but in principle the format is just a way of encoding the information. Many formats are in principle interchangeable. It would be cool if the PseudoPotentialFamily.get_pseudo method had an argument pseudo_type that allowed to specify the desired PseudoPotentialData returned. So even if the pseudo is stored internally as a UpfData, it would be possible to retrieve it as an Psp8Data.

zooks97 commented 3 years ago

It seems like this functionality would require a few different sub-projects:

The first step might be to research a couple different formats, e.g. UPF(2) and PSP8, and define a sort of schema which encompasses all the data they (can) store.

Then, a suitable data structure can be designed to efficiently and universally store that data, including units and any important metadata.

The I/O methods can then be implemented, perhaps based on implementations in codes like QuantumESPRESSO, ABINIT (links to source files), SIRIUS, etc. This can then be tested using aiida-common-workflows to ensure that passing a pseudo through the parse -> store -> write pipeline gives consistent results within/across the codes.

Does this seem like a reasonable plan to follow?

I think would also be nice to have this functionality implemented at its core AiiDA-independently so that it can be used by the broader community. Then, the underlying code can be used by aiida-pseudo.

Edit 07.05: It looks like some people from CECAM were working on this topic a few years ago in libpspio. Development seems to have stopped before reaching a stable version, but there's a lot of good information in the source code for the quirks of various formats. They also seem to have implemented a generic data structure for pseudopotentials, which could be a nice starting point.