Optical excitation in small ionized sodium clusters: closed-shell and open-shell systems