momentGW.pbc.kpts
k-points helper utilities.
Module Contents
- momentGW.pbc.kpts.allow_single_kpt(output_is_kpts=False)
Decorate functions to allow kpts arguments to be passed as a single k-point.
- Parameters:
output_is_kpts (bool, optional) – Whether the output of the function is a k-point. Default value is False.
- class momentGW.pbc.kpts.KPoints(cell, kpts, tol=1e-06, wrap_around=True)
Helper class for k-points.
- Parameters:
- property tol_decimals
Convert the tolerance into a number of decimal places.
- Returns:
tol_decimals – Number of decimal places.
- Return type:
- property kmesh
Guess the k-mesh.
- Returns:
kmesh – Size of the k-mesh in each direction.
- Return type:
- property T
Get the transpose of the k-points.
- member(kpt)
Find the index of the k-point in the k-point list.
- Parameters:
kpt (numpy.ndarray) – The k-point.
- Returns:
index – Index of the k-point.
- Return type:
- index(kpt)
Alias for member.
- Parameters:
kpt (numpy.ndarray) – The k-point.
- Returns:
index – Index of the k-point.
- Return type:
- get_scaled_kpts(kpts)
Convert absolute k-points to scaled k-points for the current cell.
- Parameters:
kpts (numpy.ndarray) – Absolute k-points.
- Returns:
scaled_kpts – Scaled k-points.
- Return type:
numpy.ndarray
- get_abs_kpts(kpts)
Convert scaled k-points to absolute k-points for the current cell.
- Parameters:
kpts (numpy.ndarray) – Scaled k-points.
- Returns:
abs_kpts – Absolute k-points.
- Return type:
numpy.ndarray
- wrap_around(kpts, window=(-0.5, 0.5))
Handle the wrapping of k-points into the first Brillouin zone.
- Parameters:
kpts (numpy.ndarray) – Absolute k-points.
window (tuple, optional) – Window within which to contain scaled k-points. Default value is (-0.5, 0.5).
- Returns:
wrapped_kpts – Wrapped k-points.
- Return type:
numpy.ndarray
- hash_kpts(kpts)
Convert k-points to a unique, hashable representation.
- Parameters:
kpts (numpy.ndarray) – Absolute k-points.
- Returns:
hash_kpts – Hashable representation of k-points.
- Return type:
- conserve(ki, kj, kk)
Get the index of the k-point that conserves momentum.
- loop(depth, mpi=False)
Iterate over all combinations of k-points up to a given depth.
- loop_size(depth=1)
Return the size of loop. Without MPI, this is equivalent to len(self)**depth.
- is_zero(kpts)
Check if the k-point is zero.
- Parameters:
kpts (numpy.ndarray) – Absolute k-points.
- Returns:
is_zero – Whether the k-point is zero.
- Return type:
- translation_vectors()
Build translation vectors to construct supercell of which the gamma point is identical to the k-point mesh of the primitive cell.
- Returns:
r_vec_abs – Translation vectors.
- Return type:
numpy.ndarray
- interpolate(other, fk)
Interpolate a function f from the current grid of k-points to those of other. Input must be in a localised basis, i.e. AOs.
- Parameters:
other (KPoints) – The k-points to interpolate to.
fk (numpy.ndarray) – The function to interpolate, expressed on the current k-point grid. Must be a matrix-valued array expressed in k-space, in a localised basis.
- Returns:
f – The interpolated function, expressed on the new k-point grid.
- Return type:
numpy.ndarray