Class ExtendedPotential#

Inheritance Relationships#

Base Type#

Class Documentation#

class ExtendedPotential : public pele::CombinedPotential#

A wrapper for a combined potential that can switch from one potential to the sum of that potential and another.

Useful for extending the reach of the potential.

This class is useful for extending the reach of the potential. For example if you want to condition the newton’s method in flat regions, this potential should allow you to do so by adding a new potential to the sum of the old potential and the new potential.

Public Functions

inline ExtendedPotential(
std::shared_ptr<BasePotential> main_potential,
std::shared_ptr<BasePotential> extension_potential
)#

Construct a new Extended Potential object.

Parameters:
  • base_potential – The potential to extend

  • extended_potential – The potential to add to the base potential

inline void switch_on_extended_potential()#
inline void switch_off_extended_potential()#
inline bool get_use_extended_potential()#

get whether the extended potential is being used

inline virtual double get_energy(Array<double> const &x)#

get the energy of the extended potential

If the extended potential is switched on, the energy of the extended potential is returned.

Parameters:

x – The coordinates

Returns:

double The energy

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

compute the energy and gradient.

If not overloaded it will compute the numerical gradient

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.

inline virtual void get_hessian(Array<double> const &x, Array<double> &hess)#

compute the hessian.

If not overloaded it will call get_energy_gradient_hessian

inline void get_hessian_extended(Array<double> const &x, Array<double> &hess)#

Get the hessian of the extended potential independent of the flag.

This helps with convexity checks.

Parameters:
  • x –

  • hess –

inline size_t get_nfev_extension()#
inline size_t get_neev_extension()#
inline size_t get_nhev_extension()#