InteratomicPotentialDataset¶
-
class
hdnnpy.dataset.property.interatomic_potential_dataset.InteratomicPotentialDataset(order, structures)[source]¶ Bases:
hdnnpy.dataset.property.property_dataset_base.PropertyDatasetBaseInteratomic potential dataset for property of HDNNP.
It accepts 0 or 3 for
order.Notes
Currently you cannot use order = 2 or 3, since it is not implemented.
Parameters: - order (int) – passed to super class.
- structures (list [AtomicStructure]) – passed to super class.
-
__getitem__(item)¶ Return property data this instance has.
If
itemis string, it returns corresponding property. Available keys can be obtained bypropertiesattribute. Otherwise, it returns a list of property sliced byitem.
-
__len__()¶ Number of atomic structures given at initialization.
-
calculate_properties(structure)[source]¶ Calculate required properties for a structure data.
Parameters: structure (AtomicStructure) – A structure data to calculate properties. Returns: Calculated properties. The length is the same as ordergiven at initialization.Return type: list [ndarray]
-
clear()¶ Clear up instance variables to initial state.
-
load(file_path, verbose=True, remake=False)¶ Load dataset from .npz format file.
Only root MPI process load dataset.
It validates following compatibility between loaded dataset and atomic structures given at initialization.
- length of data
- elemental composition
- elements
- tag
It also validates that loaded dataset satisfies requirements.
- order
Parameters: Raises: AssertionError– If loaded dataset is incompatible with atomic structures given at initialization.ValueError– If loaded dataset is lacking in any property andremake=False.
-
make(verbose=True)¶ Calculate & retain property dataset
It calculates property dataset by data-parallel using MPI communication.The calculated dataset is retained in only root MPI process.Each property values are divided by
COEFFICIENTSwhich is unique to each property dataset class.Parameters: verbose (bool, optional) – Print log to stdout.
-
save(file_path, verbose=True)¶ Save dataset to .npz format file.
Only root MPI process save dataset.
Parameters: Raises: RuntimeError– If this instance do not have any data.
-
PROPERTIES= ['energy', 'force', 'harmonic', 'third_order']¶ Names of properties for each derivative order.
Type: list [str]
-
UNITS= ['eV/atom', 'eV/$\\AA$', 'eV/$\\AA$^2', 'eV/$\\AA$^3']¶ Units of properties for each derivative order.
Type: list [str]
-
elemental_composition¶ Elemental composition of atomic structures given at initialization.
Type: list [str]