Band-structure calculation using density-functional theory: Difference between revisions
No edit summary |
|||
| Line 6: | Line 6: | ||
== Step-by-step instructions == | == Step-by-step instructions == | ||
For DFT, the Hamiltonian can be expressed in terms of the electronic charge and magnetization density. Both are written to the {{FILE|CHGCAR}} file during an initial self-consistent-field (SCF) run. From this converged {{FILE|CHGCAR}} file, we can start a subsequent NSCF (= fixed density) run to obtain the eigenvalues at the desired [[# | For DFT, the Hamiltonian can be expressed in terms of the electronic charge and magnetization density. Both are written to the {{FILE|CHGCAR}} file during an initial self-consistent-field (SCF) run. From this converged {{FILE|CHGCAR}} file, we can start a subsequent NSCF (= fixed density) run to obtain the eigenvalues at the desired [[#Choosing a high-symmetry path| high-symmetry path]]. | ||
To compute the DFT ([[GGA#Available functionals|LDA]]/[[GGA|GGA]]/deorbitalized meta-GGA) band structure, you have two options. Note that '''[[#Option A: Single run | Option A]]''' (single run) has been made available for convenience, but is not necessarily as performant and does not allow the same level of control as '''[[#Option B: Split run | Option B]]''' (split run). | |||
=== | === Option A: Single run === | ||
{{NB|mind| This option is only available as of VASP 6.3.0.}} | |||
{{NB|mind| | |||
With the introduction of the {{FILE|KPOINTS_OPT}} file, VASP can calculate the band structure in a single run. Be aware that there is a tradeoff of choosing convenience over control (see '''[[#Option B: Split run | Option B]]''' for details). Internally, this will perform a self-consistent field (SCF) computation followed by a fixed-density (NSCF) computation. | |||
* '''Step 1''': Choose your [[#Choosing a high-symmetry path| high-symmetry path]] and rename the resulting {{FILE|KPOINTS}} file to {{FILE|KPOINTS_OPT}}. | |||
'''Step | * '''Step 2''': Set up additional files: | ||
:* {{FILE|POSCAR}} containing structure information, | |||
* {{FILE| | :* {{FILE|INCAR}} containing any required tags ({{TAG|NSW}}=0 & {{TAG|IBRION}}=-1 or {{TAG| ISTART}}=0 & {{TAG| ICHARG}}=2, plus other tags as needed - i.e., {{TAG| EDIFF}}, {{TAG| LORBIT}}=11, etc.), | ||
* {{FILE| | :* {{FILE|KPOINTS}} containing a regular '''k''' mesh, using e.g. [[KPOINTS#Regular_k-point_mesh|Γ-centered mesh or Monkhorst-Pack mesh]], | ||
* {{FILE| | :* {{FILE|POTCAR}} containing the required pseudopotentials. | ||
:Note that {{FILE| KPOINTS}} and {{FILE| KPOINTS_OPT}} both co-exist in this method: {{FILE| KPOINTS}} holds the regular ''k''' mesh for the initial SCF computation, while {{FILE| KPOINTS_OPT}} holds the high-symmetry path along which the band structure will be computed at fixed density afterwards. | |||
* '''Step 3''': Start the VASP run, which will internally perform an SCF run to obtain the {{FILE| CHGCAR}} and then perform the NSCF run at fixed density to evaluate the eigenvalues along the high-symmetry path. | |||
'''Step | * '''Step 4''': [[#Visualization | Visualize]] the band structure using {{py4vasp}}. | ||
=== Option B: Split run === | |||
For full control over your settings, it is possible to split the band-structure calculation into two separate VASP runs. In this approach, we first obtain a converged {{FILE| CHGCAR}} which holds density (charge & magnetization) information in a self-consistent (SCF) run, then fix the density and start another run by reading in the {{FILE| CHGCAR}} file (NSCF run). | For full control over your settings, it is possible to split the band-structure calculation into two separate VASP runs. In this approach, we first obtain a converged {{FILE| CHGCAR}} which holds density (charge & magnetization) information in a self-consistent (SCF) run, then fix the density and start another run by reading in the {{FILE| CHGCAR}} file (NSCF run). | ||
| Line 100: | Line 71: | ||
* Then, start another VASP run. This will restart the DFT calculation from the {{FILE|CHGCAR}} file. This run is non-self-consistent (NSCF), and the densities will remain fixed. | * Then, start another VASP run. This will restart the DFT calculation from the {{FILE|CHGCAR}} file. This run is non-self-consistent (NSCF), and the densities will remain fixed. | ||
=== Visualization | == Choosing a 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. Which '''k''' points are high-symmetry points depends on the space group of your structure. | |||
External tools{{cite|seekpath}}{{cite|bilbao:kvec}} can be employed to find the space group and plot the Brillouin zone, then pick a desired high-symmetry '''k''' path. Extract the corresponding coordinates to a new {{FILE| KPOINTS}} file. | |||
{{NB|mind| The tools provide the coordinates and the labels for a given structure. Because these paths depend on the symmetry, take special care that the analysis is not tainted by finite precision or rounding. Also, keep in mind that the primitive and the conventional unit cell have different reciprocal coordinate systems.}} | |||
An example for what such a {{FILE| KPOINTS}} file might look like (example for face-centered-cubic silicon): | |||
k points for band structure | |||
10 ! intersections | |||
line | |||
Fractional | |||
0.50000 0.50000 0.50000 L | |||
0.00000 0.00000 0.00000 Γ | |||
0.00000 0.00000 0.00000 Γ | |||
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 Γ | |||
The empty lines and labels are optional and meant for readability. The labels will be used by {{py4vasp}}. VASP produces equidistant '''k''' points for each segment. The example above would yield 10 points from ''L'' to ''Γ'', 10 points from ''Γ'' to ''X'', 10 from ''X'' to ''U'', and 10 from ''K'' to ''Γ'', including endpoints. | |||
For further details and instructions, please consult the [[KPOINTS#Band-structure_calculations| KPOINTS]] documentation. | |||
== 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 (or a different directory - see input to <code>py4vasp.Calculation.from_path</code>), 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 (or a different directory - see input to <code>py4vasp.Calculation.from_path</code>), you can run the following code: | ||
Revision as of 10:32, 27 October 2025
On this page, we provide step-by-step instructions for calculating the band structure for density-functional theory (DFT), as well as references to some practical examples.
Obtaining the band structure involves first solving the Hamiltonian to get eigenvalues and eigenvectors, then plotting them as electronic energy levels versus crystal momentum. The Hamiltonian requires at least the density (charge and magnetization) and possibly higher derivatives depending on the exchange-correlation (XC) functional.
| Mind: 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. Another different approach is also required for hybrid functionals. |
Step-by-step instructions
For DFT, the Hamiltonian can be expressed in terms of the electronic charge and magnetization density. Both are written to the CHGCAR file during an initial self-consistent-field (SCF) run. From this converged CHGCAR file, we can start a subsequent NSCF (= fixed density) run to obtain the eigenvalues at the desired high-symmetry path.
To compute the DFT (LDA/GGA/deorbitalized meta-GGA) band structure, you have two options. Note that Option A (single run) has been made available for convenience, but is not necessarily as performant and does not allow the same level of control as Option B (split run).
Option A: Single run
| Mind: This option is only available as of VASP 6.3.0. |
With the introduction of the KPOINTS_OPT file, VASP can calculate the band structure in a single run. Be aware that there is a tradeoff of choosing convenience over control (see Option B for details). Internally, this will perform a self-consistent field (SCF) computation followed by a fixed-density (NSCF) computation.
- Step 1: Choose your high-symmetry path and rename the resulting KPOINTS file to KPOINTS_OPT.
- Step 2: Set up additional files:
- POSCAR containing structure information,
- KPOINTS containing a regular k mesh, using e.g. Γ-centered mesh or Monkhorst-Pack mesh,
- POTCAR containing the required pseudopotentials.
- Note that KPOINTS and KPOINTS_OPT both co-exist in this method: KPOINTS holds the regular k' mesh for the initial SCF computation, while KPOINTS_OPT holds the high-symmetry path along which the band structure will be computed at fixed density afterwards.
- Step 3: Start the VASP run, which will internally perform an SCF run to obtain the CHGCAR and then perform the NSCF run at fixed density to evaluate the eigenvalues along the high-symmetry path.
Option B: Split run
For full control over your settings, it is possible to split the band-structure calculation into two separate VASP runs. In this approach, we first obtain a converged CHGCAR which holds density (charge & magnetization) information in a self-consistent (SCF) run, then fix the density and start another run by reading in the CHGCAR file (NSCF run).
Step B1: SCF Run
If you already have a converged CHGCAR file of a self-consistent-field (SCF) calculation, you can skip this step.
Otherwise, in order to obtain a converged CHGCAR, perform a static self-consistent-field (SCF) calculation for DFT. Following step 1, you should already have a KPOINTS_OPT file holding your chosen high-symmetry path. To proceed, you will also need:
- POSCAR containing structure information,
- INCAR containing any required tags (NSW=0 & IBRION=-1 or ISTART=0 & ICHARG=2, LKPOINTS_OPT=
.FALSE.plus other tags as needed, i.e., EDIFF),
- KPOINTS containing a regular k mesh, using e.g. Γ-centered mesh or Monkhorst-Pack mesh,
- POTCAR containing the required pseudopotentials.
Once everything has been set up, start VASP and wait for the calculation to converge.
Mind: When a KPOINTS_OPT file exists, it is automatically read in (Option A) unless you disable this by setting LKPOINTS_OPT to .FALSE. in the INCAR file.
|
| 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 the next step. |
Step B2: NSCF Run
Please follow the next steps exactly:
- You may wish to copy your INCAR, POSCAR, POTCAR, KPOINTS and CHGCAR from step 2B-1 to a new folder before proceeding.
- Override the contents of your KPOINTS file with your KPOINTS_OPT file.
- In your INCAR file:
Mind: Notice that the computed Fermi energy resulting from your NSCF run will no longer be correct (because the Fermi energy cannot be computed based on k points along a path). You can set the EFERMI tag to a numeric value (when ICHARG = 11) to keep the Fermi energy fixed. You can extract the Fermi energy using py4vasp with py4vasp.calculation.energy.read().
|
- Then, start another VASP run. This will restart the DFT calculation from the CHGCAR file. This run is non-self-consistent (NSCF), and the densities will remain fixed.
Choosing a 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.
External tools[1][2] can be employed to find the space group and plot the Brillouin zone, then pick a desired high-symmetry k path. Extract the corresponding coordinates to a new KPOINTS file.
| Mind: The tools provide the coordinates and the labels for a given structure. Because these paths depend on the symmetry, take special care that the analysis is not tainted by finite precision or rounding. Also, keep in mind that the primitive and the conventional unit cell have different reciprocal coordinate systems. |
An example for what such a KPOINTS file might look like (example for face-centered-cubic silicon):
k points for band structure 10 ! intersections line Fractional 0.50000 0.50000 0.50000 L 0.00000 0.00000 0.00000 Γ 0.00000 0.00000 0.00000 Γ 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 Γ
The empty lines and labels are optional and meant for readability. The labels will be used by py4vasp. VASP produces equidistant k points for each segment. The example above would yield 10 points from L to Γ, 10 points from Γ to X, 10 from X to U, and 10 from K to Γ, including endpoints. For further details and instructions, please consult the KPOINTS documentation.
Visualization
Plot the band structure, e.g., using py4vasp. In a python notebook in the directory of the calculation (or a different directory - see input to py4vasp.Calculation.from_path), you can run the following code:
import py4vasp
calc = p4vasp.Calculation.from_path(".")
calc.band.plot()
Mind: If using KPOINTS_OPT for the high-symmetry path, 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 might be beneficial for subsequent calculations.
Note that there are additional advantages to using the KPOINTS_OPT file for computing the band structure using hybrid functionals or using meta-GGA functionals.
A number of post-processing options for the Kohn-Sham (KS) orbitals exist. These directly affect the computation of the band structure. Usually, these options are set directly in the INCAR file: See, for example, LORBIT=11 or Constructing Wannier orbitals.
Practical examples
We offer additional tutorials for calculating and visualizing DFT band structures:
- Bulk systems, Part 1: band structure of face-centered-cubic silicon.
- Bulk systems, Part 2: band structure of cubic-diamond silicon.
- Bulk systems, Part 3: band structure of face-centered-cubic nickel.
Related tags and articles
KPOINTS, KPOINTS_OPT, KPOINTS_WAN, ICHARG, LDA, GGA, Setting up an electronic minimization, Band-structure calculation using meta-GGA functionals, Band-structure calculation using hybrid functionals