  Measurements of the top quark polarization and top quark pair
($\mathrm{t\bar{t}}$) spin correlations are presented using events containing
two oppositely charged leptons (e$^+$e$^-$, e$^\pm\mu^\mp$, or $\mu^+\mu^-$)
produced in proton-proton collisions at a center-of-mass energy of 13 TeV. The
data were recorded by the CMS experiment at the LHC in 2016 and correspond to
an integrated luminosity of 35.9 fb$^{-1}$. A set of parton-level normalized
differential cross sections, sensitive to each of the independent coefficients
of the spin-dependent parts of the $\mathrm{t\bar{t}}$ production density
matrix, is measured for the first time at 13 TeV. The measured distributions
and extracted coefficients are compared with standard model predictions from
simulations at next-to-leading-order (NLO) accuracy in quantum chromodynamics
(QCD), and from NLO QCD calculations including electroweak corrections. All
measurements are found to be consistent with the expectations of the standard
model. The normalized differential cross sections are used in fits to constrain
the anomalous chromomagnetic and chromoelectric dipole moments of the top quark
to $-$0.24 $<C_\text{tG}/\Lambda^{2}$ $<$ 0.07 TeV$^{-2}$ and $-$0.33 $<
C^{I}_\text{tG}/\Lambda^{2}$ $<$ 0.20 TeV$^{-2}$, respectively, at 95%
confidence level.
