# Import the KohnSham module from ATK from ATK.KohnSham import * # Define function for handling molecule setup def waterConfiguration(angle,bondLength): from math import sin,cos theta = angle.inUnitsOf(radians) pos = [(0.0, 0.0, 0.0)*Angstrom, (1.0, 0.0, 0.0)*bondLength, (cos(theta), sin(theta), 0.0)*bondLength] elm = [Oxygen] + [Hydrogen]*2 return MoleculeConfiguration(elm,pos) # Choose DFT method method = KohnShamMethod() # Scan different bending angles and calculate energy for i in range(30,181,5): theta = i*degrees h2o = waterConfiguration(theta, 0.958*Angstrom) scf = method.apply( h2o ) print 'Angle = ', theta, ' Total Energy = ',calculateTotalEnergy(scf)