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

From VASP Wiki
No edit summary
No edit summary
Line 25: Line 25:
* {{FILE|POTCAR}} containing the required pseudopotentials.
* {{FILE|POTCAR}} containing the required pseudopotentials.


{{NB|mind|You may find mentions of the {{TAG|ICHARG}} tag related to DFT band-structure calculations. This is specific to *later steps*. For the initial SCF run to obtain the converged {{FILE|CHGCAR}} file, *do not* specify the {{TAG|ICHARG}} tag.}}
{{NB|warning| For the initial SCF run to obtain the converged {{FILE|CHGCAR}} file, '''do not''' specify the {{TAG|ICHARG}} tag. You may find mentions of the {{TAG|ICHARG}} tag related to DFT band-structure calculations: This is specific to ''later steps''.}}


=== 2. Determine the high-symmetry path ===
Once everything has been set up, start VASP and wait for the calculation to converge.


[[: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.
=== 2. Set the high-symmetry path ===


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'''.
[[: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. Which '''k''' points are high-symmetry points depends on the space group of your structure.


=== 3. Supply a regular '''k''' mesh and '''k''' points along the high-symmetry path ===
Some external tools{{cite|seekpath}}{{cite|bilbao:kvec}} can be employed to find the space group and plot the Brillouin zone to pick a '''k''' path. Extract the coordinates corresponding to the desired '''k''' path to your {{FILE|KPOINTS}} file (they replace the previous regular '''k''' mesh from step '''1'''). You may wish to preserve the SCF run from step '''1''' in a separate folder, then copy {{FILE|INCAR}}, {{FILE|POSCAR}}, {{FILE|POTCAR}}, {{FILE|CHGCAR}} and {{FILE|KPOINTS}} to a new folder before making edits to {{FILE|KPOINTS}}.


There are two options to simultaneously supply a regular '''k''' mesh ''and'' '''k''' points along a high-symmetry path to VASP.
An example for what such a {{FILE|KPOINTS}} file might look like (example for fcc Si):
:;1. Provide an [[KPOINTS#Explicit_k-point_mesh|explicit list of '''k''' points]] with zero-weighted '''k''' points.
  k points for band structure
::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.
  10  ! intersections
  line
  Fractional
    0.50000  0.50000  0.50000  L
    0.00000  0.00000  0.00000  G
   
    0.00000  0.00000  0.00000  G
    0.00000  0.50000  0.50000  X
   
    0.00000  0.50000  0.50000  X
    0.25000  0.62500  0.62500  U
   
    0.37500  0.7500  0.37500  K
    0.00000  0.00000  0.00000  G


:;2. Provide an additional {{FILE|KPOINTS_OPT}} file that can specify the [[KPOINTS#Band-structure_calculations|high-symmetry path in line mode]].
::Generally, the {{FILE|KPOINTS}} file and the {{FILE|KPOINTS_OPT}} file accept the same format. But again, the regular '''k''' mesh needs to be supplied in the {{FILE|KPOINTS}} file and the high-symmetry path in the {{FILE|KPOINTS_OPT}} file. We therefore recommend using the [[KPOINTS#Regular_k-point_mesh|Γ-centered mesh or Monkhorst-Pack mesh]], and [[KPOINTS#Band-structure_calculations|line mode]], respectively.


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.  
{{NB|mind| As of VASP 6.3.0, you may write '''k''' points of high-symmetry paths to a {{FILE|KPOINTS_OPT}} file. This allows you to combine steps '''1''' & '''3''' into one single VASP run. If all you want to do is compute the band structure, this might be preferable, although the SCF run (step '''1''') is typically the expensive task and splitting them up is generally recommended.


=== 4. Edit {{FILE|INCAR}} ===
However, if you still want to do it all in one go:
* Set up your {{FILE|INCAR}}, {{FILE|POSCAR}}, {{FILE|KPOINTS}} & {{FILE|POTCAR}} files as explained in step '''1'''. Your {{FILE|KPOINTS}} file holds a regular '''k''' mesh. Do not specify the {{TAG|ICHARG}} tag in your {{FILE|INCAR}}.
* Set up your {{FILE|KPOINTS_OPT}} file with the desired high-symmetry path.
* Start a VASP run.
* Proceed to step '''4''' to learn about plotting the band structure.}}


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.
=== 3. Calculate the band structure ===


=== 5. Restart the calculation ===
Please follow the next steps exactly:


Lastly, we restart the DFT calculation from the {{FILE|CHGCAR}} file using the new setup defined in steps '''2-4'''.
* You may wish to copy your {{FILE|INCAR}}, {{FILE|POSCAR}}, {{FILE|POTCAR}}, {{FILE|KPOINTS}} and {{FILE|CHGCAR}} from step '''1''' to a new folder before proceeding, as suggested in step '''2'''. If you decide to do so, navigate to the new folder.
* Make sure the {{FILE|KPOINTS}} file now holds the high-symmetry path determined in step '''2'''.


=== 6. Visualization using py4vasp (optional) ===
* We also need to add the {{TAG|ICHARG}}=11 tag to the {{FILE|INCAR}} file. 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.
 
* Then, start another VASP run. This will restart the DFT calculation from the {{FILE|CHGCAR}} file.
 
=== 4. Visualization using py4vasp (optional) ===


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 run the following code:


<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
import py4vasp as pv
import py4vasp
calc = pv.Calculation.from_path(".")
calc = p4vasp.Calculation.from_path(".")
calc.band.plot()
calc.band.plot()
# calc.band.plot("kpoints_opt") # if the high-symmetry path is in KPOINTS_OPT
# calc.band.plot("kpoints_opt") # if the high-symmetry path is in KPOINTS_OPT
</syntaxhighlight>
</syntaxhighlight>
{{NB|mind| If you are using {{FILE|KPOINTS_OPT}} for the high-symmetry path as outlined in the side note in step '''2''' for VASP>6.3.0, you need to pass "kpoints_opt" as an argument to 'calc.band.plot()': <syntaxhighlight lang="python">calc.band.plot("kpoints_opt")</syntaxhighlight>}}


== Recommendations and advice ==
== 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 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. Therefore, there is no computational advantage to splitting the run into two steps (one for SCF, and one for computing the band structure at fixed density). However, reaching convergence for the SCF run and obtaining the converged {{FILE|CHGCAR}} file is typically more expensive, and storing these results somewhere might be beneficial. Besides, the SCF results may serve as a starting point for subsequent calculations.


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.
== Practical examples ==
{{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.
We offer additional tutorials for calculating and visualizing DFT band structures:
{{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 ==


We offer additional tutorials for calculating and visualizing the DFT band-structure of bulk systems:
* [https://www.vasp.at/tutorials/latest/bulk/part1/#bulk-e03 Bulk systems, Part 1]: band structure of face-centered-cubic silicon.


* [[fcc Si bandstructure |fcc Si]]: band structure of face-centered Si, and
* [https://www.vasp.at/tutorials/latest/bulk/part2/#Step-3.) Bulk systems, Part 2]: band structure of cubic-diamond silicon.


* [[cd Si |cd Si]]: band structure of cubic-diamond Si.
* [https://www.vasp.at/tutorials/latest/bulk/part3/#Step-3.) Bulk systems, Part 3]: band structure of face-centered-cubic nickel.


== Related tags and articles ==
== Related tags and articles ==


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


== References ==
== References ==


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

Revision as of 11:28, 15 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.

Obtaining the band structure requires solving the Hamiltonian to get eigenvalues and eigenvectors, which can then be plotted to obtain the band structure. In DFT, you need at least the density (charge and magnetization) and possibly higher derivatives depending on the XC functional.

The unified approach presented on this page applies to LDA (needs density), GGA (needs density and gradient) and deorbitalized meta-GGA (needs density, gradient and LaPlacian) functionals. In contrast, meta-GGAs need the kinetic energy density and follow a different approach. A different approach is also required when using hybrid functionals.

For DFT, the Hamiltonian can be expressed in terms of the electronic charge and magnetization density. Both are written to to the CHGCAR file during an initial, self-consistent-field (SCF) run. The CHGCAR file obtained in such a run is required to restart a DFT calculation or compute the band structure. It allows to then perform an NSCF (=fixed density) calculation to obtain the eigenvalues at the desired high-symmetry path.

Step-by-step instructions

If you want to compute a DFT (LDA/GGA/deorbitalized meta-GGA) band structure, please adhere to the following steps:

1. Perform a self-consistent field calculation

If you already have a converged CHGCAR file of a self-consistent (SCF) calculation, you can skip this step.

Otherwise, 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 required pseudopotentials.


Warning: For the initial SCF run to obtain the converged CHGCAR file, do not specify the ICHARG tag. You may find mentions of the ICHARG tag related to DFT band-structure calculations: This is specific to later steps.

Once everything has been set up, start VASP and wait for the calculation to converge.

2. Set 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. Which k points are high-symmetry points depends on the space group of your structure.

Some external tools[1][2] can be employed to find the space group and plot the Brillouin zone to pick a k path. Extract the coordinates corresponding to the desired k path to your KPOINTS file (they replace the previous regular k mesh from step 1). You may wish to preserve the SCF run from step 1 in a separate folder, then copy INCAR, POSCAR, POTCAR, CHGCAR and KPOINTS to a new folder before making edits to KPOINTS.

An example for what such a KPOINTS file might look like (example for fcc Si):

 k points for band structure
 10  ! intersections 
 line
 Fractional
   0.50000  0.50000  0.50000   L
   0.00000  0.00000  0.00000   G
   
   0.00000  0.00000  0.00000   G
   0.00000  0.50000  0.50000   X
   
   0.00000  0.50000  0.50000   X
   0.25000  0.62500  0.62500   U
   
   0.37500  0.7500   0.37500   K
   0.00000  0.00000  0.00000   G


Mind: As of VASP 6.3.0, you may write k points of high-symmetry paths to a KPOINTS_OPT file. This allows you to combine steps 1 & 3 into one single VASP run. If all you want to do is compute the band structure, this might be preferable, although the SCF run (step 1) is typically the expensive task and splitting them up is generally recommended.

However, if you still want to do it all in one go:

  • Set up your INCAR, POSCAR, KPOINTS & POTCAR files as explained in step 1. Your KPOINTS file holds a regular k mesh. Do not specify the ICHARG tag in your INCAR.
  • Set up your KPOINTS_OPT file with the desired high-symmetry path.
  • Start a VASP run.
  • Proceed to step 4 to learn about plotting the band structure.

3. Calculate the band structure

Please follow the next steps exactly:

  • You may wish to copy your INCAR, POSCAR, POTCAR, KPOINTS and CHGCAR from step 1 to a new folder before proceeding, as suggested in step 2. If you decide to do so, navigate to the new folder.
  • Make sure the KPOINTS file now holds the high-symmetry path determined in step 2.
  • We also need to add the ICHARG=11 tag to the INCAR file. Setting ICHARG=11 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.
  • Then, start another VASP run. This will restart the DFT calculation from the CHGCAR file.

4. 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
calc = p4vasp.Calculation.from_path(".")
calc.band.plot()
# calc.band.plot("kpoints_opt") # if the high-symmetry path is in KPOINTS_OPT


Mind: If you are using KPOINTS_OPT for the high-symmetry path as outlined in the side note in step 2 for VASP>6.3.0, you need to pass "kpoints_opt" as an argument to 'calc.band.plot()':
calc.band.plot("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. Therefore, there is no computational advantage to splitting the run into two steps (one for SCF, and one for computing the band structure at fixed density). However, reaching convergence for the SCF run and obtaining the converged CHGCAR file is typically more expensive, and storing these results somewhere might be beneficial. Besides, the SCF results may serve as a starting point for subsequent calculations.

Practical examples

We offer additional tutorials for calculating and visualizing DFT band structures:

Related tags and articles

KPOINTS, KPOINTS_OPT

References