nifty8.minimization.quadratic_energy module#
- class QuadraticEnergy(position, A, b, _grad=None)[source]#
Bases:
Energy
The Energy for a quadratic form. The most important aspect of this energy is that its metric must be position-independent.
- apply_metric(x)[source]#
- Parameters:
x (
nifty8.field.Field
ornifty8.multi_field.MultiField
) – Argument for the metric operator- Returns:
Output of the metric operator
- Return type:
- at(position)[source]#
Returns a new Energy object, initialized at position.
- Parameters:
position (
nifty8.field.Field
) – Location in parameter space for the new Energy object.- Returns:
Energy object at new position.
- Return type:
- at_with_grad(position, grad)[source]#
Specialized version of at, taking also a gradient.
This custom method is meant for use within :class:ConjugateGradient` minimizers, which already have the gradient available. It saves time by not recomputing it.
- Parameters:
position (
nifty8.field.Field
) – Location in parameter space for the new Energy object.grad (
nifty8.field.Field
) – Energy gradient at the new position.
- Returns:
Energy object at new position.
- Return type:
- property gradient#
The gradient at given position.
- Type:
field
- property metric#
implicitly defined metric. A positive semi-definite operator or function describing the metric of the potential at the given position.
- Type:
- property value#
value of the functional.
The value of the energy functional at given position.
- Type:
float