pythtb.Lattice#

class Lattice(lat_vecs, orb_vecs, periodic_dirs=[])[source]#

Store lattice and orbital information.

The Lattice class 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). If orb_vecs is 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_vecs array, 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 of lat_vecs.

  • The dimension of the k-space, dim_k, is inferred from the number of entries in periodic_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_vecs and an integer for orb_vecs.

Methods#

pythtb.Lattice.add_orb

Add an orbital to the lattice.

pythtb.Lattice.change_nonperiodic_vector

Change non-periodic lattice vector.

pythtb.Lattice.cut_piece

Cut a (d-1)-dimensional piece out of a d-dimensional Lattice.

pythtb.Lattice.get_kpath_distance

Transform k-points to k-distance along a path.

pythtb.Lattice.get_lat_vecs

Return lattice vectors in Cartesian coordinates.

pythtb.Lattice.get_orb_vecs

Return orbital positions.

pythtb.Lattice.get_recip_lat_vecs

Return reciprocal lattice vectors in Cartesian coordinates.

pythtb.Lattice.info

Generate a report of the lattice properties.

pythtb.Lattice.k_path

Interpolates a path in reciprocal space.

pythtb.Lattice.k_shell_weights

Generates the finite difference weights on a k-shell.

pythtb.Lattice.k_uniform_mesh

Generate a uniform grid of k-points in reduced (fractional) coordinates.

pythtb.Lattice.make_supercell

Make lattice a super-cell.

pythtb.Lattice.nn_bonds

Enumerate nearest-neighbor shells of the lattice.

pythtb.Lattice.nn_k_shell

Generates shells of k-points around the \(\Gamma\) point.

pythtb.Lattice.remove_orb

Remove an orbital from the lattice.

pythtb.Lattice.visualize

Visualizes the lattice geometry.

pythtb.Lattice.visualize_3d

Visualize a 3D tight-binding model using Plotly.

Attributes#

pythtb.Lattice.cell_volume

Volume of the real-space unit cell in Cartesian coordinates.

pythtb.Lattice.dim_k

The dimensionality of reciprocal space (periodic directions).

pythtb.Lattice.dim_r

The dimensionality of real space.

pythtb.Lattice.lat_vecs

Lattice vectors in Cartesian coordinates with shape (dim_r, dim_r).

pythtb.Lattice.norb

The number of orbitals in the lattice.

pythtb.Lattice.nsuper

List of supercell sizes along each real-space lattice vector.

pythtb.Lattice.orb_vecs

Orbital vectors in reduced coordinates with shape (norb, dim_r).

pythtb.Lattice.periodic_dirs

List of periodic directions.

pythtb.Lattice.recip_lat_vecs

Reciprocal lattice vectors in Cartesian coordinates with shape (dim_k, dim_r).

pythtb.Lattice.recip_volume

Volume of the reciprocal unit cell in Cartesian coordinates.