relentless.simulate.PairPotentialTabulator#
- class relentless.simulate.PairPotentialTabulator(potentials, start, stop, num, neighbor_buffer)#
Tabulate one or more pair potentials.
Enables evaluation of energy, force, and derivative at different positional values (i.e.
r).- Parameters:
potentials (
PairPotentialor array_like) – The pair potential(s) to be tabulated. If array_like, all elements must bePairPotentials.start (float) – The minimum value of
rat which to tabulate.stop (float) – The maximum value of
rat which to tabulate.num (int) – The number of points (value of
r) at which to tabulate and evaluate the potential.neighbor_buffer (float) – Buffer radius used in computing the neighbor list.
Methods
derivative(pair, var[, x])Evaluates and accumulates derivative for all potentials.
energy(pair[, x])Evaluates and accumulates energy for all potentials.
force(pair[, x])Evaluates and accumulates force for all potentials.
pairwise_energy_and_force(types[, x, tight, ...])Compute pairwise matrix of energy and force.
Attributes
The amount to be added to
rmaxto search for particles while computing the neighbor list.The number of points at which to tabulate/evaluate the potential, must be at least 2.
The individual potentials that are tabulated.
x values spaced linearly from
start**2` to ``stop**2.The
xvalue at which to start tabulation.The
xvalue at which to stop tabulation.- derivative(pair, var, x=None)#
Evaluates and accumulates derivative for all potentials.
Shifts the derivative to be 0 at
rmax.- Parameters:
- Returns:
Accumulated derivative at each
rvalue.- Return type:
array_like
- energy(pair, x=None)#
Evaluates and accumulates energy for all potentials.
Shifts the energy to be 0 at
stop.
- force(pair, x=None)#
Evaluates and accumulates force for all potentials.
- property neighbor_buffer#
The amount to be added to
rmaxto search for particles while computing the neighbor list.- Type:
- property num#
The number of points at which to tabulate/evaluate the potential, must be at least 2.
- Type:
- pairwise_energy_and_force(types, x=None, tight=False, minimum_num=2)#
Compute pairwise matrix of energy and force.
- Parameters:
types (array_like) – Types to include in matrix.
x (float or array_like) – Pairwise distances at which to evaluate energy and force. Default of
Nonewill use a linear space fromstarttostop.tight (bool) – If
True, trim zeros from the ends of the energies and forces using a combination of cutoffs and evaluated potential. This option can only be used whenxis an array.minimum_num (int) – When
tightisTrue, the minimum number of points to include, even if they could be trimmed.
- Returns:
float or
numpy.ndarray– Pairwise distance.PairMatrix– Pairwise energies.PairMatrix– Pairwise forces.
- property potentials#
The individual potentials that are tabulated.
- Type:
array_like
- property squared_space#
x values spaced linearly from
start**2` to ``stop**2.- Type:
array_like