Excitation energies of terthiophene and its dioxide derivative: a first-principles study