deepmd.pt.modifier#
Submodules#
Classes#
Base class for data modifier. |
Functions#
|
Package Contents#
- class deepmd.pt.modifier.BaseModifier(use_cache: bool = True)[source]#
Bases:
torch.nn.Module,make_base_modifier()Base class for data modifier.
- modifier_type = 'base'#
- jitable = True#
- use_cache = True#
- classmethod deserialize(data: dict) BaseModifier[source]#
Deserialize the modifier.
- Parameters:
- data
dict The serialized data
- data
- Returns:
BaseModifierThe deserialized modifier
- abstractmethod forward(coord: torch.Tensor, atype: torch.Tensor, box: torch.Tensor | None = None, fparam: torch.Tensor | None = None, aparam: torch.Tensor | None = None, do_atomic_virial: bool = False, charge_spin: torch.Tensor | None = None) dict[str, torch.Tensor][source]#
Compute energy, force, and virial corrections.
- modify_data(data: dict[str, deepmd.dpmodel.array_api.Array | float], data_sys: deepmd.utils.data.DeepmdData) None[source]#
Modify data of single frame.
- Parameters:
- data
Internal data of DeepmdData. Be a dict, has the following keys - coord coordinates (nat, 3) - box simulation box (9,) - atype atom types (nat,) - fparam frame parameter (nfp,) - aparam atom parameter (nat, nap) - find_energy tells if data has energy - find_force tells if data has force - find_virial tells if data has virial - energy energy (1,) - force force (nat, 3) - virial virial (9,)