def METHOD_NAME(dim):
    state = random_density_matrix(dim)
    assert state.shape == (dim, dim)
    np.testing.assert_allclose(np.trace(state), 1)
    np.testing.assert_allclose(state, state.T.conj())
    eigs, _ = np.linalg.eigh(state)
    assert np.all(eigs >= 0)