def METHOD_NAME(rates):
    '''Get steady state solution for a rate matrix. As an optimization, returns the
    flattened labeled population vector (of length nstates*nbins); to convert to the
    nested vector used for storage, use nested_to_flat_vector().'''
    rates = rates.copy()
    # Convert to a transition probability matrix
    for i in range(rates.shape[0]):
        rowsum = rates[i, :].sum()
        if rowsum > 0:
            rates[i, :] = rates[i, :] / rowsum
        else:
            if rates[:, i].sum() != 0:
                warnings.warn('sink microstate in rate matrix', ConsistencyWarning)
            rates[i, :] = 0
    try:
        vals, vecs = scipy.linalg.eig(rates.T)
    except Exception:
        log.debug('exception obtaining eigenvectors', exc_info=True)
        return None
    vals = np.abs(vals)
    log.debug('eigenvalues: {!r}'.format(list(reversed(sorted(vals)))))
    asort = np.argsort(vals)
    vec = vecs[:, asort[-1]]
    ss = np.abs(vec)
    ss /= ss.sum()
    return ss