  We investigate the superfluid-Mott-insulator transition of a two-dimensional
photon gas in a dye-filled optical microcavity and in the presence of a
periodic potential. We show that in the random-phase approximation the effects
of the dye molecules, which generally lead to dissipation in the photonic
system, can be captured by two dimensionless parameters that only depend on
dye-specific properties. Within the mean-field approximation, we demonstrate
that one of these parameters decreases the size of the Mott lobes in the phase
diagram. By considering also Gaussian fluctuations, we show that the coupling
with the dye molecules results in a finite lifetime of the quasiparticle and
quasihole excitations in the Mott lobes. Moreover, we show that there are
number fluctuations in the Mott lobes even at zero temperature and therefore
that the true Mott-insulating state never exists if the interactions with the
dye are included.
