  We study the distribution of the Schmidt coefficients of the reduced density
matrix of a quantum system in a pure state. By applying general methods of
statistical mechanics, we introduce a fictitious temperature and a partition
function and translate the problem in terms of the distribution of the
eigenvalues of random matrices. We investigate the appearance of two phase
transitions, one at a positive temperature, associated to very entangled
states, and one at a negative temperature, signalling the appearance of a
significant factorization in the many-body wave function. We also focus on the
presence of metastable states (related to 2-D quantum gravity) and study the
finite size corrections to the saddle point solution.
