pythtb.Lattice#
- class Lattice(lat_vecs, orb_vecs, periodic_dirs=[])[source]#
Store lattice and orbital information.
The
Latticeclass encapsulates the real-space lattice vectors, orbital positions, and periodicity information for tight-binding models. It provides methods to access and manipulate lattice properties, such as retrieving lattice vectors, orbital positions, and cutting finite pieces from periodic lattices. Internally, it also computes the reciprocal lattice vectors based on the specified periodic directions.Added in version 2.0.0.
- Parameters:
- lat_vecsarray_like
Array of shape
(dim_r, dim_r)containing the real-space lattice vectors as rows in Cartesian coordinates.- orb_vecsarray_like, int
Array of shape
(norb, dim_r)containing the orbital positions as rows in reduced coordinates (fractions of the lattice vectors). Iforb_vecsis an integer, it specifies the number of orbitals at the origin.- periodic_dirsarray_like of int or {‘all’} or Ellipsis, optional
Real-space lattice directions that treated as periodic. The indices refer to the
lat_vecsarray, e.g.[0]would indicate that the first lattice vector is periodic. Use...or"all"to indicate that all directions are periodic. If an empty list (default) or None, all directions are considered finite (open boundary conditions).
Notes
The dimension of the real-space lattice,
dim_r, is inferred from the shape oflat_vecs.The dimension of the k-space,
dim_k, is inferred from the number of entries inperiodic_dirs.The lattice vectors must form a right-handed system with non-zero volume.
Orbital positions are given in reduced coordinates, i.e., fractions of the lattice vectors.
Works for 0D, 1D, 2D, and 3D lattices. For 0D, use empty arrays for
lat_vecsand an integer fororb_vecs.
Methods#
Add an orbital to the lattice. |
|
Change non-periodic lattice vector. |
|
Cut a (d-1)-dimensional piece out of a d-dimensional Lattice. |
|
Transform k-points to k-distance along a path. |
|
Return lattice vectors in Cartesian coordinates. |
|
Return orbital positions. |
|
Return reciprocal lattice vectors in Cartesian coordinates. |
|
Generate a report of the lattice properties. |
|
Interpolates a path in reciprocal space. |
|
Generates the finite difference weights on a k-shell. |
|
Generate a uniform grid of k-points in reduced (fractional) coordinates. |
|
Make lattice a super-cell. |
|
Enumerate nearest-neighbor shells of the lattice. |
|
Generates shells of k-points around the \(\Gamma\) point. |
|
Remove an orbital from the lattice. |
|
Visualizes the lattice geometry. |
|
Visualize a 3D tight-binding model using |
Attributes#
Volume of the real-space unit cell in Cartesian coordinates. |
|
The dimensionality of reciprocal space (periodic directions). |
|
The dimensionality of real space. |
|
Lattice vectors in Cartesian coordinates with shape |
|
The number of orbitals in the lattice. |
|
List of supercell sizes along each real-space lattice vector. |
|
Orbital vectors in reduced coordinates with shape |
|
List of periodic directions. |
|
Reciprocal lattice vectors in Cartesian coordinates with shape |
|
Volume of the reciprocal unit cell in Cartesian coordinates. |