Hermes - Towards an Optimal High-Performance Algorithm for Cosmic Statistics of Large Data Sets
We present Hermes, an in situ multiresolution framework for efficient and flexible measurements of cosmic large-scale-structure statistics from discrete catalogues. Hermes replaces conventional ex situ counting of particle tuples with algebraic operations among window-filtered continuous fields. A discrete point distribution is first reconstructed as a continuous density field in a compact scaling-function representation, in which two- and higher-point statistics are formulated as spatial products of locally filtered fields. This formulation expresses conventional binning for counts-in-cells and two- and higher-point correlation functions through window functions. Changing the window kernels defines generalised statistics without redesigning the estimator. We further introduce PyHermes, an open-source Python implementation of this framework, combining multiresolution field reconstruction with FFT-based window convolution, MPI/thread parallelism, and GPU acceleration for high-order field contractions. The framework supports a broad range of measurements, including isotropic and anisotropic two-point statistics, marked correlations, standard and multipole three-point functions, filtered statistics, and Fourier-space differential operators for constructing derived physical fields. Using halo catalogues from cosmological N-body simulations, we demonstrate PyHermes through a range of clustering statistics and use benchmarks to quantify its computational efficiency and scalability for large-scale data sets. By separating field representation from statistical windows, Hermes provides a unified computational framework in which a single reconstructed field can be reused for a wide range of standard and customised cosmic statistics. This field-window architecture enables scalable analysis of the large data sets expected from current and future galaxy surveys.