  Strong coupling of organic molecules to the vacuum field of a nanoscale
cavity can be used to modify their chemical and physical properties. We extend
the Tavis-Cummings model for molecular ensembles and show that the often
neglected interaction terms arising from the static dipole moment and the
dipole self-energy are essential for a correct description of the light-matter
interaction in polaritonic chemistry. On the basis of a full quantum
description, we simulate the excited-state dynamics and spectroscopy of MgH$^+$
molecules resonantly coupled to an optical cavity. We show that the inclusion
of static dipole moments and the dipole self-energy is necessary to obtain a
consistent model. We construct an efficient two-level system approach that
reproduces the main features of the real molecular system and may be used to
simulate larger molecular ensembles.
