This repository contains the Python libraries (Gaussvik, GaussIO and IRhelper) developed as part of my summer project in the Dessent Group (Chemistry, York).
- GaussIO helps extract data from Gaussian input and output files, and can create new Gaussian input files.
- Gaussvik contains streamlines the process of performing quantum chemical calculations on Viking, the University of York's supercomputer. It should also work on other supercomputers that use Slurm (i.e. ones where you type
sbatch
to schedule tasks) and SFTP. Gaussvik uploads Gaussian input files (.gjf
) and schedules them for running with an automatically-generated jobscript. - IRhelper helps with opening and plotting spectra. It can calculate IRMPD spectra from data collected at FELIX, and can read spectra exported from GaussView 6 in the .txt format. It includes a function for plotting 2D spectra, and "shadow plots". These can be used as described below to compare a computed spectrum against an experimental one
Documentation for these tools is provided in the form of example scripts and Jupyter Notebooks.
-
ir_examples.ipynb demonstrates the features of IRhelper - it shows various examples of plotting spectra, including the 2D and shadow plots shown below.
-
upload_and_run_gjf.py is a Gaussvik example with the minimum amount of code required to upload and run a
.gjf
file on Viking. Note that it requires your.gjf
file to have a specified memory limit and processor core limit. Look to the next example for inspiration if your files don't have these. -
TD-DFT_from_optimised_log_file.py is a more complicated example involving both Gaussvik and GaussIO, described in the later section titled "Case study".
There are many ways to import a Python library, depending on where it is located in relation to the script that imports it. The easiest was to import library.py
into script.py
is to put them in the same folder and put the following line at the top of script.py
.
from library import *
This allows you to use all the functions in library.py
as if they were in script.py
itself.
You'll notice that in this repository, we have put the libraries in a sub-folder called libraries, and so we import them with lines like the following
from libraries.IRhelper import *
This is a particularly good way of doing things if you have regularly-updated libraries and you want to use Git to update them to newer versions.
Put together, these libraries can be used to perform different types of calculation on the same molecular structure with minimal effort. For example, once DFT optimisations and frequency calculations were performed on a set of structures, a Gaussvik/GaussIO script was written to extract the co-ordinates of the optimised structures from the output files, then re-submit them with different keywords to perform TD-DFT energy calculations on the 6 optimised structures (using 5 different density functionals, and also with/without solvent effects). This allowed 120 files to be submitted with minimal amount of effort for each additional calculation. Creating predicted spectra remains a manual process using GaussView 6, though it was possible to export ~3 specta per minute when working at speed.