critical_power_curvature.py 1.59 KB
Newer Older
1 2 3
from ...operators.endomorphic_operator import EndomorphicOperator
from ...operators.invertible_operator_mixin import InvertibleOperatorMixin
from ...operators.diagonal_operator import DiagonalOperator
4 5 6


class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
Jakob Knollmueller's avatar
Jakob Knollmueller committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20
    """The curvature of the CriticalPowerEnergy.

    This operator implements the second derivative of the
    CriticalPowerEnergy used in some minimization algorithms or
    for error estimates of the powerspectrum.


    Parameters
    ----------
    theta: Field,
        The map and inverse gamma prior contribution to the curvature.
    T : SmoothnessOperator,
        The smoothness prior contribution to the curvature.
    """
21 22 23

    # ---Overwritten properties and methods---

24
    def __init__(self, theta, T, inverter=None, preconditioner=None, **kwargs):
25

Jakob Knollmueller's avatar
Jakob Knollmueller committed
26
        self.theta = DiagonalOperator(theta.domain, diagonal=theta)
27
        self.T = T
Jakob Knollmueller's avatar
Jakob Knollmueller committed
28 29
        if preconditioner is None:
            preconditioner = self.theta.inverse_times
Jakob Knollmueller's avatar
Jakob Knollmueller committed
30
        self._domain = self.theta.domain
31 32
        super(CriticalPowerCurvature, self).__init__(
                                                 inverter=inverter,
33 34
                                                 preconditioner=preconditioner,
                                                 **kwargs)
35 36 37 38 39 40

    def _times(self, x, spaces):
        return self.T(x) + self.theta(x)

    # ---Mandatory properties and methods---

41 42 43 44 45 46 47 48 49 50 51
    @property
    def domain(self):
        return self._domain

    @property
    def self_adjoint(self):
        return True

    @property
    def unitary(self):
        return False