reaches 30% near the line core (Fig. \[fig:nlte\_lte\_edens\]a). Individual profiles show even larger differences depending on which chromospheric structure they are emerging from. In dark fibrils the non-LTE intensity drops below the LTE one (Fig. \[fig:nlte\_lte\_edens\]b), but in flare ribbons it increases significantly near the line core (Fig. \[fig:nlte\_lte\_edens\]c).

Therefore, in the rest of the paper we only present results using the non-LTE electron density.

Formation heights {#sec:formation_height}
-----------------

Calcium and magnesium are both predominantly singly ionized in the chromosphere. ionizes to at slightly higher temperatures owing to the higher ionization potential of  (15.0 eV) compared to  (11.87 eV). Both the [h&k]{} and [H&K]{} lines have the ground state as their lower level, so their opacity scales approximately with the density as long as  and  are the dominant ionization stage. As is 18 times more abundant than , the line cores of [h&k]{} are formed a few scale heights higher up in the chromosphere than the line cores of [H&K]{}. In contrast, the lower level of [H$\alpha$]{} is an excited state at 10.2 eV above the ground state. In LTE this makes the line opacity very sensitive to the temperature. In the solar chromosphere, the H$\alpha$ line opacity depends in 