VASP Tutorial: 1-1. DFT Calculation of Isolated Oxygen Atoms
1. Tutorial Introduction
This tutorial uses VASP as an example to show how to perform calculations on high performance computing from scratch.
VASP stands for Vienna Ab-initio Simulation Package, which is a software package for electronic structure calculation and quantum mechanics-molecular dynamics simulation developed by the Hafner group at the University of Vienna. It is one of the most popular commercial software in material simulation and computational material science research. Its high accuracy and powerful functions make it an important tool for researchers to predict and design material properties. It is widely used in solid physics, material science, chemistry, molecular dynamics and other fields. VASP uses pseudopotentials and plane wave basis sets to simulate electronic structure, which is particularly suitable for systems with periodic boundary conditions, such as crystals, surfaces and nanostructures.
通过本教程的学习,您将能够:
* 在伪代码层面解释密度泛函理论 (DFT) 计算
* 创建输入文件以运行孤立原子的 DFT 计算
* 识别 stdout 和 OUTCAR 的基本结构
* 提取分子和原子的相关能量
* 从之前的 Kohn-Sham (KS) 轨道重新开始 DFT 计算
Tutorial Objectives
This tutorial is VASP Official Tutorial, perform DFT calculations with VASP, learn how to create input files, understand the basic structure of output files, and extract relevant energy data.
DFT is a framework that deals with the electron's degrees of freedom. At the pseudo-code level, the following steps are involved:
- Given the electron charge density, the Hamiltonian can be defined.
- Compute the eigenfunctions and eigenvalues of the Hamiltonian.
- Update the electron charge density.
- Repeat steps 1-3 until convergence. For details on the implementation in VASP, refer to VASP algorithm for calculating electronic ground states.
2. Operation steps
1. Prepare input files and scripts (this tutorial has already prepared them)
When performing VASP optimization calculations, you need to prepare 4 key files: (This tutorial file is for reference only. If you need to use it, please apply for permission on the official website):POSCAR , INCAR , KPOINTS and POTCAR, all sample files have been placed in /home/Oatom
Down:
POSCAR:The file provides the atomic structure information of the calculation model, including the unit cell parameters and the coordinate positions of each atom, and is the main body of VASP for structural analysis and optimization.
POSCAR
O atom in a box
1.0 ! universal scaling parameters
8.0 0.0 0.0 ! lattice vector a(1)
0.0 8.0 0.0 ! lattice vector a(2)
0.0 0.0 8.0 ! lattice vector a(3)
1 ! number of atoms
cart ! positions in cartesian coordinates
0 0 0
We use the single-atom POSCAR file. The lattice parameters are chosen to be large enough so that atoms in neighboring unit cells do not interact (significantly).
INCAR: The file defines the task type and calculation parameters of VASP calculations, and instructs VASP on what physical properties to calculate and how to perform these calculations.
SYSTEM = O atom in a box
ISMEAR = 0 ! Gaussian smearing
KPOINTS: The file contains the K-point grid information required for the calculation. The K-point is the point where the electronic state is sampled in the Brillouin zone.
Gamma-point only
0
Monkhorst Pack
1 1 1
0 0 0
For an atom or a molecule, a single k-point is sufficient. When using more k-points, only the interactions between atoms (which should be zero) can be described more accurately.
POTCAR: The file contains the pseudopotential information used for each atom during the calculation.
Submit Script:To run VASP calculations on the command line, you need to write a submission script (job.sh), which contains the resources and environment required to call the calculation, run the VASP executable file, and other related content. You can use this script to deliver jobs to the computing resources specified in the script.
#
# To run VASP this script calls $vasp_std
# (or posibly $vasp_gam and/or $vasp_ncl).
# These variables can be defined by sourcing vaspcmd
. vaspcmd 2> /dev/null
#
# When vaspcmd is not available and $vasp_std,
# $vasp_gam, and/or $vasp_ncl are not set as environment
# variables, you can specify them here
[ -z "`echo $vasp_std`" ] && vasp_std="mpirun --allow-run-as-root -np 8 /data/app/vasp/6.3.0/gcc-mkl-openmpi/vasp_std"
[ -z "`echo $vasp_gam`" ] && vasp_gam="mpirun --allow-run-as-root -np 8 /data/app/vasp/6.3.0/gcc-mkl-openmpi//vasp_gam"
[ -z "`echo $vasp_ncl`" ] && vasp_ncl="mpirun --allow-run-as-root -np 8 /data/app/vasp/6.3.0/gcc-mkl-openmpi//vasp_ncl"
#
# The real work starts here
#
$vasp_std
If the environment variables vasp_std, vasp_gam, and vasp_ncl are not set, set them to a command that runs the VASP program. This ensures that there is always a default value for subsequent use when needed. Here, -np 1 specifies running a process.
2. Start calculation
Example output (stdout) for the O atom obtained using VASP version 6.3.0. The initial charges correspond to the charges of the isolated overlapping atoms (POTCAR file). For the first 4 steps the charges are kept constant, then they are updated (rms(c) column).
* 具体步骤:
新建一个终端,输入下面命令
cd Oatom/
vasp_std
3. Standard output (stdout): The terminal displays the calculation results
running on 8 total cores
distrk: each k-point on 8 cores, 1 groups
distr: one band on 1 cores, 8 groups
using from now: INCAR
vasp.6.3.0 05Feb16 (build Aug 22 2016 16:46:23) complex
POSCAR found : 1 types and 1 ions
scaLAPACK will be used
LDA part: xc-table for Pade appr. of Perdew
POSCAR, INCAR and KPOINTS ok, starting setup
WARNING: small aliasing (wrap around) errors must be expected
FFT: planning ...
WAVECAR not read
entering main loop
N E dE d eps ncg rms rms(c)
DAV: 1 0.384469664751E+02 0.38447E+02 -0.96726E+02 16 0.293E+02
DAV: 2 0.345965628955E+01 -0.34987E+02 -0.34942E+02 32 0.450E+01
DAV: 3 -0.244485866931E+00 -0.37041E+01 -0.34307E+01 16 0.308E+01
DAV: 4 -0.312557021227E+00 -0.68071E-01 -0.66914E-01 16 0.508E+00
DAV: 5 -0.313520305300E+00 -0.96328E-03 -0.96311E-03 32 0.506E-01 0.286E-01
DAV: 6 -0.314540466589E+00 -0.10202E-02 -0.17853E-03 16 0.332E-01 0.142E-01
DAV: 7 -0.314637222361E+00 -0.96756E-04 -0.22710E-04 16 0.134E-01
1 F= -.31463722E+00 E0= -.16037490E+00 d E =-.308525E+00
writing wavefunctions
A brief explanation of the symbols in the OSZICAR and stdout files:

