  The initial abundance of radioactive heat producing isotopes in the interior
of a terrestrial planet are important drivers of its thermal evolution and the
related tectonics and possible evolution to an Earth-like habitat. The
moderately volatile element K can be outgassed from a magma ocean into
H$_2$-dominated primordial atmospheres of protoplanets with assumed masses
between 0.55-1.0$ M_{\rm Earth}$ at the time when the gas disk evaporated. We
estimate this outgassing and let these planets grow through impacts of depleted
and non-depleted material that resembles the same $^{40}$K abundance of average
carbonaceous chondrites until the growing protoplanets reach 1.0 $M_{\rm
Earth}$. We examine different atmospheric compositions and, as a function of
pressure and temperature, calculate the proportion of K by Gibbs Free Energy
minimisation using the GGChem code. We find that for H$_2$-envelopes and for
magma ocean surface temperatures that are $\ge$ 2500 K, no K condensates are
thermally stable, so that outgassed $^{40}$K can populate the atmosphere to a
great extent. However, due to magma ocean turn-over time and the limited
diffusion of $^{40}$K into the upper atmosphere, from the entire $^{40}$K in
the magma ocean only a fraction may be available for escaping into space. The
escape rates of the primordial atmospheres and the dragged $^{40}$K are further
simulated for different stellar EUV-activities with a multispecies hydrodynamic
upper atmosphere evolution model. Our results lead to different abundances of
heat producing elements within the fully grown planets which may give rise to
different thermal and tectonic histories of terrestrial planets and their
habitability conditions.
