def __random_density_hs(N, rank=None, seed=None):
G = __ginibre_matrix(N, rank, seed)<EOL>G = G.dot(G.conj().T)<EOL>return G / np.trace(G)<EOL>
Generate a random density matrix from the Hilbert-Schmidt metric.

Args:
    N (int): the length of the density matrix.
    rank (int or None): the rank of the density matrix. The default
        value is full-rank.
    seed (int): Optional. To set a random seed.
Returns:
    ndarray: rho (N,N  a density matrix.