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 using pip:

pip install cbhbd

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.1.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.1-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cbhbd-1.0.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cbhbd-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c5d75ba1664d52d26347630656f5f04af6fee4b80d7f95b35163d9ea2534f1d5
MD5 9bc3c4dbb776341fa13df96347ec0142
BLAKE2b-256 415eb3699ca01b090d2f725d1beb8e9c0974d9fb5b93475efafa9a30cc23cc98

See more details on using hashes here.

Provenance

The following attestation bundles were made for cbhbd-1.0.1.tar.gz:

Publisher: publish.yml on cBHBd/cBHBd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: cbhbd-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 55.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cbhbd-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ced707620573ea03d078b0d2331dcd18db332fce13aaff3d92cbd33177e6ce1
MD5 1fb7140bdc6153f73a79ab792399d533
BLAKE2b-256 cf496a532ca73975ccb3148e8276d7c64e2e124aba587916341dd86bb8b2be09

See more details on using hashes here.

Provenance

The following attestation bundles were made for cbhbd-1.0.1-py3-none-any.whl:

Publisher: publish.yml on cBHBd/cBHBd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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