Commit dfeedf1c authored by Jakob Knollmueller's avatar Jakob Knollmueller
Browse files

line_energy docstrings started

parent c938f284
Pipeline #12195 passed with stage
in 4 minutes and 57 seconds
......@@ -22,7 +22,7 @@ from keepers import Loggable
class Energy(Loggable, object):
""" The Energy object provides the structure required for minimization schemes.
It is the abstract implementation of a scalar function with its gradient and curvature at some position.
The implementation of a scalar function with its gradient and curvature at some position.
Parameters
----------
......@@ -35,10 +35,11 @@ class Energy(Loggable, object):
The Field location in parameter space where value, gradient and curvature is evaluated.
value : float
The evaluation of the energy functional at given position.
gradient : Field
gradient : Field, float
The gradient at given position in parameter direction.
curvature : callable
An implicit operator encoding the curvature at given position.
A positive semi-definite operator or function describing the curvature of the potential
at given position.
Raises
------
......@@ -58,7 +59,6 @@ class Energy(Loggable, object):
Memorizing the evaluations of some quantities minimizes the computational effort
for multiple calls.
"""
def __init__(self, position):
self._cache = {}
......
......@@ -20,6 +20,33 @@ from .energy import Energy
class LineEnergy(Energy):
"""A Energy object restricting an underlying Energy along some descent direction.
Given some Energy and descent direction, its position is parametrized by a scalar
step size along the descent direction.
Parameters
----------
position : float
The step length parameter along the given line direction.
Attributes
----------
position : float
The step length along the given line direction.
value : float
The evaluation of the energy functional at given position.
gradient : float
The gradient along the line direction projected on the current line position.
curvature : callable
A positive semi-definite operator or function describing the curvature of the potential
at given position.
line_direction : field
Direction along which the movement is restricted. Does not have to be normalized.
energy : Energy
The underlying Energy at the resulting position along the line according to the step length.
"""
def __init__(self, position, energy, line_direction, zero_point=None):
super(LineEnergy, self).__init__(position=position)
self.line_direction = line_direction
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment