Diagonalization of System plus Environment Hamiltonians