Class BasePotential#

Inheritance Relationships#

Derived Types#

Class Documentation#

class BasePotential#

basic potential interface for native potentials

Subclassed by pele::ATLJ, pele::BaseHarmonic, pele::BaseRadialGaussian, pele::CombinedPotential, pele::FlatHarmonic, pele::FrozenPotentialWrapper, pele::GaussianPot, pele::LAMMPSPotential, pele::LowestEigPotential, pele::MeanFieldPSpinSpherical< p >, pele::PairwisePotentialInterface, pele::PoweredCosineSum, pele::PythonPotential, pele::RBPotentialWrapper, pele::RosenBrock, pele::Saddle, pele::XCube

Public Functions

inline virtual ~BasePotential()#
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 get_energy_change(
Array<double> const &old_coords,
Array<double> const &new_coords,
std::vector<size_t> const&
)#

Return the change in energy when configuration A is changed to configuration B.

It also takes in the vector of indices of atoms changed to recalculate energies changed by those atoms.

inline virtual size_t get_ndim() const#
inline virtual bool find_rattlers(
pele::Array<double> const &minimum_coords,
Array<uint8_t> not_rattlers,
bool &jammed
)#
inline virtual double add_energy_gradient(
Array<double> const &x,
Array<double> &grad
)#

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

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(
Array<double> const &x,
std::vector<xsum_small_accumulator> &exact_grad
)#
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 void add_hessian(Array<double> const &x, Array<double> &hess)#
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 double get_energy_gradient_hessian_rattlers(
Array<double> const &x,
Array<double> &grad,
Array<double> &hess,
Array<uint8_t> not_rattlers
)#
inline virtual double get_energy_gradient(
Array<double> const &x,
Array<double> &grad,
Array<uint8_t> not_rattlers
)#
inline virtual void numerical_gradient(
Array<double> const &x,
Array<double> &grad,
double eps = 1e-6
)#

compute the numerical 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 virtual void numerical_hessian(
Array<double> const &x,
Array<double> &hess,
double eps = 1e-6
)#

compute the numerical gradient

inline virtual double compute_norm(pele::Array<double> const &x)#

compute a meaningful norm of all coordinates