deepmd.tf.modifier.dipole_charge#

Classes#

Module Contents#

class deepmd.tf.modifier.dipole_charge.DipoleChargeModifier(model_name: str, model_charge_map: list[float], sys_charge_map: list[float], ewald_h: float = 1, ewald_beta: float = 1)[source]#

Bases: deepmd.tf.infer.deep_dipole.DeepDipoleOld, deepmd.tf.modifier.base_modifier.BaseModifier

Parameters:
model_name

The model file for the DeepDipole model

model_charge_map

Gives the amount of charge for the wfcc

sys_charge_map

Gives the amount of charge for the real atoms

ewald_h

Grid spacing of the reciprocal part of Ewald sum. Unit: A

ewald_beta

Splitting parameter of the Ewald sum. Unit: A^{-1}

modifier_prefix = 'dipole_charge'[source]#
model_name[source]#
model_charge_map[source]#
sys_charge_map[source]#
sel_type[source]#
ewald_h = 1[source]#
ewald_beta = 1[source]#
er[source]#
ext_dim = 3[source]#
t_ndesc[source]#
t_sela[source]#
sel_r[source]#
nnei_a[source]#
nnei_r[source]#
nnei[source]#
ndescrpt_a[source]#
ndescrpt_r[source]#
force = None[source]#
ntypes[source]#
serialize() dict[source]#

Serialize the modifier.

Returns:
dict

The serialized data

classmethod deserialize(data: dict) deepmd.tf.modifier.base_modifier.BaseModifier[source]#

Deserialize the modifier.

Parameters:
datadict

The serialized data

Returns:
BaseModel

The deserialized modifier

build_fv_graph() deepmd.tf.env.tf.Tensor[source]#

Build the computational graph for the force and virial inference.

_build_fv_graph_inner()[source]#
_enrich(dipole, dof=3)[source]#
_slice_descrpt_deriv(deriv)[source]#
eval(coord: numpy.ndarray, box: numpy.ndarray, atype: numpy.ndarray, eval_fv: bool = True) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]#

Evaluate the modification.

Parameters:
coord

The coordinates of atoms

box

The simulation region. PBC is assumed

atype

The atom types

eval_fv

Evaluate force and virial

Returns:
tot_e

The energy modification

tot_f

The force modification

tot_v

The virial modification

_eval_fv(coords, cells, atom_types, ext_f)[source]#
_extend_system(coord, box, atype, charge)[source]#
modify_data(data: dict, data_sys: deepmd.tf.utils.data.DeepmdData) None[source]#

Modify data.

Parameters:
data

Internal data of DeepmdData. Be a dict, has the following keys - coord coordinates - box simulation box - type atom types - find_energy tells if data has energy - find_force tells if data has force - find_virial tells if data has virial - energy energy - force force - virial virial

data_sysDeepmdData

The data system.