tlm_adjoint.hessian

Module Contents

class tlm_adjoint.hessian.Hessian

Represents a Hessian associated with a given forward.

abstract action(M, dM, M0=None)

Compute (the conjugate of) a Hessian action on some \(\zeta\) using an adjoint of a tangent-linear. i.e. compute

\[\left( \frac{d}{dm} \left[ \frac{d \mathcal{J}}{d m} \zeta \right] \right)^{*,T}.\]
Parameters:
Mvariable or Sequence[variable, …]

Defines the control.

dMvariable or Sequence[variable, …]

Defines the direction \(\zeta\).

M0variable or Sequence[variable, …]

Defines the value of the control. M is used if not supplied.

Returns:
JComplex

Value of the functional.

dJvariable or tuple[variable, …]

Value of the directional derivative \(\left( d \mathcal{J} / d m \right) \zeta\).

ddJvariable or tuple[variable, …]

The (conjugate of) the Hessian action on \(\zeta\).

class tlm_adjoint.hessian.GeneralHessian(forward, *, manager=None)

Represents a Hessian associated with a given forward. Calls to GeneralHessian.action() re-run the forward.

Parameters:
forwardcallable

Accepts one or more variable arguments, and returns a scalar variable defining the functional.

managerEquationManager

Used to create an internal manager via EquationManager.new(). manager() is used if not supplied.

action(M, dM, M0=None)

Compute (the conjugate of) a Hessian action on some \(\zeta\) using an adjoint of a tangent-linear. i.e. compute

\[\left( \frac{d}{dm} \left[ \frac{d \mathcal{J}}{d m} \zeta \right] \right)^{*,T}.\]
Parameters:
Mvariable or Sequence[variable, …]

Defines the control.

dMvariable or Sequence[variable, …]

Defines the direction \(\zeta\).

M0variable or Sequence[variable, …]

Defines the value of the control. M is used if not supplied.

Returns:
JComplex

Value of the functional.

dJvariable or tuple[variable, …]

Value of the directional derivative \(\left( d \mathcal{J} / d m \right) \zeta\).

ddJvariable or tuple[variable, …]

The (conjugate of) the Hessian action on \(\zeta\).

class tlm_adjoint.hessian.GaussNewton(R_inv_action, B_inv_action=None)

Represents a Gauss-Newton approximation for a Hessian.

This defines a Hessian approximation

\[H = J^T R_\text{obs}^{-1} J + B^{-1},\]

where \(J\) is the forward Jacobian. In a variational assimilation approach \(R_\text{obs}^{-1}\) corresponds to the observational inverse covariance and \(B^{-1}\) corresponds to the background inverse covariance.

Parameters:
R_inv_actioncallable

Accepts one or more variables as arguments, defining a direction, and returns a variable or a Sequence of variables defining the conjugate of the action of \(R^{-1}\) on this direction. Arguments should not be modified.

B_inv_actioncallable

Accepts one or more variables as arguments, defining a direction, and returns a variable or a Sequence of variables defining the conjugate of the action of \(B^{-1}\) on this direction. Arguments should not be modified.

action(M, dM, M0=None)

Compute (the conjugate of) a Hessian action on some \(\zeta\), using the Gauss-Newton approximation for the Hessian. i.e. compute

\[\left[ J^T R_\text{obs}^{-1} J \zeta + B^{-1} \zeta \right]^{*,T}.\]
Parameters:
Mvariable or Sequence[variable, …]

Defines the control.

dMvariable or Sequence[variable, …]

Defines the direction \(\zeta\).

M0variable or Sequence[variable, …]

Defines the value of the control. M is used if not supplied.

class tlm_adjoint.hessian.GeneralGaussNewton(forward, R_inv_action, B_inv_action=None, *, manager=None)

Represents a Gauss-Newton approximation to a Hessian associated with a given forward. Calls to GaussNewton.action() re-run the forward.

Parameters:
forwardcallable

Accepts one or more variable arguments, and returns a variable or Sequence of variables defining the state.

R_inv_actioncallable

See GaussNewton.

B_inv_actioncallable

See GaussNewton.

managerEquationManager

Used to create an internal manager via EquationManager.new(). manager() is used if not supplied.