There is a newer version of this record available.

Software Open Access

pybinding v0.9.2: a Python package for tight-binding calculations

Moldovan, Dean; Anđelković, Miša; Peeters, Francois

Pybinding is a Python package for numerical tight-binding calculations in solid state physics. The main features include:

  • Declarative model construction - The user just needs to describe what the model should be, but not how to build it. Pybinding will take care of the numerical details of building the Hamiltonian matrix so users can concentrate on the physics, i.e. the quantum properties of the model.

  • Fast compute - Pybinding's implementation of the kernel polynomial method allows for very fast calculation of various physical properties of tight-binding systems. Exact diagonalization is also available through the use of scipy's eigenvalue solvers. The framework is very flexible and allows the addition of user-defined computation routines.

  • Result analysis and visualization - The package contains utility functions for post-processing the raw result data. The included plotting functions are tailored for tight-binding problems to help visualize the model structure and to make sense of the results.

The code interface is written in Python with the aim to be as user-friendly and flexible as possible. Under the hood, C++11 is used to accelerate demanding tasks to deliver high performance with low memory usage.

See the documentation for more details:


Changelog for version 0.9.2

New KPM features and improvements

  • Added a method for calculating spatial LDOS using KPM. See the "Kernel Polynomial Method" tutorial page and the KPM.calc_spatial_ldos API reference.

  • Improved single-threaded performance of KPM.calc_dos by ~2x by switching to a more efficient vectorization method. (Multiple random starter vectors are now computed simultaneously and accelerated using SIMD intrinsics.)

  • Various KPM methods now take advantage of multiple threads. This improves performance depending on the number of cores on the target machine. (However, for large systems performance is limited by RAM bandwidth, not necessarily core count.)

  • LDOS calculations for multiple orbitals also take advantage of the same vectorization and multi-threading improvements. Single-orbital LDOS does not benefit from this but it has received its own modest performance tweaks.

  • Long running KPM calculation now have a progress indicator and estimated completion time.

General improvements and bug fixes

  • StructureMap can now be sliced using a shape. E.g. s = pb.rectangle(5, 5); smap2 = smap[s] which returns a smaller structure map cut down to the given shape.

  • Plotting the structure of large or periodic systems is slightly faster now.

  • Added 2D periodic supercells to the "Shape and symmetry" section of the tutorial.

  • Added a few more examples to the "Plotting guide" (view rotation, separating sites and hoppings and composing multiple plots).

  • Fixed broken documentation links when using the online search function.

  • Fixed slow Hamiltonian build when hopping generators are used.

This work was supported by the Flemish Science Foundation (FWO-Vl) and the Methusalem Funding of the Flemish Government.
Files (630.4 kB)
Name Size
630.4 kB Download
All versions This version
Views 3,06338
Downloads 1446
Data volume 87.2 MB3.8 MB
Unique views 2,64537
Unique downloads 1205


Cite as