Rapid population synthesis code for binary black-hole mergers in dynamical environments.
Author: Konstantinos Kritos [email protected]
Version: July 7, 2023
(Thanks to H. Cruz for digitizing my hand-drawn logo!)
- Overview
- Requirements
- Units
- Input parameters
- Running a simulation
- Output files
- Applications of the code
- Citing this work
- Reporting bugs
- Thank you
The repository provides the source codes of the current version, files ./rapster2.py
, ./functions2.py
, ./constants2.py
, ThreeBodyBinary2.py
, BBHevol2.py
, TwoBodyCapture2.py
, Exchanges2.py
, triples2.py
, Planck18_lookup_table.npz
, and all necessary data files in folder ./MzamsMrem/
, for the rapid evolution of dense star cluster environments and the dynamical assembly of binary black hole mergers.
The modeling accounts for the necessary physical processes regarding the formation of binary black holes employing semi-analytic prescriptions as described in Sec. 2 of K. Kritos et al. (2022). This is our code paper we wrote together with V. Strokov, V. Baibhav, and E. Berti.
For computational efficiency, the folder ./MzamsMrem/
contains 12 files with pre-calculated look-up tables of stellar remnants masses on a grid of zero-age main sequence values up to
In the current version, we have also included look-up tables for the Mandel-Muller, and the Fryer et al. (2012) delayed and rapid remnant-mass prescription models in files Mueller_Mandel.txt
, MzamsMrem_F12d.txt
, and MzamsMrem_F12r.txt
, respectively.
Finally, Planck18_lookup_table.npz
is a look-up table for the redshidt-lookback time and lookback time-redshift relations assuming the Planck 2018 cosmology.
- BH: black hole
- BBH: binary black hole
- GW: gravitational wave
The following Python packages are required
-
$\tt precession$ (1.0.3) -
$\tt astropy$ (5.0.4) -
$\tt argparse$ (1.1) -
$\tt numpy$ (>=1.12.3) -
$\tt scipy$ (1.8.0) $\tt pandas$ $\tt time$
The code is tested with packages in the versions shown in parentheses above, however, it is likely that other versions work too.
It is suggested that the
The current version of the code uses astrophysical units:
- Mass: solar mass (
$M_\odot$ ) - Distance: parsec (
$\rm pc$ ) - Time:
$\rm Myr$ - Velocity:
$\rm km\ s^{-1}$ - Gravitational constant:
$G=1/232$
The code accepts parameters with flag options.
For a description of all input parameters, run the following command in the command line interface:
python3 rapster2.py --help
or see Table 1 from K. Kritos et al. (2022).
For the user’s convenience we paste the list of optional arguments in the form of a Table here as well:
Flag | Description | Type | Default |
---|---|---|---|
-N, --number | Initial number of stars | int | 1000000 |
-r, --half_mass_radius | Initial half-mass radius [pc] | float | 1 |
-mm, --minimum_star_mass | Smallest ZAMS mass [Msun] | float | 0.08 |
-mM, --maximum_star_mass | Largest ZAMS mass [Msun] | float | 150 |
-Z, --metallicity | Absolute metallicity | float | 0.001 |
-z, --cluster_formation_redshift | Redshift of cluster formation | float | 3.0 |
-n, --central_stellar_density | Central stellar number density [pc^-3] | float | 1e6 |
-fb, --binary_fraction | Initial binary star fraction | float | 0.1 |
-S, --seed | Seed number | int | 1234567890 |
-dtm, --minimum_time_step | Minimum simulation time-step [Myr] | float | 0.1 |
-dtM, --maximum_time_step | Maximum simulation time-step [Myr] | float | 50.0 |
-tM, --maximum_time | Maximum simulation time [Myr] | float | 140000 |
-wK, --supernova_kick_parameter | One-dimensional supernova kick parameter [km/s] | float | 265.0 |
-K, --natal_kick_prescription | Natal kick prescription (0 for fallback, 1 for momentum conservation) | int | 0 |
-R, --galactocentric_radius | Initial galactocentric radius [kpc] | float | 8.0 |
-vg, --galactocentric_velocity | Galactocentric circular velocity [km/s] | float | 220.0 |
-s, --spin_parameter | Natal spin parameter of first generation (1g) BHs | float | 0.0 |
-SD, --spin_distribution | Natal spin distribution model (0 for uniform, 1 for monochromatic) | int | 0 |
-P, --print_information | Print runtime information (0 for no, 1 for yes) | int | 1 |
-Mi, --mergers_file_indicator | Export mergers file (0 for no, 1 for yes) | int | 1 |
-MF, --mergers_file_name | Name of .txt output file with BBH merger source parameters | str | mergers |
-Ei, --evolution_file_indicator | Export evolution file (0 for no, 1 for yes) | int | 1 |
-EF, --evolution_file_name | Name of .txt output file with time-dependent quantities | str | evolution |
-Hi, --hardening_file_indicator | Export hardening file (0 for no, 1 for yes) | int | 1 |
-HF, --hardening_file_name | Name of .txt output file with BBH time evolution information | str | hardening |
-BIi, --blackholes_in_file_indicator | Use external BH file (0 for no, 1 for yes) | int | 0 |
-BIF, --blackholes_in_file_name | Name of .npz input file with initial BH masses | str | input_BHs.npz |
-BOi, --blackholes_out_file_indicator | Export BH masses file (0 for no, 1 for yes) | int | 1 |
-BOF, --blackholes_out_file_name | Name of .npz file with the masses of all BHs in solar masses | str | output_BHs.npz |
-RP, --remnant_mass_prescription | Remnant mass prescription (0 for SEVN delayed, 1 for Fryer 2012 delayed, 2 for SEVN rapid, 3 for Fryer 2012 rapid) | int | 1 |
usage: rapster2.py [-h] [-N] [-r] [-mm] [-mM] [-Z] [-z] [-n] [-fb] [-S] [-dtm] [-dtM] [-tM] [-wK] [-K] [-R] [-vg] [-s] [-SD] [-P] [-Mi] [-MF] [-Ei] [-EF] [-Hi] [-HF] [-BIi] [-BIF] [-BOi] [-BOF] [-RP]
As an example, we give the commands that produce data used to generate the results in Fig.4 of K. Kritos et al. (2022):
python3 rapster2.py -N 200000 -r 1.6 -n 9.5e4 -R 8 -Z 0.001 -MF meA -EF evA -HF haA -BOF bhA
python3 rapster2.py -N 800000 -r 1.6 -n 45.6e4 -R 8 -Z 0.001 -MF meB -EF evB -HF haB -BOF bhC
python3 rapster2.py -N 1600000 -r 1.6 -n 257e4 -R 20 -Z 0.0005 -MF meC -EF evC -HF haC -BOF bhC
The default values are assumed for other parameters not entered in the commands above.
To test the code, execute the program with all default values:
python3 rapster2.py
This should create four files mergers.txt
, evolution.txt
, hardening.txt
, and output_BHs.npz
in your current directory. To check and verify whether you have produced these files correctly, we include the corresponding files mergers_TEST.txt
, evolution_TEST.txt
, hardening_TEST.txt
, and output_BHs_TEST.npz
in folder ./Testing2/
in this repository with data that should match your output.
Taking different values of seed number corresponds to different realizations of the system under the same initial conditions. Passing the argument $$\tt$ RANDOM$$ in the -s flag simulates the star cluster with a pseudo-randomly generated number. Notice this syntax works only in the bash environment.
At the end of each simulation the code generates by default three .txt and one .npz file, one with information about all dynamical mergers that took place during the simulation, a second file that keeps track of time-dependent quantities, a third file that stores information about the hardening evolution of each BBH, and finally a file with the masses of the BHs that are initially retained and at end of the simulation, respectively.
a) Column description of mergers .txt file:
Column | Variable | Description |
---|---|---|
1 | seed of the simulation | |
2 | Unique integer binary identifier | |
3 | Formation mechanism of BBH | |
4 | Semimajor axis ( |
|
5 | Eccentricity when BBH enters the GW regime | |
6 | Primary mass ( |
|
7 | Secondary mass ( |
|
8 | Primary dimensionless spin parameter | |
9 | Secondary dimensionless spin parameter | |
10 | Generation of primary | |
11 | Generation of secondary | |
12 | Polar angle ( |
|
13 | Polar angle ( |
|
14 | Azimuthal angle ( |
|
15 | Time ( |
|
16 | Redshift BBH formed | |
17 | Time ( |
|
18 | Redshift BBH merged | |
19 | Remnant mass ( |
|
20 | Remnant dimensionless spin parameter | |
21 | Remnant generation | |
22 | GW kick (km/s) of remnant BH | |
23 | Effective dimensionless spin parameter | |
24 | Mass ratio | |
25 | Initial cluster mass ( |
|
26 | Initial half-mass radius ( |
|
27 | Metallicity | |
28 | Redshift of cluster formation |
BBH assembly channel (first column of mergers file), the -
sign means BBH was ejected and merged outside the cluster:
- (-)1: exchange processes
- 2: two-body capture
- (-)3: three-BH binary induced
- (-)4: von Zeipel-Lidov-Kozai (ZLK) merger
- (-)5: ZLK remnant BBH
- 6: binary-single capture
b) Column description of evolution .txt file:
Columnn | Variable | Description |
---|---|---|
1 | seed of the simulation | |
2 | Simulation time ( |
|
3 | Redshift | |
4 | Timestep ( |
|
5 | Average mass ( |
|
6 | Cluster mass ( |
|
7 | Half-mass radius ( |
|
8 | Galactocentric radius ( |
|
9 | Galactocentric velocity ( |
|
10 | Half-mass relaxation timescale ( |
|
11 | BH half-mass relaxation time ( |
|
12 | Stellar central number density ( |
|
13 | Number of BHs | |
14 | Average BH mass ( |
|
15 | Heaviest BH mass ( |
|
16 | BH half-mass radius ( |
|
17 | BH core radius ( |
|
18 | Spitzer parameter | |
19 | Equipartition parameter | |
20 | Multimass relaxation factor | |
21 | BH multimass relaxation factor | |
22 | 3bb timescale ( |
|
23 | 2-capture timescale ( |
|
24 | Number of 3bb in current step | |
25 | Number of 2-captures in current step | |
26 | Cumulative number of mergers | |
27 | Current number of BBHs | |
28 | Cumulative number of ejected merger remnants | |
29 | Cumulative number of retained merger remnants | |
30 | Stellar velocity dispersion ( |
|
31 | BH velocity dispersion ( |
|
32 | Half-mass BH number density ( |
|
33 | Core BH number density ( |
|
34 | Average BH number density ( |
|
35 | Cumulative number of 3bb | |
36 | Cumulative number of 2-captures | |
37 | Cumulative number of 3-captures | |
38 | Cumulative number of single BH ejections | |
39 | Cumulative number of BBH ejections | |
40 | Cumulative number of BBH disruptions | |
41 | Cumulative number of BBH-BH exchanges | |
42 | BBH-BBH interaction timescale ( |
|
43 | Cumulative number of BBH-BBH interactions | |
44 | Cumulative number of field mergers | |
45 | Cumulative number of in-cluster 2-body mergers | |
46 | star-star$\to$BH-star timescale ( |
|
47 | BH-star$\to$BBH timescale ( |
|
48 | Number of star-star$\to$BH-star exchanges in this step | |
49 | Number of BH-star$\to$BBH exchanges in this step | |
50 | Cumulative number of star-star$\to$BH-star exchanges | |
51 | Cumulative number of BH-star$\to$BBH exchanges | |
52 | Current number of BH-star pairs | |
53 | BH-star--BH-star interaction timescale ( |
|
54 | Number of BH-star--BH-star interactions in this step | |
55 | Cumulative number of BH-star--BH-star interactions | |
56 | Escape velocity ( |
|
57 | Escape velocity from BH subsystem ( |
|
58 | Cumulative number of BH triples | |
59 | Cumulative number of ZLK mergers |
c) Column description of hardening .txt file:
Columnn | Variable | Description |
---|---|---|
1 | Global time ( |
|
2 | Global timestep ( |
|
3 | Local time ( |
|
4 | Local timestep ( |
|
5 | Binary's unique integer identifier | |
6 | Semimajor axis ( |
|
7 | Eccentricity | |
8 | Primary mass ( |
|
9 | Secondary mass ( |
|
10 | Mass ratio | |
11 | BBH status | |
12 | Number of BBH-BH exchanges |
Condition or binary status (last column of hardening file):
- 0: BBH available to evolve (see the flowchart of our algorithm in Fig.3 of K. Kritos et al. (2022))
- 1: Local time exceeds global time
- 2: 2-body merger (the BBH hardens and merges in the cluster after entering the GW regime)
- 3: binary ionized during binary-single interaction
- 4: Binary ionized during binary-binary interaction
- 5: Binary ejected
- 6: Binary-single capture
Unless
d) The output_BHs.npz file (if exported) contains two arrays, called mBH_ini
and mBH_fin
which provide in
The code can be useful when executed multiple times, for instance when simulating a set of clusters and generating a population of dynamically formed BBH mergers.
Although the program itself is not computationally expensive (we have tested in a laptop that we generate a few binary black hole mergers per second), independent parallelization is still encouraged when simulating a very large number of star clusters for efficiency.
If you utilize this code in your research, please cite the following reference:
K. Kritos, V. Strokov, V. Baibhav & E. Berti (2022).
If you find a bug in the code, please contact us in [email protected] with a description of the bug.
Suggestions and pull requests are welcome :)
Vladimir Strokov, Vishal Baibhav, Emanuele Berti, Andrea Antonelli, Fabio Antonini, Dany Atallah, Muhsin Aljaf, Mark Cheung, Roberto Cotesta, Hector Cruz, Giacomo Fragione, Gabriele Franciolini, Thomas Helfer, Veome Kapil, Kyle Kremer, Iason Krommydas, Miguel Martinez, Luca Reali, Carl Rodriguez, Newlin Weatherford, Xiao-Xiao Kou, Giada Caneva Santoro.