relentless.optimize.ObjectiveFunction#

class relentless.optimize.ObjectiveFunction#

Abstract base class for the optimization objective function.

An ObjectiveFunction defines the objective function parametrized on one or more adjustable IndependentVariables. The function must also have a defined value and gradient for all values of its parameters.

Methods

compute(variables[, directory])

Evaluate the value and gradient of the objective function.

abstract compute(variables, directory=None)#

Evaluate the value and gradient of the objective function.

Parameters:
  • variables (Variable or tuple) – Variables to record in result.

  • directory (str or Directory) – The ouptut directory. In addition to simulation output, the pair potential design variables at the time of computation are saved (defaults to None).

Returns:

The result of the function.

Return type:

ObjectiveFunctionResult