TABLE OF CONTENTS
15-vib-mol-spectra
DESCRIPTION
This example shows how to calculate molecular vibrational spectra using the pw.x, ph.x, and dynmat.x calculations.
REMARK
In PWTK, calculations subsequent to pw.x (in the current case ph.x & dynmat.x) inherit the value of the "outdir" and "prefix" variables from the CONTROL namelist. Hence, there is no need to set them in the INPUTPH and DYNMAT namelists.
BEWARE
This example requires the OpenBabel program (http://openbabel.org).
EXAMPLE SOURCE FILE
SOURCE
# generate the coordinates of ethane molecule (C2H6) from the SMILES specs, # https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system set coor [::pwtk::smilesToCoor CC] # get the number of atoms set nat [::pwtk::getNAtoms $coor] # calculate orthorhombic box size that encapsulates the molecule with a 6 Å of vacuum lassign [::pwtk::boxify $coor 6] A B C # the pw.x input data # # (N.B. see the 32-calcmol example (file: calcmol.pwtk), where a # molecule is calculated with the convenient ::pwtk::calcmol workflow) CONTROL { calculation = 'relax' prefix = 'C2H6' outdir = '.' pseudo_dir = '.' } SYSTEM " ibrav = 8 A = $A B = $B C = $C nat = $nat ntyp = 2 ecutwfc = 50 " ELECTRONS { conv_thr = 1e-9 } IONS {} ATOMIC_SPECIES { H 1.0079 H.pz-vbc.UPF C 12.011 C.pz-vbc.UPF } ATOMIC_POSITIONS (angstrom) $coor K_POINTS (automatic) { 1 1 1 0 0 0 } # ph.x input data # # REMARK: calculations automatically inherit the value of the "outdir" # and "prefix" variables from the CONTROL namelist. Hence, there is no # need to set them here. INPUTPH { tr2_ph = 1d-17 lraman = .true. asr = .true. zue = .true. epsil = .true. trans = .true. fildyn = 'C2H6.dyn' } { 0.0 0.0 0.0 } # dynmat.x input data # # REMARK: the value of "fildyn" is inherited from the INPUTPH # namelist. Hence, there is no need to set it here. DYNMAT { asr = 'zero-dim' } # run calculations runPW relax.C2H6 runPH ph.C2H6 set dmo [runDYNMAT dynmat.C2H6]; # we need the name of the dynmat.x # output file (dmo) for subsequent # vibrational spectra plotting # plot the vibrational spectra from the dynmat.x output file with # ::pwtk::dmo_vibSpectrum (by default, it plots to EPS image) dmo_vibSpectrum $dmo # this is how to plot in window dmo_vibSpectrum -t win $dmo # this is how to plot to PNG image dmo_vibSpectrum -t png $dmo