xnn.ffnn.models.reaxff_kernels#

Triton kernels of the ReaxFF terms (the fast path of ReaxFF), the energies of one evaluation from the positions: the tapered van der Waals and shielded Coulomb pairs. Their backward kernels are generated from these forward kernels (tools/generate_amoeba_derivatives.py --target reaxff: the reverse sweep with the positions and the inputs declared as the loaded arrays), so each kernel here is written once.

Functions

eem_matrix(src, dst, off, valid, gm3, pos, ...)

The pair coefficients of _eem_matrix() into out (the model's precision).

eem_products(src, dst, g[, pairs])

The matrix-vector product x -> H x (H[dst, src] += g) of _eem_products() for (N, 2) blocks; pairs the list holds each pair once and H is symmetric (_eem_products_pairs()).

eem_rows(ptr, col, g[, idx])

The matrix-vector product x -> H x for (N, 2) blocks of the compressed-row off-diagonal part of the EEM matrix (row r holds the entries ptr[r] to ptr[r + 1], columns col, values g, or g[idx] with idx) of _eem_rows().

hbond_cross(d_ids, d_key, b_src, a_src, ...)

The hydrogen-bond candidates on the CPU as the grouped cross product of _group_cross() gives them (by hydrogen, its X-H bonds d_ids (hydrogen d_key) times its H...Z pairs (hydrogen a_key, Z a_src, offsets a_off), Z not X): the bonds, X, H, Z and the offsets (C, 3).

nonbonded_table(rvdw, alfa, devdw, gammaw, ...)

The (S, S, NB_COLUMNS) table of _nonbonded_forward() from the per-species-pair parameters (S, S) each (differentiable in them).

pair_candidates(ptr, k, r, species, bt, ...)

A CPU stepper's candidates from its half list by rows (ptr, partners k, distances r): the bond candidates (within the per-species-pair distance bt (S, S), indexed by the partner's species first; negative for no bond), and with the hydrogen-bond flags flag (S,) (1 hydrogen, 2 acceptor) the pairs within hb_cut of a hydrogen partner and an acceptor first atom, then those of the reverse; pair indices in increasing order (as nonzero gives them).

pair_geometry(i, k, shifts, pos, cell)

The distances (E,) and Cartesian image offsets (E, 3) (zero without a cell) of a pair list in the positions' precision (_pair_geometry()).

Classes

CGSolver(ptr, nbr, g, diag, b)

Jacobi-preconditioned conjugate gradients for the two right-hand sides of the EEM system on the CPU, from the half list's matrix values (each pair once, its rows ptr, nbr): an iteration is two runs of prepared kernel launches (the product, its dot and the update in one parallel region; the new direction in another) with the scalars in small tensors.