The coherent potential approximation for the density matrix of a random alloy