tbkit: Tight-Binding Models in Python#

tbkit is a Python package to build and solve Tight-Binding models, written in fully vectorized NumPy. It’s built for physics students working through a textbook problem, curious learners exploring a topic on their own, and educators building a demonstration.

Graphene's Dirac cone, Hofstadter's butterfly, and helical edge states of a Kane-Mele ribbon, all computed with tbkit

Start with the Tutorial, trace the history of Tight-Binding breakthroughs, browse the example gallery, or jump straight to the API reference.

For computational physics beyond tight-binding – quantum mechanics, classical mechanics, statistical physics, general relativity, and more – see physicskit, whose physicskit.condensed subpackage covers tight-binding band theory and topology alongside superconductivity.

Examples#

Building and solving models#

Finite lattices, defects, several orbitals per site, real space to k-space and back, k·p models discretized into lattice models, saved models and Wannier90 imports, maximally localized Wannier functions, and solvers for very large lattices.

An impurity bound state, Slater-Koster sp3 graphene bands with overlaps, and the kernel polynomial method on 45,000 sites

Fields, strain and disorder#

What happens to a lattice under a magnetic field (Peierls substitution), under strain, and with disorder.

Graphene's sqrt(n) Landau ladder, triaxial strain as a pseudo-magnetic field, and Anderson localization

Band topology#

Chern numbers, Berry phases, the Z2 invariant (and the four 3D indices), spin and mirror Chern numbers, the Bott index and entanglement spectrum, Weyl points and their chirality, Kitaev’s Majorana number, quantum geometry, symmetry classes, higher-order and 3D topological phases.

Berry curvature of the Haldane model, the Kane-Mele Z2 Wannier flow, and the four corner states of a quadrupole insulator

Response and transport#

Hall conductivities at any Fermi level (with the orbital magnetization, Nernst and thermal Hall responses), Landauer transport between leads, and linear and nonlinear optical response.

The anomalous Hall conductivity of the Haldane model, the conductance steps of a quantum point contact, and graphene's universal absorption

Flat bands and interactions#

Flat bands from lattice geometry and from a moiré twist, the Hubbard model in mean field, and superconductivity.

The flat bands of twisted bilayer graphene, magnetic zigzag edges in Hubbard mean field, and the Majorana end modes of a Kitaev chain

Driven and open systems#

Wavepacket dynamics, periodically driven (Floquet) lattices, and non-Hermitian bands with exceptional points.

Bloch oscillations in a tilted chain, the Floquet bands of graphene in circularly polarized light, and the non-Hermitian skin effect

Install#

To use tbkit:

  • Install Python 3.10 or later and three additional packages:

    • numpy

    • scipy

    • matplotlib

  • pip install tbkit or conda install -c conda-forge tbkit, or pip install -e . from a clone of the repository.

Examples are available at cpoli/tbkit, and rendered with their output in the example gallery.

Related toolkits

Sibling Python toolkits for learning and teaching, built the same way: