theochem / iodata

Python library for reading, writing, and converting computational chemistry file formats and generating input files.
https://iodata.readthedocs.io/
GNU Lesser General Public License v3.0
133 stars 46 forks source link

Feature request: Support OpenMolcas .h5 format and "contaminant" basis functions #375

Open Jellby opened 2 weeks ago

Jellby commented 2 weeks ago

OpenMolcas can store data like molecular geometry, basis set, orbitals and density matrix in portable HDF5 files (.h5). Unfortunately, the format is not very well documented, but Pegamoid is an orbital viewer that can read and display such files. It would be nice if IOData (and GBasis) could support it too.

One thing that OpenMolcas supports and I rarely see elsewhere is "contaminant" basis functions. These are the "remainder" of converting a Cartesian shell to pure spherical harmonics. For instance, a Cartesian d shell has 6 functions, when converted to pure spherical harmonics it gives 5 functions plus a contaminant s function. The tricky part is that the radial part of this contaminant has an additional r^2 factor compared to standard s functions. Does IOData support this? If not, it would be nice too.

PaulWAyers commented 1 week ago

@Jellby we don't have "contaminant" basis functions implemented. I honestly don't see the point: if one wants 6 d's, I don't see any advantage over writing them in terms of a "contaminant+spherical" basis functions. In principle it would not be difficult to support, however, as it is just a "different" Cartesian <-> Spherical mapping; if you'd like to implement it we'd be happy to provide guidance/support.

Superficially, it looks like supporting an OpenMolcas hdf5 file with iodata might not be that hard, as much of the key translation could be taken from Pegamoid (this is a permalink to what seems like the interesting place in the code).

If you'd like to add support for the OpenMolcas HDF5 (or any other file format), please follow the (detailed) contributor guide for adding a new file format, and we'll be happy to do what we can to support you. Realistically, with no full-time developers (we're just a bunch of scientists who believe in sharing their codes), it is unlikely that we can quickly support a new file format. (We've been burned repeatedly in the past, investing significant time and effort in adding a new file format based on a user request, only for that file format to be infrequently used and/or unsustainable because it wasn't a stable file format.)

Jellby commented 1 week ago

Yes, I understand. The situation is more or less the same on the other side (i.e., OpenMolcas): No full-time developer, and cautious when devoting time to support a new library/tool that might become unmaintained next month :wink:

About the contaminants, I believe the usefulness is that they allow to use basis sets equivalent to Cartesian in flexibility, but with labels that match the pure spherical harmonics (so easier to interpret when looking at a list of MO coefficients). I haven't seen them used "in the wild", but since it's something OpenMolcas supports, it should be considered in an eventual .h5 support. (See also https://github.com/TREX-CoE/trexio/issues/94)