This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Rust_DFTB
rust_dftb is a Rust/Rayon implementation for DFTB-style calculations with a Python interface. The repository is intended for development and verification of the Rust backend, Python API, and ASE wrapper.
This package does not bundle Slater-Koster parameter files. Pass an external directory containing .skf files through skf_dir.
Requirements
- Python >= 3.10
- Rust toolchain >= 1.76, including
cargo maturin >= 1.5,<2- NumPy >= 1.23
- A BLAS/LAPACK backend
- Optional: ASE, for
rust_dftb.aseand the ASE examples
The default Cargo feature set uses openblas-system, so the build expects system OpenBLAS with CBLAS/LAPACKE headers and libraries. On Debian/Ubuntu-like systems this usually means installing the OpenBLAS development package before building.
Development install
python -m pip install -U pip maturin numpy
maturin develop --release --features python
For ASE support:
python -m pip install ase
For tests and development tools:
python -m pip install -e ".[dev]"
python -m pytest
cargo test
Minimal Python API example
import numpy as np
from rust_dftb import DftbCalculator, backend_info
z = np.array([1, 1], dtype=np.int64)
positions = np.array(
[[0.0, 0.0, 0.0], [0.74, 0.0, 0.0]],
dtype=np.float64,
)
print(backend_info())
calc = DftbCalculator(skf_dir="/path/to/skf", order=2, parallel=True)
print(calc.energy(z, positions))
print(calc.forces(z, positions))
For periodic calculations, pass a cell in Angstrom:
cell = np.eye(3) * 20.0
print(calc.energy(z, positions, cell_angstrom=cell))
print(calc.stress(z, positions, cell_angstrom=cell))
Minimal ASE example
from ase import Atoms
from rust_dftb.ase import ase_calculator
atoms = Atoms("H2", positions=[[0.0, 0.0, 0.0], [0.74, 0.0, 0.0]])
atoms.calc = ase_calculator(skf_dir="/path/to/skf", order=2, parallel=True)
print(atoms.get_potential_energy())
print(atoms.get_forces())
ASE-facing quantities use ASE conventions: positions and cells in Angstrom, energies in eV, forces in eV/Angstrom, and stress in eV/Angstrom^3. The lower-level Python API uses the native units documented in the implementation and examples.
Examples
More complete usage examples are in examples/:
python examples/python_api_all_levels.py --skf-dir /path/to/skf --structure water
python examples/ase_all_levels.py --skf-dir /path/to/skf --structure methane --levels dftb2
See examples/README.md for the longer walkthroughs.
References
The implementation and examples in this repository are related to the following DFTB, SCC-DFTB, DFTB3, multipole-extended DFTB, and ASE references.
-
D. Porezag, T. Frauenheim, T. Köhler, G. Seifert, and R. Kaschner, “Construction of tight-binding-like potentials on the basis of density-functional theory: Application to carbon,” Phys. Rev. B 51, 12947 (1995). DOI:
10.1103/PhysRevB.51.12947. -
M. Elstner, D. Porezag, G. Jungnickel, J. Elsner, M. Haugk, T. Frauenheim, S. Suhai, and G. Seifert, “Self-consistent-charge density-functional tight-binding method for simulations of complex materials properties,” Phys. Rev. B 58, 7260 (1998). DOI:
10.1103/PhysRevB.58.7260. -
M. Gaus, Q. Cui, and M. Elstner, “DFTB3: Extension of the self-consistent-charge density-functional tight-binding method (SCC-DFTB),” J. Chem. Theory Comput. 7, 931-948 (2011). DOI:
10.1021/ct100684s. -
V.-Q. Vuong, T. W. Williams, J. Li, Q. Cui, and I. S. Ufimtsev, “Multipole expansion of atomic electron density fluctuation interactions in the density-functional tight-binding method,” J. Chem. Theory Comput. 19, 8152-8171 (2023). DOI:
10.1021/acs.jctc.3c00778. -
A. H. Larsen et al., “The atomic simulation environment — a Python library for working with atoms,” J. Phys.: Condens. Matter 29, 273002 (2017). DOI:
10.1088/1361-648X/aa680e.
License
GPL-3.0-or-later.
Metadata
Release files for rust-dftb 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rust_dftb-0.1.1.tar.gz | 198.7 kB | Without provenance | Details for rust_dftb-0.1.1.tar.gz |
Release files / rust_dftb-0.1.1.tar.gz
| Download URL | rust_dftb-0.1.1.tar.gz |
|---|---|
| Size | 198.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fe89c8c9c3132deeb95a8a8bdcc43dae7e504c32c958844fc07de5069455ed5
|
|
BLAKE2b-256 checksum How to use checksums |
101cb0b79598f2fe7e5dae8f50d0b4d50d72c649666f1e838b12b543449595fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for rust-dftb 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.