  Time-dependent density-functional theory (TDDFT) is a computationally
efficient first-principles approach for calculating optical spectra in
insulators and semiconductors, including excitonic effects. We show how exciton
wave functions can be obtained from TDDFT via the Kohn-Sham transition density
matrix, both in the frequency-dependent linear-response regime and in real-time
propagation. The method is illustrated using one-dimensional model solids. In
particular, we show that our approach provides insight into the formation and
dissociation of excitons in real time. This opens the door to time-resolved
studies of exciton dynamics in materials by means of real-time TDDFT.
