  We apply quantum electrodynamical density functional theory to obtain the
electronic density, the spin polarization, as well as the orbital and the spin
magnetization of square periodic arrays of quantum dots or antidots subjected
to the influence of a far-infrared cavity photon field. A gradient-based
exchange-correlation functional adapted to a two-dimensional electron gas in a
transverse homogeneous magnetic field is used in the theoretical framework and
calculations. The obtained results predict a non-trivial effect of the cavity
field on the electron distribution in the unit cell of the superlattice, as
well as on the orbital and the spin magnetization. The number of electrons per
unit cell of the superlattice is shown to play a crucial role in the
modification of the magnetization via the electron-photon coupling. The
calculations show that cavity photons strengthen the diamagnetic effect in the
quantum dots structure, while they weaken the paramagnetic effect in an antidot
structure. As the number of electrons per unit cell of the lattice increases
the electron-photon interaction reduces the exchange forces that would
otherwise promote strong spin splitting for both the dot and the antidot array.
