hydroff: Exact evaluation of hydrogenic atomic form factors with unequal masses
We present hydroff, a Python program for the bound--bound form factors $\langle n_2 l_2 m_2|e^{i\mathbf{q}\cdot\mathbf{r}}|n_1 l_1 m_1\rangle$ of hydrogen-like states with unequal Bohr radii, as when the orbiting particle changes in a weak decay. The program accepts arbitrarily large quantum numbers and any momentum transfers, and supports the form factor for general direction of $\mathbf{q}$, as well as the same form factor with an extra momentum operator, $r^k$ (integer $k\ge-1$) or $p^2$ operator acting on one of the states. All sums are carried out in exact rational arithmetic, so the severe cancellation of the series at large principal quantum numbers costs no precision; a final evaluation in ball arithmetic gives every printed value a rigorous error bound, and exact zeros are proven. On the workload of earlier double-precision programs, hydroff is of comparable speed for $n\approx30$--40, where they begin to fail, and it remains correct where they lose all accuracy; transitions with $n=300$ take seconds. As an application, we compute the decay rate for a bound pion decaying into a bound muon in hydrogen-like pionic helium and pionic hydrogen, and compare with earlier estimates.