Simulating spectroscopy experiments with a superconducting quantum computer