dispatch module

Full Documentation for hippynn.layers.pairs.dispatch module. Click here for a summary page.

System-by-system pair finders

class KDTreeNeighbors(dist_hard_max)[source]

Bases: _DispatchNeighbors

Node for finding pairs under periodic boundary conditions using Scipy’s KD Tree algorithm. Cell must be orthorhombic.

compute_one(positions, cell)[source]
class KDTreePairsMemory(skin, dist_hard_max=None, hard_dist_cutoff=None)[source]

Bases: PairMemory

Implementation of KDTreePairs with an added memory component.

Stores current pair indices in memory and reuses them to compute the pair distances if no particle has moved more than skin/2 since last pair calculation. Otherwise uses the _pair_indexer_class to recompute the pairs.

Increasing the value of ‘skin’ will increase the number of pair distances computed at each step, but decrease the number of times new pairs must be computed. Skin should be set to zero while training for fastest results.

forward(coordinates, nonblank, real_atoms, inv_real_atoms, cells, mol_index, n_molecules, n_atoms_max)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class NPNeighbors(dist_hard_max)[source]

Bases: _DispatchNeighbors

compute_one(positions, cell)[source]
class TorchNeighbors(dist_hard_max)[source]

Bases: _DispatchNeighbors

compute_one(positions, cell)[source]
neighbor_list_kdtree(cutoff, coords, cell)[source]

Use KD Tree implementation from scipy.spatial to find pairs under periodic boundary conditions with an orthorhombic cell.

neighbor_list_np(cutoff, coords, cell)[source]
wrap_points_np(coords, cell, inv_cell)[source]