Next Article in Journal
Distribution of Heavy-Element Abundances Generated by Decay from a Quasi-Equilibrium State
Previous Article in Journal
Comparing the Observational Properties of Rotation-Powered Binary Millisecond Pulsars with Various Companion Types
Previous Article in Special Issue
Two-Loop Corrections in Power Spectrum in Models of Inflation with Primordial Black Hole Formation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Technical Note

pbhstat: A Python Package for Calculating the Primordial Black Hole Abundance

by
Philippa S. Cole
1,2,* and
Jacopo Fumagalli
3,*
1
Dipartimento di Fisica “G. Occhialini”, Università degli Studi di Milano-Bicocca, Piazza della Scienza 3, 20126 Milano, Italy
2
INFN, Sezione di Milano-Bicocca, Piazza della Scienza 3, 20126 Milano, Italy
3
Departement de Física Quàntica i Astrofisica and Institut de Ciències del Cosmos (ICC), Universitat de Barcelona, Martí i Franquès 1, 08028 Barcelona, Spain
*
Authors to whom correspondence should be addressed.
Universe 2025, 11(9), 322; https://doi.org/10.3390/universe11090322
Submission received: 3 July 2025 / Revised: 5 September 2025 / Accepted: 9 September 2025 / Published: 22 September 2025
(This article belongs to the Special Issue Primordial Black Holes from Inflation)

Abstract

We present pbhstat, a publicly available Python package designed to compute the mass function and total abundance of primordial black holes (PBHs) from a given primordial power spectrum. The package offers a modular framework using multiple statistical approaches, including Press–Schechter theory, peaks theory, and formalisms based on the non-linear compaction function. Currently, the implementation is limited to scenarios with nearly Gaussian initial conditions.

1. Introduction

The possibility that dark matter consists of primordial black holes (PBHs) presents an intriguing avenue from both theoretical and observational perspectives [1,2,3,4,5,6,7,8,9,10]. We focus on the case in which PBHs are seeded by large-amplitude inflationary perturbations [11,12,13]. In this context, accurately determining the PBH abundance remains highly sensitive to the interplay between various contributing factors (see [14,15,16] for reviews on the subject). Central to this is the choice of collapse statistics, which relate the probability of black hole formation to the initial conditions and the non-linear dynamics involved. Within a given statistical framework, further ambiguities arise—such as the eventual choice of a window function, the threshold criterion that an estimator must exceed to trigger collapse, and the numerical coefficients used in the computation (inferred, for instance, from numerical simulations [17,18,19]). These elements, whether explicitly chosen or inherently defined by the framework, collectively have a substantial impact on the resulting PBH abundance, e.g., [20,21,22,23,24,25,26]. Furthermore, PBHs are challenging to search for, meaning that theoretical predictions of their mass distribution are valuable in order to better inform and refine observational approaches.
Motivated by this, we present pbhstat as a simple tool that allows for the consistent computation of PBH abundance across different methods for ease of comparison. We aim for this tool to be accessible to non-experts who may not work directly on PBH formation, by providing an easy way to generate PBH mass functions from pre-defined primordial power spectra using consistent statistical formalisms. At the same time, it is designed to support experts in the field, allowing them to input custom power spectra and make detailed choices within various statistical approaches. While many researchers have developed private implementations of these methods, to the best of our knowledge, they have not yet been integrated into a publicly available, unified codebase. We hope that this package will remove the need to re-implement standard techniques and serve as a platform for reproducibility and cross-checks across different approaches.
We implement three choices of statistics to describe how fluctuations collapse to form PBHs. The Press–Schechter theory [27,28] provides a relatively simple method based on the probability that the density contrast exceeds a critical threshold. It usually assumes a Gaussian distribution for the linear overdensity and integrates over all regions above this threshold to estimate the collapse fraction, offering a first-order approximation that is easy to implement. Peaks theory [29] was first applied to the PBH context in the mid-2000s in ref. [30], extending beyond Press–Schechter by modelling PBHs as forming from rare, high peaks in the curvature perturbation field. It is generally considered to be a more accurate description of PBH formation and has been explored and developed extensively in the literature (see, e.g., [20,24,31,32]). Finally, we place particular emphasis on the more involved implementation of the non-linear compaction function statistics [25,33,34]. This approach relies on using the initial conditions of the compaction function as the primary statistical measure. It focuses on identifying regions where the overdensity exhibits a pronounced peak; the compaction function attains its maximum at a characteristic smoothing scale relative to this peak, and this maximum surpasses the critical threshold necessary for the initial overdensity to collapse to form a black hole. We do not delve into the underlying physics of the statistical methodologies used and instead refer the reader to the relevant references for detailed discussions.
Under the assumption of nearly Gaussian initial conditions, all methods depend exclusively on the initial power spectrum. The latter should be motivated by a realisable inflationary scenario; see, e.g., [35] for a review on inflationary mechanisms that lead to PBH production.
Additional effects—such as quantum diffusion [36,37,38,39] and non-Gaussianities [40,41,42,43,44,45,46,47,48,49,50]—may play a crucial role in shaping the final abundance. Nonetheless, even when one adopts the simplifying assumption that the primordial curvature perturbations are Gaussian with a known power spectrum, the present tool provides useful first-order calculations of the mass function, illustrating the number of components that must be taken into account in different statistical approaches. We envisage implementing additional refinements in future versions of the code.
This companion to the code is organised as follows: In Section 2, we outline the main output of the code. In Section 3, we present the three statistical methods for calculating PBH abundance that we implement, along with the primordial power spectra and window functions in Section 4. We lay out the modular structure of the code in Section 5 and provide installation and quick-start usage instructions in Section 6. Finally, we comment on future additions and summarise in Section 7.

2. Output of the Code

The main output of pbhstat is the mass function of primordial black holes f ( M ) , which represents the fraction of energy density contained in primordial black holes per logarithmic mass interval:
f ( M ) = 1 Ω CDM d Ω PBH d ln M
which satisfies
f ( M ) d ln M = f PBH Ω PBH / Ω CDM ,
where M is the mass of the PBH, f PBH is the fraction of dark matter energy density contained in PBHs today, and Ω CDM is the energy density in cold dark matter today. Various definitions of the mass function are present in the literature, often simply related to the one above by a rescaling or numerical coefficients.
The PBH abundance today, Ω PBH , can be obtained by integrating the contributions over all scales:
Ω PBH = d ln R R eq R β ( R ) ,
where R is the physical scale of the horizon at the time of formation, which is related to the horizon mass, M H , as follows [51]:
R = M H M eq 1 / 2 R eq ,
where β ( R ) is the mass fraction of PBHs at the time of formation, i.e., β = ρ PBH / ρ tot | formation . The factor ( M eq / M H ) 1 / 2 scales β to its value at matter-radiation equality exploiting the fact that during radiation domination, β ρ P B H / ρ R a , and a eq / a ( M H ) = ( M eq / M H ) 1 / 2 . We use M e q = 2.8 × 10 17 M and k e q = 1 / R e q = 0.01 ( Ω m / 0.31 ) Mpc 1 , neglecting for simplicity the small correction due to the evolution of the number of relativistic degrees of freedom in Equation (4). In practice, the integral over all scales in Equation (3) will be computed over horizon mass, where it is best to integrate between extrema that correspond to the scales where the primordial power spectrum has decreased by a factor of 10 from its peak amplitude. The implementation of β has a different form depending on how the perturbations are assumed to collapse. We provide three methods from the literature for calculating β that assume three different statistics, namely Press–Schechter, peaks theory, and non-linear compaction statistics. The key ingredient to β ( R ) is the primordial power spectrum, which can be either analytically calculated or loaded as a bespoke spectrum in the package. A separate module smooths the power spectrum and calculates the relevant width parameters σ ( R ) which are fed to β ( R ) as described in Section 4. To finally arrive at the PBH mass function, one has to invert the expression for the PBH mass in terms of the horizon mass and the statistical estimator chosen (see below).

