aiida_vasp.utils.kmesh#

Generating (symmetry-reduced) k-point grids using spglib

Module Contents#

Functions#

grid_address_to_recip_coord

Convert grid address to fractional coordinates in the reciprocal space

get_ir_kpoints_and_weights

Return fractional coordinates of irreducible k-points from a given mesh. Note: The current implementation does not support using only time-reversal symmetry.

get_ir_kpoints_data

Return fractional coordinates of irreducible k-points from a given mesh. Note: The current implementation does not support using only time-reversal symmetry.

API#

aiida_vasp.utils.kmesh.grid_address_to_recip_coord(points: numpy.ndarray, mesh: list[int] | tuple[int, ...], is_shift: list[bool] | None = None) numpy.ndarray[source]#

Convert grid address to fractional coordinates in the reciprocal space

aiida_vasp.utils.kmesh.get_ir_kpoints_and_weights(cell: numpy.ndarray, scaled_positions: numpy.ndarray, numbers: list[int], mesh: int | list[int] | tuple[int, ...], is_time_reversal: bool = True, symprec: float = 1e-05, is_shift: list[bool] | None = None, symmetry_reduce: bool = True) tuple[numpy.ndarray, numpy.ndarray][source]#

Return fractional coordinates of irreducible k-points from a given mesh. Note: The current implementation does not support using only time-reversal symmetry.

Parameters:
  • atoms – An ASE atoms object

  • mesh – A tuple/list for the meshes in each direction or a single number for kpoint distance

  • is_time_reversal – Whether to use time-reversal symmetry or not.

  • symprec – Symmetry precision

  • is_shift – A tuple/list for the shift of the mesh, use [1, 1, 1] for MP Grid.

  • use_symmetry – Whether to use symmetry or not. If False, the k-points are not reduced at all.

Returns:

A tuple of (kpoints, weights).

aiida_vasp.utils.kmesh.get_ir_kpoints_data(structure: aiida.orm.StructureData, mesh_or_spacing: aiida.orm.List | aiida.orm.Float, is_time_reversal: aiida.orm.Bool | bool = True, symprec: aiida.orm.Float | float = 1e-05, is_shift: aiida.orm.List | None = None, symmetry_reduce: aiida.orm.Bool | bool = True) aiida.orm.KpointsData[source]#

Return fractional coordinates of irreducible k-points from a given mesh. Note: The current implementation does not support using only time-reversal symmetry.

Parameters:
  • atoms – An ASE atoms object

  • mesh – A tuple/list for the meshes in each direction or a single number for kpoint distance

  • is_time_reversal – Whether to use time-reversal symmetry or not.

  • symprec – Symmetry precision

  • is_shift – A tuple/list for the shift of the mesh, use [1, 1, 1] for MP Grid.

  • use_symmetry – Whether to use symmetry or not. If False, the k-points are not reduced at all.

Returns:

A KpointsData object