Ab Initio Photoabsorption Spectra and Structures of Small Semiconductor and Metal Clusters.