3. Choice of Statistics

In all three statistics methods, we use the compaction function (in its linear or non-linear version in ζ ) as an estimator. The compaction function, denoted with C, measures the mass excess within a given areal radius [52]. In the long-wavelength approximation, and by exploiting the (approximate) spherical symmetry of high peaks in a randomly distributed Gaussian field (in this case, ζ ) [29], the time-independent super-horizon compaction function can be written as [53]
C ( R ) = g ( R ) 1 3 8 g ( R ) ,
where
g = 4 3 R R ζ ( R )
which is sometimes referred to as the linear compaction function.1 Here, ζ ( R ) denotes the radial profile of the comoving curvature perturbation in a coordinate system centred on one of its peaks. The compaction function C on super-horizon scales is bounded from above, with C 2 / 3 . This bound is reached for g = 4 / 3 , which separates standard Type I fluctuations ( g 4 / 3 ) from more exotic Type II fluctuations ( g > 4 / 3 ), with the latter being characterised by a non-monotonic areal radius. The current implementation of the code considers only Type I fluctuations. Critical collapse for Type II fluctuations is currently under investigation—see [54,55,56,57], and a dedicated statistical framework should be developed to properly explore this case. Accordingly, we bound our integral in g to 4 / 3 . In practice, this consideration is relevant primarily for the non-linear statistics discussed in Section 3.3. For the statistics in Section 3.1 and Section 3.2, the constant threshold is sufficiently far from 4 / 3 that Type II fluctuations are naturally excluded.

3.1. Press–Schechter

We implement Press–Schechter statistics in the PressSchechterModel class within the collapse_stats.py module following [58] (and references therein). Note that in the original Press–Schechter formalism for PBHs, the mass fraction is typically expressed as an integral over the density contrast δ , which is assumed to be Gaussian. When the time-independent component of the linear density contrast is averaged over a volume enclosed by a sphere of radius R, it becomes equivalent to the compaction function estimator C (see for instance [59]) on super-horizon scales. This is valid for the linear (in ζ ) term of the compaction function, i.e., g, and the linear smoothed density contrast. Using g and adjusting the critical threshold C c accordingly [58] means that we can write the subsequent expressions in terms of g in place of the original δ .
The form of β in terms of the horizon mass (which can be converted from R using Equation (4)) is
β ( M H ) = 2 g c 4 / 3 d g M M H P ( g )
where P ( g ) is the probability distribution function of the initial density perturbations and the upper limit of the integral is a result of excluding Type II fluctuations. Under the Gaussian approximation, this reads as
P ( g ) = 1 2 π σ 2 ( M H ) exp g 2 2 σ 2 ( M H )
where σ ( M H ) is the mass variance, which corresponds to the zero-th width parameter σ 0 in the hierarchy of moments2
σ n 2 = 16 81 0 d k k ( k R ) 4 + 2 n W 2 ( k , R ) P ζ
where ( k R ) 4 accounts for the super-horizon growth of the density perturbations, described by the dimensionless primordial power spectrum of the comoving curvature perturbation P ζ , defined by ζ k ζ k = ( 2 π ) 3 δ ( k + k ) ( 2 π 2 / k 3 ) P ζ ( k ) , and W ( k , R ) is a window function chosen to filter the perturbations over the smoothing scale R.
The window functions implemented for use with Press–Schechter are the Gaussian window function3 and the real-space top-hat window function. A real-space top-hat window corresponds to averaging over a sharp spherical region of radius R:
W TH ( k R ) = 3 sin ( k R ) k R cos ( k R ) ( k R ) 3
while the Gaussian window function corresponds to a weighted average over all space, where points closer to the centre are weighted more heavily, and the weight decays exponentially with distance
W G ( k R ) = e x 2 / 4
where we have defined x k R . From Equation (6), one can show that σ g 2 g g = σ 0 2 [33,34] in Equation (9), with the window function automatically given by the real-space top-hat one.
The critical scaling behaviour of the PBH mass can be written as [60]
M = K M H ( g g c ) γ cr ,
where K, γ cr , and g c are numerical coefficients that should be chosen to be consistent with the smoothing function used to calculate σ ( M H ) . Standard choices based on fiducial profiles are { K = 4 , g c = 0.77 } for the real-space top-hat window function [59] and { K = 10 , g c = 0.28 } for the Gaussian window function [32]. These values of g c are obtained by solving Equation (5) for g with C = 0.55 for the top-hat, and C = 0.25 for the Gaussian window functions, respectively, so as to account for the fact that we are using only the linear term of the compaction function [61]. γ cr is implemented as an optional argument with a default value of 0.36 in the MassVariance class within the mass_variance.py module. As is customary in these statistics, we do not consider here the profile dependence of the threshold. We note that for the real-space top-hat window function, the integral over β ( R ) diverges and therefore we implement a large-k cut-off as an optional argument in the MassVariance class, following [58]. This is placed at the point where the window function reaches its first trough, at k = 4.49 / R . This removes the divergence from the integral, but the window function is no longer a true top-hat function.
Combining Equations (7) and (8), and trading the variable g for M by inverting Equation (12), we can write f ( M ) as
f ( M ) = 1 Ω CDM d M H M eq M H M K M H 1 / γ cr γ cr M H 2 M P g ,
where g denotes g expressed in terms of the other variables by inverting the critical scaling relation in Equation (12):
g g ( M , M H ) = M K M H 1 / γ cr + g c .

3.2. Peaks Theory

