Skip to main content

A fast code for simulating star cluster and black hole dynamics

Project description

ᴄBHBᴅ

A fast code for simulating star clusters and black hole dynamics.

ᴄBHBᴅ can be used for

  1. the evolution of a star cluster with black holes in a tidal field
  2. population synthesis of binary black hole mergers in a time-evolving star cluster

If you use ᴄBHBᴅ in any publication, please cite it as follows:

ᴄBHBᴅ (Antonini & Gieles 2020; Antonini et al. 2023), with the updates of Fronimos Pouliasis et al. (2025), Chattopadhyay et al. (2026), and Marín Pina et al. (in prep)

ᴄBHBᴅ stands for the combination of ᴄʟᴜsᴛᴇʀBH (the code for the cluster evolution) and BHBᴅʏɴᴀᴍɪᴄs (the code for the black hole mergers).

Installation

The cBHBd package can be installed directly from this repository using pip:

python -m pip install git+https://github.com/cBHBd/cBHBd.git

All required dependencies will be installed automatically.

You can also simply download the ᴄBHBᴅ package source from this repository and install or place it into your path:

git clone https://github.com/cBHBd/cBHBd

Running ᴄBHBᴅ

You can run ᴄBHBᴅ as

from cbhbd.cbhbd import CBHBD

c = CBHBD(...)

with the following arguments:

  • N: Initial number of stars or M0: Initial cluster mass
  • rhoh0: Initial half-mass density [Msun/pc^3] or rh0: Initial half-mass radius [pc]
  • Z: Metallicity or FeH: Metallicity as in [Fe/H]
  • kwargs: Additional parameters to override defaults (see code comments in the CBHBD class and the Cluster class)

If you only want to run the cluster evolution, you can use compute_mergers=False for efficiency

Analysing the ᴄBHBᴅ output

The output of the simulations is stored in a CBHBD object. The cluster properties can be accessed from c.cluster. See cluster.py for the full documentation.

c.cluster.Mst # Total stellar mass in the cluster as function of time
c.cluster.Mbh # Total BH mass in the cluster as function of time
c.cluster.rh # Half-mass radius of the cluster as function of time
...
c.cluster.Mst_interp(t) # For convenience, you can also interpolate the cluster properties at any time using the interpolating functions

The merger properties are stored in a pandas.Dataframe in c.mergers. See mergers.py for the full documentation.

c.mergers # The merger data, use print(c.mergers) to see a table of the merger properties
c.mergers.m1 # The mass of the primary
c.mergers.merger_type # The type of merger (ejected, gw_capture, ...), see the code for the full documentation
... 
c.mergers.to_numpy() # You can also export the merger data to a numpy array

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cbhbd-1.0.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cbhbd-1.0.0-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

Details for the file cbhbd-1.0.0.tar.gz.

File metadata

  • Download URL: cbhbd-1.0.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.1 cpython/3.12.3 HTTPX/0.28.1

File hashes

Hashes for cbhbd-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a9613be4b30a141f8f75adb73ce78f1797bddb9f575038c834277d58b3e5210c
MD5 8198bcd9b76a82fbca174d013eb51f7a
BLAKE2b-256 27cffae9578e8f4a1e7a204e5232d9261004f6d267fceb17fec8778bfe5744f9

See more details on using hashes here.

File details

Details for the file cbhbd-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cbhbd-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 55.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.1 cpython/3.12.3 HTTPX/0.28.1

File hashes

Hashes for cbhbd-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 febaa9ad198290ef4051e5222c4ac1421d30a49e6457d55d3eaa52ef24103869
MD5 fecf573f6c2f47c93ad73159a8c86ba1
BLAKE2b-256 b00fd5d16a3f447c95dbcd34a152a7aa384401bbe804348ea753165ee0f7e49a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page