OMNI-P3x: UV/vis spectrum of pyrazine with the nuclear ensemble approach¶
SPC uses the excitations at a single geometry. The nuclear ensemble approach (NEA, Theor. Chem. Acc. 2012, 131, 1237) samples geometries from the vibrational ground state (Wigner sampling) and sums the excitations of all of them. This gives the band shapes, and intensity to transitions that are dark at the symmetric minimum. In this tutorial we
optimize pyrazine and compute its frequencies with OMNI-P3x,
sample 250 geometries,
compute ten excited states at each and the NEA spectrum,
compare with the NEA spectrum from TD-DFT.
Files for download; put the input files next to the notebook:
starting geometry
pyrazine.xyzTD-DFT NEA spectrum (MLatom spectrum: wavelength in nm, extinction coefficient):
pyrazine_nea_tddft.txt
Besides the OMNI-P3x installation, this tutorial needs geometric, pyscf and py3Dmol; the NEA routine of MLatom runs on Linux.
import numpy as np
import mlatom as ml
omnip3x = ml.models.methods(method='OMNI-P3x')
Minimum and frequencies¶
Ground state at the default level, TDA-ωB97X-D/def2-SVP. The Hessian comes from OMNI-P3x; PySCF does the normal-mode analysis.
initial = ml.data.molecule.from_xyz_file('pyrazine.xyz')
opt = ml.optimize_geometry(model=omnip3x, initial_molecule=initial, program='geometric')
eq = opt.optimized_molecule
ml.freq(model=omnip3x, molecule=eq, program='pyscf')
print('frequencies (cm-1):', np.round(eq.frequencies))
frequencies (cm-1): [ 362. 421. 590. 642. 734. 838. 865. 1002. 1008. 1062. 1102. 1110.
1172. 1222. 1290. 1388. 1469. 1548. 1689. 1697. 3179. 3188. 3208. 3214.]
Wigner sampling¶
250 geometries at 0 K (zero-point motion only):
ensemble = ml.generate_initial_conditions(molecule=eq, generation_method='wigner',
number_of_initial_conditions=250, initial_temperature=0,
random_seed=1)
ensemble.write_file_with_xyz_coordinates('pyrazine_ensemble.xyz')
ensemble.view() # the 250 geometries, animated
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
Excited states of the ensemble and the NEA spectrum¶
omnip3x.predict(molecular_database=ensemble, nstates=11)
nea = ml.spectra.uvvis.nea(molecular_database=ensemble, broadening_width=0.10) # range: all excitations
Vertical lines: oscillator strengths at the minimum.
omnip3x.predict(molecule=eq, nstates=11)
ml.spectra.plot_uvvis(spectra=[nea], molecule=eq, labels=['OMNI-P3x, NEA'], title='Pyrazine')

Comparison with TD-DFT¶
NEA spectrum with TDA-ωB97X-D/def2-SVP (Turbomole): 250 Wigner geometries at 0 K from the TD-DFT minimum and Hessian, same broadening; an MLatom spectrum (wavelength in nm, extinction coefficient).
tddft = ml.spectra.uvvis.load('pyrazine_nea_tddft.txt')
ml.spectra.plot_uvvis(spectra=[nea, tddft], labels=['OMNI-P3x', 'TDA-ωB97X-D/def2-SVP'], title='Pyrazine, NEA')
