kpoint¶
- py4vasp.calculation.kpoint¶
- class py4vasp.calculation._kpoint.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()¶
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, optional) – 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:
A reduction of the k points onto a one-dimensional array based on the distance between the points.
- Return type:
np.ndarray
- labels()¶
Get any labels given in the input file for specific k points.
- Parameters:
selection (str, optional) – 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:
A list of all the k-points explicitly named in the file or the coordinates of the band edges if no name was provided.
- Return type:
list[str]
- line_length()¶
Get the number of points per line in the Brillouin zone.
- Parameters:
selection (str, optional) – 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:
The number of points used to sample a single line.
- Return type:
int
- mode()¶
Get the k-point generation mode specified in the Vasp input file
- Parameters:
selection (str, optional) – 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:
A string representing which mode was used to setup the k-points.
- Return type:
str
- number_kpoints()¶
Get the number of points in the Brillouin zone.
- Parameters:
selection (str, optional) – 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:
The number of points used to sample the Brillouin zone.
- Return type:
int
- number_lines()¶
Get the number of lines in the Brillouin zone.
- Parameters:
selection (str, optional) – 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:
The number of lines the band structure contains. For regular meshes this is set to 1.
- Return type:
int
- path_indices(start, finish)¶
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:
selection (str, optional) – 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:
A list of indices of all k points that fulfil the linear dependence.
- Return type:
list[int]
- print()¶
Print a string representation of this instance.
- read(*args, **kwargs)¶
Convenient wrapper around to_dict. Check that function for examples and optional arguments.
- selections()¶
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.
- Returns:
The key indicates this quantity and the values possible choices for arguments to other functions of this quantity.
- Return type:
dict
- to_dict()¶
Read the k points data into a dictionary.
- Parameters:
selection (str, optional) – 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:
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.
- Return type:
dict