deepmd.infer.deep_property#

Classes#

DeepProperty

Properties of structures.

Module Contents#

class deepmd.infer.deep_property.DeepProperty(model_file: str, *args: Any, auto_batch_size: bool | int | deepmd.utils.batch_size.AutoBatchSize = True, neighbor_list: ase.neighborlist.NewPrimitiveNeighborList | None = None, **kwargs: Any)[source]#

Bases: deepmd.infer.deep_eval.DeepEval

Properties of structures.

Parameters:
model_filePath

The name of the frozen model file.

*argslist

Positional arguments.

auto_batch_sizebool or int or AutoBatchSize, default: True

If True, automatic batch size will be used. If int, it will be used as the initial batch size.

neighbor_listase.neighborlist.NewPrimitiveNeighborList, optional

The ASE neighbor list class to produce the neighbor list. If None, the neighbor list will be built natively in the model.

**kwargsdict

Keyword arguments.

output_def() deepmd.dpmodel.output_def.ModelOutputDef[source]#

Get the output definition of this model. But in property_fitting, the output definition is not known until the model is loaded. So we need to rewrite the output definition after the model is loaded. See detail in change_output_def.

change_output_def() None[source]#

Change the output definition of this model. In property_fitting, the output definition is known after the model is loaded. We need to rewrite the output definition and related information.

property task_dim: int[source]#

Get the output dimension.

eval(coords: numpy.ndarray, cells: numpy.ndarray | None, atom_types: list[int] | numpy.ndarray, atomic: bool = False, fparam: numpy.ndarray | None = None, aparam: numpy.ndarray | None = None, mixed_type: bool = False, **kwargs: dict[str, Any]) tuple[numpy.ndarray, Ellipsis][source]#

Evaluate properties. If atomic is True, also return atomic property.

Parameters:
coordsnp.ndarray

The coordinates of the atoms, in shape (nframes, natoms, 3).

cellsnp.ndarray

The cell vectors of the system, in shape (nframes, 9). If the system is not periodic, set it to None.

atom_typeslist[int] or np.ndarray

The types of the atoms. If mixed_type is False, the shape is (natoms,); otherwise, the shape is (nframes, natoms).

atomicbool, optional

Whether to return atomic property, by default False.

fparamnp.ndarray, optional

The frame parameters, by default None.

aparamnp.ndarray, optional

The atomic parameters, by default None.

mixed_typebool, optional

Whether the atom_types is mixed type, by default False.

**kwargsdict[str, Any]

Keyword arguments.

Returns:
property

The properties of the system, in shape (nframes, num_tasks).

get_task_dim() int[source]#

Get the output dimension.

get_intensive() bool[source]#

Get whether the property is intensive.

get_var_name() str[source]#

Get the name of the fitting property.