Skip to main content

GPU/CPU Binary Black Hole Waveforms for LISA.

Project description

GPU-Accelerated Black Hole Binary Waveforms (bbhx)

Designed for LISA data analysis of Massive Black Hole Binaries.

This package implements GPU/CPU agnostic Massive Black Hole Binary waveforms and likelihood computations from arXiv:2005.01827 and arXiv:2111.01064. The various parts of this package are arranged to be modular as waveform or response changes or improvements are made. Generally, the modules fall into four categories: waveforms, response, waveform building, and utilities. Please see the documentation for further information on these modules. The code can be found on Github here.

This package is a part of the LISA Analysis Tools environment.

If you use this software please cite arXiv:2005.01827, arXiv:2111.01064, and the associated Zenodo page Please also cite any consituent parts used like the response function or waveforms. See the citation attribute for each class or docstring for functions for more information.

Getting started

Detailed installation instructions can be found in the documentation. Below is a quick set of instructions to install the BBHx package on CPUs and GPUs.

To install the latest version of bbhx using pip, simply run:

# For CPU-only version
pip install bbhx

# For GPU-enabled versions with CUDA 11.Y.Z
pip install bbhx-cuda11x

# For GPU-enabled versions with CUDA 12.Y.Z
pip install bbhx-cuda12x

To know your CUDA version, run the tool nvidia-smi in a terminal a check the CUDA version reported in the table header:

$ nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.15              Driver Version: 550.54.15      CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
...

You may also install bbhx directly using conda (including on Windows) as well as its CUDA 12.x plugin (only on Linux). It is strongly advised to:

  1. Ensure that your conda environment makes sole use of the conda-forge channel
  2. Install bbhx directly when building your conda environment, not afterwards
# For CPU-only version, on either Linux, macOS or Windows:
conda create --name bbhx_cpu -c conda-forge --override-channels python=3.12 bbhx
conda activate bbhx_cpu

# For CUDA 12.x version, only on Linux
conda create --name bbhx_cuda -c conda-forge --override-channels python=3.12 bbhx-cuda12x
conda activate bbhx_cuda

Now, in a python file or notebook:

import bbhx

You may check the currently available backends:

>>> for backend in ["cpu", "cuda11x", "cuda12x", "cuda", "gpu"]:
...     print(f" - Backend '{backend}': {"available" if bbhx.has_backend(backend) else "unavailable"}")
 - Backend 'cpu': available
 - Backend 'cuda11x': unavailable
 - Backend 'cuda12x': unavailable
 - Backend 'cuda': unavailable
 - Backend 'gpu': unavailable

Note that the cuda backend is an alias for either cuda11x or cuda12x. If any is available, then the cuda backend is available. Similarly, the gpu backend is (for now) an alias for cuda.

If you expected a backend to be available but it is not, run the following command to obtain an error message which can guide you to fix this issue:

>>> import bbhx
>>> bbhx.get_backend("cuda12x")
ModuleNotFoundError: No module named 'bbhx_backend_cuda12x'

The above exception was the direct cause of the following exception:
...

bbhx.cutils.BackendNotInstalled: The 'cuda12x' backend is not installed.

The above exception was the direct cause of the following exception:
...

bbhx.cutils.MissingDependencies: BBHx CUDA plugin is missing.
    If you are using bbhx in an environment managed using pip, run:
        $ pip install bbhx-cuda12x

The above exception was the direct cause of the following exception:
...

bbhx.cutils.BackendAccessException: Backend 'cuda12x' is unavailable. See previous error messages.

Once FEW is working and the expected backends are selected, check out the examples notebooks on how to start with this software.

Installing from sources

Prerequisites

To install this software from source, you will need:

  • A C++ compiler (g++, clang++, ...)
  • A Python version supported by scikit-build-core (>=3.7 as of Jan. 2025)

Some installation steps require the external library LAPACK along with its C-bindings provided by LAPACKE. If these libraries and their header files (in particular lapacke.h) are available on your system, they will be detected and used automatically. If they are available on a non-standard location, see below for some options to help detecting them. Note that by default, if LAPACKE is not available on your system, the installation step will attempt to download its sources and add them to the compilation tree. This makes the installation a bit longer but a lot easier.

If you want to enable GPU support in FEW, you will also need the NVIDIA CUDA Compiler nvcc in your path as well as the CUDA toolkit (with, in particular, the libraries CUDA Runtime Library, cuBLAS and cuSPARSE).

There are a set of files required for total use of this package. They will download automatically the first time they are needed. Files are generally under 10MB. However, there is a 100MB file needed for the slow waveform and the bicubic amplitude interpolation. This larger file will only download if you run either of those two modules. The files are hosted on the Black Hole Perturbation Toolkit Download Server.

Installation instructions using conda

We recommend to install FEW using conda in order to have the compilers all within an environment. First clone the repo

git clone https://github.com/mikekatz04/BBHx.git
cd BBHx

Now create an environment (these instructions work for all platforms but some adjustements can be needed, refer to the detailed installation documentation for more information):

