  The recent development of efficient chirality sorting techniques has opened
the way to the use of single-walled carbon nanotubes (SWCNTs) in a plethora of
nanoelectronic, photovoltaic, and optoelectronic applications. However, to
understand the excitation processes undergone by SWCNTs, it is necessary to
have highly efficient and accurate computational methods to describe their
optical and electronic properties, methods which have until now been
unavailable. Here we employ linear combinations of atomic orbitals (LCAOs) to
represent the Kohn-Sham (KS) wavefunctions and perform highly efficient time
dependent density functional theory (TDDFT) calculations in the frequency
domain using our LCAO-TDDFT-$k$-$\omega$ code to model the optical absorbance
and energy loss spectra and spatial distribution of the exciton charge
densities in SWCNTs. By applying the GLLB-SC derivative discontinuity
correction to the KS eigenenergies, we reproduce the measured $E_{11}$ and
$E_{22}$ transitions within $\sigma \lesssim 70$ meV and the optical absorbance
and electron energy loss spectra semi-quantitatively for a set of fifteen
semiconducting and four metallic chirality sorted SWCNTs. Furthermore, our
calculated electron hole density difference $\Delta \rho(\textbf{r}, \omega)$
resolves the spatial distribution of the measured excitations in SWCNTs. These
results open the path towards the computational design of optimized SWCNT
nanoelectronic, photovoltaic, and optoelectronic devices $\textit{in silico}$.
