  A theory of Bose-Einstein condensation of light in a dye-filled optical
microcavity is presented. The theory is based on the hierarchical maximum
entropy principle and allows one to investigate the fluctuating behavior of the
photon gas in the microcavity for all numbers of photons, dye molecules, and
excitations at all temperatures, including the whole critical region. The
master equation describing the interaction between photons and dye molecules in
the microcavity is derived and the equivalence between the hierarchical maximum
entropy principle and the master equation approach is shown. The cases of a
fixed mean total photon number and a fixed total excitation number are
considered, and a much sharper, nonparabolic onset of a macroscopic
Bose-Einstein condensation of light in the latter case is demonstrated. The
theory does not use the grand canonical approximation, takes into account the
photon polarization degeneracy, and exactly describes the microscopic,
mesoscopic, and macroscopic Bose-Einstein condensation of light. Under certain
conditions, it predicts sub-Poissonian statistics of the photon condensate and
the polarized photon condensate, and a universal relation takes place between
the degrees of second-order coherence for these condensates. In the macroscopic
case, there appear a sharp jump in the degrees of second-order coherence, a
sharp jump and kink in the reduced standard deviations of the fluctuating
numbers of photons in the polarized and whole condensates, and a sharp peak, a
cusp, of the Mandel parameter for the whole condensate in the critical region.
The possibility of nonclassical light generation in the microcavity with the
photon Bose-Einstein condensate is predicted.
