  Ultralight axionlike particles (ALPs) are compelling dark matter candidates
because of their potential to resolve small-scale discrepancies between
$\Lambda$CDM predictions and cosmological observations. Axion-photon coupling
induces a polarization rotation in linearly polarized photons traveling through
an ALP field; thus, as the local ALP dark matter field oscillates in time,
distant static polarized sources will appear to oscillate with a frequency
proportional to the ALP mass. We use observations of the cosmic microwave
background from SPT-3G, the current receiver on the South Pole Telescope, to
set upper limits on the value of the axion-photon coupling constant
$g_{\phi\gamma}$ over the approximate mass range $10^{-22} - 10^{-19}$ eV,
corresponding to oscillation periods from 12 hours to 100 days. For periods
between 1 and 100 days ($4.7 \times 10^{-22} \text{ eV} \leq m_\phi \leq 4.7
\times 10^{-20} \text{ eV}$), where the limit is approximately constant, we set
a median 95% C.L. upper limit on the amplitude of on-sky polarization rotation
of 0.071 deg. Assuming that dark matter comprises a single ALP species with a
local dark matter density of $0.3\text{ GeV/cm}^3$, this corresponds to
$g_{\phi\gamma} < 1.18 \times 10^{-12}\text{ GeV}^{-1} \times \left(
\frac{m_{\phi}}{1.0 \times 10^{-21} \text{ eV}} \right)$. These new limits
represent an improvement over the previous strongest limits set using the same
effect by a factor of ~3.8.