conda create -n bbhx_env -y -c conda-forge --override-channels |
    cxx-compiler pkgconfig conda-forge/label/lapack_rc::liblapacke

activate the environment

conda activate bbhx_env

Then we can install locally for development:

pip install -e '.[dev, testing]'

Installation instructions using conda on GPUs and linux

Below is a quick set of instructions to install the BBHx package on GPUs and linux.

conda create -n bbhx_env -c conda-forge bbhx-cuda12x python=3.12
conda activate bbhx_env

Test the installation device by running python

import bbhx
bbhx.get_backend("cuda12x")

Running the installation

To start the from-source installation, ensure the pre-requisite are met, clone the repository, and then simply run a pip install command:

# Clone the repository
git clone https://github.com/mikekatz04/BBHx.git
cd BBHx

# Run the install
pip install .

If the installation does not work, first check the detailed installation documentation. If it still does not work, please open an issue on the GitHub repository or contact the developers through other means.

Running the Tests

The tests require a bbhx dependencies which are not installed by default. To install them, add the [testing] label to FEW package name when installing it. E.g:

# For CPU-only version with testing enabled
pip install bbhx[testing]

# For GPU version with CUDA 12.Y and testing enabled
pip install bbhx-cuda12x[testing]

# For from-source install with testing enabled
git clone https://github.com/mikekatz04/BBHx.git
cd BBHx
pip install '.[testing]'

To run the tests, open a terminal in a directory containing the sources of FEW and then run the unittest module in discover mode:

$ git clone https://github.com/mikekatz04/BBHx.git
$ cd BBHx
$ python -m bbhx.tests  # or "python -m unittest discover"
...
----------------------------------------------------------------------
Ran 20 tests in 71.514s
OK

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

If you want to develop FEW and produce documentation, install bbhx from source with the [dev] label and in editable mode:

$ git clone https://github.com/mikekatz04/BBHx.git
$ cd BBHx
pip install -e '.[dev, testing]'

This will install necessary packages for building the documentation (sphinx, pypandoc, sphinx_rtd_theme, nbsphinx) and to run the tests.

The documentation source files are in docs/source. To compile the documentation locally, change to the docs directory and run make html.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Contributors

A (non-exhaustive) list of contributors to the FEW code can be found in CONTRIBUTORS.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

Please make sure to cite FEW papers and the FEW software on Zenodo. We provide a set of prepared references in PAPERS.bib. There are other papers that require citation based on the classes used. For most classes this applies to, you can find these by checking the citation attribute for that class. All references are detailed in the CITATION.cff file.

Acknowledgments

  • This research resulting in this code was supported by National Science Foundation under grant DGE-0948017 and the Chateaubriand Fellowship from the Office for Science & Technology of the Embassy of France in the United States.
  • It was also supported in part through the computational resources and staff contributions provided for the Quest/Grail high performance computing facility at Northwestern University.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

