Quick start¶
Install UPET with pip:
pip install upet
Then run a single-point energy and force evaluation on a bulk silicon cell
using the ASE-compatible UPETCalculator:
from upet.ase import UPETCalculator
from ase.build import bulk
atoms = bulk("Si", cubic=True, a=5.43, crystalstructure="diamond")
calculator = UPETCalculator(model="pet-mad-s", version="1.6.0", device="cpu")
atoms.calc = calculator
energy = atoms.get_potential_energy()
forces = atoms.get_forces()
For DOS calculations, you can use the PETMADDOSCalculator:
from upet.ase.dos import PETMADDOSCalculator
from ase.build import bulk
atoms = bulk("Si", cubic=True, a=5.43, crystalstructure="diamond")
calculator = PETMADDOSCalculator(version="latest", device="cpu")
results = calculator.calculate(atoms)
where the keys in the results dictionary include dos_raw, dos_denoised,
fermi_level and bandgap. Each key corresponds to its output quantity, e.g.
dos_denoised is the denoised DOS obtained by applying a denoising algorithm to the
raw predicted DOS. The DOS has units of states/eV and is projected on an energy grid
with intervals of 0.05 eV. The bandgap and Fermi level have units of eV.
In both examples, the first call downloads the model checkpoint from the HuggingFace repository and caches it locally, so subsequent calls are fast.
Next steps¶
See Installation for the full list of installation methods (PyPI, GitHub,
uv, pinning a specific version).See Usage for the complete feature surface: ASE workflows, batched evaluation with
metatrain, LAMMPS, NVIDIA ALCHEMI Toolkit, i-PI, TorchSim, and GROMACS.See Available models for the list of available pre-trained models and their recommended use cases.