- class Energy(position)¶
Provides the functional used by minimization schemes.
The Energy object is an implementation of a scalar function including its gradient and metric at some position.
position (Field) – The input parameter of the scalar function.
An instance of the Energy class is defined at a certain location. If one is interested in the value, gradient or metric of the abstract energy functional one has to ‘jump’ to the new position using the at method. This method returns a new energy instance residing at the new position. By this approach, intermediate results from computing e.g. the gradient can safely be reused for e.g. the value or the metric.
Memorizing the evaluations of some quantities minimizes the computational effort for multiple calls.
Returns a new Energy object, initialized at position.
- property gradient_norm¶
L2-norm of the gradient at given position.
Returns the longest allowed step size along direction
direction (Field) – the search direction
the longest allowed step when starting from self.position along direction. If None, the step size is not limited.
- Return type
float or None
- property metric¶
implicitly defined metric. A positive semi-definite operator or function describing the metric of the potential at the given position.
- property position¶
selected location in parameter space.
The Field location in parameter space where value, gradient and metric are evaluated.
- property value¶
value of the functional.
The value of the energy functional at given position.