gwsnr: A python package for efficient signal-to-noise calculation of gravitational-waves
Hemantakumar Phurailatpam, Otto Akseli Hannuksela
TL;DR
gwsnr tackles the computational bottleneck of evaluating gravitational-wave detectability by delivering an efficient, flexible toolkit for $\rho_{\rm opt}$ and $P_{\rm det}$. It combines a partial-scaling interpolation for non-precessing binaries, a multiprocessing inner-product routine for frequency-domain waveforms including precession and subdominant modes, an ANN-based yet calibrated path to $P_{\rm det}$, and a Hybrid SNR recalculation that preserves accuracy near the detection threshold, all accelerated by NumPy, Numba, and optional GPU backends such as $\text{JAX}$ and MLX. The package supports analytical and numerical horizon-distance computations and accommodates diverse detector networks, noise models, and waveform families, enabling large-scale population studies and robust treatment of selection effects in hierarchical Bayesian analyses. By delivering substantial speedups without sacrificing accuracy, gwsnr empowers rapid, scalable GW simulations and improves the reliability of event-rate inferences and lensed/unlensed population studies in the era of advanced detectors.
Abstract
Gravitational wave astrophysics requires accurate evaluation of the Signal-to-Noise Ratio (SNR) and the Probability of Detection (Pdet) for applications such as population simulations and hierarchical Bayesian inference with selection effects. Traditional approaches for computing SNR are often computationally demanding and inefficient for large-scale analyses. The gwsnr Python package addresses this challenge by providing efficient and flexible tools for calculating the optimal SNR. It features a user-friendly interface and employs techniques such as a partial-scaling interpolation method for non-precessing binaries, a multiprocessing inner-product routine for frequency-domain waveforms that include spin precession and subdominant modes, among others. High computational performance is achieved through NumPy vectorization and Just-in-Time compilation with Numba, with optional GPU acceleration using JAX and MLX. By combining efficiency, scalability, and ease of use, gwsnr enables large-scale simulations of detectable compact binary mergers and facilitates robust modeling of selection effects through Pdet.
