function.so.lennard_jones

function.so.lennard_jones(X, n_atoms=13)

Lennard-Jones Atomic Cluster Potential Energy.

Calculates the potential energy of a cluster of N atoms interacting via the Lennard-Jones potential. The optimization problem involves finding the atomic coordinates that minimize the total potential energy. This is a classic benchmark problem known for its high difficulty due to the exponential growth of local minima with N.

Input Domain Handling

The function accepts inputs in the range [0, 1] and internally maps them to the search domain [-2, 2] for each coordinate.

Parameters

Name Type Description Default
X np.ndarray Input points. - Shape (n_samples, 3 * n_atoms) for batch evaluation. - Shape (3 * n_atoms,) for single evaluation. The input represents the flattened [x1, y1, z1, x2, y2, z2, …] coordinates. required
n_atoms int Number of atoms in the cluster. Defaults to 13. 13

Returns

Name Type Description
np.ndarray np.ndarray: Potential energy values. Shape (n_samples,).

Raises

Name Type Description
ValueError If input dimensions do not match 3 * n_atoms.

Note

  • Global minimum for N=13: E ≈ -44.3268
  • Search domain: [-2, 2]^(3N) (mapped from [0, 1])
  • Characteristics: Extremely rugged landscape, non-convex, many local minima.

Examples

Single point evaluation (random configuration):

from spotoptim.function import lennard_jones
import numpy as np
rng = np.random.default_rng(42)
X = rng.random(39)  # 13 atoms * 3 coords, in [0, 1]
lennard_jones(X)
array([74.35227958])

Batch evaluation:

from spotoptim.function import lennard_jones
import numpy as np
rng = np.random.default_rng(42)
X = rng.random((5, 39))
lennard_jones(X).shape
(5,)

References

Wales, D. J., & Doye, J. P. (1997). Global optimization by basin-hopping and the lowest energy structures of Lennard-Jones clusters containing up to 110 atoms. The Journal of Physical Chemistry A, 101(28), 5111-5116.