iodata icon indicating copy to clipboard operation
iodata copied to clipboard

Support loading data from Gaussian matrix element files

Open tovrstra opened this issue 4 years ago • 1 comments

I'm taking this issue from another thread, see #139.

The Matrix Element File from Gaussian 16 seems to be a replacement (to some extent) for the old formatted checkpoint file. See https://gaussian.com/interfacing/ It seems the matrix element file is binary ("unformatted") and architecture dependent, which makes it challenging, still it contains a lot of interesting data. Here are some potentially useful links to parse binary data in Python:

  • https://docs.python.org/3/library/struct.html
  • SCM has developed a pure python reader for its RKF files, which are binary files written by FORTRAN code. These are still a bit different from Gaussian unformatted files, but similar tricks may potentially work. See the _autodetect method in https://www.scm.com/doc/plams/_modules/scm/plams/tools/kftools.html
  • Numpy can read binary data from (parts of) files directly, see https://numpy.org/doc/stable/reference/generated/numpy.fromfile.html

tovrstra avatar Jul 27 '20 15:07 tovrstra

Seems complicated.

There is a C++ code for reading matrix element files https://urania.chem.washington.edu/chronusq/chronusq_public and also there is a Scipy routine https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.FortranFile.html The Gaussian documentation specific to matrix element files is relevant https://gaussian.com/output/?tabid=1 It's a bit painful, though. We can generate most of what is in this file with gbasis or other methods, so it may be that this is mainly useful for testing or cases where someone wishes to avoid a gbasis dependency.

PaulWAyers avatar Jul 28 '20 14:07 PaulWAyers