Raman spectra
This tutorial explains how to run Raman spectra calculations, visualize them. Please also check out the theory behind the calculations and the current limitations of our implementations.
备注
Currently, you can only use this feature with A-MLatom and MLatom@XACS, i.e., you can only perform such calculations on the XACS cloud (registration and basic use is free but you may want to request more computing time) or request the copy of A-MLatom for your local use. It is not available yet in the open-source MLatom.
Theory
The frequencies of a stationary point can be calculated by diagonalizing its Hessian matrix. The corresponding Raman intensities need polarizability derivatives (first derivatives of polarizability with respect to coordinates):
\(I_{n} = 45 a_{n}^{2} + 7 \gamma _{n}^{2}\) ,
\(a_{n} = (R_{nxx} + R_{nyy} + R_{nzz}) / 3\) ,
\(\gamma _{n}^{2} = [(R_{nxx}-R_{nyy})^2 + (R_{nxx}-R_{nzz})^2 + (R_{nyy}-R_{nzz})^2 + 6(R_{nxy}^2 + R_{nxz}^2 + R_{nyz}^2)] / 2\) ,
where \(R_{n \mu \nu} = \frac {\partial \alpha_{\mu \nu}} {\partial Q_{n}}\), \(\alpha_{\mu \nu}\) is the component of polarizability, \(Q_{n}\) is the \(n\) th normal coordinate. Usually, we get polarizability with respect to each atomic coordinate, so the above derivatives can be rewritten as:
\(R_{n \mu \nu} = \sum \limits _{x} \frac {\partial \alpha_{\mu \nu}} {\partial q_{x}} \frac {\partial q_{x}} {\partial Q_{n}}\) ,
where \(q_{x}\) is the component of atomic coordinates.
Example
We present a simple example of calculating Raman intensities of ethanol. The initial geometry can be downloaded here ethanol_init.xyz
. We need to optimize its geometry first at the same level as we intend to calculate Raman spectra.
警告
We recommend to use UAIQM methods for the Raman spectra calculations, example below is just to show that you can also use GFN2-xTB.
Example with input file
First, optimize the geometry of ethanol.
geomopt
GFN2-xTB
#uaiqm_gfn2xtbstar@cc # if you want to use UAIQM
xyzfile=ethanol_init.xyz
optxyz=ethanol_opt.xyz
After getting the geometry of the optimized ethanol (ethanol_opt.xyz
) we can calculate its frequencies and Raman intensities. The keyword raman
is needed for such calculations. IR intensities are calculated as well. You can refer to frequencies tutorial for information of other keywords.
raman
GFN2-xTB
#uaiqm_gfn2xtbstar@cc # if you want to use UAIQM
xyzfile=ethanol_opt.xyz
You will find in the MLatom output the vibrational analysis and Raman intensities.
==============================================================================
Vibration analysis for molecule 1
==============================================================================
Multiplicity: 1
Rotational symmetry number: 1
This is a nonlinear molecule
Mode Frequencies Reduced masses Force Constants IR intensities Raman intensities
(cm^-1) (AMU) (mDyne/A) (km/mol) (A^4/AMU)
1 202.4514 1.1396 0.0275 6.9861 0.0561
2 293.5529 1.0836 0.0550 146.0294 2.1517
3 394.0049 2.8293 0.2588 10.2430 0.1549
4 837.2716 1.0923 0.4512 0.0441 0.0392
5 930.2857 2.0739 1.0575 17.0638 3.4220
6 1040.4667 1.9132 1.2203 33.2100 4.2849
7 1128.2307 2.9052 2.1788 64.1200 4.0781
8 1152.3249 1.5093 1.1808 12.9415 0.5200
9 1239.8816 1.3027 1.1799 85.5492 3.1744
10 1265.1749 1.1070 1.0440 0.7252 6.4292
11 1365.5011 1.2951 1.4228 2.9341 0.8742
12 1404.6911 1.2902 1.5000 17.2619 2.4119
13 1474.2396 1.0536 1.3492 8.6029 5.5777
14 1493.7381 1.0691 1.4054 5.5911 10.6898
15 1495.5801 1.0697 1.4098 3.3431 1.5195
16 2853.0411 1.0966 5.2594 55.5098 58.1244
17 2886.1994 1.0439 5.1236 73.3246 107.4003
18 3046.5584 1.0570 5.7805 7.8562 77.8001
19 3051.4826 1.0946 6.0053 9.7351 39.2472
20 3055.3796 1.0641 5.8528 12.8053 63.1401
21 3568.2629 1.0658 7.9951 75.0869 44.4583
Visualizing vibrations
There are several ways to visualize the vibrations:
Currently only on the XACS cloud computing:
At the end of the calculations via input file/command line using the options
freq
,ir
, orraman
, MLatom will dump thefreq_gaussian{mol_index}.log
file, which uses Gaussian-style output format for frequencies. You can open it in ChemCraft.You can also dump text output file using Gaussian-style format for frequencies from the Python API:
mymolecule.dump(filename='gauss.log', format='gaussian')
.
NEW: Now infrared spectrum and vibrations can be visualized at the same time. We offer a slider to choose which normal model to show and at the same time highlight the corresponding IR band in the spectrum. You can download the
Jupyter notebook
for an example ofcalc.json
andexp.txt
files.You can directly view the vibrations in
Jupyter notebook
by usingmymolecule.view(normal_mode=...)
, as shown below for an examplemolvibr.json
file:
import mlatom as ml
# let's load the molecule with the required properties
molvibr = ml.molecule()
molvibr.load(filename='molvibr.json')
# choose the normal mode to visualize
normal_mode = 1
# let's view it
molvibr.view(normal_mode=normal_mode)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
# we can also check the information for this normal mode
print(f'Frequency: {molvibr.frequencies[normal_mode]:.2f} cm^-1')
print(f'Normal mode in Angstrom')
for atom in molvibr.atoms:
disp = atom.normal_modes[normal_mode]
print(f" {disp[0]:8.3f} {disp[1]:8.3f} {disp[2]:8.3f}")
Frequency: 288.70 cm^-1 Normal mode in Angstrom -0.000 0.000 -0.025 -0.085 0.168 -0.141 0.085 -0.168 -0.141 0.000 0.000 0.184 -0.000 -0.000 -0.003 0.018 -0.021 -0.014 -0.018 0.021 -0.014 0.000 0.000 0.085 -0.000 -0.000 -0.890
# the non-displaced geometry for reference
print(molvibr.get_xyz_string())
9 C -1.2121068000000 -0.2252488500000 0.0000164100000 H -1.2701429600000 -0.8599818400000 -0.8855315500000 H -1.2701264500000 -0.8599834500000 0.8855643400000 H -2.0710636400000 0.4504289000000 0.0000252100000 C 0.0804149500000 0.5556635800000 0.0000041500000 H 0.1395635900000 1.1970970800000 -0.8856250600000 H 0.1395848700000 1.1970854800000 0.8856411200000 O 1.1428329300000 -0.3971737900000 -0.0000106600000 H 1.9796722200000 0.0702558200000 -0.0001121300000
# non-displaced geometry
molvibr.view()
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
Limitations
备注
Currently, you can only use this feature with A-MLatom and MLatom@XACS, i.e., you can only perform such calculations on the XACS cloud (registration and basic use is free but you may want to request more computing time) or request the copy of A-MLatom for your local use. It is not available yet in the open-source MLatom.
The Raman spectra are only available when using GFN2-xTB and UAIQM that uses GFN2-xTB as baseline. While GFN2-xTB does not support calculations of polarizability derivatives, they are calculated using PTB (S. Grimme, M. Mueller, A. Hansen, J. Chem. Phys. 2023, 158, 124111 DOI: 10.1063/5.0137838).
Any questions or suggestions?
If you have further questions, criticism, and suggestions, we would be happy to receive them in English or Chinese via email, Slack (preferred), or WeChat (please send an email to request to add you to the XACS user support group).