Gaussian Matrix Parser
I share a lot of code here on my blog, and for most of the quantum chemistry programs to work, I need some inputs, such as one and two electron integrals, overlap matrices, and the like. To be honest, aside from working through the Szabo and Ostlund integral evaluation code, I have no idea how to compute these quantities in practice. I know there are plenty of good algorithms out there (PRISM comes to mind), but I’ve never taken the time to work them out for myself (future project maybe?). Instead, I parse the codes directly from Gaussian09 output files. It’s a little time consuming, to do that for each molecule, so I wanted to share my code with you.
Here is a link to it: gauss_parse.
The program, Gaussian Matrix Parser (gauss_parse
), is a command line routine to extract integrals from Gaussian output files and write them to text files as a 2D array. gauss_parse
takes the .log
file as an argument, and then creates a directory with (named after the logfile), and fills it with the matrices you want, e.g:
This program assumes you have included the extra print options for matrices, e.g for minimal basis water, our h2o.com
would look like:
Which has a suitable route section to print overlap, kinetic energy, two-electron repulsion, and potential energy integrals (and more)!
Say you have installed to a folder called gauss_parse
. From the terminal, cd
to that directory, and list the contents:
Note how h2o
has been added to the directory. cd
into that directory, and you should see:
Each .dat
file contains the information extracted from the Gaussian .log
file, which you can use for whatever you like! For example, say we want to see the overlap matrix for our water molecule:
And we see in vim
:
With the ones along the diagonal — just as expected! (Actual precision in gauss_parse
is much higher).