Q-switched energy extraction efficiency (source code)

= Q-switched energy extraction efficiency
{c}
{title2=$\eta=\beta^{-1}(1-N_f^*/N_i^*)$}

For an ideal pulse with negligible stored seed <photons> and useful output accounting for all <optical cavity>[cavity] <photon> loss, the extracted <energy> is $(N_i^*-N_f^*)V_g\hbar\omega_L/\beta$. The factor $\beta=1+g_2/g_1$ converts inversion depletion into stimulated transitions. With over-pumping $r=N_i^*/N_{\rm th}^*$, the nonzero extraction branch satisfies $r\beta\eta=-\ln(1-\beta\eta)$. A fraction $0.95$ of the maximum <energy> requires $r=-\ln(0.05)/0.95$.