xnn.cnn.featurizers.spherical.SphericalGrid#
- class xnn.cnn.featurizers.spherical.SphericalGrid(species, cutoff=10.0, radius=0.48, bandwidth=10, exponent=1.0, cutoff_fn=None)[source]#
Bases:
FeaturizerPer-atom spherical signals of the species-resolved neighbor potential.
- Parameters:
species (sequence of int) – Atomic numbers with a potential channel, in channel order.
cutoff (float, optional) – Neighbor-list radius of the sums (Angstrom), by default 10.0.
radius (float, optional) – Radius of the sphere around each atom, by default 0.48 (half the shortest interatomic distance of QM7).
bandwidth (int, optional) – Bandwidth
bof the grid (2bsamples per axis), by default 10.exponent (float, optional) – Power of the inverse distance, by default 1.0.
cutoff_fn (str or None, optional) –
"cosine"multiplies each neighbor’s potential by theCosineCutoffenvelope atcutoff;None(default) keeps the untruncated potential of the paper.
- Variables:
- channel_index(atomic_numbers)[source]#
Channel of every atom, raising for species without a channel.
- potential(atomic_numbers, edge_index, edge_vec)[source]#
Build the signals from tensors (the core reused by
forward()).- Parameters:
atomic_numbers (Tensor) – Per-atom atomic numbers, shape
(N,).edge_index (Tensor) – Edge index
(2, E); row 0 the neighbor, row 1 the central atom.edge_vec (Tensor) –
pos[dst] - pos[src]per edge, shape(E, 3); the neighbor sits at-edge_vecrelative to the center.
- Returns:
Shape
(N, n_channels, 2b, 2b)in the dtype ofedge_vec.- Return type:
Tensor
- forward(data)[source]#
Signals of every atom of a batch,
(N, n_channels, 2b, 2b).- Parameters:
data (AtomicGraph)
- Return type: