Registry / ai-ml / tblite

tblite

JSON →
library0.6.0pypypiunverified

Tblite is a lightweight Python interface to the tblite C++ library, providing fast and efficient tight-binding calculations for quantum chemistry and materials science. It allows users to perform energy, force, and other property calculations for molecular systems. The current version is 0.5.0, and it maintains a regular release cadence, with API changes detailed in release notes.

pip install tblite numpy
INSTALL
IMPORT
SIG · TBLITE
T
tblite
ai-mlpythonv0.6.0
Install
4.6s avg
Import
256ms
Disk
106MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.6s · import 0.256s · 104MB
106MB installed
● package 106MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Calculator
from tblite.interface import Calculator

Initializes a `Calculator` for a specified tight-binding method, defines a simple H2 molecule, and performs an energy and force calculation, accessing results from the returned dictionary. Also shows an example with an explicit charge.

import numpy as np from tblite.interface import Calculator # Define the molecule species = ["H", "H"] positions = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.7]]) # Initialize the calculator with a specific method # Available methods include GFN1-xTB, GFN2-xTB, GFN-FF, etc. # Check official docs for a complete list. calc = Calculator(method="GFN2-xTB") # Perform the calculation result = calc.calculate(species, positions) # Access results from the dictionary print(f"Total energy: {result['energy']} Hartree") print(f"Forces (Hartree/Bohr):\n{result['forces']}") # Example with optional charge (default is 0) calc_charged = Calculator(method="GFN2-xTB") charged_result = calc_charged.calculate(species, positions, charge=1) print(f"Charged system energy: {charged_result['energy']} Hartree")
Debug
Known issues
breakingThe `calculate` method's return type changed from a tuple to a dictionary in v0.4.0. Direct unpacking or attribute access (e.g., `result.energy`) will fail.
fix
Update your code to access results via dictionary keys: `result = calc.calculate(...); energy = result['energy']`. Check the documentation for available keys.
affects: >=0.4.0
gotchaThe `Calculator` constructor requires a valid `method` string (e.g., 'GFN2-xTB'). Using an unknown or misspelled method name will lead to a `ValueError`.
fix
Ensure the `method` string exactly matches one of the supported methods listed in the tblite documentation. Common methods include 'GFN1-xTB', 'GFN2-xTB', 'GFN-FF'.
affects: all
gotchaMolecular positions must be provided as a NumPy array. Passing a standard Python list of lists will result in a `TypeError`.
fix
Convert your list of positions to a NumPy array before passing it to `calc.calculate`: `positions = np.array([[x1, y1, z1], ...])`.
affects: all
Upgrade
Version history
0.6.0latest on PyPI · released May 16, 2026
Audit
Dependencies
numpyrequiredRequired for array manipulations, particularly for molecular positions.
scipyrequiredUsed for certain numerical operations within the tight-binding calculations.
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
tblite — pip install tblite · libregistry