deepmd.tf.nvnmd.entrypoints.mapt

Module Contents

Classes

MapTable

Generate the mapping table describing the relastionship of

Functions

mapt(*[, nvnmd_config, nvnmd_weight, nvnmd_map])

Attributes

log

deepmd.tf.nvnmd.entrypoints.mapt.log[source]
class deepmd.tf.nvnmd.entrypoints.mapt.MapTable(config_file: str, weight_file: str, map_file: str)[source]

Generate the mapping table describing the relastionship of atomic distance, cutoff function, and embedding matrix.

three mapping table will be built:

\(r^2_{ji} \rightarrow s_{ji}\)
\(r^2_{ji} \rightarrow h_{ji}\)
\(r^2_{ji} \rightarrow \mathcal{G}_{ji}\)

where \(s_{ji}\) is cut-off function, \(h_{ji} = \frac{s(r_{ji})}{r_{ji}}\), and \(\mathcal{G}_{ji}\) is embedding matrix.

The mapping funciton can be define as:

\(y = f(x) = y_{k} + (x - x_{k}) * dy_{k}\)
\(y_{k} = f(x_{k})\)
\(dy_{k} = \frac{f(x_{k+1}) - f(x_{k})}{dx}\)
\(x_{k} \leq x < x_{k+1}\)
\(x_{k} = k * dx\)

where \(dx\) is interpolation interval.

Parameters:
config_file

input file name an .npy file containing the configuration information of NVNMD model

weight_file

input file name an .npy file containing the weights of NVNMD model

map_file

output file name an .npy file containing the mapping tables of NVNMD model

References

DOI: 10.1038/s41524-022-00773-z

build_map()[source]
mapping(x, dic_map, cfgs)[source]

Evaluate value by mapping table operation of tensorflow.

mapping2(x, dic_map, cfgs)[source]

Evaluate value by mapping table of numpy.

plot_lines(x, dic1, dic2=None)[source]

Plot lines to see accuracy.

build_map_coef(cfgs, x, ys, grads, grad_grads, Nr, Nc)[source]

Build mapping table coefficient cfgs: cfg list cfg = x0, x1, dx.

coef4: a x^3 + b x^2 + c x + d = y: / d = y0 | c = y0’ | b = (3 y1 - dx dy’ - 2dx y0’ - 3y0) / dx^2 a = (dx y1’ - 2 y1 + dx y0’ + 2 y0) / dx^3

cal_coef4(cfgs, x, y, dy)[source]

Build mapping table coefficient for one line coef4: a x^3 + b x^2 + c x + d = y: / d = y0 | c = y0’ | b = (3 y1 - dx dy’ - 2dx y0’ - 3y0) / dx^2 a = (dx y1’ - 2 y1 + dx y0’ + 2 y0) / dx^3.

build_grad(x, y, Nr, Nc)[source]

: Build gradient of tensor y of x.

build_u2s(r2)[source]

Build tensor s, s=s(r2).

build_u2s_grad()[source]

Build gradient of s with respect to u (r^2).

run_u2s()[source]

Build u->s graph and run it to get value of mapping table.

build_s2g(s)[source]

Build s->G s is switch function G is embedding net output.

build_s2g_grad()[source]

Build gradient of G with respect to s.

run_s2g()[source]

Build s-> graph and run it to get value of mapping table.

build_t2g()[source]

Build t->G t is chemical species of center atom and neighbor atom G is embedding net output of type.

run_t2g()[source]

Build t-> graph and run it to get value of mapping table.

build_embedding_net(xx, wbs, activation_fn=tf.tanh)[source]
build_davg_dstd()[source]
deepmd.tf.nvnmd.entrypoints.mapt.mapt(*, nvnmd_config: str | None = 'nvnmd/config.npy', nvnmd_weight: str | None = 'nvnmd/weight.npy', nvnmd_map: str | None = 'nvnmd/map.npy', **kwargs)[source]