Skip to content

PET-MAD (UPET Backend)

Optional dependency

PetMadCalculator requires the petmad extra.

uv add "materialsframework[petmad]"
pip install "materialsframework[petmad]"

PetMadCalculator

PetMadCalculator(
    model: str = "pet-mad-s",
    version: str = "latest",
    checkpoint_path: str | None = None,
    device: Literal["cuda", "cpu", "mps"] = "cpu",
    **kwargs: Any,
)

Calculator for material property calculations and structure relaxation using PET-MAD models served by UPET.

Attributes:

Name Type Description
AVAILABLE_PROPERTIES list[str]

A list of properties that this calculator can compute, including "energy", "forces", and "stresses".

References
  • UPET: https://github.com/lab-cosmo/upet

Initializes the PetMadCalculator with the specified model and calculation settings.

Parameters:

Name Type Description Default
model str

PET-MLIP model to use. Default is "pet-mad-s". Ignored if checkpoint_path is provided.

'pet-mad-s'
version str

Version of the model to use. Default is "latest". Ignored if checkpoint_path is provided.

'latest'
checkpoint_path str

Path to the model checkpoint file. If not provided, the model will be downloaded using the "version" parameter.

None
device Literal['cuda', 'cpu', 'mps']

The device to use for calculations. Defaults to "cpu".

'cpu'
**kwargs Any

Additional keyword arguments passed to the BaseCalculator and BaseMDCalculator constructors.

{}

calculator

calculator() -> Calculator

Lazily builds the ASE Calculator object for the PET-MAD model, using UPET.

Returns:

Name Type Description
Calculator Calculator

The ASE Calculator object configured via UPET.