Band-structure calculation using density-functional theory: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
Line 1: Line 1:
[[:Category:Band structure |DFT band-structure calculations]] require multiple steps. On this page, you will find step-by-step instructions, some common pitfalls and pointers on avoiding them, and references to some practical examples to explore.
[[:Category:Band structure |Calculating the band structure]] for [[GGA|density-functional theory]] (DFT) requires multiple steps. On this page, you will find step-by-step instructions, as well as references to some practical examples to explore. Additionally, we provide some advice to reduce computational and human effort.


== Step-by-step instructions ==
== Step-by-step instructions ==


A regular '''k''' mesh must first be supplied in the {{FILE|KPOINTS}} file. For [[GGA|density-functional theory]] (DFT) band-structure calculations, the electronic charge density written to the {{FILE|CHGCAR}} file suffices to restart a DFT calculation. In total, the following 4 files are required initially:
For [[GGA|density-functional theory]] (DFT), the Hamiltonian can be expressed in terms of the electronic charge density. Therefore, the electronic charge density written to the {{FILE|CHGCAR}} file from a previous self-consistent-field (SCF) run suffices to restart a DFT calculation. Generally, computing the band-structure consists of the following steps:


:;- {{FILE|POSCAR}}
=== 1. Perform a self-consistent field calculation ===
::containing structure information,


:;- {{FILE|INCAR}}  
In order to obtain a converged {{FILE|CHGCAR}}, perform a static ({{TAG|NSW}}=0, {{TAG|IBRION}}=-1) self-consistent-field (SCF) calculation for DFT. To achieve this, you will need:
::containing any required tags,