We implement peaks theory statistics [29,30] in the PeaksTheoryModel class within the collapse_stats.py module in the following way. The mass fraction is given by
β ( M H ) = b g c 4 / 3 d g M M H n g σ ( M H )
where b is a pre-factor that accounts for the volume over which the window function is integrated, taking b = { ( 2 π ) 3 2 , 4 π / 3 } for Gaussian and top-hat window functions, respectively [24]. n is the number density of peaks given by
n g , M H = 1 3 3 2 ( 2 π ) 2 σ 1 ( M H ) σ 0 ( M H ) 3 g σ 0 ( M H ) 3 exp 1 2 g σ 0 ( M H ) 2 ,
with σ 0 and σ 1 as defined in Equation (9). Note that we have absorbed the usual R 3 factor in this equation into the dimensionless expression for σ 1 ; see Equation (9).
The window functions implemented for use with the PeakTheoryModel are the same as for the PressSchechterModel, namely the Gaussian window function and the real-space top-hat window function. The recommended choices for the numerical coefficients are the same as in the previous Section 3.1. The large-k cut-off flag is also compatible with this statistics choice and can be implemented in the MassVariance class within the mass_variance.py module.
Putting Equations (15) and (16) together with Equation (1), we compute the mass function with [58]
f ( M ) = b 2 1 Ω CDM 1 γ cr K 1 γ cr d M H M eq M H 3 M M H 1 + 1 γ cr n g , M H ,
where once again g is given in Equation (14) by inverting the critical scaling relation in Equation (12).

3.3. Non-Linear Compaction Function Statistics

We implement non-linear compaction function statistics [33] in the NonLinearModel class within the collapse_stats.py module. For this method, the estimator for the PBH abundance is the full super-horizon compaction function C in Equation (5). Since PBH formation occurs when the super-horizon C at its maximum ( R = R m ) exceeds a certain threshold C c [21], it is useful to introduce the following variables:
v = R g , w = R 2 g ,
where primes denote derivatives with respect to the comoving radial coordinate R. In the following expressions, these quantities are understood to be evaluated at the maximum of C.
By requiring that these three conditions are satisfied—(i) the overdensity has a peak, (ii) the compaction function reaches a maximum ( v = 0 and w 0 ), and (iii) this maximum exceeds a critical threshold ( g g c )—one can rewrite β ( R ) in the following convenient form [34] (see also [25]):
β ( M H ) = 2 π 3 0 d w w g c ( w ) 4 / 3 d g f χ σ χ ( 2 π ) 3 / 2 ( 3 σ 1 / σ 2 ) M M H P ( g , w , v = 0 ) ,
where χ = 2 g + w is the trace of the Hessian at the position of the peak’s centre under the condition v = 0 . It should be noted that, here and in the following, ( g , w ) are evaluated at the maximum of the compaction function. The explicit form of the function f, arising from condition (i), is given in Equation (A15) of Ref. [29]. The probability distribution function P ( g , w , v = 0 ) , obtained from the three conditions mentioned above, is given by
P ( g , w , v = 0 ) = p ( v = 0 ) p ( g , w ) = 1 2 π σ v 2 p ( g , w ) ,
where p ( v = 0 ) is the (assumed) Gaussian distribution of v evaluated at v = 0 , i.e., the probability of having a peak in the compaction function, multiplied by the conditional joint probability of the other two variables p ( g , w ) . Assuming again for simplicity that primordial fluctuations, and therefore g, are Gaussian, p ( g , w ) becomes a bi-variate Gaussian distribution for the two correlated variables w and g with an extra correction inherited from imposing the condition v = 0 . We then have (using σ x 2 x 2 , σ x y x y , γ x y σ x y σ x σ y )
p ( w , g ) = 1 2 π det Σ exp 1 2 X T Σ 1 X ,
where
X T = ( w g ) , Σ = σ ˜ w 2 σ ˜ w g 2 σ ˜ g w 2 σ ˜ g 2 , ,
with
σ ˜ g 2 = σ g 2 ( 1 γ v g 2 ) , σ ˜ w 2 = σ w 2 ( 1 γ v w 2 ) , σ ˜ w g 2 = σ w g 2 σ w v 2 σ v g 2 σ v 2 .
The probability distribution function can therefore be explicitly written as
p ( g , w ) = 1 2 π σ ˜ w 2 ( 1 γ ˜ 2 ) exp ( w γ ˜ σ ˜ w σ ˜ g g ) 2 2 σ ˜ w 2 ( 1 γ ˜ 2 ) 1 2 π σ ˜ g 2 exp g 2 2 σ ˜ g 2 ,
or analogously exchanging g with w. γ ˜ , the so-called Pearsol coefficient, tells us the strength of the cross-correlation between the two variables:
γ ˜ = σ ˜ w g 2 σ ˜ w σ ˜ g .
The threshold depends on the shape of the compaction function and is characterised by the function g c ( w ) , where the dimensionless curvature of the linear compaction function w parametrises the profile. In the current implementation, we adopt the threshold derived using the “q-approach” [62], which asymptotically approaches 4 / 3 for large w, corresponding to sharply peaked compaction function profiles. This method relies on fiducial C profiles expressed in terms of the normalised variable q R 2 C / [ 4 C ( 1 3 2 C ) ] . One first inverts the universal threshold on the average compaction function [62,63] to obtain the threshold of the compaction function as a function of q:
C c ( q ) = 4 15 e 1 / q q 1 5 2 q Γ 5 2 q Γ 5 2 q , 1 q ,
where Γ ( x ) and Γ ( x , y ) denote the Euler gamma function and the upper incomplete gamma function, respectively. Then, to express the threshold as a function of w, one uses the relation4
w = R 2 C = 4 q C 1 3 2 C .
Evaluating the right-hand side of the previous expression at the threshold C c and substituting (26), one finds q ( w ) . Finally, this expression is substituted into the inverted relation for g as a function of C to obtain the threshold for g as a function of w:
g c ( w ) = 4 3 1 1 3 2 C c ( q ( w ) ) .
The steps outlined in Equations (26)–(28) are implemented in the module stats_utils.py to compute g c ( w ) .
Within this method, it is customary to express the mass of the PBHs using the critical scaling given in terms of the compaction function as
M = K ˜ M H C ( g ) C ( g c ( w ) ) γ cr .
The term in parentheses, when expanded around g c , reduces to Equation (12) with a different re-scaled coefficient, which we denote by K ˜ . The two numerical coefficients are optional arguments in the code, but we choose K = 6 and critical exponent γ cr = 0.36 as default values [62].
The final abundance depends crucially on the choice of the profile-dependent threshold g c ( w ) and, to some extent, the critical scaling. Both elements are subject to ongoing scrutiny in the literature (e.g., [54,55,56,57]) and can be readily modified within the stats_utils.py module of the code in the future.
By inverting (29) and trading the variable g for M, one can derive the mass function [25]:
f ( M ) = 2 π K ˜ 3 d ln M H 0 d w w ( M K M H ) 1 γ cr + 1 γ cr ( 1 3 4 g ) M eq M H 1 / 2 P ( g , w , v = 0 ) f 2 g + w σ χ ( 2 π ) 3 / 2 ( 3 σ 1 / σ 2 ) .
Here, g denotes g evaluated by inverting Equation (29).
For completeness, we report the expressions for the various correlators used in this choice of statistics. All of them can be derived from the definitions of the relevant variables in Equations (6) and (18), the σ defined in Equation (9), and the standard expression for the dimensionless primordial power spectrum given just below that equation:
σ g 2 = σ 0 2 , σ w 2 = σ 2 2 4 σ 1 2 + 4 σ 0 2 , σ χ 2 = σ 2 2 σ v 2 = 16 81 d k k 3 x sin x x 2 W ( x ) 2 P ζ σ v g v g = 16 81 0 d k k 3 x sin x x 2 W ( x ) W ( x ) x 2 P ζ σ g w = 16 81 0 d k k x 6 2 x 4 W 2 ( x ) P ζ σ v w = 16 81 0 d k k 3 x sin x x 2 W ( x ) x 4 2 x 2 W ( x ) P ζ ,
where we have defined x k R . Note that, if one strictly takes as an estimator the orthodox definition of the compaction function C (as in Equation (5)), then W, playing the role of the window function in the formula above, is automatically the real-space top-hat function.
In practice, we choose the range of k-values so that only those corresponding to amplitudes of the primordial power spectrum within a factor of 10 of the peak amplitude are integrated over. In this way, the code determines an effective width of the power spectrum and sets the limits of both w (see [25]) and M H R 2 k 2 accordingly. This threshold_factor can be modified from its default value of 0.1 in the collapse_stats.py module. We emphasise that it may be particularly important to test different values if the input power spectrum is especially broad, to ensure convergence of the σ ’s in Equation (31) and to properly account for high values of w.
As already mentioned, if initial non-Gaussianity is assumed to be present, the expressions in this Section 3 have to be corrected with the specific form of non-Gaussianity included (see, e.g., [47,48,49,50]).

