msmjax.kernels

Code for splitting interaction kernels into sum of partial kernels.

References

[1] Hardy, D. J.; Wolff, M. A.; Xia, J.; Schulten, K.; Skeel, R. D. Multilevel Summation with B-Spline Interpolation for Pairwise Interactions in Molecular Dynamics Simulations. J. Chem. Phys. 2016, 144 (11), 114112. https://doi.org/10.1063/1.4943868.

[2] Hardy, D. J. Multilevel Summation for the Fast Evaluation of Forces for the Simulation of Biomolecules (PhD thesis), University of Illinois at Urbana-Champaign, 2006.

class msmjax.kernels.SoftenerOneOverR(order)[source]

Class for constructing and evaluating softener for the 1/r kernel.

The softener is a function of a dimensionless argument rho that is equal to 1/rho for rho >= 1 and bounded and smooth for rho < 1.

Parameters:

order (int) – Order (as a function of s = rho**2) of the Taylor polynomial that the softening function consists of for rho < 1. In line with common spline terminology, its polynomial degree (as a function of s = rho**2) is equal to order - 1.

msmjax.kernels.split_one_over_r(max_level, level_zero_cutoff, softening_function)[source]

Split kernel 1/r in (max_level + 1) terms according to reference.

The splitting terms sum up to the Coulomb kernel 1/r like this: 1/r = g_0(r) + g_1(r) + g_2(r) + … + g_{max_order}(r)

Parameters:
  • max_level (int) – The number of splits to be performed.

  • level_zero_cutoff (float) – The cutoff radius of the level-zero kernel function.

  • softening_function (Callable) – The basic smoothing function for this splitting.

Return type:

list[Callable[[jax.typing.ArrayLike], Array]]

Returns:

A list of one-argument functions g_l with l from zero to max_order that represent the terms in the splitting of the interaction kernel. These have their respective cutoffs ‘built in’ already (in the sense that they evaluate to zero for distances beyond) and take their arguments in the same length units that level_zero_cutoff was supplied in.

Raises:

ValueError – If the arguments do not make sense.

msmjax.kernels._get_distances(extents_from_center, spacing_or_gridcell)[source]
msmjax.kernels._compute_one_stencil(function_values, omega, mode)[source]
Parameters:
  • function_values (Array | ndarray | bool_ | number | bool | int | float | complex)

  • omega (Array | ndarray | bool_ | number | bool | int | float | complex)

  • mode (str)

msmjax.kernels.make_construct_stencils(omega, n_levels_intermed, include_toplevel, scaled_spacings, cell_mode, k_lowest_intermed=None, extents_from_center_intermed=None, k_toplevel=None, grid_shape_toplevel=None)[source]
Return type:

Callable[[jax.typing.ArrayLike], list[Array]]

Parameters:
  • omega (Array | ndarray | bool_ | number | bool | int | float | complex)

  • n_levels_intermed (int)

  • include_toplevel (bool)

  • scaled_spacings (Array | ndarray | bool_ | number | bool | int | float | complex)

  • cell_mode (Literal['ortho', 'triclinic'])

  • k_lowest_intermed (Callable[[Array | ndarray | bool_ | number | bool | int | float | complex], Array])

  • extents_from_center_intermed (tuple[int, ...])

  • k_toplevel (Callable[[Array | ndarray | bool_ | number | bool | int | float | complex], Array])

  • grid_shape_toplevel (tuple[int, ...])