docs: def computeOverlap(self, output='scalar'):
          """Compute estimate of overlap matrix between the states.
  
          Returns
          -------
          O : np.ndarray, float, shape=(K, K)
              estimated state overlap matrix: O[i,j] is an estimate
              of the probability of observing a sample from state i in state j
  
          Parameters
          ----------
          output : string, optional
              One of 'scalar', 'matrix', 'eigenvalues', 'all', specifying
          what measure of overlap to return
  
          Notes
          -----
  
          W.T * W \approx \int (p_i p_j /\sum_k N_k p_k)^2 \sum_k N_k p_k dq^N
                        = \int (p_i p_j /\sum_k N_k p_k) dq^N
  
          Multiplying elementwise by N_i, the elements of row i give the probability
          for a sample from state i being observed in state j.
  
          Examples
          --------
  
          >>> from pymbar import testsystems
          >>> (x_n, u_kn, N_k, s_n) = testsystems.HarmonicOscillatorsTestCase().sample(mode='u_kn')
          >>> mbar = MBAR(u_kn, N_k)
          >>> O_ij = mbar.computeOverlap()
          """
  
          W = np.matrix(self.getWeights(), np.float64)
          O = np.multiply(self.N_k, W.T * W)
          (eigenval, eigevec) = linalg.eig(O)
          # sort in descending order
          eigenval = np.sort(eigenval)[::-1]
          overlap_scalar = 1 - eigenval[1]
          if (output == 'scalar'):
              return overlap_scalar
          elif (output == 'eigenvalues'):
              return eigenval
          elif (output == 'matrix'):
              return O
          elif (output == 'all'):
              return overlap_scalar, eigenval, O