A computational study of hydrogen dimers in giant-planet infrared spectra