  The efficiency of optical trapping is determined by the atomic dynamic dipole
polarizability, whose real and imaginary parts are associated with the
potential energy and photon-scattering rate respectively. In this article we
develop a formalism to calculate analytically the real and imaginary parts of
the scalar, vector and tensor polarizabilities of lanthanide atoms. We assume
that the sum-over-state formula only comprises transitions involving electrons
in the valence orbitals like $6s$, $5d$, $6p$ or $7s$, while transitions
involving $4f$ core electrons are neglected. Applying this formalism to the
ground level of configuration $4f^q6s^2$, we restrict the sum to transitions
implying the $4f^q6s6p$ configuration, which yields polarizabilities depending
on two parameters: an effective transition energy and an effective transition
dipole moment. Then, by introducing configuration-interaction mixing between
$4f^q6s6p$ and other configurations, we demonstrate that the imaginary part of
the scalar, vector and tensor polarizabilities is very sensitive to
configuration-interaction coefficients, whereas the real part is not. The
magnitude and anisotropy of the photon-scattering rate is thus strongly related
to the details of the atomic electronic structure. Those analytical results
agree with our detailed electronic-structure calculations of energy levels,
Land\'e $g$-factors, transition probabilities, polarizabilities and van der
Waals $C_6$ coefficients, previously performed on erbium and dysprosium, and
presently performed on holmium. Our results show that, although the density of
states decreases with increasing $q$, the configuration interaction between
$4f^q6s6p$, $4f^{q-1}5d6s^2$ and $4f^{q-1}5d^26s$ is surprisingly stronger in
erbium ($q=12$), than in holmium ($q=11$), itself stronger than in dysprosium
($q=10$).
