Irreducible components of the density matrix. Application to optical pumping