:;- {{FILE|KPOINTS}}  
* {{FILE|POSCAR}} containing structure information,
::containing a regular '''k''' mesh, using e.g. [[KPOINTS#Regular_k-point_mesh|Γ-centered mesh or Monkhorst-Pack mesh]].


:;- {{FILE|POTCAR}}  
* {{FILE|INCAR}} containing any required tags ({{TAG|NSW}}=0, {{TAG|IBRION}}=-1, plus other tags as needed),
::containing the desired potentials.


'''Step 1 (optional):''' Obtain a converged {{FILE|CHGCAR}} file from a self-consistent DFT calculation.
* {{FILE|KPOINTS}} containing a regular '''k''' mesh, using e.g. [[KPOINTS#Regular_k-point_mesh|Γ-centered mesh or Monkhorst-Pack mesh]],


[[:Category:Band structure |Band-structure calculations]] generally compute the Kohn-Sham orbitals and eigenenergies along a path in reciprocal space which usually connects high-symmetry points in the first Brillouin zone. Some external tools{{cite|bilbao:kvec}}{{cite|seekpath}} help to identify the high-symmetry points and '''k''' points along a high-symmetry path for materials of any symmetry.
* {{FILE|POTCAR}} containing the desired potentials ([[GGA|GGA]]).


'''Step 2:''' Determine the high-symmetry path along which VASP should compute the band structure.  
Make sure you copy the converged {{FILE|CHGCAR}} alongside the other files if you want to run the band structure calculation in a separate folder.
 
=== 2. Determine the high-symmetry path ===
 
[[:Category:Band structure |Band-structure calculations]] generally compute the Kohn-Sham orbitals and eigenenergies along a path in reciprocal space which usually connects high-symmetry points in the first Brillouin zone. Some external tools{{cite|bilbao:kvec}}{{cite|seekpath}} help to identify the high-symmetry points and '''k''' points along a high-symmetry path for materials of any symmetry.
 
In any event, we need to determine the high-symmetry path along which VASP should compute the band structure. Once that path is known, we proceed to set it in  step '''3'''.
 
=== 3. Supply a regular '''k''' mesh and '''k''' points along the high-symmetry path ===


There are two options to simultaneously supply a regular '''k''' mesh ''and'' '''k''' points along a high-symmetry path to VASP.  
There are two options to simultaneously supply a regular '''k''' mesh ''and'' '''k''' points along a high-symmetry path to VASP.  
:;1. Provide an [[KPOINTS#Explicit_k-point_mesh|explicit list of '''k''' points]] with zero-weighted '''k''' points.  
:;1. Provide an [[KPOINTS#Explicit_k-point_mesh|explicit list of '''k''' points]] with zero-weighted '''k''' points.  
::Here, the explicit list of the irreducible '''k''' points of the regular '''k''' mesh can be copied from the {{FILE|IBZKPT}} file of a previous run to the {{FILE|KPOINTS}} file. For instance, use the {{FILE|IBZKPT}} file of step 1. These irreducible '''k''' points must be weighted by their multiplicity according to the system's symmetry. Additionally, the '''k''' points along a high-symmetry path must be added to the {{FILE|KPOINTS}} file with the value of all weights set to zero.
::Here, the explicit list of the irreducible '''k''' points of the regular '''k''' mesh can be copied from the {{FILE|IBZKPT}} file of a previous run to the {{FILE|KPOINTS}} file. For instance, use the {{FILE|IBZKPT}} file of '''Step 1'''. These irreducible '''k''' points must be weighted by their multiplicity according to the system's symmetry. Additionally, the '''k''' points along a high-symmetry path must be added to the {{FILE|KPOINTS}} file with the value of all weights set to zero.


:;2. Provide an additional {{FILE|KPOINTS_OPT}} file that can specify the [[KPOINTS#Band-structure_calculations|high-symmetry path in line mode]].  
:;2. Provide an additional {{FILE|KPOINTS_OPT}} file that can specify the [[KPOINTS#Band-structure_calculations|high-symmetry path in line mode]].  
Line 32: Line 36:
The {{FILE|KPOINTS_OPT}} method is more convenient because it allows using the automatic generation modes for the '''k''' points. The computational cost and memory requirement can vary for the two methods due to the scaling behaviour with the number of '''k''' points.  
The {{FILE|KPOINTS_OPT}} method is more convenient because it allows using the automatic generation modes for the '''k''' points. The computational cost and memory requirement can vary for the two methods due to the scaling behaviour with the number of '''k''' points.  


'''Step 3:''' Supply a regular '''k''' mesh and '''k''' points along a high-symmetry path either using the explicit list including zero-weighted '''k''' points or using a {{FILE|KPOINTS_OPT}} file.
=== 4. Edit {{FILE|INCAR}} ===


Setting {{TAG|ICHARG}} = 11 allows the DFT calculation to pick up from the {{FILE|CHGCAR}} at the same densities. Notice that the computed Fermi energy for this case will no longer be correct once a k-path has been declared and the '''k''' mesh is no longer regular.
Setting {{TAG|ICHARG}} = 11 in the {{FILE|INCAR}} file allows the DFT calculation to pick up from the {{FILE|CHGCAR}} at the same densities. Notice that the computed Fermi energy for this case will no longer be correct once a '''k'''-path has been declared and the '''k''' mesh is no longer regular.


'''Step 4:''' Set {{TAG|ICHARG}} = 11 in the {{FILE|INCAR}} file and restart the DFT calculation from the {{FILE|CHGCAR}} file.
=== 5. Restart the calculation ===


== Recommendations and advice ==
Lastly, we restart the DFT calculation from the {{FILE|CHGCAR}} file using the new setup defined in steps '''2-4'''.


=== 6. Visualization using py4vasp (optional) ===


== Visualization ==
Plot the band structure, e.g., using {{py4vasp|url=calculation/band/#py4vasp.calculation._band.Band.to_graph}}. In a python notebook in the directory of the calculation, you can run the following code:


Plot the band structure, e.g., using {{py4vasp|url=calculation/band/#py4vasp.calculation._band.Band.to_graph}}. In a python notebook in the directory of the calculation, you can execute
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
import py4vasp as pv
import py4vasp as pv
Line 51: Line 55:
</syntaxhighlight>
</syntaxhighlight>


== Recommendations and advice ==
In case a {{FILE|KPOINTS_OPT}} file is present, VASP computes the band energies for the '''k''' points of the {{FILE|KPOINTS_OPT}} file after SCF is reached within the same submitted job. Their convergence is checked independently by requiring the sum over occupied band energies not to change in two successive iterations. Hence, for the computational time, there is no advantage to restart from a converged hybrid calculation, but in principle it is possible.
In contrast, the method using an explicit list including zero-weighted '''k''' points computes the band energies for all '''k''' points at each SCF step. The convergence criterion considers the total energy and, thus, does not account for convergence of KS orbitals at zero-weighted '''k''' points. Taking the KS orbitals of the zero-weighted '''k''' points along the entire SCF run makes their convergence highly likely. However, restarting from a converged hybrid calculation can result in premature stopping. This can be counteracted by setting the {{TAG|NELMIN}} tag to a higher value. Especially if the hybrid calculation needs many SCF steps to reach convergence and each SCF step is very expensive when including zero-weighted '''k''' points, one may consider to restart from a converged hybrid calculation with {{TAG|NELMIN}} set to a large number. We recommend carefully checking the convergence of the band structure in this case.
{{NB|tip|For a band-structure calculation with an explicit list including zero-weighted '''k''' points, avoid restarting from a converged hybrid {{FILE|WAVECAR}} file.}}
It is possible to achieve very fine sampling along the '''k''' path with both methods, but there are some aspects to take into account. As mentioned, the computational cost and memory requirement can vary for the two methods due to the scaling with the number of '''k''' points. For the {{FILE|KPOINTS_OPT}} method, the number of '''k''' points treated simultaneously can be controlled by means of the {{TAG|KPOINTS_OPT_NKBATCH}} tag. For the explicit list including zero-weighted '''k''' points, VASP may exceed the available memory if the number of zero-weighted '''k''' points is large. In that case, split the hybrid band-structure calculation into multiple calculations. For each calculation, add part of the zero-weighted '''k''' points.
{{NB|tip|Make fine sampling computationally feasible using the {{TAG|KPOINTS_OPT_NKBATCH}} tag or splitting the calculation with part of the zero-weighted '''k''' points.}}
Let us stress a significant difference between hybrid band-structure calculations and DFT band-structure calculations. The electronic charge density suffices for density functionals to define the Hamiltonian, and no regular '''k''' mesh is required during DFT band-structure calculations. However, if no regular '''k''' mesh is provided, the electronic charge density must be fixed during the DFT band-structure calculation by setting {{TAG|ICHARG}}=11 in the {{FILE|INCAR}} file.
{{NB|warning| The electronic charge density must not be fixed for any hybrid calculation, i.e., never set {{TAG|ICHARG}}{{=}}11!}}
{{NB|tip|To understand how the two methods work in practice, try using them with a DFT calculation as if it were a hybrid calculation.}}
If you forgot setting {{TAG|HFRCUT}} you may be able to mitigate the band structure. Semi-core states can be assumed to be dispersionless but you will see the same discontinuities featured on the semi core states. By subtracting the faulty dispersion of the semi-core state from all bands, you can recover the true dispersion of the conduction bands.


== Practical examples ==
== Practical examples ==


The bulk-systems tutorials [[fcc Si bandstructure |here]] and [[cd Si |here]] feature calculating and visualizing DFT band-structure for face-centered and cubic-diamond Si, respectively.
We offer additional tutorials for calculating and visualizing the DFT band-structure of bulk systems:


==Related tags and articles==
* [[fcc Si bandstructure |fcc Si]]: band structure of face-centered Si, and
{{FILE| KPOINTS}}, {{FILE| KPOINTS_OPT}}


== References ==
* [[cd Si |cd Si]]: band structure of cubic-diamond Si.


== Related tags and articles ==


{{FILE| KPOINTS}}, {{FILE| KPOINTS_OPT}}, [[Band-structure calculation using hybrid functionals]], [[Band-structure calculation using meta-GGA functionals]]


== References ==


<!--[[Category:Band structure |Band structure]][[Category:Howto|Howto]]-->
<!--[[Category:Band structure |Band structure]][[Category:Howto|Howto]]-->

Revision as of 13:35, 14 October 2025

Calculating the band structure for density-functional theory (DFT) requires multiple steps. On this page, you will find step-by-step instructions, as well as references to some practical examples to explore. Additionally, we provide some advice to reduce computational and human effort.

Step-by-step instructions

For density-functional theory (DFT), the Hamiltonian can be expressed in terms of the electronic charge density. Therefore, the electronic charge density written to the CHGCAR file from a previous self-consistent-field (SCF) run suffices to restart a DFT calculation. Generally, computing the band-structure consists of the following steps:

1. Perform a self-consistent field calculation

In order to obtain a converged CHGCAR, perform a static (NSW=0, IBRION=-1) self-consistent-field (SCF) calculation for DFT. To achieve this, you will need:

  • POSCAR containing structure information,
  • INCAR containing any required tags (NSW=0, IBRION=-1, plus other tags as needed),
  • POTCAR containing the desired potentials (GGA).

Make sure you copy the converged CHGCAR alongside the other files if you want to run the band structure calculation in a separate folder.

2. Determine the high-symmetry path

Band-structure calculations generally compute the Kohn-Sham orbitals and eigenenergies along a path in reciprocal space which usually connects high-symmetry points in the first Brillouin zone. Some external tools[1][2] help to identify the high-symmetry points and k points along a high-symmetry path for materials of any symmetry.

In any event, we need to determine the high-symmetry path along which VASP should compute the band structure. Once that path is known, we proceed to set it in step 3.

3. Supply a regular k mesh and k points along the high-symmetry path

There are two options to simultaneously supply a regular k mesh and k points along a high-symmetry path to VASP.

1. Provide an explicit list of k points with zero-weighted k points.
Here, the explicit list of the irreducible k points of the regular k mesh can be copied from the IBZKPT file of a previous run to the KPOINTS file. For instance, use the IBZKPT file of Step 1. These irreducible k points must be weighted by their multiplicity according to the system's symmetry. Additionally, the k points along a high-symmetry path must be added to the KPOINTS file with the value of all weights set to zero.
2. Provide an additional KPOINTS_OPT file that can specify the high-symmetry path in line mode.
Generally, the KPOINTS file and the KPOINTS_OPT file accept the same format. But again, the regular k mesh needs to be supplied in the KPOINTS file and the high-symmetry path in the KPOINTS_OPT file. We therefore recommend using the Γ-centered mesh or Monkhorst-Pack mesh, and line mode, respectively.

The KPOINTS_OPT method is more convenient because it allows using the automatic generation modes for the k points. The computational cost and memory requirement can vary for the two methods due to the scaling behaviour with the number of k points.

4. Edit INCAR

Setting ICHARG = 11 in the INCAR file allows the DFT calculation to pick up from the CHGCAR at the same densities. Notice that the computed Fermi energy for this case will no longer be correct once a k-path has been declared and the k mesh is no longer regular.

5. Restart the calculation

Lastly, we restart the DFT calculation from the CHGCAR file using the new setup defined in steps 2-4.

6. Visualization using py4vasp (optional)

Plot the band structure, e.g., using py4vasp. In a python notebook in the directory of the calculation, you can run the following code:

import py4vasp as pv
calc = pv.Calculation.from_path(".")
calc.band.plot()
# calc.band.plot("kpoints_opt") # if the high-symmetry path is in KPOINTS_OPT

Recommendations and advice

In case a KPOINTS_OPT file is present, VASP computes the band energies for the k points of the KPOINTS_OPT file after SCF is reached within the same submitted job. Their convergence is checked independently by requiring the sum over occupied band energies not to change in two successive iterations. Hence, for the computational time, there is no advantage to restart from a converged hybrid calculation, but in principle it is possible.

In contrast, the method using an explicit list including zero-weighted k points computes the band energies for all k points at each SCF step. The convergence criterion considers the total energy and, thus, does not account for convergence of KS orbitals at zero-weighted k points. Taking the KS orbitals of the zero-weighted k points along the entire SCF run makes their convergence highly likely. However, restarting from a converged hybrid calculation can result in premature stopping. This can be counteracted by setting the NELMIN tag to a higher value. Especially if the hybrid calculation needs many SCF steps to reach convergence and each SCF step is very expensive when including zero-weighted k points, one may consider to restart from a converged hybrid calculation with NELMIN set to a large number. We recommend carefully checking the convergence of the band structure in this case.

Tip: For a band-structure calculation with an explicit list including zero-weighted k points, avoid restarting from a converged hybrid WAVECAR file.

It is possible to achieve very fine sampling along the k path with both methods, but there are some aspects to take into account. As mentioned, the computational cost and memory requirement can vary for the two methods due to the scaling with the number of k points. For the KPOINTS_OPT method, the number of k points treated simultaneously can be controlled by means of the KPOINTS_OPT_NKBATCH tag. For the explicit list including zero-weighted k points, VASP may exceed the available memory if the number of zero-weighted k points is large. In that case, split the hybrid band-structure calculation into multiple calculations. For each calculation, add part of the zero-weighted k points.

Tip: Make fine sampling computationally feasible using the KPOINTS_OPT_NKBATCH tag or splitting the calculation with part of the zero-weighted k points.

Let us stress a significant difference between hybrid band-structure calculations and DFT band-structure calculations. The electronic charge density suffices for density functionals to define the Hamiltonian, and no regular k mesh is required during DFT band-structure calculations. However, if no regular k mesh is provided, the electronic charge density must be fixed during the DFT band-structure calculation by setting ICHARG=11 in the INCAR file.

Warning: The electronic charge density must not be fixed for any hybrid calculation, i.e., never set ICHARG=11!
Tip: To understand how the two methods work in practice, try using them with a DFT calculation as if it were a hybrid calculation.

If you forgot setting HFRCUT you may be able to mitigate the band structure. Semi-core states can be assumed to be dispersionless but you will see the same discontinuities featured on the semi core states. By subtracting the faulty dispersion of the semi-core state from all bands, you can recover the true dispersion of the conduction bands.

Practical examples

We offer additional tutorials for calculating and visualizing the DFT band-structure of bulk systems:

  • fcc Si: band structure of face-centered Si, and
  • cd Si: band structure of cubic-diamond Si.

Related tags and articles

KPOINTS, KPOINTS_OPT, Band-structure calculation using hybrid functionals, Band-structure calculation using meta-GGA functionals

References