An unofficial Python/ASE interface for the g-xTB semi-empirical method.
Enables easy usage of g-xTB within Python scripts. Features automatic binary configuration and full ASE calculator support.
This package is a wrapper around the g-xTB method and builds upon existing ASE interface concepts.
The binary and parameters wrapped in this package are obtained from the Grimme Lab repository.
- Preprint: g-xTB: A General-Purpose Extended Tight-Binding Electronic Structure Method For the Elements H to Lr (Z=1–103)
- Source Repository: grimme-lab/g-xtb (Commit:
df43e00)
The ASE calculator implementation in this package is inspired by and references the work of:
- g-xtb-ase: stefanbringuier/g-xtb-ase
install via pip:
pip install pygxtbfrom ase.build import molecule
from pygxtb import PygxTB
# Create a water molecule
atoms = molecule("H2O")
# Attach the calculator
# It automatically finds the binary/parameters inside the package
calc = PygxTB()
atoms.calc = calc
# Calculate Potential Energy
energy = atoms.get_potential_energy()
print(f"Energy: {energy:.6f} eV")
# Calculate Forces
forces = atoms.get_forces()
print("Forces (eV/Ang):")
print(forces)
# Access Dipole Moment
dipole = atoms.get_dipole_moment()
print(f"Dipole: {dipole}")GNU General Public License v3 (GPLv3)
See LICENSE for details.