In this example we use MacroDensity
with VASP
to align the energy levels of a porous material.
The procedure involves one DFT calculaion, yielding different important values
The ionisation potential ($IP$) is then obtained from:
$IP = V_{vac} - \epsilon_{vbm}$
The difference to a bulk calculation is that here the material itself has a vacuum within. That means that we can sample the vacuum level from there.
The procedure was first outlined in a seminal JACS paper, read it here.
The beautiful ZIF-8 is our porous system of choice for this demonstration.
Calculate the electronic structure at your chosen level of theory Remember in your INCAR:
LVHAR = .TRUE. # This generates a LOCPOT file with the potential
Locate the centre of the largest pore - do this "by eye" first
NB This whole procedure is probably better run in a notebook than by script, the reason being that you can read the file once, then do the manipulations later. The reading is the intensive and time consuming step.
In [1]:
%matplotlib inline
%load_ext autoreload
%autoreload 2
import imp
import macrodensity as md
import math
import numpy as np
import matplotlib.pyplot as plt
In [2]:
input_file = 'LOCPOT'
#=== No need to edit below
vasp_pot, NGX, NGY, NGZ, Lattice = md.read_vasp_density(input_file)
vector_a,vector_b,vector_c,av,bv,cv = md.matrix_2_abc(Lattice)
resolution_x = vector_a/NGX
resolution_y = vector_b/NGY
resolution_z = vector_c/NGZ
grid_pot, electrons = md.density_2_grid(vasp_pot,NGX,NGY,NGZ)
For this we will use VESTA
.
VESTA
.Now we look at a contour plot of this plane to see if we are at a plateau.
In [3]:
cube_origin = [1,1,1]
travelled = [0,0,0]
In [4]:
dim = [1,10,20,40,60,80,100]
print "Dimension Potential Variance"
print "--------------------------------"
for d in dim:
cube = [d,d,d]
cube_potential, cube_var = md.cube_potential(cube_origin,travelled,cube,grid_pot,NGX,NGY,NGZ)
print " %3i %10.4f %10.6f"%(d,cube_potential,cube_var)
In [5]:
extrema = md.vasp_tools.get_band_extrema('OUTCAR')
print extrema
In [6]:
print "IP: %3.4f eV" % (2.3068 -- 2.4396 )
In [ ]: