Class PoweredCosineSum#

Inheritance Relationships#

Base Type#

Class Documentation#

class PoweredCosineSum : public pele::BasePotential#

Negative cosine sum function for testing basin volume calculations.

Yields a hypercubic basin with volume period^dim. We also add a power to the energy to ensure that the hessian isn’t diagonal. The full potential is given by

\[V(x) = \left(\mathrm{offset} + \sum_i \left[1-\cos(2\pi x_i/\mathrm{period})\right]\right)^{\mathrm{power}} \]
The offset ensures that the hessian is smooth if power goes below 0.

Public Functions

inline PoweredCosineSum(
size_t dim,
double period = 1,
double pow = 0.5,
double offset = 1.0
)#
inline virtual ~PoweredCosineSum()#
inline virtual double get_energy(Array<double> const &x)#

Return the energy of configuration x.

This is the only function which must be overloaded

inline virtual double add_energy_gradient(
const Array<double> &x,
Array<double> &grad
)#

compute the energy and gradient, but don’t initialize the gradient to zero

inline virtual double get_energy_gradient(
const Array<double> &x,
Array<double> &grad
)#

compute the energy and gradient.

If not overloaded it will compute the numerical gradient

inline virtual void add_hessian(const Array<double> &x, Array<double> &hess)#
inline virtual double add_energy_gradient_hessian(
Array<double> const &x,
Array<double> &grad,
Array<double> &hess
)#

compute the energy, gradient, and Hessian, but don’t initialize the gradient or hessian to zero

inline virtual double get_energy_gradient_hessian(
Array<double> const &x,
Array<double> &grad,
Array<double> &hess
)#

compute the energy and gradient and Hessian.

If not overloaded it will compute the Hessian numerically and use get_energy_gradient to get the energy and gradient.