PythTB API Reference#
Core Classes#
PythTB centers on a small set of core classes for constructing and analyzing tight-binding models. This page highlights what each component is for and links to the API reference in the tables below.
pythtb.TBModelTight-binding Hamiltonians on arbitrary lattices. Use it to set hoppings, sweep parameters, compute spectra, and evaluate derived quantities such as Berry curvature, quantum geometric tensors, axion angles, or local Chern markers.pythtb.WFArrayMesh-aware wavefunction storage. Solve a model across \((k, \lambda)\) grids, then evaluate Wilson loops, Berry phases, Chern numbers, and other objects with consistent periodic boundary conditions.pythtb.W90Interface with Wannier90 and export a Wannierized tight-binding model in the form of aTBModel.
Added in version 2.0.0: The classes below were introduced in PythTB version 2.0.0.
pythtb.MeshDescribes combined crystal momentum and parameter meshes, \((k, \lambda)\). Can construct uniform grids, paths, and meshes defined on a custom set of points. Encodes boundary conditions (loops, endpoints, adiabatic cycles) forWFArrayto apply appropriate gauge conditions downstream.pythtb.LatticeHolds real- and reciprocal-space geometry, orbital positions, and nearest-neighbor shells. Every model and wavefunction array references the same lattice instance to ensure consistent coordinates.pythtb.WannierBuild Wannier gauges directly inside PythTB from aWFArray, perform projections, disentanglement and maximal localization, and analyze spreads and centers.
|
Build, parametrize, and solve tight-binding Hamiltonians. |
|
Wavefunction container defined on a sampling mesh. |
|
Store lattice and orbital information. |
|
Store and manage a mesh in \((k, \lambda)\)-space. |
|
Interface to Wannier90 |
|
Construct Wannier functions through the projection method. |
Predefined Models#
PythTB also provides a collection of predefined tight-binding models. Import and use these models using the following syntax:
from pythtb.models import haldane, graphene, ssh
Collection of tight-binding models. |
I/O Utilities#
PythTB ships with lightweight readers for importing data from external software packages such as Wannier90 and Quantum ESPRESSO.