pythtb.TBModel.k_uniform_mesh#
- TBModel.k_uniform_mesh(mesh_size, *, gamma_centered=False, include_endpoints=True)[source]#
Generate a uniform grid of k-points in reduced (fractional) coordinates.
The grid spans the interval \([0,1)\) along each periodic crystal direction and always contains the origin. The total number of k-points is the product of the entries in
mesh_size.- Parameters:
- mesh_sizearray_like
The number of k-points along each periodic direction. Its length must equal the number of periodic dimensions of the model. For example,
mesh_size = [n1, n2, n3]produces a 3D mesh withn1 x n2 x n3points.- gamma_centeredbool, optional
If
True, the mesh is centered around the Gamma point, spanning the interval \([-0.5, 0.5)\) along each periodic direction. Default isFalse.Added in version 2.0.0.
- include_endpointsbool, optional
If
True, the mesh includes the endpoint at 1.0 (or 0.5 ifgamma_centered=True) along each periodic direction. Default isTrue.Added in version 2.0.0.
- Returns:
- k_pointsnumpy.ndarray
An array of shape
(n1, n2, ..., dim_k)where the final index runs over the reduced-coordinate components of each k-vector.If
mesh_size = [n1, n2, ..., nD]and the model hasdim_k = D, then the returned array has shape(n1, n2, ..., nD, D).
Notes
This uniform mesh is suitable for evaluating model quantities on a regular Brillouin-zone sampling grid, e.g. via
solve_ham().Examples
Construct a 10x20x30 mesh for a model with three periodic directions:
>>> k_points = my_model.k_uniform_mesh([10, 20, 30]) >>> k_points.shape (10, 20, 30, 3)
Solve the model on the mesh:
>>> evals = my_model.solve_ham(k_points)