I want to derive the quantum state for the canonical ensemble which maximizes the entropy under constraints: $$S[\hat{\rho}] = -k_B \text{Tr}[\hat{\rho}\log\hat{\rho}]-\nu(\text{Tr}[\hat{\rho}]-1) - \eta(\text{Tr}[\hat{\rho}\hat{H}]-E),$$ where $\hat{H}$ is the Hamiltonian, $E$ is the average energy and $\nu, \eta$ are Lagrange multipliers.
Well I can say that the density matrix operator is diagonal $\hat{\rho} = \sum_{i}p_i|i\rangle\langle i|$ and derive expressions for $p_i$. I don't know, however, how to show that the states $|i\rangle$ should be the eigenstates of $\hat{H}$.