def gram_vec(Z):  # (N, D)
    """
    Computes the empirical second moment of a data matrix Z.
    Args:
        Z: a data matrix (N, D)

    Returns:
        The covariance matrix of Z data (D, D)
    """
    return Z.T @ Z.conj()