Convergence of Computational Parameters#
So far, we have learnt about the parameters that need to be specified in a DFT calculation but we haven’t looked at the details of the standard procedure of choosing these parameters. As we know that solving Kohn-Sham (KS) equations require multiple iterations with an initial guess of electron density, when we run DFT calculations, we always need to verify if the calculations have converged. In a “well-converged” calculation, the solution should accurately approximate the true solution of the mathematical formulation of the KS-DFT equations. In this lesson, we will learn about what is needed to perform a well-converged DFT calculation.
Parameters for bulk structures#
In DFT, we need to perform some convergence tests to select important computational parameters. Planewave codes:
For planewave codes such as VASP and Quantum Espresso, we need to perform the following convergence tests:
k-point
When Schrodinger equation is solved for a periodic system in DFT, it is usually convenient to solve it in k space or the reciprocal space. For a DFT calculation, we need to specify the k-points because integrals are evaluated in k-space. The total energy with a larger number of k-points will be more accurate. These integrals tend to be computationally expensive hence, we should converge k-points with respect to total energy such that the error in total energy goes below the numerical accuracy of 1e-3 Ha/atom.
Ecut (planewave cut-off)
Ecut should also be defined while performing a DFT calculation. Hence, ecut convergence test should be performed in the same way as the k-point convergence test. A higher ecut will give a more accurate total energy but it becomes computationally expensive. The ecut for which the error in total energy goes below the numerical accuracy of 1e-3 Ha/atom should be chosen for all DFT calculations.
Finite-difference (FD) code:
For FD codes such as SPARC, we need to perform the following convergence tests:
Mesh spacing (grid spacing)
In SPARC, we have to converge the mesh spacing which is equivalent to converging the planewave cut off in QE. A finer mesh spacing will lead to a more accurate calculation.
k-point
Convergence of k-point in SPARC and QE follow the same procedure.
Exercises:#
Use ASE’s bulk crystal method to generate a copper bulk crystal (FCC) and perform mesh spacing convergence on the bulk crystal using SPARC. For mesh spacing, use 0.1, 0.15, 0.2, 0.25, 0.3, 0.35 and 0.4 Angstrom. Plot a curve with absolute energy difference between total energy at a given mesh spacing and energy at the finest mesh spacing value on y-axis and mesh spacing on x-axis. The y-axis should be in log scale. Use RELAX_FLAG = 1 (single-point) and k-point as 4x4x4 (same in all three directions as it is a periodic cell).
Fix the mesh spacing for which the total energy converges below the numerical accuracy for the copper bulk and perform k-point convergence in SPARC. For k-points, use 2, 3, 4, 5, 6, 7 and 8 (same values in all three directions) as it is a periodic crystal. Plot a curve with absolute energy difference between total energy at a given k-point and energy at the highest k-point value on y-axis and k-point on x-axis on log scale. Use RELAX_FLAG = 1 (single-point) and mesh spacing of 0.1 Angstrom for all the calculations.
Calculate the reaction energy of oxygen and hydrogen converting to water at different values of “h” or “mesh spacing”. Vary the mesh spacing from 0.1 Angstrom to 0.5 Angstrom with a step difference of 0.1. Note that sparc-dft-api takes in the mesh spacing values in Angstrom and SPARC converts it to Bohr which is the default unit for length scales.
Recommended reading#
To learn more about convergence of computation parameters, it is recommended to read Chapter 3: Nuts and Bolts of DFT calculation of Dr. David Sholl’s book on Density Functional Theory which explains in details about the k-points Brillouin zone