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

From VASP Wiki
(Add Category:Crystal momentum)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
On this page, we provide step-by-step instructions for calculating the '''[[:Category:Band structure |band structure]]''' for '''density-functional theory''' (DFT), as well as references to some practical examples.
The step-by-step instructions below cover calculating the [[:Category:Band structure|band structure]] within density-functional theory (DFT), including references to 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 [[:Category:Exchange-correlation functionals|exchange-correlation]] (XC) functional.  
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 Kohn-Sham (KS) Hamiltonian requires at least the density (charge and possibly magnetization) and may contain higher derivatives depending on the [[:Category:Exchange-correlation functionals|exchange-correlation (XC) functional]].  
{{NB|mind| The '''unified approach''' presented on this page applies to [[GGA#Available functionals|LDA]] (needs density), [[GGA|GGA]] (needs density and gradient) and deorbitalized meta-GGA (needs density, gradient and Laplacian) functionals. In contrast, [[METAGGA|meta-GGAs]] need the kinetic energy density and follow a [[Band-structure calculation using meta-GGA functionals|different approach]]. Another [[Band-structure calculation using hybrid functionals| different approach]] is also required for [[:Category:Hybrid functionals| hybrid functionals]].}}
{{NB|mind| The approach presented on this page applies to [[GGA#Available functionals|LDA]] (needs density), [[GGA|GGA]] (needs density and gradient), and deorbitalized meta-GGA (needs density, gradient, and Laplacian) functionals. Additionally, it can be used for [[METAGGA|meta-GGAs]] that need the kinetic energy density as of VASP 6.6.0. In contrast, another approach is required [[Band-structure calculation using hybrid functionals|for computing the band structure for hybrid functionals]] and [[Band-structure calculation using hybrid functionals|for computing the band structure for MGGAs before VASP 6.6.0]].}}


== 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 obtain the eigenvalues at the desired [[#Choosing a high-symmetry path| high-symmetry path]] via a subsequent NSCF (= fixed density) run.
{{NB|tip|[[#Option A: Single run|Option A: Single run]] is convenient, because it does not require restarting the calculation. On the other hand, there is less control, e.g., over the used algorithm ({{TAG|ALGO}}), and depending on the number of '''k''' points on the regular mesh and the [[parallelization]], it can be less performant than [[#Option B: Split run|Option B: Split run]].}}
 
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 does not allow the same level of control nor (necessarily) performance as '''[[#Option B: Split run | Option B: Split run]]'''.


=== Option A: Single run ===
=== Option A: Single run ===
{{NB|mind| This option is only available as of VASP 6.3.0.}}
{{Available|6.3.0}}


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: Prepare SCF settings ====


* '''Step 1''': Choose your [[#Choosing a high-symmetry path| high-symmetry path]] and rename the resulting {{FILE|KPOINTS}} file to {{FILE|KPOINTS_OPT}}.
:Follow [[Setting_up_an_electronic_minimization#Create_the_input_files|the steps to create input files]] on the instructions for [[setting up an electronic minimization]]. Typically, this involves defining the input settings using the {{FILE|INCAR}}, {{FILE|POSCAR}}, {{FILE|KPOINTS}}, and {{FILE|POTCAR}} files.


* '''Step 2''': Set up additional files:
==== Step 2: High-symmetry path ====


:* {{FILE|POSCAR}} containing structure information,
:[[#Choosing a high-symmetry path|Choose a high-symmetry path]] and set it in the {{FILE|KPOINTS_OPT}} file. Both {{FILE|KPOINTS}} and {{FILE|KPOINTS_OPT}} define crystal momenta: The {{FILE|KPOINTS}} file holds the regular '''k''' mesh for the initial SCF computation, while the {{FILE|KPOINTS_OPT}} file holds the high-symmetry path usually in line mode along which the band structure will be evaluated.


:* {{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.),
==== Step 3: Run the calculation ====


:* {{FILE|KPOINTS}} containing a regular '''k''' mesh, using e.g. [[KPOINTS#Regular_k-point_mesh|Γ-centered mesh or Monkhorst-Pack mesh]],
:Start the VASP run, which will internally perform an SCF run to obtain the converged KS orbitals and densities, and then perform the NSCF run at fixed density to evaluate the eigenvalues along the high-symmetry path. The progress is written to '''stdout'''. For more detailed suggestions on [[Setting_up_an_electronic_minimization#Optimize_your_settings|optimizing your settings]] and [[Setting_up_an_electronic_minimization#Run_the_calculation|running the calculation]] check the article on [[setting up an electronic minimization]].


:* {{FILE|POTCAR}} containing the required pseudopotentials.
==== Step 4: Plot the band structure ====


: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 evaluated.
:{{py4vasp|url=calculation/band/#py4vasp.calculation._band.Band.to_graph}} provides utilities for plotting the band structure. Run the following in a Python notebook in the directory of the calculation:
<syntaxhighlight lang="python">
import py4vasp
calc = py4vasp.Calculation.from_path(".")
ef = calc.dos.read()["fermi_energy"]
calc.band.plot("kpoints_opt", fermi_energy=ef)
</syntaxhighlight>
{{NB|tip|Set the {{TAG|EFERMI}} tag or pass the Fermi energy explicitly, because {{py4vasp}} reads the Fermi energy from the {{FILE|KPOINTS_OPT}} density of states (<code>results/electron_dos_kpoints_opt/efermi</code>), which is computed from the line-mode '''k''' points and is therefore unreliable.|:}}


* '''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.
=== Option B: Split run ===


* '''Step 4''': [[#Visualization | Visualize]] the band structure using {{py4vasp}}.
In a nutshell, the KS Hamiltonian within DFT can be expressed in terms of the electronic charge and possibly the 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 obtain the eigenvalues at the desired [[#Choosing a high-symmetry path|high-symmetry path]] via a subsequent non-self-consistent-field (NSCF) run at fixed density.


=== Option B: Split run ===
==== Step 1: Set up and perform a full SCF calculation ====


Splitting the band-structure calculation into two separate VASP runs allows full control over the tags/parameters for both steps. In this approach, first, an initial self-consistent field (SCF) run yields a converged {{FILE| CHGCAR}} file storing density (charge & magnetization) information. Then, we start an NSCF (fixed-density) run that reads in the {{FILE| CHGCAR}} file and computes the eigenvalues along the chosen [[#Choosing a high-symmetry path | high-symmetry path]].
:Follow the steps described in [[setting up an electronic minimization]].
{{NB|tip| If you already have a converged {{FILE|CHGCAR}} file of a static self-consistent-field (SCF) calculation, copy that {{FILE|CHGCAR}} to your working directory and proceed with '''Step 4'''.}}
{{NB|important|Set {{TAG|LMAXMIX|4}} for d-electron systems and {{TAG|LMAXMIX|6}} for f-electron systems to adjust the maximum l-quantum number up to which the one-center PAW charge densities are written to the {{FILE|CHGCAR}} file. If you are unsure about the appropriate value for {{TAG|LMAXMIX}}, restart with fixed density using the regular '''k''' mesh and check that the total energy is identical to the SCF run.|:}}


* '''Step 1''': Set up the following files:
==== Step 2 (optionally): Create a backup ====


:* {{FILE|POSCAR}} containing structure information,
:The simplest procedure is to create a new directory for the band-structure calculation and copy the input files of the SCF calculation (usually the {{FILE|INCAR}} file, {{FILE|POSCAR}} file, and the {{FILE|POTCAR}} file) as well as the {{FILE|CHGCAR}} file to the new directory.


:* {{FILE|INCAR}} containing any required tags ({{TAG|NSW}}=0 & {{TAG|IBRION}}=-1 or {{TAG| ISTART}}=0 & {{TAG| ICHARG}}=2, {{TAG| LKPOINTS_OPT}}=<code>.FALSE.</code> plus other tags as needed, i.e., {{TAG| EDIFF}}),
{{CB|mkdir -f bands
cp INCAR POSCAR POTCAR CHGCAR bands/.|:}}


:* {{FILE|KPOINTS}} containing a regular '''k''' mesh, using e.g. [[KPOINTS#Regular_k-point_mesh|Γ-centered mesh or Monkhorst-Pack mesh]],  
:Alternatively, backup the {{FILE|OUTCAR}} file, {{FILE|KPOINTS}} file and possibly the {{FILE|OSZICAR}} file and {{FILE|vaspout.h5}} to be able to reconstruct the SCF calculation, if needed.


:* {{FILE|POTCAR}} containing the required pseudopotentials.
==== Step 3: High-symmetry path ====
{{NB|warning| For the initial SCF run ('''Step 2'''), '''do not''' set {{TAG|ICHARG|11}}. You will find mentions of the {{TAG|ICHARG}} tag related to DFT band-structure calculations: This is specific to '''Step 5'''-'''6'''.}}


* '''Step 2''': Start VASP to perform the SCF run, and wait for the calculation to converge. Adjust parameters if needed until convergence is reached (see, e.g., {{TAG|EDIFF}}).
:[[#Choosing a high-symmetry path|Choose a high-symmetry path]] and set it in the {{FILE|KPOINTS}} file.


* '''Step 3''' (optional): You may wish to backup your {{FILE|INCAR}}, {{FILE|POSCAR}}, {{FILE|POTCAR}}, {{FILE|KPOINTS}} and {{FILE|CHGCAR}} to a new directory before proceeding.
==== Step 4: Prepare a restart with fixed density ====


* '''Step 4''': Choose a [[#Choosing a high-symmetry path| high-symmetry path]] and overwrite the {{FILE|KPOINTS}} file accordingly.
:Adjust the {{FILE|INCAR}} file:
::* Remove any of the following tags, if present: {{TAG|NSW}}, {{TAG|IBRION}} and {{TAG|ISTART}}.
::* Add {{TAG|ICHARG|11}}. This restarts from the converged charge density read from the {{FILE|CHGCAR}} file and continues with the density held fixed.
::* Add additional relevant tags as needed, i.e., {{TAG|LORBIT}}=11.
{{NB|tip|Set the {{TAG|EFERMI}} tag to the Fermi energy obtained during the SCF calculation. Infact, the Fermi energy cannot be computed based on '''k''' points along a path, and the Fermi energy given by the NSCF calculation will therefore be unreliable. The Fermi energy of the SCF calculation is written to the {{FILE|OUTCAR}} file or can be extracted using {{py4vasp}}:


* '''Step 5''': Adjust your {{FILE|INCAR}} file:
<syntaxhighlight lang="python">from py4vasp import Calculation
:* Remove any of the following tags, if present: {{TAG| NSW}}, {{TAG| IBRION}} & {{TAG| ISTART}}.
Calculation.from_path("dir/with/SCF/vaspout.h5").dos.read()["fermi_energy"]
:* Add the {{TAG|ICHARG}}=11 tag. Setting {{TAG|ICHARG}}=11 allows the DFT calculation to pick up from the {{FILE|CHGCAR}} at the same densities.
</syntaxhighlight>
:* Add additional relevant tags as needed, i.e., {{TAG| LORBIT}}=11.
|:}}
{{NB|mind| You may wish to also set the {{TAG|EFERMI}} tag to a numeric value to keep the Fermi energy fixed for the next step (because the Fermi energy cannot be computed based on '''k''' points along a path, and the Fermi energy given by the NSCF calculation will therefore be incorrect when {{TAG|ICHARG|11}}). You can extract the Fermi energy from the SCF calculation using {{py4vasp}} like so:


<syntaxhighlight lang="python">from py4vasp import Calculation
==== Step 5: Run the NSCF calculation ====
Calculation.from_path("dir/with/vaspout.h5").dos.read()["fermi_energy"]
# or, instead:
Calculation.from_path("dir/with/vaspout.h5").band.read()["fermi_energy"]</syntaxhighlight>


Alternatively, you can investigate the vaspout.h5 file yourself, and find the Fermi energy under <code>results/electron_dos/efermi</code>.}}
:Perform the NSCF calculation with the prepared files. This will read the {{FILE|CHGCAR}} file and keep the density fixed.
{{NB|mind| Any existing {{FILE|KPOINTS_OPT}} file triggers '''[[#Option A: Single run|Option A]]''' unless you disable this by setting {{TAG|LKPOINTS_OPT|F}}.|:}}


* '''Step 6''': Start VASP to perform the NSCF calculation, reading in the {{FILE|CHGCAR}} file and keeping the density fixed.
==== Step 6: Plot the band structure ====
{{NB|mind| Any existing {{FILE|KPOINTS_OPT}} file triggers '''[[#Option A: Single run | Option A]]''' unless you disable this by setting {{TAG| LKPOINTS_OPT}} to <code>.FALSE.</code> in the {{FILE|INCAR}} file.}}


* '''Step 7''': [[#Visualization | Visualize]] the band structure using {{py4vasp}}.
:{{py4vasp|url=calculation/band/#py4vasp.calculation._band.Band.to_graph}} provides utilities for plotting the band structure. Run the following in a Python notebook in the directory of the calculation:
<syntaxhighlight lang="python">
import py4vasp
calc = py4vasp.Calculation.from_path(".")
calc.band.plot()
</syntaxhighlight>
{{NB|tip|If you did not set {{TAG|EFERMI}} in Step 4, pass the Fermi energy from the SCF run at the plotting stage:
<syntaxhighlight lang="python">calc.band.plot(fermi_energy=...)  # plug in the Fermi energy from the SCF run</syntaxhighlight>|:}}


== Choosing a high-symmetry path ==
== 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.
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 the 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.
Use external tools{{cite|seekpath}}{{cite|bilbao:kvec}} to find the space group, plot the Brillouin zone, and pick a high-symmetry '''k''' path. Extract the corresponding coordinates and provide them in {{FILE|KPOINTS}}-file format, either as a list of [[KPOINTS#Explicit_k-point_mesh|explicit coordinates]] or (more commonly) using [[KPOINTS#Band-structure_calculations|line mode]].
{{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.}}
{{NB|tip|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 (see {{TAG|SYMPREC}}). 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):
Example high-symmetry path for face-centered-cubic silicon:
   k points for band structure
   k points for band structure
   10  ! intersections  
   10  ! intersections  
Line 98: Line 110:


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.
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.
For further details and instructions, please consult the section on [[KPOINTS#Band-structure_calculations|band-structure calculations in the KPOINTS]] documentation.
 
== Visualization ==
 
{{py4vasp|url=calculation/band/#py4vasp.calculation._band.Band.to_graph}} provides utilities for plotting the band structure. 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:
<syntaxhighlight lang="python">
import py4vasp
calc = p4vasp.Calculation.from_path(".")
calc.band.plot()
</syntaxhighlight>
However, if using {{FILE|KPOINTS_OPT}} for the high-symmetry path ('''[[#Option A: Single run |Option A: Single run]]'''), you need to pass "kpoints_opt" as an argument to <code>calc.band.plot</code>:
<syntaxhighlight lang="python">calc.band.plot("kpoints_opt")</syntaxhighlight>
Conversely, if using '''[[#Option B: Split run |Option B: Split run]]''' and not setting {{TAG|EFERMI}} in Step 5, you can still change the Fermi energy at the plotting stage. Simply use:
<syntaxhighlight lang="python">calc.band.plot(fermi_energy=...) # plug in extracted Fermi energy from SCF run</syntaxhighlight>


== Recommendations and advice ==
== Recommendations and advice ==
Line 117: Line 116:
In case a {{FILE|KPOINTS_OPT}} file is present ([[#Option A: Single run |Option A]]), VASP computes the band energies for the '''k''' points of the {{FILE|KPOINTS_OPT}} file after SCF convergence is reached within the same submitted job. There may, however, be a '''computational advantage''' to splitting the run  ([[#Option B: Split run |Option B]]) because of different optimal batching options for the '''k''' mesh.
In case a {{FILE|KPOINTS_OPT}} file is present ([[#Option A: Single run |Option A]]), VASP computes the band energies for the '''k''' points of the {{FILE|KPOINTS_OPT}} file after SCF convergence is reached within the same submitted job. There may, however, be a '''computational advantage''' to splitting the run  ([[#Option B: Split run |Option B]]) because of different optimal batching options for the '''k''' mesh.


There are additional advantages to using the {{FILE|KPOINTS_OPT}} file for computing the band structure [[Band-structure calculation using hybrid functionals| using hybrid functionals]] or [[Band-structure calculation using meta-GGA functionals| using meta-GGA functionals]]. Refer to these references for details.
There are additional advantages to using the {{FILE|KPOINTS_OPT}} file for computing the band structure [[Band-structure calculation using hybrid functionals|using hybrid functionals]] or [[Band-structure calculation using meta-GGA functionals|using meta-GGA functionals]]. Refer to these references for details.


A number of '''post-processing options''' for the Kohn-Sham (KS) orbitals can affect the computation of the band structure. Usually, these options are set directly in the {{FILE|INCAR}} file: See, for example, {{TAG|LORBIT}}=11 or [[Constructing_Wannier_orbitals | Constructing Wannier orbitals]].
A number of '''post-processing options''' for the Kohn-Sham (KS) orbitals can affect the computation of the band structure. Usually, these options are set directly in the {{FILE|INCAR}} file: See, for example, {{TAG|LORBIT}}=11 or [[constructing Wannier orbitals]].


== Practical examples ==
== Practical examples ==
Line 133: Line 132:
== Related tags and articles ==
== Related tags and articles ==


{{FILE| KPOINTS}}, {{FILE| KPOINTS_OPT}}, {{FILE| KPOINTS_WAN}}, {{TAG|ICHARG}}, [[GGA#Available functionals|LDA]], [[GGA|GGA]], [[Setting up an electronic minimization]], [[Band-structure calculation using meta-GGA functionals]], [[Band-structure calculation using hybrid functionals]]
{{FILE|KPOINTS}}, {{FILE|KPOINTS_OPT}},  
 
{{TAG|ICHARG}}, {{TAG|LMAXMIX}}
 
[[XC functionals]], [[Setting up an electronic minimization]]
 
[[Band-structure calculation using meta-GGA functionals]], [[Band-structure calculation using hybrid functionals]]


== References ==
== References ==


<!--[[Category:Band structure |Band structure]][[Category:Howto|Howto]]-->
<references/>
 
[[Category:Band structure]]
[[Category:Howto]]
[[Category:Crystal momentum]]

Latest revision as of 16:08, 20 March 2026

The step-by-step instructions below cover calculating the band structure within density-functional theory (DFT), including references to 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 Kohn-Sham (KS) Hamiltonian requires at least the density (charge and possibly magnetization) and may contain higher derivatives depending on the exchange-correlation (XC) functional.

Mind: The 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. Additionally, it can be used for meta-GGAs that need the kinetic energy density as of VASP 6.6.0. In contrast, another approach is required for computing the band structure for hybrid functionals and for computing the band structure for MGGAs before VASP 6.6.0.

Step-by-step instructions

Tip: Option A: Single run is convenient, because it does not require restarting the calculation. On the other hand, there is less control, e.g., over the used algorithm (ALGO), and depending on the number of k points on the regular mesh and the parallelization, it can be less performant than Option B: Split run.

Option A: Single run

Mind: Available as of VASP 6.3.0

Step 1: Prepare SCF settings

Follow the steps to create input files on the instructions for setting up an electronic minimization. Typically, this involves defining the input settings using the INCAR, POSCAR, KPOINTS, and POTCAR files.

Step 2: High-symmetry path

Choose a high-symmetry path and set it in the KPOINTS_OPT file. Both KPOINTS and KPOINTS_OPT define crystal momenta: The KPOINTS file holds the regular k mesh for the initial SCF computation, while the KPOINTS_OPT file holds the high-symmetry path usually in line mode along which the band structure will be evaluated.

Step 3: Run the calculation

Start the VASP run, which will internally perform an SCF run to obtain the converged KS orbitals and densities, and then perform the NSCF run at fixed density to evaluate the eigenvalues along the high-symmetry path. The progress is written to stdout. For more detailed suggestions on optimizing your settings and running the calculation check the article on setting up an electronic minimization.

Step 4: Plot the band structure

py4vasp provides utilities for plotting the band structure. Run the following in a Python notebook in the directory of the calculation:
import py4vasp
calc = py4vasp.Calculation.from_path(".")
ef = calc.dos.read()["fermi_energy"]
calc.band.plot("kpoints_opt", fermi_energy=ef)
Tip: Set the EFERMI tag or pass the Fermi energy explicitly, because py4vasp reads the Fermi energy from the KPOINTS_OPT density of states (results/electron_dos_kpoints_opt/efermi), which is computed from the line-mode k points and is therefore unreliable.

Option B: Split run

In a nutshell, the KS Hamiltonian within DFT can be expressed in terms of the electronic charge and possibly the magnetization density. Both are written to the CHGCAR file during an initial self-consistent-field (SCF) run. From this converged CHGCAR file, we can obtain the eigenvalues at the desired high-symmetry path via a subsequent non-self-consistent-field (NSCF) run at fixed density.

Step 1: Set up and perform a full SCF calculation

Follow the steps described in setting up an electronic minimization.
Important: Set LMAXMIX = 4 for d-electron systems and LMAXMIX = 6 for f-electron systems to adjust the maximum l-quantum number up to which the one-center PAW charge densities are written to the CHGCAR file. If you are unsure about the appropriate value for LMAXMIX, restart with fixed density using the regular k mesh and check that the total energy is identical to the SCF run.

Step 2 (optionally): Create a backup

The simplest procedure is to create a new directory for the band-structure calculation and copy the input files of the SCF calculation (usually the INCAR file, POSCAR file, and the POTCAR file) as well as the CHGCAR file to the new directory.
mkdir -f bands
cp INCAR POSCAR POTCAR CHGCAR bands/.
Alternatively, backup the OUTCAR file, KPOINTS file and possibly the OSZICAR file and vaspout.h5 to be able to reconstruct the SCF calculation, if needed.

Step 3: High-symmetry path

Choose a high-symmetry path and set it in the KPOINTS file.

Step 4: Prepare a restart with fixed density

Adjust the INCAR file:
  • Remove any of the following tags, if present: NSW, IBRION and ISTART.
  • Add ICHARG = 11. This restarts from the converged charge density read from the CHGCAR file and continues with the density held fixed.
  • Add additional relevant tags as needed, i.e., LORBIT=11.
Tip: Set the EFERMI tag to the Fermi energy obtained during the SCF calculation. Infact, the Fermi energy cannot be computed based on k points along a path, and the Fermi energy given by the NSCF calculation will therefore be unreliable. The Fermi energy of the SCF calculation is written to the OUTCAR file or can be extracted using py4vasp:
from py4vasp import Calculation
Calculation.from_path("dir/with/SCF/vaspout.h5").dos.read()["fermi_energy"]

Step 5: Run the NSCF calculation

Perform the NSCF calculation with the prepared files. This will read the CHGCAR file and keep the density fixed.
Mind: Any existing KPOINTS_OPT file triggers Option A unless you disable this by setting LKPOINTS_OPT = F.

Step 6: Plot the band structure

py4vasp provides utilities for plotting the band structure. Run the following in a Python notebook in the directory of the calculation:
import py4vasp
calc = py4vasp.Calculation.from_path(".")
calc.band.plot()
Tip: If you did not set EFERMI in Step 4, pass the Fermi energy from the SCF run at the plotting stage:
calc.band.plot(fermi_energy=...)  # plug in the Fermi energy from the SCF run

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 the structure.

Use external tools[1][2] to find the space group, plot the Brillouin zone, and pick a high-symmetry k path. Extract the corresponding coordinates and provide them in KPOINTS-file format, either as a list of explicit coordinates or (more commonly) using line mode.

Tip: 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 (see SYMPREC). Also, keep in mind that the primitive and the conventional unit cell have different reciprocal coordinate systems.

Example high-symmetry path 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 section on band-structure calculations in the KPOINTS documentation.

Recommendations and advice

In case a KPOINTS_OPT file is present (Option A), VASP computes the band energies for the k points of the KPOINTS_OPT file after SCF convergence is reached within the same submitted job. There may, however, be a computational advantage to splitting the run (Option B) because of different optimal batching options for the k mesh.

There are additional advantages to using the KPOINTS_OPT file for computing the band structure using hybrid functionals or using meta-GGA functionals. Refer to these references for details.

A number of post-processing options for the Kohn-Sham (KS) orbitals can 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:

Related tags and articles

KPOINTS, KPOINTS_OPT,

ICHARG, LMAXMIX

XC functionals, Setting up an electronic minimization

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

References