[ase-users] Loading a previously completed calculation (vasp)

Adam Jackson a.j.jackson at physics.org
Fri Aug 2 12:47:11 CEST 2019


  Hi Johannes,
 > 
 > I have a large set of already finished bandstructure calculations done 
 > in vasp. I would now like to use ase to plot the band structures and 
 > calculate the band gap. usually all information is stored in the vasprun.xml 
 >  
 > is there a way to import that one directly to ase to keep working with? 
 >  
Indeed, we can import a vasprun.xml file directly into ase with

    import ase.io
    atoms = ase.io.read('vasprun.xml')

A slight curiosity is that this creates an Atoms object with a generic SinglePointCalculator object, rather than a Vasp calculator object. On this occasion it is very much to our advantage, as band-structure plotting is well-supported for this object. First we can get the band edge energies with

    atoms.calc.get_homo_lumo()

and then an ASE band structure object with

    bs = atoms.calc.band_structure()

This object has a .plot() method and may be a useful basis for other manipulation and plotting schemes.

One caveat I would add is that ASE cannot currently read band structures generated with VASP's "line mode": https://gitlab.com/ase/ase/issues/352 . This will likely be fixed in the future, but in any case I cannot generally recommend line-mode for band structures because it leads to inconsistent sampling densities along the branches.

All the best,
Adam

--
Dr Adam J. Jackson
Scientific Computing Department
Science and Technology Facilities Council
Rutherford Appleton Laboratory, Oxfordshire, UK



More information about the ase-users mailing list