For one selected direction, such as z direction. VASPKIT do an average in XY plane on each NZ, $$ \sum_{i j} \Delta x_{i} \Delta y_{j} \rho_{i, j} / \sum_{i j} \Delta x_{i} \Delta y_{j} $$
The output POTPAVG.dat contains two columns. First column is z coordinate (in Å), Second column is Planar Average-Potential (in eV) or Densitiy (in e).
Here, take LOCPOT as an example. It contains total local potential (in eV) when LVTOT = .TRUE. exists in the INCAR file, or contains electrostatic potential (in eV) when LVHAR = .TRUE. exists in the INCAR file. Electrostatic potential is desirable for the evaluation of the work-function, because the electrostatic potential converges more rapidly to the vacuum level than the total potential. To get the work-function, potential along z direction (i.e. slab normal direction) must be averaged in the slab planes.
Hamiltonian of Kohn-Sham is:
\begin{align} \hat{H}=-\frac{1}{2} \nabla^{2}-\sum_{A} \frac{Z_{A}}{\left|\boldsymbol{r}-\boldsymbol{R}_{A}\right|}+\int_{\infty} \frac{\rho\left(\boldsymbol{r}^{\prime}\right)}{\left|\boldsymbol{r}-\boldsymbol{r}^{\prime}\right|} d \boldsymbol{r}^{\prime}+v_{x c}[\rho(\boldsymbol{r}) \end{align}
Electrostatic potential is the summation of second (ionic) and third (hartree) parts of Hamiltonian .
Example, Work-function of Au(111) slab with five atomic layers.
(1) Do an optimization and a single-point calculation to get the LOCPOT file, single-point INCAR as following:
426 +-------------------------- Warm Tips --------------------------+ You MUST Know What You are Doing Check Convergence of Planar Average Value on Vacuum-Thickness! +---------------------------------------------------------------+ ===================== Specified Direction ======================= Which Direction is for the Planar Average? 1) x Direction 2) y Direction 3) z Direction 0) Quit 9) Back ------------>> 3 -->> (1) Reading Structural Parameters from LOCPOT File... -->> (2) Reading Local Potential From LOCPOT File... -->> (3) Written POTPAVG.dat File! +-------------------------- Warm Tips --------------------------+ Check the Convergence of Vacuum-Level Versus Vacuum Thickness! +---------------------------------------------------------------+ +-------------------------- Summary ----------------------------+ Vacuum-Level (eV): 6.695 +---------------------------------------------------------------+
So, the Vacuum-Level is 6.695, POTPAVG.dat as following:
1 2 3 4 5 6 7 8 9 10
# Planar Distance (in Angstrom), Planar Average-Potential (in eV) or -Densitiy (in e) 0.0000 0.27377302E+01 0.1025 0.94832051E+00 0.2049 -0.13842911E+01 0.3074 -0.40872693E+01 0.4099 -0.69356914E+01 0.5123 -0.96882699E+01 0.6148 -0.12150765E+02 0.7172 -0.14164741E+02 ...
import numpy as np import matplotlib as mpl mpl.rcParams['font.size'] = 42. #mpl.rc('font',family='Times New Roman') import matplotlib.pyplot as plt import matplotlib.ticker as ticker import sys
fig = plt.figure(figsize=(35,21)) # set figure size ax = fig.add_subplot(111) # describing the position of the subplot plane=np.loadtxt("./POTPAVG.dat") # read ax.plot(plane[1:,0],plane[1:,1],lw=4,c='blue') # remove the first line xmax, xmin = max(plane[1:,0]), min(plane[1:,0]) ymax, ymin = max(plane[1:,1]), min(plane[1:,1]) plt.xlim(xmin, xmax) plt.ylim(ymin-1, ymax+1) plt.xticks(np.arange(0, xmax, 5)) plt.yticks(np.arange(int(ymin), int(ymax), 5))