Diffusion Coefficients for Resonant Relativistic Wave-Particle Interactions Using the PIRAN Code
By Oliver Allanson (University of Birmingham; University of Exeter)
Quasilinear diffusion coefficients can be used to model the response of charged particles to resonant wave-particle interactions. The calculation of these coefficients is sufficiently complicated and arduous to render it prohibitive to many potential users, because of the expense in time spent developing the code. The PIRAN software package (”Particles In ResonANce”) is written using Python, and allows the user to calculate local and bounce-averaged relativistic diffusion coefficients in energy and pitch-angle space via the two main current proposed methods in the literature. The code is predominantly based upon the formalisms and methods presented in Glauert and Horne (2005, https://doi.org/10.1029/2004JA010851) and Cunningham (2023, https://doi.org/10.1029/10.1029/2023JA031703). We solve for diffusion coefficients using exact relativistic formulae. We use Gaussian spectra in wave frequency and in tangent of the wave normal angle and solve the full cold-plasma dispersion relation. At present the code supports fully tested calculations for electron diffusion coefficients based on whistler-mode waves in a fully ionized proton-electron cold plasma. However the codebase architecture is built such that future developments to include other wave modes and other plasma compositions should involve incremental additions. The initial release of PIRAN may not have the same number of features as some other numerical codes, but is has the advantages of being a fully open-source diffusion coefficient code that: (a) supports calculation of both local and bounce-averaged diffusion coefficients via both of the two proposed methods; (b) is written fully in Python; (c) has detailed user pages, commit history and changelog on GitHub.
The codebase is made available with the “GNU General Public License version 3” (https://opensource.org/license/gpl-3-0). All users of the code should follow the instructions of that license, and cite this paper in any publications or reports that make use of the PIRAN software package and repository. The work in this paper particularly refers to PIRAN Release 1.1.0 (Kappas et al., 2026).
O.A. and his wife Sophie, and their family, would like to gratefully acknowledge the outstanding support and contributions of the Williams Syndrome Foundation (WSF) in the United Kingdom (https://williams-syndrome.org.uk/). The WSF is a registered charity that promotes research and funding, and provides help and support for families and individuals with the rare congenital disorder known in the UK as Williams Syndrome (sometimes also known as Williams-Beuren syndrome). As such this software package is eponymously named after the son of Oliver and Sophie (who doesn't much care for diffusion coefficients himself). This acknowledgement serves to thank the WSF for their support to the lead author and his family during the preparation of work in this manuscript.
Paper: https://doi.org/10.1029/2025EA004479
Code: https://github.com/RB-ENVIRONMENT/PIRAN
Documentation: https://rb-environment.github.io/PIRAN/
Release 1.1.0: https://zenodo.org/records/18875558
Please email This email address is being protected from spambots. You need JavaScript enabled to view it. with any questions.
