Solution of the Redfield equation for the dissipative quantum dynamics of multilevel systems