# Import the KohnSham module from ATK from ATK.KohnSham import * # Load molecule from VNLFile h2o = VNLFile("h2o.vnl").readAtomicConfigurations()["h2o"] # Set up Kohn-Sham for two exchange correlation functionals gga_calculation = KohnShamMethod(exchange_correlation_type=GGA.PBE).apply(h2o) lda_calculation = KohnShamMethod(exchange_correlation_type=LDA.PZ).apply(h2o) # Perform the actual calculations gga_spectrum = calculateMolecularEnergySpectrum(gga_calculation).energies() lda_spectrum = calculateMolecularEnergySpectrum(lda_calculation).energies() # eV = electronVolt print ' Energy eigenvalues for water (in eV)\n' print '-----------------------------------------' print ' LDA\t\t GGA\t\t diff\t' print '-----------------------------------------' for (E1,E2) in zip(lda_spectrum,gga_spectrum): e1 = E1.inUnitsOf(eV) e2 = E2.inUnitsOf(eV) print '%7.3f\t\t%7.3f\t\t%7.3f' % (e1,e2,(e1-e2))