code: def _logdetH(self):
          
          if not self._restricted:
              return 0.0
          ldet = slogdet(sum(self._XTQDiQTX) / self.scale)
          if ldet[0] != 1.0:
              raise ValueError("The determinant of H should be positive.")
          return ldet[1]
docs: log(｜H｜) for H = s⁻¹XᵀQD⁻¹QᵀX.