Attachment 'H2O_vib.py'
Download 1 """Calculate the vibrational modes of a H2O molecule."""
2 from Dacapo import Dacapo
3 from ASE.Utilities.VibrationalCalculation import *
4
5 #Change filename to *.nc output file of your relaxation
6 loa=Dacapo.ReadAtoms('H2Orelax.nc')
7 loa.GetCalculator().SetNetCDFFile('temp.nc')
8
9 vib=VibrationalCalculation(filetoken='H2O_vib',
10 atoms=loa,
11 freeatoms=[0,1,2],
12 displacements=[0.08] * 3,
13 method=0)
14
15
16 vib.RunCalculations()
17
18 #Ensure symmetry of Hessian matrix
19 vib.SetHessianSymmetry(1)
20
21 vib.PrintFrequencies()
22
23 #Make trajectory files to visualize normal modes
24 #for all 9 modes
25 for mode in range(0,9):
26 vib.CreateModeTrajectory(mode=mode,scaling=2)
27
28
29 print 'Zero-point energy = %1.2f eV' % vib.GetZeroPointEnergy()
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.