Energy calculation (molecule)
- In this section, we will see how to calculate the energy of molecules. Let's take a carbon monooxide (CO) molecule as an example.
- The energy here means the total energy, which is the sum of the electronic energy and the nuclear repulsion energy. The total energy is the energy expectation value of Schroedinger equation (under the Born-Oppenheimer approximation).
- In VASP, you always need INCAR, POSCAR, KPOINTS, and POTCAR files.
- These files should be stored in the same directory, and one directry corresponds to one VASP calculation. The VASP command should be executed in that directory.
- The example here is taken from the VaspWiki: https://www.vasp.at/wiki/index.php/CO
INCAR
- This file specifies the computational condition in VASP. In this file, you need to specify tag-variable pairs.
- Variable might be integer, float, logical (.TRUE. or .FALSE.), and string.
- The minimal INCAR file is something like below. The details will be explained later or see VaspWiki website.
SYSTEM = CO molecule in a box
ISMEAR = 0
NSW = 0
IBRION = -1
- The keywords above is just simple examples of the INCAR tags. These mean
SYSTEM
: A free keyword to identify the calculation.ISMEAR
: This tag sets a smearing method for the electron occupation near the Fermi level.NSW
: This tag controls the number of ionic steps i.e. geometry optimization steps.IBRION
: Controls the motion of ions. IBRION = -1 means energy calculation at given geometry.
- Details of other INCAR tags are explained in incar.md.
POSCAR
- This file gives the element species and positions of atoms.
- POSCAR consists of three parts:
- The top part gives the size of the unit cell.
- The middle part gives the number of each elements.
- The last part gives x-, y-, and z-coordinates of atoms.
CO molecule in a box
1.0
8.0 0.0 0.0
0.0 8.0 0.0
0.0 0.0 8.0
C O
1 1
Cartesian
0.0 0.0 0.0
0.0 0.0 1.1
- Each lines have following meanings:
CO molecule in a box
: Title1.0
: universal scaling parameters8.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)C O
: elements (this line can be omitted)1 1
: number of atoms for each speciesCartesian
: positions in cartesian coordinates0.0 0.0 0.0
: first atom x, y, z (in Angstrom)0.0 0.0 1.1
: second atom x, y, z (in Angstrom)
- Note that the first line of xyz-coordinate part has two lines. The first line corresponds to the carbon atom, and the second does the oxygen atom. So the xyz-coordinate part uses the information of the middle part (element number specification).
- For example, to calculate CO2 molecule
...
C O
1 2
cart
0.0 0.0 1.1 ! carbon
0.0 0.0 0.0 ! oxygen
0.0 0.0 2.2 ! oxygen
KPOINTS
- This file specifies the number of k-points, used for the reciprocal lattice integration.
- The details of the k-points will be given elsewhere.
- For the isolated atom/molecule calculation, you should use the following KPOINTS file corresponding to the Gamma-point calculation.
Gamma-point only
0
Monkhorst Pack
1 1 1
0 0 0
POTCAR
- This file has the information of pseudo-potentials of each element.
- Pseudo-potential information of all elements in POSCAR should be stored one POTCAR file.
- In VASP, mehtod called the projector augumented-wave (PAW) is used.
- POTCAR file can be generated by the Linux command:
cat {POTCAR_directory}/C/POTCAR > POTCAR
cat {POTCAR_directory}/O/POTCAR >> POTCAR
- Note that
cat text_file > new_file
copies the text file to a new file, andcat text_file >> new_file
appends to new_file. {POTCAR_directory}
depends on the installation setting. If you don't know the directry, ask your superviser.- Usually, a directory like
potpaw...
is what you want.
Executing VASP
- When all the files i.e. INCAR, POSCAR, KPOINTS, and POTCAR are made, you can execute the vasp in the directory.
- Note: the following command is if you have VASP in your computer. If you are using supercomputers, use different command (see the following section).
vasp_std >& {output_filename}
- To execute above,
vasp_std
should be included in the directories in yourPATH
.
How to execute job in supercomputers
- Now we will asssume using TSUBAME.
- The supercomputer usually uses the job queueing system, to take control of the calculations of many users. The queing system assigns the jobs to vacant nodes (computers).
- You need to submit the job in a login node, the computer you first login to use the TSUBAME. The computation is done in other nodes, and you do not need to login these computational nodes.
- You need to write the command in the job script file (with .sh or .csh filetype). The computational node executes the command written in that file.
Writing job script
- We use the library called the message passing interface (MPI) to do the parallel calculation (using single or multiple computational nodes)
- The script example is written here:
- Here we modify the example script with MPI and intel-mpi. The file is named as
run.sh
(see somewhere).
Submitting a job
- qsub:
qsub -g [TSUBAME_group] run.sh
- TSUBAME_group: Name of your TSUBAME group. If you don't specify this, the job becomes trial mode (limited execution time).
- If your input files are correctly made, the output files (e.g. OUTCAR) will be generated in the directory.
Job controls
Checking the job status
qstat
command gives the job status:qstat [option]
Stopping or deleting the job
- qdel:
qdel JOB_ID
Analyzing output files
- OSZICAR: This file contains a summary of the iteration loop.
- OUTCAR: This file writes down everything about the run.
- The most important output is the total energy of this system.
- This is found in line
energy without entropy = -13.82671748 energy(sigma->0) = -13.82671748
in OUTCAR. - The exact values may change depending on the environment.
- Among these values, use the latter one (i.e.
energy(sigma->0)
). The energy is defined in eV (electron volt) unit.
- This is found in line
Visualization
VESTA
- For visualization, you can use VESTA for free: https://jp-minerals.org/vesta/jp/
- After installing VESTA, you can see the structure of POSCAR by "Open" -> "POSCAR".
It is useful to set alias to
~/.bashrc
file (in mac)alias vesta=/Applications/VESTA.app/Contents/MacOS/VESTA
then you can use
vesta POSCAR
.
ASE
- When using ASE, you can see the POSCAR file with:
ase gui POSCAR
.
Ovito
- Ovito visualization software is sometimes useful because it has many functionalities (that VESTA doen't have): https://www.ovito.org/
Exercise
- For CO molecule, change the position of the second atom (O atom,
0.0 0.0 1.1
in the above example) to 0.9, 1.0, 1.2, and 1.3 and see the change in the energy. Plot the energy using Excel (or any), and draw the curve. Confirm that the energy minimum is close to the experimental value of C-O distance in CO (1.12 Angstrom). - Try to calculate N2 molecule instead of CO.