glimix_core/cov/_kron2sum.py
def _LhD(self):
        """
        Implements Lₕ and D.

        Returns
        -------
        Lh : ndarray
            Uₕᵀ S₁⁻½ U₁ᵀ.
        D : ndarray
            (Sₕ ⊗ Sₓ + Iₕₓ)⁻¹.
        """
        from numpy_sugar.linalg import ddot

        self._init_svd()
        if self._cache["LhD"] is not None:
            return self._cache["LhD"]
        S1, U1 = self.C1.eigh()
        U1S1 = ddot(U1, 1 / sqrt(S1))
        Sh, Uh = eigh(U1S1.T @ self.C0.value() @ U1S1)
        self._cache["LhD"] = {
            "Lh": (U1S1 @ Uh).T,
            "D": 1 / (kron(Sh, self._Sx) + 1),
            "De": 1 / (kron(Sh, self._Sxe) + 1),
        }
        return self._cache["LhD"]
def _LhD(self):
        """
        Implements Lₕ and D.

        Returns
        -------
        Lh : ndarray
            Uₕᵀ S₁⁻½ U₁ᵀ.
        D : ndarray
            (Sₕ ⊗ Sₓ + Iₕₓ)⁻¹.
        """
        from numpy_sugar.linalg import ddot

        self._init_svd()
        if self._cache["LhD"] is not None:
            return self._cache["LhD"]
        S1, U1 = self.C1.eigh()
        U1S1 = ddot(U1, 1 / sqrt(S1))
        Sh, Uh = eigh(U1S1.T @ self.C0.value() @ U1S1)
        self._cache["LhD"] = {
            "Lh": (U1S1 @ Uh).T,
            "D": 1 / (kron(Sh, self._Sx) + 1),
            "De": 1 / (kron(Sh, self._Sxe) + 1),
        }
        return self._cache["LhD"]
Implements Lₕ and D.

        Returns
        -------
        Lh : ndarray
            Uₕᵀ S₁⁻½ U₁ᵀ.
        D : ndarray
            (Sₕ ⊗ Sₓ + Iₕₓ)⁻¹.