4. View the running results
After execution, the results will be saved to ./Oatom/OUTCAR
, enter the command cat OUTCAR
to see the results.
The following are the sections of the OUTCAR file, separated by a dash:
- Read INCAR , POTCAR , POSCAR
- Nearest neighbor distance and symmetry analysis
- Detailed job information
- Information about the lattice, k-points, and positions
- Basis set information (number of plane waves)
- Non-local pseudo-potential information
- Information for each electronic step (one line in OSZICAR)
- Time and energy information
- Information about eigenvalues
POTLOK: cpu time 0.0878: real time 0.0877
SETDIJ: cpu time 0.0015: real time 0.0014
EDDAV: cpu time 0.0267: real time 0.0434
DOS: cpu time 0.0001: real time 0.0001
--------------------------------------------
LOOP: cpu time 0.1165: real time 0.1346
eigenvalue-minimisations : 16
total energy-change (2. order) : 0.3844697E+02 (-0.9672571E+02)
number of electron 6.0000000 magnetization
augmentation part 6.0000000 magnetization
Free energy of the ion-electron system (eV)
---------------------------------------------------
alpha Z PSCENC = 0.27135287
Ewald energy TEWEN = -91.92708002
-Hartree energ DENC = -281.84385691
-exchange EXHF = 0.00000000
-V(xc)+E(xc) XCENC = 26.11948841
PAW double counting = 245.99840262 -247.84808825
entropy T*S EENTRO = -0.08636665
eigenvalues EBANDS = -44.50008162
atomic energy EATOM = 432.26319604
Solvation Ediel_sol = 0.00000000
---------------------------------------------------
free energy TOTEN = 38.44696648 eV
energy without entropy = 38.53333313 energy(sigma->0) = 38.49014980
- Stress Tensor Information
E-fermi : -8.8431 XC(G=0): -0.8043 alpha+bet : -0.1463
k-point 1 : 0.0000 0.0000 0.0000
band No. band energies occupation
1 -23.8439 2.00000
2 -8.9040 1.33333
3 -8.9040 1.33333
4 -8.9040 1.33333
5 -0.4676 0.00000
6 1.8633 0.00000
7 1.8633 0.00000
8 1.8633 0.00000
- Energy Information
The O atom (Example: Oatom)
FORCE on cell =-STRESS in cart. coord. units (eV):
Direction XX YY ZZ XY YZ ZX
--------------------------------------------------------------------------------------
Alpha Z 0.27135 0.27135 0.27135
Ewald -30.64236 -30.64236 -30.64236 0.00000 0.00000 0.00000
Hartree 93.90244 93.90244 93.90244 -0.00000 -0.00000 -0.00000
E(xc) -27.93035 -27.93035 -27.93035 -0.00000 -0.00000 -0.00000
Local -147.86211 -147.86211 -147.86211 0.00000 0.00000 0.00000
n-local -20.54942 -20.54942 -20.54942 -0.00000 -0.00000 -0.00000
augment 5.55366 5.55366 5.55366 0.00000 -0.00000 0.00000
Kinetic 126.50998 126.50998 126.50997 -0.00000 0.00000 -0.00000
Fock 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
-------------------------------------------------------------------------------------
Total -0.74681 -0.74681 -0.74681 0.00000 -0.00000 -0.00000
in kB -2.33695 -2.33695 -2.33695 0.00000 -0.00000 -0.00000
external pressure = -2.34 kB Pullay stress = 0.00 kB
- Information about eigenvalues
FREE ENERGIE OF THE ION-ELECTRON SYSTEM (eV)
---------------------------------------------------
free energy TOTEN = -0.31463722 eV
energy without entropy= -0.00611258 energy(sigma->0) = -0.16037490
5. Recalculate
If you need to recalculate, you can re-enter the command vasp_std
, you can restart the calculation. When VASP is restarted, it will read the WAVECAR file and continue running from the previous wave function (fast convergence).
6. Clean up previous calculations
Run Command bash cleanup.sh
, will clear the previous wave function and start the calculation completely again.
Conclusion
This tutorial focuses on DFT calculations of isolated oxygen atoms. We learned how to set up DFT calculations for a single oxygen atom to calculate the energy of the isolated atom. This process involves defining the Hamiltonian, calculating the eigenfunctions and eigenvalues of the Hamiltonian, and updating the electron charge density until the system converges. The preparation of input files includes POSCAR, INCAR, KPOINTS, and POTCAR, each of which has its specific format and function. After the calculation is completed, we can understand the calculation process and results by analyzing the stdout and OUTCAR files.