Skip to content

Modify vibrations py

This branch contains modifications to the vibrations.py and infrared.py files. Current users will be unaffected but it allows vibrations frequencies, modes, and infrared intensities to be determined directly from a list of atoms objects generated from a previous vibrational calculation. This would be the case if a vasprun.xml file was read in after a vibrational calculation was run in Vasp. Below is an example of how it could be used.

-- coding: utf-8 --

""" Created on Mon Jul 25 14:20:17 2016   @author: lansford   """ import numpy as np import os from ase.io import read from ase.vibrations import Vibrations from ase.vibrations import Infrared

"""Getting Frequencies""" vibration_file = os.path.expanduser('~/C2H4/freq/vasprun.xml') vaspxml = read(vibration_file,index=':') vib = Vibrations(vaspxml,delta=0.025, nfree=2) vib.get_frequencies()

"""Adding dipole moment to each atom object in list vaspxml""" dipole_file = os.path.expanduser('~/C2H4/dipole.extxyz') dipoles = read(dipole_file,format='extxyz') for i in range(0,len(vaspxml)): vaspxml[i].dipole = dipols[i]

"""Running infrared and getting spectra""" C2H4 = Infrared(vaspxml,delta=0.025, nfree=2) C2H4.get_spectrum(start=0,end=3500,width=80, normalize=False)

Merge request reports