nanotools.kpoint module

This module defines the Kpoint class.

class nanotools.kpoint.Kpoint(bvec=None, special_points=None, gamma_centered: bool = False, grid=None, fractional_coordinates=None, kwght=None, shift=array([0., 0., 0.]), resolution=<Quantity(0.35, '1 / angstrom')>, type: str = 'full')[source]

Bases: Base

Kpoint class.

The Kpoint class defines parameters related to k-sampling.

bvec

Array of row-reciprocal-vectors.

Type:

2D array

special_points

special_points specifies k-points (typically high-symmetry k-points) defining the line which samples the Brillouin zone. A line going through all such k-points is generated and discretized using system.kpoint. grid points or a resolution of 0.015 $mathring{ ext{A}}^{-1}$ is used. This keyword can be a list of labels, ['L','G','X'], a list of lists (or array), [[.5, .5, .5], [.0, .0, .0], [.5, .0, .5]], or a mix of the two.

Examples:

kpoint.special_points = ['L','G','X']
Type:

list of strings

gamma_centered

gamma_centered equal True induces a shift of the Monkhorst-Pack mesh such that a point lies at $Gamma$.

Examples:

kpoint.gamma_centered = True
Type:

bool

grid

grid is a size-3 array giving the number of points along each direction in the Brillouin zone discretization. The Monkhorst-Pack scheme is used . In linear band structure calculations, grid is a size-1 array giving the total number of points. The points are distributed as uniformly as possible. Note that a line such as [“L”, “G”, “X”, “W”] is always decomposed into segments [[“L”, “G”], [“G”, “X”], [“X”, “W”]]. Since “G” and “X” are duplicated, if grid is set to 20, internal quantities like kpoint.fractional_coordinates will have size 22 in the k-point axis. Examples:

kpoint.grid = [4 4 4]
Type:

1D array

fractional_coordinates

fractional_coordinates contains row-vectors giving the fractional coordinates of the k-points. fractional_coordinates has precedence over Monkhors-Pack mesh generation and linear k-point sampling.

Examples:

kpoint.fractional_coordinates = [0.25,0.25,0.25,0.25,0.25,-0.25]
Type:

2D array

kwght

weight of each k-point.

Examples:

kpoint.kwght = [6;2]
Type:

1D array

type

type equal “full” will sample the entire Brillouin zone (most calculations use this, e.g. self-consistent); type equal “line” will sample high-symmetry edges of the Brillouin zone (as in linear band structure calculations).

Examples:

kpoint.type = "full"
Type:

string

get_cartesian_coordinates()[source]

Computes the k-points Cartesian coordinates.

get_fractional_coordinates()[source]

Computes the k-points Cartesian coordinates.

get_kpoint_num()[source]

Returns the number of k-points.

get_special_points_labels()[source]

Computes the k-points Cartesian coordinates.

set_bvec(cell)[source]

Sets the reciprocal lattice data from a Cell object.

Parameters:

cell – A Cell object.

set_cartesian_coordinates(cartesian_coordinates, kwght=None)[source]

Sets fractional_coordinates given Cartesian coordinates and optionally the k-point weights.

set_fractional_coordinates(fractional_coordinates=None, kwght=None)[source]

Sets fractional_coordinates given fractional coordinates and optionally the k-point weights.

set_grid(grid, shift=None, gamma_centered=None)[source]

Defines the k-points given a grid size or shape.

If the k-point object is of type “full”, then the grid argument is expected to be a 3-element array. The k-point coordinates and weights are reinitialized accordingly.

If the k-point object is of type “line”, then the grid argument is expected to be an integer. The k-point coordinates are regenerate along a path going around the Brillouin zone.

Parameters:

grid (1D array or int) – Shape or size of the k-point grid or path.

set_kpoint_path(special_points=None, grid=None)[source]

Compute k-point coordinates along the line specified in Kpoint object.

set_kwght(kwght=None)[source]

Sets the k-point weights.

set_type(type)[source]

Sets the type of the k-point object.

The type can be either “full”, for a self-consistent or DOS calculation for instance, or “line” for a band structure calculation.

Parameters:

type (string) – Type of the k-point object.