bbhx-1.2.3-cp313-cp313-manylinux_2_28_aarch64.whl (14.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

bbhx-1.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

bbhx-1.2.3-cp313-cp313-macosx_14_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

bbhx-1.2.3-cp313-cp313-macosx_13_0_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

bbhx-1.2.3-cp312-cp312-manylinux_2_28_aarch64.whl (14.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

bbhx-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

bbhx-1.2.3-cp312-cp312-macosx_14_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

bbhx-1.2.3-cp312-cp312-macosx_13_0_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

bbhx-1.2.3-cp311-cp311-manylinux_2_28_aarch64.whl (14.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

bbhx-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

bbhx-1.2.3-cp311-cp311-macosx_14_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

bbhx-1.2.3-cp311-cp311-macosx_13_0_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

bbhx-1.2.3-cp310-cp310-manylinux_2_28_aarch64.whl (14.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

bbhx-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

bbhx-1.2.3-cp310-cp310-macosx_14_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

bbhx-1.2.3-cp310-cp310-macosx_13_0_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

bbhx-1.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

bbhx-1.2.3-cp39-cp39-macosx_14_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

bbhx-1.2.3-cp39-cp39-macosx_13_0_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

Details for the file bbhx-1.2.3-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 219289d6187560c2cf2d62f39ba06d9280ec9153c34e40f01d058be57dcf1e61
MD5 c27f235b380a218bf25090f5dbf9ad37
BLAKE2b-256 d35cff8611fe1e33fd0c2e26767a4d29768afb8ccc6a489c99d2e8adb0e2677c

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf4a4af73878e453f5cf4bcdfc3f2e3f134fbd2f760d1db21989803ee1035dd5
MD5 6ad5ca10febee31b6feeea221bad910f
BLAKE2b-256 9b568554922f0b412545ae04f078071237b52cbdcaea534ed4e1b7d784a251ee

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ac6210070ce53f434762f2f6fc53cfa09628aa8b922be268c7dd9db8506b3b7a
MD5 f06c90a825b5846404d720c0f49b56d9
BLAKE2b-256 ac17dfbe436fbc6ccd1c579bf4a265ff208cc470e8957467903455eecb2123dd

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 99211885c82adad1d739f3d94cc1e8a104cf0a0ab879c6950aebd239df461b4f
MD5 acfe1cd21ca968d6e728e3b9c8754181
BLAKE2b-256 86263ecc8eed1ae6b80cb67cecbe5c94fc7a1eb4ac4a99dc82cf027f49617464

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4c08a02acb260197298203441984ec44cb9a83ee0acbf64e01e44058be78845e
MD5 f7683821bf9420d05ca926c6a53e5b8b
BLAKE2b-256 7f83459ef984280ea40f098ddba9636c424debc1788c4c85cb1b4530f9bb1843

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 671c3223d8c7a30d8fa2c8e423d0a3cd5d7827070c1436d4236e3963b23b8270
MD5 5e6d8430a78175354061649fc04e7c7e
BLAKE2b-256 9318b78fd481261188ac0eb6c54e2112efc07fc4cd493857dd2cbc3842639dbb

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c520495d79acb4da3a8f7f4717aa298b8bccf09379eab7524163bd62c54a8806
MD5 f919d62f673a32a4ce7a2f9d172e381c
BLAKE2b-256 858e1cc4ccb0f06d7c4cdef5bba1c3720f4ebb41aa1daa745d903e899ceaad7a

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8786fa60255017c269be39cba224b60c14d07b5cc0ae7c08a0d5372f09d9ac8e
MD5 bd5a2272f4ac74f310754e615377d714
BLAKE2b-256 a6f50645011f31c7415efa28b5958be772791a58c1c691583c2cacb432b4ea01

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5fcd6f03b57a1849ecf12ce752e72523ebb198406a86f9244054bb12ab162a5d
MD5 68e9702d93c15e8ee6c877233a828aaa
BLAKE2b-256 527cd379dfdc93cb8273052c6fdab0bd31ad1a8c31d26709939991db07d0cc9e

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 256c9c9ccd1c6059b304ffb8a6fd2b65b1fb59a2cf1c77bab62c526fa8f1d81b
MD5 f5c83c47774c66e7239ddc164cff876a
BLAKE2b-256 5162fafcf5a77b1632e8e47af143004998d5b5bf549162901058f6ca1ebc7eda

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 799685d077f5aa9c08c296537dbdeeeeb48702904d5872902496b0525f97d167
MD5 c8e7a18a308db4774e55bcd69774b6c1
BLAKE2b-256 602e2e4bb95fde0a1213a44388de2a5921ff63eda5504ee3b9d7d26f77bec47e

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8654f43d4d3a58c0cf26bd587da029ee54afd5e466b48f51c17b07e8a6f5516a
MD5 138c29db3a206cc3ea46012db7125ea9
BLAKE2b-256 400c9306cfdbd353d6429dcd31032a97b83d731380543c9a81020328c6bec99a

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4b645c1aef8f693653928a6bd929cf82f136a5c3b0c469b0af0fdc18479bacb1
MD5 403718f0de153d218f65a0d152e195f9
BLAKE2b-256 74d471fea25548e280e831d7847f597ad90600c59a35a7b438d2c3e637157e27

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8112f71eb137a38b0082849273bb426a98196a09c53c9e3450bf925341c23a52
MD5 15abae9b9c38e3030d541a574bcd9246
BLAKE2b-256 c7ecf9e51fe028e964871e7d18282f94806734e6f9290ac8385d50ac1e8e095d

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f97e38a1d5889d33a611bdd7723e2e9ee0ba4c68694ba099a6463a113d7343a9
MD5 4eab1107df35b3c9f18078a8135923ea
BLAKE2b-256 66b42a2b3107a71710151d425fa0055041de6ee8b60ac3e00b568e0d012da36e

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1c2e5df1de2fcd940c8d53b525c4d5e8494ec4e0f9dccce2d1169a018e6838da
MD5 c06f86748f526874fa172aa7ac108fba
BLAKE2b-256 ff91581781cdd6219a7d1e02238c2aafa388df8b7ac3b5b09c1349fc2a2a4878

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26d4fcefe475386a28401f84588dbf9ba7f01e71b45e2fdc995001b04c7fecb9
MD5 c06de1cbcea0a4b7b4d7243c15cab001
BLAKE2b-256 c0f4e762fc10a77811acf1221df980fe6565848d29376bbf19b8247b6f4387e0

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

  • Download URL: bbhx-1.2.3-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: CPython 3.9, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for bbhx-1.2.3-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 560124c2718e387e0b4b39e7fcb174275fb65959dfb732e6c1c96007d0593dcc
MD5 4230899182676d6a6cdb5294106eebc9
BLAKE2b-256 375690351f328a5d6ba469674565c81fe319d34e12658ad48e7743cbc17ea1e6

See more details on using hashes here.

File details

Details for the file bbhx-1.2.3-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bbhx-1.2.3-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 164f251a767e4417b888e8734d3ebd10afc06918e1d51e2fb892e0671a938dc6
MD5 b3ab86bc5d7064652f2306e955636a94
BLAKE2b-256 67056e9adb79ab5c37c188198f48e95f086f03dbe224e57cb884b214cb60b72b

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