  The density of Two-level systems (TLS) controls the low-temperature thermal
properties in glasses and has been found to be almost depleted in ultrastable
glasses. While this depletion of TLS is thought to have a close relationship
with the dramatic decrease of quasi-localized modes (QLMs), it has yet to be
clearly formalized. In this work, we argue, based on the
\textit{soft-potential} model, that TLS correspond to QLMs with typical
frequency $\omega_0$. The density $n_0$ of TLS is proportional to both the
density of QLMs $D_L(\omega_0)$, and the fraction of symmetric double-wells
$f(\omega_0)$ at $\omega_0$, i.e., $n_0 \propto D_L(\omega_0)f(\omega_0)$. We
numerically estimate $\omega_0$ and $n_0$ in computer glasses at different
levels of stabilities, and find that $\omega_0$ is about $5\%$ to $10\%$ of the
Debye frequency. $n_0$ in ultrastable glasses is over $1000$ times smaller than
that in poorly prepared glasses, with both $D_L(\omega_0)$ and $f(\omega_0)$
decreasing significantly. Remarkably, the order of magnitude of estimations for
$n_0$ agrees with that found in experiments in amorphous silicon. Our study
paves the way to understanding the depletion of TLS through the rarefaction of
QLMs.
