Solution (source code)

= Solution

The <Q-switched energy extraction efficiency> in the ideal loss convention of <1/b/ii> is
$$
\boxed{\eta=\frac1\beta\left(1-\frac{N_f^*}{N_i^*}\right),\qquad
\eta_{\max}=\frac1\beta.}
$$
The first factor reflects the definition of inversion: one stimulated transition reduces the upper population and increases the lower population, changing $N^*=N_2-(g_2/g_1)N_1$ by $1+g_2/g_1=\beta$. Thus one emitted <photon> consumes $\beta$ units of inversion. The second factor accounts for the inversion left after the pulse; finite pumping above threshold does not generally extract all the initially stored inversion. This $\eta$ is not the wall-plug efficiency and does not include the <energy> cost of pumping or the factor $\zeta$ for imperfect output extraction.