Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
dfeedf1c
Commit
dfeedf1c
authored
May 09, 2017
by
Jakob Knollmueller
Browse files
line_energy docstrings started
parent
c938f284
Pipeline
#12195
passed with stage
in 4 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/energies/energy.py
View file @
dfeedf1c
...
...
@@ -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
=
{}
...
...
nifty/energies/line_energy.py
View file @
dfeedf1c
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment