Skip to content

Instantly share code, notes, and snippets.

@ehermes
Created October 31, 2016 19:42
Show Gist options
  • Save ehermes/c673adae47c064b9e1272be415fbb390 to your computer and use it in GitHub Desktop.
Save ehermes/c673adae47c064b9e1272be415fbb390 to your computer and use it in GitHub Desktop.
from ase.build.bulk import bulk
from ase.calculators.vasp import Vasp
from ase.dft.kpoints import bandpath
from ase.io import read
from ase.dft.band_structure import BandStructure
si = bulk('Si', 'diamond', a=5.4)
si.calc = Vasp(kpts=(4, 4, 4), xc='PBE', ediff=1e-6)
si.calc.clean()
si.get_potential_energy()
kpts, kcart, kcartspecial = bandpath('WLGXWK', si.cell, npoints=100)
si.calc.set(icharg=11, # Read charge density from CHGCAR
lorbit=11,
kpts=kpts,
isym=-1,
reciprocal=True)
si.get_potential_energy()
bs = BandStructure(read('vasprun.xml'))
bs.plot(emax=5.0, filename='bands_Si.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment