Lennard Jones Cluster#

New in version 2.11.

#include <pagmo/problems/lennard_jones.hpp>

../../../_images/lennard_jones.jpg

A cluster of atoms.#

class lennard_jones#

This is a box-constrained continuous single-objective problem. It represents the minimization of the energy of a cluster of atoms assuming a Lennard-Jones potential between each pair. The complexity for computing the objective function scales with the square of the number of atoms.

The decision vector contains \([z_2, y_3, z_3, x_4, y_4, z_4, ....]\) as the cartesian coordinates \(x_1, y_1, z_1, x_2, y_2\) and \(x_3\) are fixed to be zero.

See: http://doye.chem.ox.ac.uk/jon/structures/LJ.html

lennard_jones(unsigned atoms = 3u)#

Constructs a UDP representing the Lennard Jones Clusters global optimisation problem.

Parameters

atoms – the number of atoms in the cluster.

Throws

std::invalid_argument – if atoms is < 3

vector_double fitness(const vector_double &x) const#

Computes the fitness for this UDP. The complexity is \(n^2\), where \(n^2\) is the number of atoms.

Parameters

x – the decision vector.

Returns

the fitness of x.

std::pair<vector_double, vector_double> get_bounds() const#

Returns the box-bounds for this UDP.

Returns

the lower and upper bounds for each of the decision vector components.

std::string get_name() const#

Returns the problem name.

Returns

a string containing the problem name: “Lennard Jones Cluster (atoms atoms)”.