Note: This is distinct from the inverse power law potential
\(U(r) = \epsilon (\sigma/r)^\alpha\) used in some fluid simulations.
Reference:
O’Hern, C. S., Silbert, L. E., Liu, A. J., & Nagel, S. R. (2003).
Jamming at zero temperature and zero applied stress: The epitome of
disorder. Physical Review E, 68(1), 011306.
https://doi.org/10.1103/PhysRevE.68.011306
Parameters:
dr (Array) – An ndarray of shape [n,m] of pairwise distances between particles.
sigma (Array | float) – Particle diameter. Should either be a floating point scalar or an
ndarray whose shape is [n,m].
epsilon (Array | float) – Interaction energy scale. Should either be a floating point scalar
or an ndarray whose shape is [n,m].
alpha (Array | float) – Exponent specifying interaction stiffness. Should either be a float
point scalar or an ndarray whose shape is [n,m].
unused_kwargs – Allows extra data (e.g. time) to be passed to the energy.
Lennard-Jones interaction between particles with a minimum at sigma.
Parameters:
dr (Array) – An ndarray of shape [n,m] of pairwise distances between particles.
sigma (Array | float) – Distance between particles where the energy has a minimum. Should
either be a floating point scalar or an ndarray whose shape is [n,m].
epsilon (Array | float) – Interaction energy scale. Should either be a floating point scalar
or an ndarray whose shape is [n,m].
unused_kwargs – Allows extra data (e.g. time) to be passed to the energy.
Morse interaction between particles with a minimum at sigma.
Parameters:
dr (Array) – An ndarray of shape [n,m] of pairwise distances between particles.
sigma (Array | float) – Distance between particles where the energy has a minimum. Should
either be a floating point scalar or an ndarray whose shape is [n,m].
epsilon (Array | float) – Interaction energy scale. Should either be a floating point scalar
or an ndarray whose shape is [n,m].
alpha (Array | float) – Range parameter. Should either be a floating point scalar or an
ndarray whose shape is [n,m].
unused_kwargs – Allows extra data (e.g. time) to be passed to the energy.
jax_md.energy.gupta_potential(displacement, p, q, r_0n, U_n, A, cutoff)[source]#
Gupta potential with default parameters for Au_55 cluster. Gupta
potential was introduced by R. P. Gupta [1]. This potential uses
parameters that were fit for bulk gold by Jellinek [2]. This
particular implementation of the Gupta potential was introduced by Garzon and
Posada-Amarillas [3].
Parameters:
displacement – Function to compute displacement between two positions.
p – Gupta potential parameter of the repulsive term that was fitted for
bulk gold.
q – Gupta potential parameter of the attractive term that was fitted for
bulk gold.
r_0n – Parameter that determines the length scale of the potential. This
value was particularly fit for gold clusters of size 55 atoms.
U_n – Parameter that determines the energy scale, fit particularly for
gold clusters of size 55 atoms.
A – Parameter that was obtained using the cohesive energy of the fcc gold
metal.
cutoff – Pairwise interactions that are farther than the cutoff distance will be
ignored.
Returns:
A function that takes in positions of gold atoms (shape [n,3] where n
is the number of atoms) and returns the total energy of the system in units
of eV.
Beest-Kramer-van Santen (BKS) potential [4] which is commonly used to
model silicas. This function computes the interaction between two
given atoms within the Buckingham form [5] , following the
implementation from Liu et al. [6] .
Parameters:
dr (Array) – An ndarray of shape [n,m] of pairwise distances between particles.
Q_sq (Array) – An ndarray of shape [n,m] of pairwise product of partial charges.
exp_coeff (Array) – An ndarray of shape [n,m] that sets the scale of the
exponential decay of the short-range interaction.
attractive_coeff (Array) – An ndarray of shape [n,m] for the coefficient of the
attractive 6th order term.
repulsive_coeff (Array) – An ndarray of shape [n,m] for the coefficient of the
repulsive 24th order term, to prevent the unphysical fusion of atoms.
coulomb_alpha (Array) – Damping parameter for the approximation of the long-range
coulombic interactions (a scalar).
cutoff (float) – Cutoff distance for considering pairwise interactions.
unused_kwargs – Allows extra data (e.g. time) to be passed to the energy.
The Stillinger-Weber (SW) potential [7] which is commonly used to
model silicon and similar systems. This function uses the default SW
parameters from the original paper. The SW potential was originally proposed
to model diamond in the diamond crystal phase and the liquid phase, and is
known to give unphysical amorphous configurations [8][9] .
For this reason, we provide a three_body_strength parameter. Changing this
number to 1.5 or 2.0 has been know to produce more physical amorphous
phase, preventing most atoms from having more than four nearest neighbors.
Note that this function currently assumes nearest-image-convention.
Parameters:
displacement (DisplacementFn) – The displacement function for the space.
sigma (float) – A scalar that sets the distance scale between neighbors.
A (float) – A scalar that determines the scale of two-body term.
B (float) – A scalar that determines the scale of the \(1 / r^p\) term.
lam (float) – A scalar that determines the scale of the three-body term.
epsilon (float) – A scalar that sets the total energy scale.
gamma (float) – A scalar used to fit the angle interaction.
three_body_strength (float) – A scalar that determines the relative strength
of the angular interaction. Default value is 1.0, which works well
for the diamond crystal and liquid phases. 1.5 and 2.0 have been used
to model amorphous silicon.
The Tersoff potential [1] which is commonly used to model
semiconducting materials. The Tersoff potential was originally proposed to
model various types of lattice with a simple functional form.
For this reason, Tersoff model was introduced bond-order function
to determine the strength of repulsive and attractive forces between atoms.
Parameters:
displacement (DisplacementFn) – The displacement function for the space.
params (list[Dict[str, Any]]) – A dictionary of parameters for the tersoff potential. Usually this
should be loaded from lammps using the
load_lammps_tersoff_parameters function.
species (Array | None) – An array of species. Currently only None is supported.
The Tersoff potential [1] which is commonly used to model
semiconducting materials. The Tersoff potential was originally proposed to
model various types of lattice with a simple functional form.
For this reason, Tersoff model was introduced bond-order function
to determine the strength of repulsive and attractive forces between atoms.
Parameters:
displacement (DisplacementFn) – The displacement function for the space.
box_size (float) – A float or vector specifying the size of the simulation box.
params (list[Dict[str, Any]]) – A dictionary of parameters for the tersoff potential. Usually this
should be loaded from lammps using the
load_lammps_tersoff_parameters function.
species (Array | None) – An array of species. Currently only None is supported.
dr_threshold (float) – A distance threshold that controls how often the neighor list
is recomputed.
fractional_coordinates (bool) – A boolean specifying whether coordinates are stored
in the unit cube.
Reads EAM parameters from a LAMMPS file and returns relevant spline fits.
This function reads single-element EAM potential fit parameters from a file
in DYNAMO funcl format. In summary, the file contains:
Line 1-3: Comments
Line 4: Number of elements and the element type
Line 5: The number of charge values that the embedding energy is evaluated
on (num_drho), interval between the charge values (drho), the number of
distances the pairwise energy and the charge density is evaluated on
(num_dr), the interval between these distances (dr), and the cutoff
distance (cutoff).
The lines that come after are the embedding function evaluated on num_drho
charge values, charge function evaluated at num_dr distance values, and
pairwise energy evaluated at num_dr distance values. Note that the pairwise
energy is multiplied by distance (in units of eV x Angstroms).
Interatomic potential as approximated by embedded atom model (EAM).
This code implements the EAM approximation to interactions between metallic
atoms. In EAM, the potential energy of an atom is given by two terms: a
pairwise energy and an embedding energy due to the interaction between the
atom and background charge density. The EAM potential for a single atomic
species is often determined by three functions:
Charge density contribution of an atom as a function of distance.
Energy of embedding an atom in the background charge density.
Pairwise energy.
These three functions are usually provided as spline fits, and we follow the
implementation and spline fits given by Mishin et al. [10]
Note that in current implementation, the three functions listed above
can also be expressed by a any function with the correct signature,
including neural networks.
Parameters:
displacement – A function that produces an ndarray of shape [n,m,spatial_dimension] of particle displacements from particle positions
specified as an ndarray of shape [n,spatial_dimension] and [m,spatial_dimension] respectively.
box_size – The size of the simulation box.
charge_fn (Callable[[Array], Array]) – A function that takes an ndarray of shape [n,m] of distances
between particles and returns a matrix of charge contributions.
embedding_fn (Callable[[Array], Array]) – Function that takes an ndarray of shape [n] of charges and
returns an ndarray of shape [n] of the energy cost of embedding an atom
into the charge.
pairwise_fn (Callable[[Array], Array]) – A function that takes an ndarray of shape [n,m] of distances
and returns an ndarray of shape [n,m] of pairwise energies.
cutoff – A float specifying the maximum interaction distance.
dr_threshold – A float specifying the halo in the neighbor list.
axis (Optional[Tuple[int, ...]]) – Specifies which axis the total energy should be summed over.
fractional_coordinates – A boolean specifying whether or not the coordinates
will be in the unit cube.
A tuple containing a function to build the neighbor list and function that
computes the EAM energy of a set of atoms with positions given by an
[n,spatial_dimension] ndarray.
displacement_fn (DisplacementFn) – Function to compute displacement between two positions.
r_cutoff (float) – A floating point cutoff; Edges will be added to the graph
for pairs of particles whose separation is smaller than the cutoff.
key (Array) – A JAX random key used to initialize model parameters.
nodes (Array | None) – None or an ndarray of shape [N,node_dim] specifying the state
of the nodes. If None this is set to the zeros vector. Often, for a
system with multiple species, this could be the species id.
spatial_dimension (int) – The spatial dimension of the system (default 3).
n_recurrences (int) – The number of steps of message passing in the graph network.
mlp_sizes (Tuple[int, ...]) – A tuple specifying the layer-widths for the fully-connected
networks used to update the states in the graph network.
r_cutoff (float) – A floating point cutoff; Edges will be added to the graph
for pairs of particles whose separation is smaller than the cutoff.
dr_threshold (float) – A floating point number specifying a “halo” radius that we use
for neighbor list construction. See neighbor_list for details.
key (Array) – A JAX random key used to initialize model parameters.
nodes (Array | None) – None or an ndarray of shape [N,node_dim] specifying the state
of the nodes. If None this is set to the zeros vector. Often, for a
system with multiple species, this could be the species id.
spatial_dimension (int) – The spatial dimension of the system (default 3).
n_recurrences (int) – The number of steps of message passing in the graph network.
mlp_sizes (Tuple[int, ...]) – A tuple specifying the layer-widths for the fully-connected
networks used to update the states in the graph network.
fractional_coordinates (bool) – A boolean specifying whether or not the coordinates
will be in the unit cube.
format (NeighborListFormat) – The format of the neighbor list. See partition.NeighborListFormat
for details. Only Dense and Sparse formats are accepted. If the
Dense format is used, then the graph network is constructed using the
JAX MD backend, otherwise Jraph is used.
**neighbor_kwargs – Additional kwargs forwarded to the neighbor list
constructor and to EnergyGraphNet (e.g. activation,
kernel_init, bias_init).
Returns:
A tuple (neighbor_fn,energy_fn) where
energy_fn(R,neighbor=nbrs)->scalar. The underlying NNX module is
accessible via energy_fn.model for training.
Takes an isotropic function and constructs a truncated function.
Given a function f:R->R, we construct a new function f':R->R such
that f'(r)=f(r) for r<r_onset, f'(r)=0 for r>r_cutoff, and
f(r) is \(C^1\) everywhere. To do this, we follow the approach outlined
in HOOMD Blue [11] (thanks to Carl Goodrich for the pointer). We
construct a function S(r) such that S(r)=1 for r<r_onset,
S(r)=0 for r>r_cutoff, and S(r) is \(C^1\). Then
f'(r)=S(r)f(r).
Parameters:
fn (Callable[..., Array]) – A function that takes an ndarray of distances of shape [n,m] as well
as varargs.
r_onset (float) – A float specifying the distance marking the onset of deformation.
r_cutoff (float) – A float specifying the cutoff distance.
Reads EAM parameters from a LAMMPS file and returns relevant spline fits.
This function reads single-element EAM potential fit parameters from a file
in DYNAMO funcl format. In summary, the file contains:
Line 1-3: Comments
Line 4: Number of elements and the element type
Line 5: The number of charge values that the embedding energy is evaluated
on (num_drho), interval between the charge values (drho), the number of
distances the pairwise energy and the charge density is evaluated on
(num_dr), the interval between these distances (dr), and the cutoff
distance (cutoff).
The lines that come after are the embedding function evaluated on num_drho
charge values, charge function evaluated at num_dr distance values, and
pairwise energy evaluated at num_dr distance values. Note that the pairwise
energy is multiplied by distance (in units of eV x Angstroms).