Skip to content

Interatomic potentials

beignet.lennard_jones_potential

lennard_jones_potential(input, sigma, epsilon)

Lennard-Jones potential.

Parameters:

Name Type Description Default
input Tensor, shape=(n, m)

Pairwise distances between particles.

required
sigma float | Tensor, shape=(n, m)

Distance where the potential energy, :math:V, is zero.

required
epsilon float | Tensor, shape=(n, m)

Depth of the potential well.

required

Returns:

Name Type Description
output Tensor, shape=(n, m)

Energies.

Source code in src/beignet/_lennard_jones_potential.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def lennard_jones_potential(
    input: Tensor,
    sigma: float | Tensor,
    epsilon: float | Tensor,
) -> Tensor:
    r"""
    Lennard-Jones potential.

    Parameters
    ----------
    input : Tensor, shape=(n, m)
        Pairwise distances between particles.

    sigma : float | Tensor, shape=(n, m)
        Distance where the potential energy, :math:`V`, is zero.

    epsilon : float | Tensor, shape=(n, m)
        Depth of the potential well.

    Returns
    -------
    output : Tensor, shape=(n, m)
        Energies.
    """
    a = sigma / input

    b = a**6.0
    c = b**2.0

    return 4.0 * epsilon * (c - b)