  We present results for the static energy in ($2+1+1$)-flavor QCD over a wide
range of lattice spacings and several quark masses, including the physical
quark mass, with ensembles of lattice-gauge-field configurations made available
by the MILC Collaboration. We obtain results for the static energy out to
distances of nearly $1$~fm, allowing us to perform a simultaneous determination
of the scales $r_{1}$ and $r_{0}$, as well as the string tension $\sigma$. For
the smallest three lattice spacings we also determine the scale $r_{2}$. Our
results for $r_{0}/r_{1}$ and $r_{0}\sqrt{\sigma}$ agree with published
($2+1$)-flavor results. However, our result for $r_{1}/r_{2}$ differs
significantly from the value obtained in the ($2+1$)-flavor case, which is most
likely due to the effect of the charm quark. We also report results for
$r_{0}$, $r_{1}$, and $r_{2}$ in~fm, with the former two being slightly lower
than published ($2+1$)-flavor results. We study in detail the effect of the
charm quark on the static energy by comparing our results on the finest two
lattices with the previously published ($2+1$)-flavor QCD results at similar
lattice spacing. We find that for $r > 0.2$~fm our results on the static energy
agree with the ($2+1$)-flavor result, implying the decoupling of the charm
quark for these distances. For smaller distances, on the other hand, we find
that the effect of the dynamical charm quark is noticeable. The lattice results
agree well with the two-loop perturbative expression of the static energy
incorporating finite charm mass effects. This is the first time that the
decoupling of the charm quark is observed and quantitatively analyzed on
lattice data of the static energy.
