kpoint¶
(
- data_context,
- **kwargs
)
The k-point mesh used in the VASP calculation.
In VASP calculations, k points play an important role in discretizing the Brillouin zone of a crystal. For self-consistent DFT calculations, typically a regular grid of k points is employed to sample the Brillouin zone. A sufficiently dense k-points mesh is critical for the precision of your DFT calculation, so make sure to test the results for different meshes. Denser k point meshes provide more accurate results but also demand greater computational resources.
Another common use case is irregular meshes in non-self-consistent calculations. In particular in band structure analysis, one employs a mesh along specific lines in the Brillouin zone. The line mode involves connecting high-symmetry points and calculating the electronic band structure along these paths.
This class provides utility functionality to extract information about either of the aforementioned use cases. As such it is mostly used as a helper class for other postprocessing classes to extract the required information, e.g., to generate a band structure. It may also be used to programmatically analyze the selected k point mesh or take subsets along high symmetry lines.
distances
str) → np.ndarray
Convert the coordinates of the k points into a one dimensional array
For every line in the Brillouin zone, the distance between each k point and the start of the line is calculated. Then the distances of different lines are concatenated into a single list. This routine is mostly useful to plot data along high-symmetry lines like band structures.
Parameters
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
np.ndarray- A reduction of the k points onto a one-dimensional array based on the distance between the points.
labels
str) → list[str]
Get any labels given in the input file for specific k points.
Parameters
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
list[str]- A list of all the k-points explicitly named in the file or the coordinates of the band edges if no name was provided.
line_length
str) → int
Get the number of points per line in the Brillouin zone.
Parameters
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
int- The number of points used to sample a single line.
mode
str) → str
Get the k-point generation mode specified in the Vasp input file
Parameters
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
str- A string representing which mode was used to setup the k-points.
number_kpoints
str) → int
Get the number of points in the Brillouin zone.
Parameters
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
int- The number of points used to sample the Brillouin zone.
number_lines
str) → int
Get the number of lines in the Brillouin zone.
Parameters
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
int- The number of lines the band structure contains. For regular meshes this is set to 1.
path
path_indices
(
- start:
ArrayLike, - finish:
ArrayLike, - selection:
str
) → list[int]
Find linear dependent k points between start and finish
Loop over all possible k points and return the indices of the ones for which k-point - start is linear dependent on finish - start.
Parameters
- start:
ArrayLike - The starting k-point of the path segment. Expects exactly 3 coordinates.
- finish:
ArrayLike - The ending k-point of the path segment. Expects exactly 3 coordinates.
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
list[int]- A list of indices of all k points that fulfil the linear dependence.
read
selections
dict
Returns possible alternatives for this particular quantity VASP can produce.
The returned dictionary contains a single item with the name of the quantity mapping to all possible selections. Each of these selection may be passed to other functions of this quantity to select which output of VASP is used. Some quantities provide additional elements which can be passed as selection for other routines.
Returns
dict- The key indicates this quantity and the values possible choices for arguments to other functions of this quantity.
to_dict
str) → dict
Read the k points data into a dictionary.
Parameters
- selection:
str - You can select “kpoints_opt” or “kpoints_wan” here, to read from those meshes instead of the default one defined by the KPOINTS file.
Returns
dict- Contains the coordinates of the k points (in crystal units) as well as their weights used for integrations. Moreover, some data specified in the input file of Vasp are transferred such as the mode used to generate the k points, the line length (if line mode was used), and any labels set for specific points.