  We report on the determination of the dynamical polarizability of ultracold
erbium atoms in the ground and in one excited state at three different
wavelengths, which are particularly relevant for optical trapping. Our study
combines experimental measurements of the light shift and theoretical
calculations. In particular, our experimental approach allows us to isolate the
different contributions to the polarizability, namely the isotropic scalar and
anisotropic tensor part. For the latter contribution, we observe a clear
dependence of the atomic polarizability on the angle between the
laser-field-polarization axis and the quantization axis, set by the external
magnetic field. Such an angle-dependence is particularly pronounced in the
excited-state polarizability. We compare our experimental findings with the
theoretical values, based on semi-empirical electronic-structure calculations
and we observe a very good overall agreement. Our results pave the way to
exploit the anisotropy of the tensor polarizability for spin-selective
preparation and manipulation.
