TBdMM (Tight-Binding d-Band Moment) is a Python package that computes the tight-binding d-band moment (m_n) and the corresponding Hamiltonian matrix (H) for a given site of a material structure. It is useful for analyzing electronic structures in materials modeling, especially in surface chemistry.
- Compute tight-binding d-band moment (m_n) for a selected atomic site. A few low-order moments: d-band center (first moment), d-band width (related to second moment), d-band skewness (standardized third moment) and d-band kurtosis (standardized fourth moment).
- Construct tight-binding Hamiltonian matrix (H) based on user-defined structure.
- Return both (m_n) and (H).
- Command-line interface (CLI) for straightforward usage in shell scripts or remote servers.
- Python API for integration into custom workflows and research pipelines.
You can install TBdMM in several ways:
pip install TBdMM
git clone https://github.com/your_username/TBdMM.git
cd TBdMM
pip install -e .
After installation, TBdMM provides a command-line tool tbdmm. You can run:
tbdmm -i <input_structure> -s <site_index> -n <order> [-o output_file.npy]
Arguments:
-i, --input-file: Path to your structure file (e.g., POSCAR, CIF, XYZ, etc.).-s, --site-index: The site index of the center atom for which to compute the d-band moment.-n, --order: The order of the d-band moment.-o, --output-h: (Optional) The file path to save the Hamiltonian matrix (H) in NumPy.npyformat.
Example:
tbdmm -i POSCAR -s 10 -n 2 -o H_matrix.npy
Sample output:
m_2 = 0.123456 # example result
Hamiltonian saved to H_matrix.npy
You can also import and use TBdMM in Python scripts or Jupyter notebooks:
from ase.io import read
from TBdMM import TBdMM # or from TBdMM.calculations import TBdMM
atoms = read("POSCAR") # Load the structure into an ASE Atoms object
m2, H = TBdMM(atoms, site_index=10, n=2)
print("m2 =", m2)
print("Hamiltonian shape:", H.shape)
This returns a tuple (m2, H), where:
m2is the second-order d-band moment.His the constructed Hamiltonian as a NumPy 2D array.
If you are using this package, please consider citing the following papers: