Python library for constructing and analyzing tight-binding models.
Project description
PythTB is a Python library for constructing and analyzing tight-binding models, built for modern topological band theory applications. It provides a streamlined path from model specification to physical interpretation, making it useful for both learning electronic structure and conducting research-level studies. With only a few lines of code, you can define lattice models, build tight-binding Hamiltonians, and compute electronic properties.
PythTB provides tools for:
- Band structures and density of states
- Berry phases and Berry curvature
- Chern numbers, Wilson loops, and related invariants
- Quantum geometric tensors and local Chern markers
- Chern-Simons axion angle
- Maximally localized Wannier functions
- Wannier-based tight-binding models generated through Wannier90
Resources
- Documentation: https://pythtb.readthedocs.io/en/latest/
- Contributing: https://pythtb.readthedocs.io/en/latest/development.html
- Tutorials: https://pythtb.readthedocs.io/en/latest/tutorials.html
- Formalism: https://pythtb.readthedocs.io/en/latest/formalism.html
- Source: https://github.com/pythtb/pythtb
- Report Issues: https://github.com/pythtb/pythtb/issues
Installation
PythTB is available through conda-forge (recommended) and PyPI.
# Conda (pythtb >= 1.8.0)
conda install -c conda-forge pythtb
# pip
pip install pythtb
To install from source in editable mode:
git clone https://github.com/pythtb/pythtb.git
cd pythtb
pip install -e .
PythTB ≥ 2.0.0 requires Python ≥ 3.12 and the core dependencies:
- numpy ≥ 2.0
- matplotlib ≥ 3.9
Optional extras can be installed via pip install .[group]:
[plotting]: Plotly for interactive visualization[speedup]: TensorFlow for GPU-accelerated routines[notebooks]: Jupyter support (IPython ≥ 8.17, ipykernel, notebook, jupyter, jupyterlab)[docs]: Sphinx toolchain for documentation[tests]: pytest[dev]: developer tools (pytest, ruff, pre-commit)
For more detailed instructions, see:
Citation
If you use the code in your paper, please cite us
@software{Cole_Python_Tight_Binding_2025,
author = {Cole, Trey and Coh, Sinisa and Vanderbilt, David},
doi = {10.5281/zenodo.12721315},
license = {GPL-3.0-or-later},
month = nov,
title = {{Python Tight Binding (PythTB)}},
url = {https://zenodo.org/records/12721315},
version = {2.0.0},
year = {2025}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythtb-2.0.1.tar.gz.
File metadata
- Download URL: pythtb-2.0.1.tar.gz
- Upload date:
- Size: 36.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d31cedd0399fedc36753dac58054cafb53e4d985c4524759e00f67134bfb5374
|
|
| MD5 |
724adf94401d47dc7b0459887807cb1c
|
|
| BLAKE2b-256 |
bc00f41d03ab61181e43f7f38311199747848e7a04224ec562f53c5a16272117
|
Provenance
The following attestation bundles were made for pythtb-2.0.1.tar.gz:
Publisher:
pypi-publish.yml on pythtb/pythtb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythtb-2.0.1.tar.gz -
Subject digest:
d31cedd0399fedc36753dac58054cafb53e4d985c4524759e00f67134bfb5374 - Sigstore transparency entry: 870907720
- Sigstore integration time:
-
Permalink:
pythtb/pythtb@80fc33629d3a41b67b0e1f0cad562148f8cec8e0 -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/pythtb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@80fc33629d3a41b67b0e1f0cad562148f8cec8e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pythtb-2.0.1-py3-none-any.whl.
File metadata
- Download URL: pythtb-2.0.1-py3-none-any.whl
- Upload date:
- Size: 197.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b79ee7916564436023685ec82fe0c7a0b57ee9b291038eaf892776a3b017ccf0
|
|
| MD5 |
7007064caaf8a3e00d026d12639cb2d9
|
|
| BLAKE2b-256 |
141174b5a3d450eae33ac7d32be80a4ec6b8dbd206f6d51345fead284ce6c8d3
|
Provenance
The following attestation bundles were made for pythtb-2.0.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on pythtb/pythtb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythtb-2.0.1-py3-none-any.whl -
Subject digest:
b79ee7916564436023685ec82fe0c7a0b57ee9b291038eaf892776a3b017ccf0 - Sigstore transparency entry: 870907733
- Sigstore integration time:
-
Permalink:
pythtb/pythtb@80fc33629d3a41b67b0e1f0cad562148f8cec8e0 -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/pythtb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@80fc33629d3a41b67b0e1f0cad562148f8cec8e0 -
Trigger Event:
push
-
Statement type: