code: def calculate_fuzzy_chi(alpha, square_map, right_eigenvectors):
      
      # Convert parameter vector into matrix A
      A = to_square(alpha, square_map)
      # Make A feasible.
      A = fill_A(A, right_eigenvectors)
      # Calculate the fuzzy membership matrix.
      chi_fuzzy = np.dot(right_eigenvectors, A)
      # Calculate the microstate mapping.
      mapping = np.argmax(chi_fuzzy, 1)
      return A, chi_fuzzy, mapping
docs: Calculate the membership matrix (chi) from parameters alpha.
  
      Parameters
      ----------
      alpha : ndarray
          Parameters of objective function (e.g. flattened A)
      square_map : ndarray
          Mapping from square indices (i,j) to flat indices (k).
      right_eigenvectors : ndarray
          The right eigenvectors.
  
      Returns
      -------
      A : ndarray
          The transformation matrix A
      chi_fuzzy : ndarray
          The (fuzzy) membership matrix.
      mapping: ndarray
          The mapping from microstates to macrostates.