4. Power Spectra and Smoothing

We implement both pre-set options for the primordial power spectrum, as well as the possibility for a user-defined primordial power spectrum that can be defined analytically or by uploading an array of P R along with their corresponding wavenumbers k.
The key pre-set options are piecewise, defined as
P R ( k ) = A k k n g , if k k A k k n d , if k > k
where A is the amplitude of the peak of the power spectrum, k is the position of the peak in the power spectrum, n g is the index of the growing slope and n d 0 is the index of the decaying slope. We also set the minimum amplitude of the power spectrum at any k to be A = 2 × 10 9 in order to match CMB observations at large scales. While such small amplitude perturbations will not affect PBH abundance, this setting can be overridden by adjusting the value of min_amplitude in the power_spectrum.py module.
The lognormal power spectrum class is defined by
P R ( k ) = A exp 1 2 ln ( k / k ) σ ln 2
where A is the amplitude of the peak, k the position of the peak, and σ ln the width of the log-normal distribution. We also implement a delta class by setting σ ln to be very small (e.g., 0.001). This produces a very narrow log-normal distribution which can be used to approximate a delta-function and avoids numerical issues with using a true delta-function in the same framework as the rest of the code. We note that this type of power spectrum is unphysical but it is often used for simplicity.
The flat power spectrum class is scale-invariant across the range of scales provided by the user, simply defined with an amplitude A.
These pre-set power spectra aim to capture the key classes of inflationary models in the literature that lead to PBH production. We emphasise that a numerical power spectrum calculated by evolving the equations of motion for the inflaton with a given inflationary potential should be used in order to calculate the precise PBH abundance from specific initial conditions.
Finally, the custom class allows the user to load an array of P R values that correspond to an array of k-values.
The values of P R are fed to the MassVariance class. The calculation of the relevant σ ( R ) , depending on the choice of statistics, involves convolving P R with the chosen window function to find the smoothed power spectrum for Press–Schechter and peaks theory methods, as well as other combinations for the non-linear statistics. These expressions are then integrated over the user-defined k-range such that the output of the MassVariance class is an interpolating function for the relevant σ ( R ) , where the R-range of validity for the interpolators are given by R = 1 / k .

5. Structure of the Code and Installation

The pbhstat package is organised into modular components, each handling a distinct stage of the calculation pipeline outlined above, from reading the initial primordial power spectrum to computing the PBH mass function. The core codebase resides in the src/ directory, structured as follows:
  • power_spectrum.py
    Contains the PowerSpectrum class, which defines and evaluates the primordial curvature power spectrum. There are some pre-defined forms for the power spectrum which can be loaded, such as flat and piecewise. It also supports both analytical and tabulated user-defined spectra, which can be implemented directly into the class or loaded as an array. The class then provides interpolation over a user-specified range of wavenumbers k.
  • mass_variance.py
    Implements the MassVariance class, which computes the smoothed mass variance σ 2 ( R ) over a range of scales, using the power spectrum and a choice of window function. Currently, the Gaussian window function and the real-space top-hat window functions are implemented, with a large-k cut-off optional for the latter.
  • collapse_stats.py
    Provides statistical models for PBH formation. It includes classes for the Press–Schechter formalism (PressSchechterModel), peaks theory (PeaksTheoryModel), and for non-linear compaction statistics (NonLinearModel). These classes set up the computation of the mass function of primordial black holes as a function of mass.
  • mass_function.py
    Contains the MassFunction class, which wraps around the collapse statistics to compute the differential PBH mass function f ( M ) and total abundance f PBH .
  • stats_utils.py
    Hosts auxiliary functions used predominantly for the NonLinearkModel class, such as critical threshold calculations, filtering functions, and intermediate formulae that can be pre-computed.
  • plot_utils.py
    Provides helper routines for plotting key quantities such as the power spectrum, mass variance, and PBH mass function.
  • constants.py
    Stores fiducial values of cosmological quantities that can be edited and will be imported for abundance calculations.
This modular architecture is designed to be user-friendly and easily adaptable with extensions and further refinements as the user sees fit.

6. Usage Instructions

6.1. Installation

To install, it is recommended to create either a Python virtual environment or a conda environment, and then run the following:
  • pip install pbhstat
