deepmd.tf.infer.deep_dos

Module Contents

Classes

DeepDOS

Deep density of states model.

class deepmd.tf.infer.deep_dos.DeepDOS(model_file: str, *args: List[Any], auto_batch_size: bool | int | deepmd.utils.batch_size.AutoBatchSize = True, neighbor_list: ase.neighborlist.NewPrimitiveNeighborList | None = None, **kwargs: Dict[str, Any])[source]

Bases: deepmd.infer.deep_eval.DeepEval

Deep density of states model.

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.

property output_def: deepmd.dpmodel.output_def.ModelOutputDef

Get the output definition of this model.

property numb_dos: int

Get the number of DOS.

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 energy, force, and virial. If atomic is True, also return atomic energy and atomic virial.

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 energy and atomic virial, 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:
energy

The energy of the system, in shape (nframes,).

force

The force of the system, in shape (nframes, natoms, 3).

virial

The virial of the system, in shape (nframes, 9).

atomic_energy

The atomic energy of the system, in shape (nframes, natoms). Only returned when atomic is True.

atomic_virial

The atomic virial of the system, in shape (nframes, natoms, 9). Only returned when atomic is True.

get_numb_dos() int[source]