Table

class hoomd.md.pair.Table(nlist, default_r_cut=None)

Bases: Pair

Tabulated pair force.

Parameters:

Table computes the tabulated pair force on every particle in the simulation state.

The force \(\vec{F}\) is:

\[\begin{split}\vec{F}(\vec{r}) = \begin{cases} 0 & r < r_{\mathrm{min}} \\ F_\mathrm{table}(r)\hat{r} & r_{\mathrm{min}} \le r < r_{\mathrm{cut}} \\ 0 & r \ge r_{\mathrm{cut}} \\ \end{cases}\end{split}\]

and the potential \(U(r)\) is:

\[\begin{split}U(r) = \begin{cases} 0 & r < r_{\mathrm{min}} \\ U_\mathrm{table}(r) & r_{\mathrm{min}} \le r < r_{\mathrm{cut}} \\ 0 & r \ge r_{\mathrm{cut}} \\ \end{cases}\end{split}\]

where \(\vec{r}\) is the vector pointing from one particle to the other in the pair, r_min is defined in params, and r_cut is defined in Pair.r_cut.

Provide \(F_\mathrm{table}(r)\) and \(U_\mathrm{table}(r)\) on evenly spaced grid points points between \(r_{\mathrm{min}}\) and \(r_{\mathrm{cut}}\). Table linearly interpolates values when \(r\) lies between grid points and between the last grid point and \(r=r_{\mathrm{cut}}\). The force must be commensurate with the potential: \(F = -\frac{\partial U}{\partial r}\).

Table does not support energy shifting or smoothing modes.

Note

For potentials that diverge near r=0, to set r_min to a non-zero value.

Note

The implicitly defined \(r\) values are those that would be returned by numpy.linspace(r_min, r_cut, len(U), endpoint=False).

Tip

Define non-interacting potentials with:

table.params[(type1, type2)] = dict(r_min=0, U=[0], F=[0])
table.r_cut[(type1, type2)] = 0

There must be at least one element in U and F, and the r_cut value of 0 disables the interaction entirely.


Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members inherited from Force:

additional_energy

Additional energy term. Read more...

additional_virial

Additional virial tensor term \(W_\mathrm{additional}\). Read more...

cpu_local_force_arrays

Local force arrays on the CPU. Read more...

energies

Energy contribution \(U_i\) from each particle. Read more...

energy

The potential energy \(U\) of the system from this force. Read more...

forces

The force \(\vec{F}_i\) applied to each particle. Read more...

gpu_local_force_arrays

Local force arrays on the GPU. Read more...

torques

The torque \(\vec{\tau}_i\) applied to each particle. Read more...

virials

Virial tensor contribution \(W_i\) from each particle. Read more...


Members inherited from Pair:

nlist

Neighbor list used to compute the pair force. Read more...

mode

Energy smoothing/cutoff mode. Read more...

r_cut

Cuttoff radius beyond which the energy and force are 0. Read more...

r_on

Radius at which the XPLOR smoothing function starts. Read more...

compute_energy()

Compute the energy between two sets of particles. Read more...


Members defined in Table:

params

The potential parameters. The dictionary has the following keys:

  • r_min (float, required) - the minimum distance to apply the tabulated potential, corresponding to the first element of the energy and force arrays \([\mathrm{length}]\).

  • U ((N,) numpy.ndarray of float, required) - the tabulated energy values \([\mathrm{energy}]\).

  • F ((N,) numpy.ndarray of float, required) - the tabulated force values \([\mathrm{force}]\). Must have the same length as U.

Type:

TypeParameter [ tuple [particle_type, particle_type], dict]