critical_power_curvature.py 1.52 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, preconditioner=None, **kwargs):
Martin Reinecke's avatar
Martin Reinecke committed
25
        self.theta = DiagonalOperator(theta)
26
        self.T = T
Jakob Knollmueller's avatar
Jakob Knollmueller committed
27
28
        if preconditioner is None:
            preconditioner = self.theta.inverse_times
29
30
        super(CriticalPowerCurvature, self).__init__(
                                                 inverter=inverter,
31
32
                                                 preconditioner=preconditioner,
                                                 **kwargs)
33

34
    def _times(self, x):
35
36
37
38
        return self.T(x) + self.theta(x)

    # ---Mandatory properties and methods---

39
40
    @property
    def domain(self):
Martin Reinecke's avatar
Martin Reinecke committed
41
        return self.theta.domain
42
43
44
45
46
47
48
49

    @property
    def self_adjoint(self):
        return True

    @property
    def unitary(self):
        return False