pythtb.Mesh.build_custom#

Mesh.build_custom(points)[source]#

Build a custom mesh from the given points.

This method allows for the creation of a mesh with arbitrary points, rather than a regular grid. The shape of the input points array must match the axis types defined in the Mesh object.

Parameters:
pointsnp.ndarray

Array of shape (N1, N2, ..., Nd, dim_total), where d is the number of axes defined by axis_types and dim_total is the total number of dimensions in the mesh defined by dim_total = dim_k + dim_lambda.

Examples

Say we have a model with two k-space dimensions (e.g., kx and ky). We can then build a custom mesh using arbitrary points:

>>> custom_points = np.random.rand(10, 10, 2)  # 2D mesh in 2D k-space
>>> mesh = Mesh(axis_types=['k', 'k'])
>>> mesh.build_custom(custom_points)

Suppose instead we have a custom path through k-space that is not a regular grid. We would then need to initialize the Mesh with a single ‘k’ axis type.

>>> path_points = np.random.rand(100, 2)  # 100 point path in 2D k-space
>>> mesh = Mesh(axis_types=['k'], dim_k=2)
>>> mesh.build_custom(path_points)