TDDFT and TDA calculations + parsing of Gaussian output files

You can now use MLatom to perform TDDFT and TDA calculations with MLatom and parse Gaussian output files.
This can be useful for UV/vis spectra simulations via single-point convolution and nuclear-ensemble approach (NEA).
We also welcome a new contributor to MLatom: Vignesh Kumar from Nicolaus Copernicus University in Toruń!

Upgrade your MLatom as usual:

pip install --upgrade mlatom

To run TDDFT and TDA calculations with PySCF, just define your method as:

import mlatom as ml

tddft=ml.models.methods(method='TD-B3LYP/6-31G*', program='PySCF')
# or
tda=ml.models.methods(method='TDA-B3LYP/6-31G*', program='PySCF')

Interface to Gaussian supports TDDFT as:

import mlatom as ml

tddft=ml.models.methods(method='TD-B3LYP/6-31G*', program='Gaussian')
# note that by default the Gaussian output files will not be saved. You can request to save them, e.g., in the current directory as:
tddft=ml.models.methods(method='TD-B3LYP/6-31G*', program='Gaussian', working_directory='.')

Once defined, you can use the methods as usual for calculating excited-state properties, e.g., for UV/vis spectra simulations. Here is an example for single-point calculations for a single molecule or a molecular database (e.g., to get properties required for nuclear-ensemble approach in UV/vis spectra simulations or to generate data for ML):

tddft.predict(molecule=single_molecule, calculate_energies=True)
# or
tda.predict(molecular_database=my_molecular_database, calculate_energy_gradients=True)

The nice thing is also that if you have Gaussian output files lying around, you can directly parse them with MLatom to get the molecules in its data format, e.g.:

import mlatom as ml

mol = ml.molecule.load('gaussian_output_file.log', format='gaussian')
mol.dump('parsed_molecule.json', format='json')

Leave a Reply

Your email address will not be published. Required fields are marked *

*