code: def metric(self):
          
          if self._metric is None:
              _log.debug("Computing and caching operator basis metric")
              self._metric = np.matrix([[(j.dag() * k).tr() for k in self.ops] for j in self.ops])
          return self._metric
docs: Compute a matrix of Hilbert-Schmidt inner products for the basis operators, update
          self._metric, and return the value.
  
          :return: The matrix of inner products.
          :rtype: numpy.matrix