We provide two example jupyter Python notebooks for quick-start examples of how to use the code when installed using pip. Alternatively, download the code from github with
  • git clone https://github.com/pipcole/pbhstat.git
  • and run
  • cd pbhstat
  • pip install -e .
  • {for an editable install. The required dependencies are numpy, matplotlib, scipy, and tqdm.
The code has been tested with Python version 3.9.15 on an Apple M3 Pro running macOS Sonoma 14.1 and with Python 3.12.3 on a Lenovo Yoga 7 2-in-1 14IML9 running Ubuntu 24.04 LTS as well as with Python version 3.11 in a Google Colab notebook.

6.2. Example Usage

We provide two example Python notebooks with the code release for calculating the mass function and PBH abundance from a custom primordial power spectrum and from a pre-defined piecewise power spectrum. We annotate below the step-by-step code snippets to perform this.
First, import numpy, pickle, or similar if loading own arrays from file and pbhstat, assuming it has been successfully installed with pip. Then, import the relevant classes and functions from the package. Note that the imports will need to be edited if the package is not installed with pip.
Universe 11 00322 i001
Next, define a power spectrum and corresponding k-values. All inverse length units should be in Mpc 1 . This could be a custom power spectrum either defined analytically, for example,
Universe 11 00322 i002
  • or loaded from file:
Universe 11 00322 i003
  • which should then be instantiated with
Universe 11 00322 i004
  • Alternatively, the power spectrum can be generated from one of the pre-set options, for example, a piecewise power spectrum which can be instantiated directly:
Universe 11 00322 i005
We will now assume that we are using ps_piecewise for the remainder of these instructions. The next step is to instantiate the mass variance (and higher moments) with a choice of window function (realtophat or gaussian) and statistics (press, peaks, or nonlinear). When choosing the real top-hat window function, there is also an option to use the large-k cut-off as described in Section 3.1—the default is False. There are some incompatible choices which will throw an exception, for example, that the non-linear statistics must be chosen together with the real top-hat window function.
Universe 11 00322 i006
Finally, all that is left is to instantiate the mass function class with the same statistics model as the mass variance, and evaluate on a grid of M values, calculating f PBH as well if desired. Numerical values of K, g c , and γ can be defined by the user here as optional arguments when instantiating the mass function class, but recommended values are defaulted to.
Furthermore, correlations with v can be enabled or disabled in the non-linear compaction function statistic using the flag vcorr. By toggling vcorr, the user can assess the impact of consistently accounting for the conditional probability of v = 0 , i.e., the probability of being at an extremum of the compaction function. In particular, setting vcorr=False implies that all σ ˜ in Equation (23) reduce to their untilde versions. It has been shown analytically in [25] that for a broad spectrum, these correlations are subleading for R 1 / k IR , where k IR is the infrared scale associated with the broad power spectrum.
The number of M values that f ( M ) is calculated for can be adjusted from the default 50 with the optional argument mpbh_vals in the mass function evaluate call.
Universe 11 00322 i007
  • Key quantities can be plotted using the routines in plot_utils.py.
Universe 11 00322 i008
  • We plot a comparison of mass functions for different statistics choices in Figure 1 for a broad log-normal distribution and in Figure 2 for a narrow step function.
In Figure 1, the non-linear compaction function statistics yields a narrower and higher peak toward the infrared part of the spectrum compared to the other two statistical approaches considered. This behaviour has been extensively discussed in Ref. [25], and we adopt the same underlying assumptions here, particularly regarding the threshold criterion. It was shown that for broad power spectra, the mass function is dominated by infrared modes associated with curvature profiles in which the compaction function is sharply peaked (i.e., with large values of w). In the mildly broad log-normal example considered here, these infrared modes produce PBHs that are not-so-heavy due to the suppression implied by the critical scaling relation in Equation (29), namely M M H w 2 γ cr for large w, resulting in PBHs with masses significantly below the horizon mass. It is worth noting that while Press–Schechter and peaks theory lead to mass functions with the same shape, their overall amplitudes agree only because we choose the power spectrum amplitudes such that the total PBH abundance for the two cases are comparable. If instead the same value for the power spectrum amplitude is used for both methods, there is a difference of 2–3 orders of magnitude in the resulting PBH abundance as demonstrated in, e.g., ref. [64]. In Figure 2, as a benchmark for a narrow spectrum, we use a top-hat profile with width k UV / k IR = 1.3 . For such narrow spectra, all statistics prefer the same comoving scale, namely r 2.74 / k p , which corresponds to the first maximum of σ g 2 . The difference in the position of the main peak in the resulting mass function arises from the different choices of threshold and overall normalisation in the critical scaling relation. Specifically, we adopt the same parameters for Press–Schechter and peaks theory (see Section 3), namely ( K , g c ) = ( 4 ,   0.77 ) . For the non-linear compaction function statistics, we instead choose K ˜ = 6 , and for a narrow spectrum, g c 0.91 [25].
In the case of a monochromatic power spectrum, all methods produce mass functions that are nearly identical in shape because the statistical profile of the various estimators is essentially fixed. In contrast, for broader spectra, the situation becomes significantly more complex due to the influence of different statistical realisations. This influence is more relevant for the non-linear compaction function statistics, where one scans over different realisations of the curvature of the compaction function. Furthermore, the dependence on the threshold on w provides a way to account for the influence of UV modes on IR modes. Whether this approach is sufficient is still under investigation. In contrast, for the other two statistics, this effect is incorporated by imposing an artificial cut-off at k 4.49 / R (see discussion in Section 3.1). These are the sources of the discrepancy behind the different curves in Figure 1. As stated in the introduction, the present tool introduced in this work is also intended to explore differences between distinct statistical approaches that remain under active investigation in the literature.
Finally, we provide a simple interface so that mass functions can be overlaid with the observational constraints available in the PBHbounds repository [65], available here: https://github.com/bradkav/PBHbounds/ (accessed on 3 July 2025). Arrays of f ( M ) and corresponding M values can be saved to the directory in which PBHbounds is located with
Universe 11 00322 i009
  • Then, a modified version of the default script PlotPBHbounds.py is available at https://github.com/pipcole/pbhstat (accessed on 3 July 2025) to be run in the directory of PBHbounds. This will overplot the mass function produced with pbhstat with the bounds (that can be specified via the command line, if not all bounds are desired) from PBHbounds. We emphasise that the constraints themselves depend on the form of the mass function, and therefore overlaying broad mass functions with monochromatic PBH constraints is inconsistent. We recommend that this utility should only be used for narrow mass functions, and in any case as an approximate guide. See [66] for a method for converting constraints from monochromatic to extended mass functions.

7. Summary and Outlook

pbhstat is a simple, user-friendly tool for computing the mass function of primordial black holes from an initial primordial power spectrum. Given the many sensitivities of this calculation to the choice of power spectrum, window function, numerical coefficients, and statistics that describe the collapse of the perturbations, we aim to provide a community tool that enables easy comparisons. Furthermore, we hope it will be useful for researchers who are non-experts on primordial black holes, who need a reasonable PBH mass function to input into their pipelines for calculating, e.g., observational constraints from pulsar timing arrays [67,68] or microlensing experiments [69,70]. The code could also provide a supporting tool for future and ongoing efforts toward a complete framework for computing gravitational wave signatures from PBHs, as is in progress within the LISA Cosmology Working Group.
The current version of the code includes the three statistical methods briefly outlined in Section 3 and assumes that the comoving curvature perturbation follows an approximately Gaussian distribution. We would like, in the future, to add the ability to deal with additional complications such as the softening of the equation of state during the QCD phase transition [71,72,73] (relevant for M black holes) and non-Gaussianity [40,41,42,43,44,45,46,47,48,49,50,74] as well as keeping the package up to date with theoretical advances as they are established. We welcome feedback and suggestions at https://github.com/pipcole/pbhstat (accessed on 3 July 2025).

Author Contributions

Conceptualization, P.S.C. and J.F.; Methodology, P.S.C. and J.F.; Software, P.S.C. and J.F.; Validation, P.S.C. and Jacopo Fumagalli; Writing—original draft, P.S.C. and J.F.; Writing—review and editing, P.S.C. and J.F. All authors have read and agreed to the published version of the manuscript.

Funding

P.C. is supported by ERC Starting Grant No. 945155–GWmining, Cariplo Foundation Grant No. 2021-0555, MUR PRIN Grant No. 2022-Z9X4XS, MUR Grant “Progetto Dipartimenti di Eccellenza 2023-2027” (BiCoQ), and the ICSC National Research Centre funded by NextGenerationEU. The research of J.F. is supported by the Grant PID2022-136224NB-C22, funded by MCIN/AEI/10.13039/501100011033/FEDER, UE, and by the Grant/2021-SGR00872.

Acknowledgments

The authors thank Andrew Gow for helpful discussions.

Conflicts of Interest

The authors declare no conflicts of interest.

Notes

1
In some works, this variable is also denoted by C G , C ζ , or δ l .
2
Here, we defined the width parameters to be dimensionless.
3
This choice, strictly speaking, refers to a non-canonical definition of the compaction function; see [32].
4
We remind the reader that all expressions are considered at the maximum of the compaction function where C = g = 0 .

References

  1. Zel’dovich, Y.B.; Novikov, I.D. The Hypothesis of Cores Retarded during Expansion and the Hot Cosmological Model. Soviet Astron. AJ (Engl. Transl.) 1967, 10, 602. [Google Scholar]
  2. Hawking, S. Gravitationally collapsed objects of very low mass. Mon. Not. Roy. Astron. Soc. 1971, 152, 75. [Google Scholar] [CrossRef]
  3. Carr, B.J.; Hawking, S.W. Black holes in the early Universe. Mon. Not. Roy. Astron. Soc. 1974, 168, 399–415. [Google Scholar] [CrossRef]
  4. Page, D.N.; Hawking, S.W. Gamma rays from primordial black holes. Astrophys. J. 1976, 206, 1–7. [Google Scholar] [CrossRef]
  5. MacGibbon, J.H.; Carr, B.J. Cosmic rays from primordial black holes. Astrophys. J. 1991, 371, 447–469. [Google Scholar] [CrossRef]
  6. Barrau, A.; Boudoul, G.; Donnard, J.; Grain, J.; Servant, G. Gamma-ray constraints on the density of primordial black holes. Astron. Astrophys. 2003, 398, 403–410. [Google Scholar] [CrossRef]
  7. Sasaki, M.; Suyama, T.; Tanaka, T.; Yokoyama, S. Primordial black hole scenario for the gravitational wave event GW150914. Phys. Rev. Lett. 2016, 117, 061101. [Google Scholar] [CrossRef]
  8. Carr, B.; Kohri, K.; Sendouda, Y.; Yokoyama, J. Constraints on primordial black holes. Rept. Prog. Phys. 2021, 84, 116902. [Google Scholar] [CrossRef] [PubMed]
  9. Green, A.M.; Kavanagh, B.J. Primordial black holes as a dark matter candidate. J. Phys. G 2021, 48, 043001. [Google Scholar] [CrossRef]
  10. Khlopov, M.Y. Primordial black holes. Res. Astron. Astrophys. 2010, 10, 495–528. [Google Scholar] [CrossRef]
  11. Ivanov, P.; Naselsky, P.; Novikov, I. Inflation and primordial black holes as dark matter. Phys. Rev. D 1994, 50, 7173–7178. [Google Scholar] [CrossRef]
  12. Carr, B.J.; Gilbert, J.H.; Lidsey, J.E. Black hole relics and inflation: Limits on blue perturbation spectra. Phys. Rev. D 1994, 50, 4853–4867. [Google Scholar] [CrossRef]
  13. Garcia-Bellido, J.; Linde, A.D.; Wands, D. Density perturbations and black hole formation in hybrid inflation. Phys. Rev. D 1996, 54, 6040–6058. [Google Scholar] [CrossRef]
  14. Yoo, C.M. The basics of primordial black hole formation and abundance estimation. arXiv 2024, arXiv:2211.13512. [Google Scholar] [CrossRef]
  15. Carr, B.; Kuhnel, F. Primordial black holes as dark matter candidates. SciPost Phys. Lect. Notes 2022, 48, 1. [Google Scholar] [CrossRef]
  16. Escrivà, A.; Kuhnel, F.; Tada, Y. Primordial Black Holes. In Black Holes in the Era of Gravitational-Wave Astronomy; Elsevier: Amsterdam, The Netherlands, 2022. [Google Scholar] [CrossRef]
  17. Musco, I.; Miller, J.C.; Rezzolla, L. Computations of primordial black hole formation. Class. Quant. Grav. 2005, 22, 1405–1424. [Google Scholar] [CrossRef]
  18. Escrivà, A. Simulation of primordial black hole formation using pseudo-spectral methods. Phys. Dark Univ. 2020, 27, 100466. [Google Scholar] [CrossRef]
  19. Musco, I. Numerical Simulations of Primordial Black Holes. In Primordial Black Holes; Springer: Singapore, 2025. [Google Scholar] [CrossRef]
  20. Germani, C.; Musco, I. Abundance of Primordial Black Holes Depends on the Shape of the Inflationary Power Spectrum. Phys. Rev. Lett. 2019, 122, 141302. [Google Scholar] [CrossRef] [PubMed]
  21. Musco, I. Threshold for primordial black holes: Dependence on the shape of the cosmological perturbations. Phys. Rev. D 2019, 100, 123524. [Google Scholar] [CrossRef]
  22. Ando, K.; Inomata, K.; Kawasaki, M. Primordial black holes and uncertainties in the choice of the window function. Physical Review D 2018, 97, 103528. [Google Scholar] [CrossRef]
  23. Yoo, C.M.; Harada, T.; Garriga, J.; Kohri, K. Primordial black hole abundance from random Gaussian curvature perturbations and a local density threshold. Prog. Theor. Exp. Phys. 2018, 2018, 123E01. [Google Scholar] [CrossRef]
  24. Young, S. Computation of the Abundance of Primordial Black Holes. In Primordial Black Holes; Springer: Singapore, 2025. [Google Scholar] [CrossRef]
  25. Fumagalli, J.; Garriga, J.; Germani, C.; Sheth, R.K. Unexpected shape of the primordial black hole mass function. Phys. Rev. D 2025, 111, 123518. [Google Scholar] [CrossRef]
  26. Pi, S.; Sasaki, M.; Takhistov, V.; Wang, J. Primordial Black Hole Formation from Power Spectrum with Finite-width. arXiv 2024, arXiv:2501.00295. [Google Scholar] [CrossRef]
  27. Press, W.H.; Schechter, P. Formation of Galaxies and Clusters of Galaxies by Self-Similar Gravitational Condensation. Astrophys. J. 1974, 187, 425–438. [Google Scholar] [CrossRef]
  28. Carr, B.J. The Primordial black hole mass spectrum. Astrophys. J. 1975, 201, 1–19. [Google Scholar] [CrossRef]
  29. Bardeen, J.M.; Bond, J.R.; Kaiser, N.; Szalay, A.S. The Statistics of Peaks of Gaussian Random Fields. Astrophys. J. 1986, 304, 15. [Google Scholar] [CrossRef]
  30. Green, A.M.; Liddle, A.R.; Malik, K.A.; Sasaki, M. A New calculation of the mass fraction of primordial black holes. Phys. Rev. D 2004, 70, 041502. [Google Scholar] [CrossRef]
  31. Young, S.; Byrnes, C.T.; Sasaki, M. Calculating the mass fraction of primordial black holes. J. Cosmol. Astropart. Phys. 2014, 2014, 45. [Google Scholar] [CrossRef]
  32. Young, S.; Musso, M. Application of peaks theory to the abundance of primordial black holes. J. Cosmol. Astropart. Phys. 2020, 11, 22. [Google Scholar] [CrossRef]
  33. Germani, C.; Sheth, R.K. Nonlinear statistics of primordial black holes from Gaussian curvature perturbations. Phys. Rev. D 2020, 101, 063520. [Google Scholar] [CrossRef]
  34. Germani, C.; Sheth, R.K. The Statistics of Primordial Black Holes in a Radiation-Dominated Universe: Recent and New Results. Universe 2023, 9, 421. [Google Scholar] [CrossRef]
  35. Özsoy, O.; Tasinato, G. Inflation and Primordial Black Holes. Universe 2023, 9, 203. [Google Scholar] [CrossRef]
  36. Pattison, C.; Vennin, V.; Assadullahi, H.; Wands, D. Quantum diffusion during inflation and primordial black holes. J. Cosmol. Astropart. Phys. 2017, 2017, 46. [Google Scholar] [CrossRef]
  37. Ezquiaga, J.M.; García-Bellido, J. Quantum diffusion beyond slow-roll: Implications for primordial black-hole production. J. Cosmol. Astropart. Phys. 2018, 2018, 18. [Google Scholar] [CrossRef]
  38. Biagetti, M.; De Luca, V.; Franciolini, G.; Kehagias, A.; Riotto, A. The formation probability of primordial black holes. Phys. Lett. B 2021, 820, 136602. [Google Scholar] [CrossRef]
  39. Vennin, V.; Wands, D. Quantum Diffusion and Large Primordial Perturbations from Inflation. In Primordial Black Holes; Springer Nature: Singapore, 2025; pp. 201–227. [Google Scholar] [CrossRef]
  40. Bullock, J.S.; Primack, J.R. NonGaussian fluctuations and primordial black holes from inflation. Phys. Rev. D 1997, 55, 7423–7439. [Google Scholar] [CrossRef]
  41. Ivanov, P. Nonlinear metric perturbations and production of primordial black holes. Phys. Rev. D 1998, 57, 7145–7154. [Google Scholar] [CrossRef]
  42. Young, S.; Byrnes, C.T. Primordial black holes in non-Gaussian regimes. J. Cosmol. Astropart. Phys. 2013, 08, 52. [Google Scholar] [CrossRef]
  43. Byrnes, C.T.; Copeland, E.J.; Green, A.M. Primordial black holes as a tool for constraining non-Gaussianity. Phys. Rev. D 2012, 86, 043512. [Google Scholar] [CrossRef]
  44. Tada, Y.; Yokoyama, S. Primordial black holes as biased tracers. Phys. Rev. D 2015, 91, 123534. [Google Scholar] [CrossRef]
  45. Atal, V.; Germani, C. The role of non-Gaussianities in Primordial Black Hole formation. Phys. Dark Univ. 2019, 24, 100275. [Google Scholar] [CrossRef]
  46. Franciolini, G.; Kehagias, A.; Matarrese, S.; Riotto, A. Primordial Black Holes from Inflation and non-Gaussianity. J. Cosmol. Astropart. Phys. 2018, 3, 16. [Google Scholar] [CrossRef]
  47. Kehagias, A.; Musco, I.; Riotto, A. Non-Gaussian Formation of Primordial Black Holes: Effects on the Threshold. J. Cosmol. Astropart. Phys. 2019, 12, 29. [Google Scholar] [CrossRef]
  48. Riccardi, F.; Taoso, M.; Urbano, A. Solving peak theory in the presence of local non-gaussianities. J. Cosmol. Astropart. Phys. 2021, 8, 60. [Google Scholar] [CrossRef]
  49. Gow, A.D.; Assadullahi, H.; Jackson, J.H.P.; Koyama, K.; Vennin, V.; Wands, D. Non-perturbative non-Gaussianity and primordial black holes. EPL 2023, 142, 49001. [Google Scholar] [CrossRef]
  50. Matsubara, T.; Sasaki, M. Non-Gaussianity effects on the primordial black hole abundance for sharply-peaked primordial spectrum. J. Cosmol. Astropart. Phys. 2022, 2022, 94. [Google Scholar] [CrossRef]
  51. Nakama, T.; Silk, J.; Kamionkowski, M. Stochastic gravitational waves associated with the formation of primordial black holes. Phys. Rev. D 2017, 95, 043511. [Google Scholar] [CrossRef]
  52. Shibata, M.; Sasaki, M. Black hole formation in the Friedmann universe: Formulation and computation in numerical relativity. Phys. Rev. D 1999, 60, 084002. [Google Scholar] [CrossRef]
  53. Harada, T.; Yoo, C.M.; Nakama, T.; Koga, Y. Cosmological long-wavelength solutions and primordial black hole formation. Phys. Rev. D 2015, 91, 084057. [Google Scholar] [CrossRef]
  54. Uehara, K.; Escrivà, A.; Harada, T.; Saito, D.; Yoo, C.M. Numerical simulation of type II primordial black hole formation. J. Cosmol. Astropart. Phys. 2025, 1, 3. [Google Scholar] [CrossRef]
  55. Shimada, M.; Escrivá, A.; Saito, D.; Uehara, K.; Yoo, C.M. Primordial black hole formation from type II fluctuations with primordial non-Gaussianity. J. Cosmol. Astropart. Phys. 2025, 2, 18. [Google Scholar] [CrossRef]
  56. Inui, R.; Joana, C.; Motohashi, H.; Pi, S.; Tada, Y.; Yokoyama, S. Primordial black holes and induced gravitational waves from logarithmic non-Gaussianity. J. Cosmol. Astropart. Phys. 2025, 3, 21. [Google Scholar] [CrossRef]
  57. Escrivà, A. The threshold for PBH formation in the type-II region and its analytical estimation. arXiv 2025, arXiv:2504.05814. [Google Scholar] [CrossRef]
  58. Gow, A.D.; Byrnes, C.T.; Cole, P.S.; Young, S. The power spectrum on small scales: Robust constraints and comparing PBH methodologies. J. Cosmol. Astropart. Phys. 2021, 2, 2. [Google Scholar] [CrossRef]
  59. Young, S. The primordial black hole formation criterion re-examined: Parametrisation, timing and the choice of window function. Int. J. Mod. Phys. D 2019, 29, 2030002. [Google Scholar] [CrossRef]
  60. Niemeyer, J.C.; Jedamzik, K. Near-Critical Gravitational Collapse and the Initial Mass Function of Primordial Black Holes. Phys. Rev. Lett. 1998, 80, 5481–5484. [Google Scholar] [CrossRef]
  61. Young, S.; Musco, I.; Byrnes, C.T. Primordial black hole formation and abundance: Contribution from the non-linear relation between the density and curvature perturbation. J. Cosmol. Astropart. Phys. 2019, 11, 12. [Google Scholar] [CrossRef]
  62. Escrivà, A.; Germani, C.; Sheth, R.K. Universal threshold for primordial black hole formation. Phys. Rev. D 2020, 101, 044022. [Google Scholar] [CrossRef]
  63. Kehagias, A.; Perrone, D.; Riotto, A. Why the universal threshold for primordial black hole formation is universal. Class. Quant. Grav. 2025, 42, 055010. [Google Scholar] [CrossRef]
  64. Wang, Q.; Liu, Y.C.; Su, B.Y.; Li, N. Primordial black holes from the perturbations in the inflaton potential in peak theory. Phys. Rev. D 2021, 104, 083546. [Google Scholar] [CrossRef]
  65. Kavanagh, B.J. Bradkav/PBHbounds: Release Version, version = 1.0; Zenodo: Geneve, Switzerland, 2019. [Google Scholar] [CrossRef]
  66. Bellomo, N.; Bernal, J.L.; Raccanelli, A.; Verde, L. Primordial Black Holes as Dark Matter: Converting Constraints from Monochromatic to Extended Mass Distributions. J. Cosmol. Astropart. Phys. 2018, 1, 4. [Google Scholar] [CrossRef]
  67. Afzal, A.; Agazie, G.; Anumarlapudi, A.; Archibald, A.M.; Arzoumanian, Z.; Baker, P.T.; Bécsy, B.; Blanco-Pillado, J.J.; Blecha, L.; Boddy, K.K. The NANOGrav 15 yr Data Set: Search for Signals from New Physics. Astrophys. J. Lett. 2023, 951, L11. [Google Scholar] [CrossRef]
  68. Antoniadis, J.; Arumugam, P.; Arumugam, S.; Babak, S.; Bagchi, M.; Nielsen, A.S.B.; Bassa, C.G.; Bathula, A.; Berthereau, A.; Bonetti, M.; et al. The second data release from the European Pulsar Timing Array-IV. Implications for massive black holes, dark matter, and the early Universe. A&A 2024, 685, A94. [Google Scholar] [CrossRef]
  69. Niikura, H.; Takada, M.; Yasuda, N.; Lupton, R.H.; Sumi, T.; More, S.; Kurita, T.; Sugiyama, S.; More, A.; Oguri, M.; et al. Microlensing constraints on primordial black holes with Subaru/HSC Andromeda observations. Nat. Astron. 2019, 3, 524–534. [Google Scholar] [CrossRef]
  70. Mróz, P.; Udalski, A.; Szymański, M.K.; Soszyński, I.; Pietrukowicz, P.; Kozłowski, S.; Poleski, R.; Skowron, J.; Ulaczyk, K.; Gromadzki, M.; et al. Limits on Planetary-mass Primordial Black Holes from the OGLE High-cadence Survey of the Magellanic Clouds. Astrophys. J. Lett. 2024, 976, L19. [Google Scholar] [CrossRef]
  71. Byrnes, C.T.; Hindmarsh, M.; Young, S.; Hawkins, M.R. Primordial black holes with an accurate QCD equation of state. J. Cosmol. Astropart. Phys. 2018, 2018, 41. [Google Scholar] [CrossRef]
  72. Escrivà, A.; Bagui, E.; Clesse, S. Simulations of PBH formation at the QCD epoch and comparison with the GWTC-3 catalog. J. Cosmol. Astropart. Phys. 2023, 2023, 4. [Google Scholar] [CrossRef]
  73. Musco, I.; Jedamzik, K.; Young, S. Primordial black hole formation during the QCD phase transition: Threshold, mass distribution, and abundance. Phys. Rev. D 2024, 109, 083506. [Google Scholar] [CrossRef]
  74. Young, S.; Musco, I.; Byrnes, C.T. Influence of large local and nonlocal bispectra on primordial black hole abundance. J. Cosmol. Astropart. Phys. 2022, 2, 32. [Google Scholar] [CrossRef]
Figure 1. Comparison of mass functions calculated with the three different statistical methods. The power spectrum is chosen to be a log-normal distribution with width Δ = 1 and the window function is a real-space top-hat. The amplitudes of the peak of the power spectrum are A = { 0.00865 , 0.0077 , 0.009 } for Press–Schechter, peaks theory, and the non-linear compaction statistics, respectively. All mass functions result in f PBH = 2.5 × 10 3 .
Figure 1. Comparison of mass functions calculated with the three different statistical methods. The power spectrum is chosen to be a log-normal distribution with width Δ = 1 and the window function is a real-space top-hat. The amplitudes of the peak of the power spectrum are A = { 0.00865 , 0.0077 , 0.009 } for Press–Schechter, peaks theory, and the non-linear compaction statistics, respectively. All mass functions result in f PBH = 2.5 × 10 3 .
Universe 11 00322 g001
Figure 2. Comparison of mass functions calculated with the three different statistical methods. The power spectrum is chosen to be a narrow top-hat function with width in k-space equal to 1.3 and the window function is a real-space top-hat. The amplitudes of the peak of the power spectrum are A = { 0.02795 , 0.02455 , 0.03118 } for Press–Schechter, peaks theory, and the non-linear compaction statistics, respectively. All mass functions result in f PBH = 2.5 × 10 3 .
Figure 2. Comparison of mass functions calculated with the three different statistical methods. The power spectrum is chosen to be a narrow top-hat function with width in k-space equal to 1.3 and the window function is a real-space top-hat. The amplitudes of the peak of the power spectrum are A = { 0.02795 , 0.02455 , 0.03118 } for Press–Schechter, peaks theory, and the non-linear compaction statistics, respectively. All mass functions result in f PBH = 2.5 × 10 3 .
Universe 11 00322 g002
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Cole, P.S.; Fumagalli, J. pbhstat: A Python Package for Calculating the Primordial Black Hole Abundance. Universe 2025, 11, 322. https://doi.org/10.3390/universe11090322

AMA Style

Cole PS, Fumagalli J. pbhstat: A Python Package for Calculating the Primordial Black Hole Abundance. Universe. 2025; 11(9):322. https://doi.org/10.3390/universe11090322

Chicago/Turabian Style

Cole, Philippa S., and Jacopo Fumagalli. 2025. "pbhstat: A Python Package for Calculating the Primordial Black Hole Abundance" Universe 11, no. 9: 322. https://doi.org/10.3390/universe11090322

APA Style

Cole, P. S., & Fumagalli, J. (2025). pbhstat: A Python Package for Calculating the Primordial Black Hole Abundance. Universe, 11(9), 322. https://doi.org/10.3390/universe11090322

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop