  We present a first-principles method for the calculation of optical
excitations in nanosystems. The method is based on solving the Bethe-Salpeter
equation (BSE) for neutral excitations. The electron self-energy is evaluated
within the GW approximation, with dynamical screening effects described within
time-dependent density-functional theory in the adiabatic, local approximation.
This method is applied to two systems: the benzene molecule, C$_6$H$_6$, and
azobenzene, C$_{12}$H$_{10}$N$_2$. We give a description of the
photoisomerization process of azobenzene after an $n-\pi^\star$ excitation,
which is consistent with multi-configuration calculations.
